doc-exports/docs/dws/tool/dws_07_6832.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

645 lines
48 KiB
HTML

<a name="EN-US_TOPIC_0000001234042157"></a><a name="EN-US_TOPIC_0000001234042157"></a>
<h1 class="topictitle1">Table (Optional)</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164422_p153001227758">This section describes the migration syntax of MySQL tables (optional parameter). The migration syntax determines how the keywords and features are migrated. <span id="EN-US_TOPIC_0000001234042157__text10892754124514">GaussDB(DWS)</span> does not support table migration. Currently, all table migration methods are temporary.</p>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section1449751153020"><h4 class="sectiontitle">AUTO_INCREMENT</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164775_p48341613162011">In database application, unique numbers that increase automatically are needed to identify records. In MySQL, the <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b161121646143318">AUTO_INCREMENT</strong> attribute of a data column can be used to automatically generate the numbers. When creating a table, you can use <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b311214683315">AUTO_INCREMENT=</strong><em id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_i1111274616339">n</em> to specify a start value. You can also use the <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b1112154683312">ALTER TABLE </strong><em id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_i6112846143317">TABLE_NAME</em><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b13112174615339"> AUTO_INCREMENT=</strong><em id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_i151122046113318">n</em> command to reset the start value. <span id="EN-US_TOPIC_0000001234042157__text769210538473">GaussDB(DWS)</span> does not support this attribute, which will be converted to <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b3112446123312">SERIAL</strong> and deleted by DSC during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164775_p6645131502215"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b101121246203319">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164775_screen41228368223">CREATE TABLE `public`.`job_instance` (
`job_sche_id` int(11) NOT NULL AUTO_INCREMENT,
`task_name` varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY (`job_sche_id`)
) ENGINE=InnoDB AUTO_INCREMENT=219 DEFAULT CHARSET=utf8;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164775_p1523917273222"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b311234616339">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164775_screen1489394112228">CREATE TABLE "public"."job_instance"
(
"job_sche_id" SERIAL NOT NULL,
"task_name" VARCHAR(100) NOT NULL DEFAULT '',
PRIMARY KEY ("job_sche_id")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("job_sche_id");</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164775_p7586132133119">In addition, <span id="EN-US_TOPIC_0000001234042157__text148795814718">GaussDB(DWS)</span> does not support table definition modification using the <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b14112184623313">AUTO_INCREMENT</strong> attribute. DSC will delete this attribute during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164775_p15219154320327"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b18112204613318">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164775_screen1725735293216">CREATE TABLE IF NOT EXISTS `public`.`runoob_alter_test`(
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` FLOAT(10,2),
PRIMARY KEY(`dataType1`)
);
ALTER TABLE runoob_alter_test AUTO_INCREMENT 100;
ALTER TABLE runoob_alter_test AUTO_INCREMENT=100;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164775_p10773347173215"><strong id="EN-US_TOPIC_0000001234042157__b148808016">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164775_screen143081457173210">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(10),
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section1588615165115"><h4 class="sectiontitle">AVG_ROW_LENGTH</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164646_p8060118"><strong id="EN-US_TOPIC_0000001234042157__b1484637802">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164646_screen1315510571232">CREATE TABLE `public`.`runoob_tbl_test`(
`runoob_id` VARCHAR(30),
`runoob_title` VARCHAR(100) NOT NULL,
`runoob_author` VARCHAR(40) NOT NULL,
`submission_date` VARCHAR(30)
)AVG_ROW_LENGTH=10000;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164646_p1345204611236"><strong id="EN-US_TOPIC_0000001234042157__b851078407">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164646_screen102614453918">CREATE TABLE "public"."runoob_tbl_test"
(
"runoob_id" VARCHAR(30),
"runoob_title" VARCHAR(100) NOT NULL,
"runoob_author" VARCHAR(40) NOT NULL,
"submission_date" VARCHAR(30)
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("runoob_id");</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164646_p1754562019146">In addition, <span id="EN-US_TOPIC_0000001234042157__text2844198204810">GaussDB(DWS)</span> does not allow using the <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b1979412019345">AUTO_INCREMENT</strong> attribute to modify tables. DSC will delete the attribute after migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164646_p12307829151512"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b1679416043417">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164646_screen1829455218152">CREATE TABLE IF NOT EXISTS `public`.`runoob_alter_test`(
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` FLOAT(10,2),
PRIMARY KEY(`dataType1`)
);
ALTER TABLE runoob_alter_test AUTO_INCREMENT 100;
ALTER TABLE runoob_alter_test AUTO_INCREMENT=100;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164646_p1288283741520"><strong id="EN-US_TOPIC_0000001234042157__b1590911032">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164646_screen9857133516143">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(10),
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section119521171313"><h4 class="sectiontitle">CHARSET</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164715_p1318631611717"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b101752016203412">CHARSET</strong> specifies the default character set for a table. <span id="EN-US_TOPIC_0000001234042157__text1360451512489">GaussDB(DWS)</span> does not support table definition modification using this attribute. DSC will delete the keyword during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164715_p8060118"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b317513165346">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164715_screen1216417236569">CREATE TABLE `public`.`runoob_tbl_test`(
`runoob_id` VARCHAR(30),
`runoob_title` VARCHAR(100) NOT NULL,
`runoob_author` VARCHAR(40) NOT NULL,
`submission_date` VARCHAR(30)
)DEFAULT CHARSET=utf8;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164715_p14480941125617"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b717541653417">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164715_screen1431183205720">CREATE TABLE "public"."runoob_tbl_test"
(
"runoob_id" VARCHAR(30),
"runoob_title" VARCHAR(100) NOT NULL,
"runoob_author" VARCHAR(40) NOT NULL,
"submission_date" VARCHAR(30)
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("runoob_id");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section175753189110"><h4 class="sectiontitle">CHECKSUM</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164589_p579713312318">In MySQL, <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b7421193210349">CHECKSUM</strong> maintains a live checksum for all rows. <span id="EN-US_TOPIC_0000001234042157__text10141111021911">GaussDB(DWS)</span> does not support table definition modification using this attribute. DSC will delete the keyword during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164589_p1752404014416"><strong id="EN-US_TOPIC_0000001234042157__b594609594">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164589_screen287831351410">CREATE TABLE `public`.`runoob_alter_test`(
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` FLOAT(10,2),
`dataType3` DOUBLE(20,8),
PRIMARY KEY(`dataType1`)
) CHECKSUM=1;
ALTER TABLE runoob_alter_test CHECKSUM 0;
ALTER TABLE runoob_alter_test CHECKSUM=0;
ALTER TABLE runoob_alter_test CHECKSUM 1;
ALTER TABLE runoob_alter_test CHECKSUM=1;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164589_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__b1500014055">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164589_screen13766191113164">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(10),
"datatype3" FLOAT(20),
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section2431919611"><h4 class="sectiontitle">COLLATE</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164518_p579713312318">In MySQL, <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b7983742193415">COLLATE</strong> specifies a default database sorting rule. <span id="EN-US_TOPIC_0000001234042157__text7567122251919">GaussDB(DWS)</span> does not support table definition modification using this attribute. DSC will delete the keyword during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164518_p1632923415414"><strong id="EN-US_TOPIC_0000001234042157__b1300678467">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164518_screen252183922111">CREATE TABLE `public`.`runoob_tbl_test`(
`runoob_id` VARCHAR(30),
`runoob_title` VARCHAR(100) NOT NULL,
`runoob_author` VARCHAR(40) NOT NULL,
`submission_date` VARCHAR(30)
) COLLATE=utf8_general_ci;
ALTER TABLE `public`.`runoob_tbl_test` COLLATE=utf8mb4_bin;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164518_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b5983142163418">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164518_screen11342634102316">CREATE TABLE "public"."runoob_tbl_test"
(
"runoob_id" VARCHAR(30),
"runoob_title" VARCHAR(100) NOT NULL,
"runoob_author" VARCHAR(40) NOT NULL,
"submission_date" VARCHAR(30)
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("runoob_id");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section194891919212"><h4 class="sectiontitle">COMMENT</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164629_p781310512108">In MySQL, <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b19181151313517">COMMENT</strong> is a comment for a table. <span id="EN-US_TOPIC_0000001234042157__text158151232121920">GaussDB(DWS)</span> does not support table definition modification using this attribute. DSC will delete the attribute during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164629_p659017367411"><strong id="EN-US_TOPIC_0000001234042157__b11241760">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164629_screen260412397186">CREATE TABLE `public`.`runoob_alter_test`(
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` FLOAT(10,2),
PRIMARY KEY(`dataType1`)
) comment='table comment';
ALTER TABLE `public`.`runoob_alter_test` COMMENT 'table comment after modification';</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164629_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__b1994089044">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164629_screen489081782010">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(10),
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section39131219517"><h4 class="sectiontitle">CONNECTION</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164618_p579713312318"><span id="EN-US_TOPIC_0000001234042157__text15825205361910">GaussDB(DWS)</span> does not support table definition modification using this attribute. DSC will delete the attribute during migration.</p>
<div class="caution" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164618_note9749104517138"><span class="cautiontitle"><img src="public_sys-resources/caution_3.0-en-us.png"> </span><div class="cautionbody"><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164618_p117497455133">In MySQL, the keyword <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b14440262231">CONNECTION</strong> is used as a referenced, external data source. Currently, DSC cannot completely migrate the feature of <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b16444926152315">CONNECTION</strong>. So as a workaround, it simply deletes the keyword.</p>
</div></div>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164618_p1752404014416"><strong id="EN-US_TOPIC_0000001234042157__b1737092987">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164618_screen6661259162415">CREATE TABLE `public`.`runoob_alter_test`(
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` DOUBLE(20,8),
`dataType3` TEXT NOT NULL,
`dataType4` YEAR NOT NULL DEFAULT '2018',
PRIMARY KEY(`dataType1`)
);
ALTER TABLE runoob_alter_test CONNECTION 'hello';
ALTER TABLE runoob_alter_test CONNECTION='hello';</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164618_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__b717919765">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164618_screen113702403278">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(20),
"datatype3" TEXT NOT NULL,
"datatype4" VARCHAR(4) NOT NULL DEFAULT '2018',
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section10326420018"><h4 class="sectiontitle">DELAY_KEY_WRITE</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164432_p579713312318"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b92961633163516">DELAY_KEY_WRITE</strong> is valid only for MyISAM tables. It is used to delay updates until the table is closed. <span id="EN-US_TOPIC_0000001234042157__text1554618717208">GaussDB(DWS)</span> does not support table definition modification using this attribute. DSC will delete the attribute during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164432_p819210440419"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b102966333356">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164432_screen19200191373016">CREATE TABLE `public`.`runoob_tbl_test`(
`runoob_id` VARCHAR(30),
`runoob_title` VARCHAR(100) NOT NULL,
`runoob_author` VARCHAR(40) NOT NULL,
`submission_date` VARCHAR(30)
) ENGINE=MyISAM, DELAY_KEY_WRITE=0;
ALTER TABLE `public`.`runoob_tbl_test6` DELAY_KEY_WRITE=1;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164432_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b3297153318359">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164432_screen18579330113120">CREATE TABLE "public"."runoob_tbl_test"
(
"runoob_id" VARCHAR(30),
"runoob_title" VARCHAR(100) NOT NULL,
"runoob_author" VARCHAR(40) NOT NULL,
"submission_date" VARCHAR(30)
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("runoob_id");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section972911208119"><h4 class="sectiontitle">DIRECTORY</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164594_p579713312318"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b142721345143520">DIRECTORY</strong> enables a tablespace to be created outside the data directory and index directory. It allows <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b15272174515354">DATA DIRECTORY</strong> and <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b3272124514350">INDEX DIRECTORY</strong>. <span id="EN-US_TOPIC_0000001234042157__text9256191732012">GaussDB(DWS)</span> does not support table definition modification using this attribute. DSC will delete the attribute during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164594_p9770184613410"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b19272845133511">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164594_screen1127363614498">CREATE TABLE `public`.`runoob_tbl_test1` (
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` DOUBLE(20,8),
PRIMARY KEY(`dataType1`)
) ENGINE=MYISAM DATA DIRECTORY = 'D:\\input' INDEX DIRECTORY= 'D:\\input';
CREATE TABLE `public`.`runoob_tbl_test2` (
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` DOUBLE(20,8),
PRIMARY KEY(`dataType1`)
) ENGINE=INNODB DATA DIRECTORY = 'D:\\input';</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164594_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b17272545113514">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164594_screen9733549145313">CREATE TABLE "public"."runoob_tbl_test1"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(20),
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");
CREATE TABLE "public"."runoob_tbl_test2"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(20),
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section1313721917"><h4 class="sectiontitle">ENGINE</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164405_p579713312318">In MySQL, <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b17911194104618">ENGINE</strong> specifies the storage engine for a table. When the storage engine is <strong id="EN-US_TOPIC_0000001234042157__b93331551611">ARCHIVE</strong>, <strong id="EN-US_TOPIC_0000001234042157__b113151915110">BLACKHOLE</strong>, <strong id="EN-US_TOPIC_0000001234042157__b362111318120">CSV</strong>, <strong id="EN-US_TOPIC_0000001234042157__b53078191312">FEDERATED</strong>, <strong id="EN-US_TOPIC_0000001234042157__b872110259111">INNODB</strong>, <strong id="EN-US_TOPIC_0000001234042157__b99451231414">MYISAM</strong>, <strong id="EN-US_TOPIC_0000001234042157__b1741111368115">MEMORY</strong>, <strong id="EN-US_TOPIC_0000001234042157__b3306547715">MRG_MYISAM</strong>, <strong id="EN-US_TOPIC_0000001234042157__b63481151113">NDB</strong>, <strong id="EN-US_TOPIC_0000001234042157__b9752257910">NDBCLUSTER</strong>, or <strong id="EN-US_TOPIC_0000001234042157__b177691412215">PERFORMANCE_SCHEMA</strong>, this attribute can be migrated and will be deleted during the migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164405_p1070104916416"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b11934755123513">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164405_screen777222917">CREATE TABLE `public`.`runoob_alter_test`(
`dataType1` int NOT NULL,
`dataType2` DOUBLE(20,8),
PRIMARY KEY(`dataType1`)
)ENGINE=MYISAM;
## A.
ALTER TABLE runoob_alter_test ENGINE INNODB;
ALTER TABLE runoob_alter_test ENGINE=INNODB;
## B.
ALTER TABLE runoob_alter_test ENGINE MYISAM;
ALTER TABLE runoob_alter_test ENGINE=MYISAM;
## C.
ALTER TABLE runoob_alter_test ENGINE MEMORY;
ALTER TABLE runoob_alter_test ENGINE=MEMORY;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164405_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__b310443516">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164405_screen651011366104">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" INTEGER NOT NULL,
"datatype2" FLOAT(20),
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");
-- A.
-- B.
-- C.</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section730022119116"><h4 class="sectiontitle">INSERT_METHOD</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164615_p1187315419415"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b13285146203615">INSERT_METHOD</strong> specifies the table into which the row should be inserted. Use a value of <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b828516653616">FIRST</strong> or <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b192851769362">LAST</strong> to have inserts go to the first or last table, or a value of <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b1328576143616">NO</strong> to prevent inserts. DSC will delete this attribute during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164615_p123702501346"><strong id="EN-US_TOPIC_0000001234042157__b839186374">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164615_screen13295161583220">CREATE TABLE `public`.`runoob_alter_test`(
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` DOUBLE(20,8),
`dataType3` TEXT NOT NULL,
PRIMARY KEY(`dataType1`)
) INSERT_METHOD=LAST;
ALTER TABLE runoob_alter_test INSERT_METHOD NO;
ALTER TABLE runoob_alter_test INSERT_METHOD=NO;
ALTER TABLE runoob_alter_test INSERT_METHOD FIRST;
ALTER TABLE runoob_alter_test INSERT_METHOD=FIRST;
ALTER TABLE runoob_alter_test INSERT_METHOD LAST;
ALTER TABLE runoob_alter_test INSERT_METHOD=LAST;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164615_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__b1720457873">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164615_screen38432053610">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(20),
"datatype3" TEXT NOT NULL,
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section4542721912"><h4 class="sectiontitle">KEY_BLOCK_SIZE</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164414_p579713312318"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b99653141365">KEY_BLOCK_SIZE</strong> choices vary depending on the storage engine used for a table. For MyISAM tables, <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b5965161413613">KEY_BLOCK_SIZE</strong> optionally specifies the size in bytes to be used for index key blocks. For InnoDB tables, <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b149651214153615">KEY_BLOCK_SIZE</strong> specifies the page size in kilobytes to be used for compressed InnoDB tables. <span id="EN-US_TOPIC_0000001234042157__text685584119488">GaussDB(DWS)</span> does not support this attribute, which will be deleted by DSC during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164414_p35351252542"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b596521493619">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164414_screen154311436362">CREATE TABLE `public`.`runoob_tbl_test`(
`runoob_id` VARCHAR(30),
`runoob_title` VARCHAR(100) NOT NULL,
`runoob_author` VARCHAR(40) NOT NULL,
`submission_date` VARCHAR(30)
) ENGINE=MyISAM KEY_BLOCK_SIZE=8;
ALTER TABLE runoob_tbl_test ENGINE=InnoDB;
ALTER TABLE runoob_tbl_test KEY_BLOCK_SIZE=0;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164414_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b13966131413619">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164414_screen10934142533613">CREATE TABLE "public"."runoob_tbl_test"
(
"runoob_id" VARCHAR(30),
"runoob_title" VARCHAR(100) NOT NULL,
"runoob_author" VARCHAR(40) NOT NULL,
"submission_date" VARCHAR(30)
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("runoob_id");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section138261521419"><h4 class="sectiontitle">MAX_ROWS</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164396_p579713312318">In MySQL, <strong id="EN-US_TOPIC_0000001234042157__b4598341103911">MAX_ROWS</strong> indicates the maximum number of rows that can be stored in a table. This attribute will be deleted during migration using DSC.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164396_p136120543415"><strong id="EN-US_TOPIC_0000001234042157__b685527727">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164396_screen14793185144311">CREATE TABLE `public`.`runoob_alter_test`(
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` DOUBLE(20,8),
`dataType3` TEXT NOT NULL,
PRIMARY KEY(`dataType1`)
);
ALTER TABLE runoob_alter_test MAX_ROWS 100000;
ALTER TABLE runoob_alter_test MAX_ROWS=100000;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164396_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__b2101567795">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164396_screen18955193712444">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(20),
"datatype3" TEXT NOT NULL,
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section1751722318"><h4 class="sectiontitle">MIN_ROWS</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164756_p579713312318"><strong id="EN-US_TOPIC_0000001234042157__b126362282610">MIN_ROWS</strong> indicates the minimum number of rows that can be stored in a table. This attribute will be deleted during migration using DSC.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164756_p1089814579418"><strong id="EN-US_TOPIC_0000001234042157__b1566938480">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164756_screen171131075472">CREATE TABLE `public`.`runoob_alter_test`(
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` DOUBLE(20,8),
`dataType3` TEXT NOT NULL,
PRIMARY KEY(`dataType1`)
);
ALTER TABLE runoob_alter_test MIN_ROWS 10000;
ALTER TABLE runoob_alter_test MIN_ROWS=10000;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164756_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__b1664810651">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164756_screen74081720185019">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(20),
"datatype3" TEXT NOT NULL,
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section12231221116"><h4 class="sectiontitle">PACK_KEYS</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164502_p579713312318">In MySQL, <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b1354716418365">PACK_KEYS</strong> specifies the index compression mode in the MyISAM storage engine. <span id="EN-US_TOPIC_0000001234042157__text8159454152011">GaussDB(DWS)</span> does not support this attribute, which will be deleted by DSC during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164502_p8625165918420"><strong id="EN-US_TOPIC_0000001234042157__b1828767768">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164502_screen11491161995312">CREATE TABLE `public`.`runoob_alter_test`(
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` DOUBLE(20,8),
`dataType3` TEXT NOT NULL,
PRIMARY KEY(`dataType1`)
) ENGINE=MyISAM PACK_KEYS=1;
##A
ALTER TABLE runoob_alter_test PACK_KEYS 0;
ALTER TABLE runoob_alter_test PACK_KEYS=0;
##B
ALTER TABLE runoob_alter_test PACK_KEYS 1;
ALTER TABLE runoob_alter_test PACK_KEYS=1;
##C
ALTER TABLE runoob_alter_test PACK_KEYS DEFAULT;
ALTER TABLE runoob_alter_test PACK_KEYS=DEFAULT;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164502_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__b86083988">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164502_screen1360576145519">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(10),
"datatype3" FLOAT(20),
"datatype4" TEXT NOT NULL,
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");
--A
--B
--C</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section124453225113"><h4 class="sectiontitle">PASSWORD</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164599_p579713312318">In MySQL, <strong id="EN-US_TOPIC_0000001234042157__b190311382720">PASSWORD</strong> indicates the user password. <span id="EN-US_TOPIC_0000001234042157__text122641882113">GaussDB(DWS)</span> does not support this attribute, which will be deleted by DSC during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164599_p574881056"><strong id="EN-US_TOPIC_0000001234042157__b338574382">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164599_screen52843365572">CREATE TABLE `public`.`runoob_alter_test`(
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` DOUBLE(20,8),
`dataType3` TEXT NOT NULL,
PRIMARY KEY(`dataType1`)
);
ALTER TABLE runoob_alter_test PASSWORD 'HELLO';</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164599_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__b1493649656">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164599_screen1360576145519">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(20),
"datatype3" TEXT NOT NULL,
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section365819221918"><h4 class="sectiontitle">ROW_FORMAT</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164761_p579713312318"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b642201183718">ROW_FORMAT</strong> defines the physical format in which the rows are stored. Row format choices vary depending on the storage engine used for the table. If you specify a row format that is not supported by the storage engine that is used for the table, the table will be created using that storage engine's default row format. If <strong id="EN-US_TOPIC_0000001234042157__b16148242115011">ROW_FORMAT</strong> is set to <strong id="EN-US_TOPIC_0000001234042157__b0148104295017">DEFAULT</strong>, the value will be migrated to <strong id="EN-US_TOPIC_0000001234042157__b1514844218504">SET NOCOMPRESS</strong>. If <strong id="EN-US_TOPIC_0000001234042157__b5148104218505">ROW_FORMAT</strong> is set to <strong id="EN-US_TOPIC_0000001234042157__b11148114214501">COMPRESSED</strong>, the value will be migrated to <strong id="EN-US_TOPIC_0000001234042157__b1514813421505">SET COMPRESS</strong>. <span id="EN-US_TOPIC_0000001234042157__text6677951184820">GaussDB(DWS)</span> supports only the preceding two <strong id="EN-US_TOPIC_0000001234042157__b1231712103225">ROW_FORMAT</strong> values. If other values are used, they will be deleted by DSC.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164761_p1634512101858"><strong id="EN-US_TOPIC_0000001234042157__b469813373">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164761_screen153713219158">CREATE TABLE `public`.`runoob_alter_test`(
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` FLOAT(10,2),
`dataType3` DOUBLE(20,8),
`dataType4` TEXT NOT NULL,
PRIMARY KEY(`dataType1`)
) ENGINE=InnoDB;
## A.
ALTER TABLE runoob_alter_test ROW_FORMAT DEFAULT;
ALTER TABLE runoob_alter_test ROW_FORMAT=DEFAULT;
## B.
ALTER TABLE runoob_alter_test ROW_FORMAT DYNAMIC;
ALTER TABLE runoob_alter_test ROW_FORMAT=DYNAMIC;
## C.
ALTER TABLE runoob_alter_test ROW_FORMAT COMPRESSED;
ALTER TABLE runoob_alter_test ROW_FORMAT=COMPRESSED;
## D.
ALTER TABLE runoob_alter_test ROW_FORMAT REDUNDANT;
ALTER TABLE runoob_alter_test ROW_FORMAT=REDUNDANT;
## E.
ALTER TABLE runoob_alter_test ROW_FORMAT COMPACT;
ALTER TABLE runoob_alter_test ROW_FORMAT=COMPACT;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164761_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__b1041149499">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164761_screen13966133461520">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(10),
"datatype3" FLOAT(20),
"datatype4" TEXT NOT NULL,
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");
-- A.
ALTER TABLE "public"."runoob_alter_test" SET NOCOMPRESS;
ALTER TABLE "public"."runoob_alter_test" SET NOCOMPRESS;
-- B.
-- C.
ALTER TABLE "public"."runoob_alter_test" SET COMPRESS;
ALTER TABLE "public"."runoob_alter_test" SET COMPRESS;
-- D.
-- E.</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section086942216120"><h4 class="sectiontitle">STATS_AUTO_RECALC</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164724_p579713312318"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b182301611153713">STATS_AUTO_RECALC</strong> specifies whether to automatically recalculate persistent statistics for an InnoDB table. <span id="EN-US_TOPIC_0000001234042157__text01752034102216">GaussDB(DWS)</span> does not support this attribute, which will be deleted by DSC during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164724_p29165111653"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b1323015117374">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164724_screen6241195619015">CREATE TABLE `public`.`runoob_alter_test`(
`runoob_id` VARCHAR(30),
`runoob_title` VARCHAR(100) NOT NULL,
`runoob_author` VARCHAR(40) NOT NULL,
`submission_date` VARCHAR(30)
) ENGINE=InnoDB, STATS_AUTO_RECALC=DEFAULT;
## A.
ALTER TABLE runoob_alter_test STATS_AUTO_RECALC DEFAULT;
ALTER TABLE runoob_alter_test STATS_AUTO_RECALC=DEFAULT;
## B.
ALTER TABLE runoob_alter_test STATS_AUTO_RECALC 0;
ALTER TABLE runoob_alter_test STATS_AUTO_RECALC=0;
## C.
ALTER TABLE runoob_alter_test STATS_AUTO_RECALC 1;
ALTER TABLE runoob_alter_test STATS_AUTO_RECALC=1;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164724_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__b150980041">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164724_screen1360576145519">CREATE TABLE "public"."runoob_alter_test"
(
"runoob_id" VARCHAR(30),
"runoob_title" VARCHAR(100) NOT NULL,
"runoob_author" VARCHAR(40) NOT NULL,
"submission_date" VARCHAR(30)
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("runoob_id");
-- A.
-- B.
-- C.
</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section911615231410"><h4 class="sectiontitle">STATS_PERSISTENT</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164677_p579713312318">In MySQL, <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b14185112719372">STATS_PERSISTENT</strong> specifies whether to enable persistence statistics for an InnoDB table. The <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b8185027163717">CREATE TABLE</strong> and <strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b4185827113718">ALTER TABLE</strong> statements can be used to enable persistence statistics. DSC will delete this attribute during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164677_p2730413959"><strong id="EN-US_TOPIC_0000001234042157__b1702634943">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164677_screen13538625524">CREATE TABLE `public`.`runoob_alter_test`(
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` DOUBLE(20,8),
`dataType3` TEXT NOT NULL,
PRIMARY KEY(`dataType1`)
) ENGINE=InnoDB, STATS_PERSISTENT=0;
## A.
ALTER TABLE runoob_alter_test STATS_PERSISTENT DEFAULT;
ALTER TABLE runoob_alter_test STATS_PERSISTENT=DEFAULT;
## B.
ALTER TABLE runoob_alter_test STATS_PERSISTENT 0;
ALTER TABLE runoob_alter_test STATS_PERSISTENT=0;
## C.
ALTER TABLE runoob_alter_test STATS_PERSISTENT 1;
ALTER TABLE runoob_alter_test STATS_PERSISTENT=1;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164677_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__b2009137889">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164677_screen1360576145519">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(20),
"datatype3" TEXT NOT NULL,
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");
-- A.
-- B.
-- C.</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section1933718231617"><h4 class="sectiontitle">STATS_SAMPLE_PAGES</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164636_p579713312318"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b107951035153712">STATS_SAMPLE_PAGES</strong> specifies the number of index pages to sample when cardinality and other statistics for an indexed column are estimated. DSC will delete this attribute during migration.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164636_p20279151915518"><strong id="EN-US_TOPIC_0000001234042157__b1672408082">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164636_screen66474452410">CREATE TABLE `public`.`runoob_alter_test`(
`dataType1` int NOT NULL AUTO_INCREMENT,
`dataType2` DOUBLE(20,8),
`dataType3` TEXT NOT NULL,
PRIMARY KEY(`dataType1`)
) ENGINE=InnoDB,STATS_SAMPLE_PAGES=25;
ALTER TABLE runoob_alter_test STATS_SAMPLE_PAGES 100;
ALTER TABLE runoob_alter_test STATS_SAMPLE_PAGES=100;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164636_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__b392143084">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164636_screen1360576145519">CREATE TABLE "public"."runoob_alter_test"
(
"datatype1" SERIAL NOT NULL,
"datatype2" FLOAT(20),
"datatype3" TEXT NOT NULL,
PRIMARY KEY ("datatype1")
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("datatype1");</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_section135275238112"><h4 class="sectiontitle">UNION</h4><p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164504_p579713312318"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b118321735159">UNION</strong> is a table creation parameter of the MERGE storage engine. Creating a table using this keyword is similar to creating a common view. The created table logically combines the data of multiple tables that are specified by UNION. DSC migrates this feature to the view creation statement in GaussDB.</p>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164504_p524954714513"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b105978525379">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164504_screen48015451078">CREATE TABLE t1 (
a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
message CHAR(20)
) ENGINE=MyISAM;
CREATE TABLE t2 (
a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
message CHAR(20)
) ENGINE=MyISAM;
CREATE TABLE total (
a INT NOT NULL AUTO_INCREMENT,
message CHAR(20))
ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;</pre>
<p id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164504_p12114173518210"><strong id="EN-US_TOPIC_0000001234042157__en-us_topic_0237712592_b1959811528374">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001234042157__en-us_topic_0238518440_en-us_topic_0237362490_en-us_topic_0214164504_screen1145484581614">CREATE TABLE t1 (
a SERIAL NOT NULL PRIMARY KEY,
message CHAR(20)
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("a");
CREATE TABLE t2 (
a SERIAL NOT NULL PRIMARY KEY,
message CHAR(20)
)
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
NOCOMPRESS
DISTRIBUTE BY HASH ("a");
CREATE VIEW total(a, message) AS
SELECT * FROM t1
UNION ALL
SELECT * FROM t2;</pre>
</div>
</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>