forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
85 lines
6.7 KiB
HTML
85 lines
6.7 KiB
HTML
<a name="EN-US_TOPIC_0000001819336225"></a><a name="EN-US_TOPIC_0000001819336225"></a>
|
|
|
|
<h1 class="topictitle1">Hash Indexes</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_p330274862511">GaussDB(DWS) does not support hash indexes. DSC will replace these indexes with normal indexes based on GaussDB(DWS) features.</p>
|
|
<ol id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_ol12553123692615"><li id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_li15553183615265">Inline hash indexes<p id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_p135691921172717"><a name="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_li15553183615265"></a><a name="en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_li15553183615265"></a><strong id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_b123631548192715">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_screen182799185276">CREATE TABLE `public`.`test_create_table03` (
|
|
`DEMAND_ID` INT(11) NOT NULL AUTO_INCREMENT,
|
|
`DEMAND_NAME` CHAR(100) NOT NULL,
|
|
`THEME` VARCHAR(200) NULL DEFAULT NULL,
|
|
`SEND_ID` INT(11) NULL DEFAULT NULL,
|
|
`SEND_NAME` CHAR(20) NULL DEFAULT NULL,
|
|
`SEND_TIME` DATETIME NULL DEFAULT NULL,
|
|
`DEMAND_CONTENT` TEXT NOT NULL,
|
|
PRIMARY KEY(`DEMAND_ID`),
|
|
INDEX CON_INDEX(DEMAND_CONTENT(100)) USING HASH ,
|
|
INDEX SEND_INFO_INDEX USING HASH (SEND_ID,SEND_NAME(10),SEND_TIME)
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_p77858251279"><strong id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_b197144504277">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_screen71919285272">CREATE TABLE "public"."test_create_table03"
|
|
(
|
|
"demand_id" SERIAL NOT NULL,
|
|
"demand_name" CHAR(400) NOT NULL,
|
|
"theme" VARCHAR(800) DEFAULT NULL,
|
|
"send_id" INTEGER DEFAULT NULL,
|
|
"send_name" CHAR(80) DEFAULT NULL,
|
|
"send_time" TIMESTAMP WITHOUT TIME ZONE DEFAULT NULL,
|
|
"demand_content" TEXT NOT NULL,
|
|
PRIMARY KEY ("demand_id")
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("demand_id");
|
|
CREATE INDEX "con_index" ON "public"."test_create_table03" ("demand_content");
|
|
CREATE INDEX "send_info_index" ON "public"."test_create_table03" ("send_id","send_name","send_time");</pre>
|
|
</li><li id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_li19672194516269">Hash index created by <strong id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_b117311842331857">ALTER TABLE</strong><p id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_p1287443289"><strong id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_b728710413284">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_screen9287164132817">CREATE TABLE IF NOT EXISTS `public`.`runoob_alter_test`(
|
|
`dataType1` int NOT NULL AUTO_INCREMENT,
|
|
`dataType2` FLOAT(10,2),
|
|
PRIMARY KEY(`dataType1`)
|
|
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
ALTER TABLE runoob_alter_test ADD KEY alterTable_addKey_indexType(dataType1) USING HASH;</pre>
|
|
<p id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_p142870442811"><strong id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_b10288134162811">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_screen19288648288">CREATE TABLE IF NOT EXISTS "public"."runoob_alter_test"
|
|
(
|
|
"datatype1" SERIAL NOT NULL,
|
|
"datatype2" REAL,
|
|
PRIMARY KEY ("datatype1")
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("datatype1");
|
|
|
|
CREATE INDEX "altertable_addkey_indextype" ON "public"."runoob_alter_test" ("datatype1");</pre>
|
|
</li><li id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_li1937655815268">Hash index created by <strong id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_b29840312431857">CREATE INDEX</strong><p id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_p15863552819"><strong id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_b11586205182818">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_screen758620572815">CREATE TABLE `public`.`test_index_table06` (
|
|
`ID` INT(11) NOT NULL AUTO_INCREMENT,
|
|
`FNAME` VARCHAR(30) NOT NULL,
|
|
`INAME` VARCHAR(30) NOT NULL,
|
|
PRIMARY KEY (`ID`)
|
|
);
|
|
CREATE INDEX FNAME_INDEX ON TEST_INDEX_TABLE06(FNAME(10)) USING HASH;
|
|
CREATE INDEX NAME_01 ON TEST_INDEX_TABLE06(FNAME(10),INAME(10)) USING HASH;</pre>
|
|
<p id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_p35869514281"><strong id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_b458615162817">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819336225__en-us_topic_0000001657865606_en-us_topic_0000001436192221_en-us_topic_0214164771_screen8586145162813">CREATE TABLE "public"."test_index_table06"
|
|
(
|
|
"id" SERIAL NOT NULL,
|
|
"fname" VARCHAR(120) NOT NULL,
|
|
"iname" VARCHAR(120) NOT NULL,
|
|
PRIMARY KEY ("id")
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("id");
|
|
CREATE INDEX "fname_index" ON "public"."test_index_table06" ("fname");
|
|
CREATE INDEX "name_01" ON "public"."test_index_table06" ("fname","iname");</pre>
|
|
</li></ol>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_16_0166.html">Indexes</a></div>
|
|
</div>
|
|
</div>
|
|
|