doc-exports/docs/dws/tool/dws_07_8310.html
Lu, Huayi 346ac31da9 DWS TG 8.1.3.200 VERSION
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>
2023-08-28 09:20:17 +00:00

83 lines
5.3 KiB
HTML

<a name="EN-US_TOPIC_0000001233922193"></a><a name="EN-US_TOPIC_0000001233922193"></a>
<h1 class="topictitle1">Delete an Index</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_p11532411115112">MySQL supports both <strong id="EN-US_TOPIC_0000001233922193__en-us_topic_0237712416_b2027031512543">DROP INDEX</strong> and <strong id="EN-US_TOPIC_0000001233922193__en-us_topic_0237712416_b1227061518544">ALTER TABLE DROP INDEX</strong> for deleting indexes. DSC will perform adaptation based on GaussDB features during migration.</p>
<ol id="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_ol9597141171115"><li id="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_li1359714141114">DROP INDEX<p id="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_p6923191441210"><a name="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_li1359714141114"></a><a name="en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_li1359714141114"></a><strong id="EN-US_TOPIC_0000001233922193__en-us_topic_0237712416_b172711153541">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_screen2075817255126">CREATE TABLE `test_create_table03` (
`DEMAND_ID` INT(11) NOT NULL,
`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
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
CREATE UNIQUE INDEX DEMAND_NAME_INDEX ON TEST_CREATE_TABLE03(DEMAND_NAME);
DROP INDEX DEMAND_NAME_INDEX ON TEST_CREATE_TABLE03;
CREATE INDEX SEND_ID_INDEX ON TEST_CREATE_TABLE03(SEND_ID);
DROP INDEX SEND_ID_INDEX ON TEST_CREATE_TABLE03;</pre>
<p id="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_p18349428171219"><strong id="EN-US_TOPIC_0000001233922193__en-us_topic_0237712416_b1327110154546">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_screen1227033412127">CREATE TABLE "public"."test_create_table03"
(
"demand_id" INTEGER(11) NOT NULL,
"demand_name" CHAR(100) NOT NULL,
"theme" VARCHAR(200) DEFAULT NULL,
"send_id" INTEGER(11) DEFAULT NULL,
"send_name" CHAR(20) DEFAULT NULL,
"send_time" TIMESTAMP WITHOUT TIME ZONE DEFAULT NULL,
"demand_content" TEXT NOT NULL
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("demand_id");
CREATE INDEX "demand_name_index" ON "public"."test_create_table03" ("demand_name");
DROP INDEX "demand_name_index" RESTRICT;
CREATE INDEX "send_id_index" ON "public"."test_create_table03" USING BTREE ("send_id");
DROP INDEX "send_id_index" RESTRICT;</pre>
</li><li id="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_li99313585112">ALTER TABLE DROP INDEX<p id="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_p636619384129"><a name="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_li99313585112"></a><a name="en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_li99313585112"></a><strong id="EN-US_TOPIC_0000001233922193__en-us_topic_0237712416_b32711156544">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_screen123668384128">CREATE TABLE `test_create_table03` (
`DEMAND_ID` INT(11) NOT NULL,
`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
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
ALTER TABLE TEST_CREATE_TABLE03 ADD UNIQUE INDEX TEST_CREATE_TABLE03_NAME_INDEX(DEMAND_NAME(50));
ALTER TABLE TEST_CREATE_TABLE03 DROP INDEX TEST_CREATE_TABLE03_NAME_INDEX;</pre>
<p id="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_p17366193816128"><strong id="EN-US_TOPIC_0000001233922193__en-us_topic_0237712416_b14272115165410">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233922193__en-us_topic_0238518448_en-us_topic_0237362258_en-us_topic_0214164733_screen936612384127">CREATE TABLE "public"."test_create_table03"
(
"demand_id" INTEGER(11) NOT NULL,
"demand_name" CHAR(100) NOT NULL,
"theme" VARCHAR(200) DEFAULT NULL,
"send_id" INTEGER(11) DEFAULT NULL,
"send_name" CHAR(20) DEFAULT NULL,
"send_time" TIMESTAMP WITHOUT TIME ZONE DEFAULT NULL,
"demand_content" TEXT NOT NULL
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("demand_id");
CREATE INDEX "test_create_table03_name_index" ON "public"."test_create_table03" ("demand_name");
DROP INDEX "test_create_table03_name_index" RESTRICT;</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>