forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
74 lines
5.4 KiB
HTML
74 lines
5.4 KiB
HTML
<a name="EN-US_TOPIC_0000001188362542"></a><a name="EN-US_TOPIC_0000001188362542"></a>
|
|
|
|
<h1 class="topictitle1">Normal and Prefix Indexes</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_p330274862511"><span id="EN-US_TOPIC_0000001188362542__text10892754124514">GaussDB(DWS)</span> does not support prefix indexes or inline normal indexes. DSC will replace these indexes with normal indexes based on GaussDB features.</p>
|
|
<ol id="EN-US_TOPIC_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_ol12553123692615"><li id="EN-US_TOPIC_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_li15553183615265">Inline normal/prefix index<p id="EN-US_TOPIC_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_p135691921172717"><a name="EN-US_TOPIC_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_li15553183615265"></a><a name="en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_li15553183615265"></a><strong id="EN-US_TOPIC_0000001188362542__en-us_topic_0237712503_b7715141554411">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_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_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_p77858251279"><strong id="EN-US_TOPIC_0000001188362542__en-us_topic_0237712503_b1715141515447">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_screen71919285272">CREATE TABLE "public"."runoob_datatype_test"
|
|
(
|
|
"id" SERIAL PRIMARY KEY,
|
|
"name" VARCHAR(128) 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_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_li19672194516269">Normal/Prefix index created by <strong id="EN-US_TOPIC_0000001188362542__en-us_topic_0237712503_b5715115144415">ALTER TABLE</strong><p id="EN-US_TOPIC_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_p1287443289"><strong id="EN-US_TOPIC_0000001188362542__en-us_topic_0237712503_b147156155446">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_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_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_p142870442811"><strong id="EN-US_TOPIC_0000001188362542__en-us_topic_0237712503_b13715151517444">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_screen19288648288">CREATE TABLE "public"."test_create_table05"
|
|
(
|
|
"id" SERIAL NOT NULL,
|
|
"user_id" INTEGER(20) NOT NULL,
|
|
"user_name" CHAR(20) DEFAULT NULL,
|
|
"detail" VARCHAR(100) 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_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_li1937655815268">Normal/Prefix index created by <strong id="EN-US_TOPIC_0000001188362542__en-us_topic_0237712503_b2715181554410">CREATE INDEX</strong><p id="EN-US_TOPIC_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_p15863552819"><strong id="EN-US_TOPIC_0000001188362542__en-us_topic_0237712503_b57156158440">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_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_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_p35869514281"><strong id="EN-US_TOPIC_0000001188362542__en-us_topic_0237712503_b117151815164414">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001188362542__en-us_topic_0238518443_en-us_topic_0237362130_en-us_topic_0214164686_screen8586145162813">CREATE TABLE "public"."customer"
|
|
(
|
|
"name" VARCHAR(64) 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_sct_0013.html">MySQL Syntax Migration</a></div>
|
|
</div>
|
|
</div>
|
|
|