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>
74 lines
5.9 KiB
HTML
74 lines
5.9 KiB
HTML
<a name="EN-US_TOPIC_0000001819416253"></a><a name="EN-US_TOPIC_0000001819416253"></a>
|
|
|
|
<h1 class="topictitle1">Normal and Prefix Indexes</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_p330274862511">GaussDB(DWS) does not support prefix indexes or inline normal indexes. DSC will replace these indexes with normal indexes based on GaussDB(DWS) features.</p>
|
|
<ol id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_ol12553123692615"><li id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_li15553183615265">Inline normal/prefix indexes<p id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_p135691921172717"><a name="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_li15553183615265"></a><a name="en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_li15553183615265"></a><strong id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_b123631548192715">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_screen182799185276">CREATE TABLE IF NOT EXISTS `public`.`runoob_dataType_test`
|
|
(
|
|
`id` INT PRIMARY KEY AUTO_INCREMENT,
|
|
`name` VARCHAR(128) NOT NULL,
|
|
INDEX index_single(name(10))
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_p77858251279"><strong id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_b197144504277">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_screen71919285272">CREATE TABLE IF NOT EXISTS "public"."runoob_datatype_test"
|
|
(
|
|
"id" SERIAL PRIMARY KEY,
|
|
"name" VARCHAR(512) NOT NULL
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("id");
|
|
CREATE INDEX "index_single" ON "public"."runoob_datatype_test" USING BTREE ("name");</pre>
|
|
</li><li id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_li19672194516269">Normal/Prefix index created by <strong id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_b17914244993168">ALTER TABLE</strong><p id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_p1287443289"><strong id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_b728710413284">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_screen9287164132817">CREATE TABLE `public`.`test_create_table05` (
|
|
`ID` INT(11) NOT NULL AUTO_INCREMENT,
|
|
`USER_ID` INT(20) NOT NULL,
|
|
`USER_NAME` CHAR(20) NULL DEFAULT NULL,
|
|
`DETAIL` VARCHAR(100) NULL DEFAULT NULL,
|
|
PRIMARY KEY (`ID`)
|
|
);
|
|
|
|
ALTER TABLE TEST_CREATE_TABLE05 ADD INDEX USER_NAME_INDEX_02(USER_NAME(10));</pre>
|
|
<p id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_p142870442811"><strong id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_b10288134162811">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_screen19288648288">CREATE TABLE "public"."test_create_table05"
|
|
(
|
|
"id" SERIAL NOT NULL,
|
|
"user_id" INTEGER NOT NULL,
|
|
"user_name" CHAR(80) DEFAULT NULL,
|
|
"detail" VARCHAR(400) DEFAULT NULL,
|
|
PRIMARY KEY ("id")
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("id");
|
|
|
|
CREATE INDEX "user_name_index_02" ON "public"."test_create_table05" ("user_name");</pre>
|
|
</li><li id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_li1937655815268">Normal/Prefix index created by <strong id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_b5640892803168">CREATE INDEX</strong><p id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_p15863552819"><strong id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_b11586205182818">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_screen758620572815">CREATE TABLE IF NOT EXISTS `public`.`customer`(
|
|
`name` varchar(64) primary key,
|
|
id integer,
|
|
id2 integer
|
|
);
|
|
|
|
CREATE INDEX part_of_name ON customer (name(10));</pre>
|
|
<p id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_p35869514281"><strong id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_b458615162817">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819416253__en-us_topic_0000001657865602_en-us_topic_0000001385632522_en-us_topic_0214164686_screen8586145162813">CREATE TABLE IF NOT EXISTS "public"."customer"
|
|
(
|
|
"name" VARCHAR(256) PRIMARY KEY,
|
|
"id" INTEGER,
|
|
"id2" INTEGER
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("name");
|
|
|
|
CREATE INDEX "part_of_name" ON "public"."customer" USING BTREE ("name");</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>
|
|
|