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>
117 lines
7.4 KiB
HTML
117 lines
7.4 KiB
HTML
<a name="EN-US_TOPIC_0000001819416257"></a><a name="EN-US_TOPIC_0000001819416257"></a>
|
|
|
|
<h1 class="topictitle1">Full-Text Indexes</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_p330274862511">GaussDB(DWS) does not support full-text indexes. DSC will perform adaptation based on GaussDB(DWS) features during migration.</p>
|
|
<ol id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_ol12553123692615"><li id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_li15553183615265">Inline full-text index<p id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_p135691921172717"><a name="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_li15553183615265"></a><a name="en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_li15553183615265"></a><strong id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_b123631548192715">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_screen182799185276">## A.
|
|
CREATE TABLE `public`.`test_create_table02` (
|
|
`ID` INT(11) NOT NULL PRIMARY KEY,
|
|
`TITLE` CHAR(255) NOT NULL,
|
|
`CONTENT` TEXT NULL,
|
|
`CREATE_TIME` DATETIME NULL DEFAULT NULL,
|
|
FULLTEXT (`CONTENT`)
|
|
);
|
|
|
|
## B.
|
|
CREATE TABLE IF NOT EXISTS `public`.`runoob_dataType_test`
|
|
(
|
|
`id` INT PRIMARY KEY AUTO_INCREMENT,
|
|
`name` VARCHAR(128) NOT NULL,
|
|
FULLTEXT INDEX (name)
|
|
);
|
|
|
|
## C.
|
|
CREATE TABLE IF NOT EXISTS `public`.`runoob_dataType_test`
|
|
(
|
|
`id` INT PRIMARY KEY AUTO_INCREMENT,
|
|
`name` VARCHAR(128) NOT NULL,
|
|
FULLTEXT INDEX (name ASC)
|
|
);</pre>
|
|
<p id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_p77858251279"><strong id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_b197144504277">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_screen71919285272">-- A.
|
|
CREATE TABLE "public"."test_create_table02"
|
|
(
|
|
"id" INTEGER NOT NULL PRIMARY KEY,
|
|
"title" CHAR(1020) NOT NULL,
|
|
"content" TEXT,
|
|
"create_time" TIMESTAMP WITHOUT TIME ZONE DEFAULT NULL
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("id");
|
|
CREATE INDEX "idx_test_create_table02_content" ON "public"."test_create_table02" USING GIN(to_tsvector(coalesce("content",'')));
|
|
|
|
-- B.
|
|
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 "idx_runoob_datatype_test_name" ON "public"."runoob_datatype_test" USING GIN(to_tsvector(coalesce("name",'')));
|
|
|
|
-- C.
|
|
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 "idx_runoob_datatype_test_name" ON "public"."runoob_datatype_test" USING GIN(to_tsvector(coalesce("name",'')));</pre>
|
|
</li><li id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_li19672194516269">Full-text index created by <strong id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_b145195595131646">ALTER TABLE</strong><p id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_p1287443289"><strong id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_b728710413284">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_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 FULLTEXT INDEX USER_ID_INDEX_02(USER_ID);
|
|
ALTER TABLE TEST_CREATE_TABLE05 ADD FULLTEXT USER_NAME_INDEX_02(USER_NAME);</pre>
|
|
<p id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_p142870442811"><strong id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_b10288134162811">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_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_id_index_02" ON "public"."test_create_table05" USING GIN(to_tsvector(coalesce("user_id",'')));
|
|
CREATE INDEX "user_name_index_02" ON "public"."test_create_table05" USING GIN(to_tsvector(coalesce("user_name",'')));</pre>
|
|
</li><li id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_li1937655815268">Full-text index created by <strong id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_b94293422631646">CREATE INDEX</strong><p id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_p15863552819"><strong id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_b11586205182818">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_screen758620572815">CREATE TABLE `public`.`test_index_table02` (
|
|
`ID` INT(11) NOT NULL PRIMARY KEY,
|
|
`TITLE` CHAR(255) NOT NULL,
|
|
`CONTENT` TEXT NULL,
|
|
`CREATE_TIME` INT(10) NULL DEFAULT NULL
|
|
);
|
|
CREATE FULLTEXT INDEX CON_INDEX ON TEST_INDEX_TABLE02(CONTENT);</pre>
|
|
<p id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_p35869514281"><strong id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_b458615162817">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001819416257__en-us_topic_0000001706104829_en-us_topic_0000001385313378_en-us_topic_0214164597_screen8586145162813">CREATE TABLE "public"."test_index_table02"
|
|
(
|
|
"id" INTEGER NOT NULL PRIMARY KEY,
|
|
"title" CHAR(1020) NOT NULL,
|
|
"content" TEXT,
|
|
"create_time" INTEGER DEFAULT NULL
|
|
)
|
|
WITH ( ORIENTATION = ROW, COMPRESSION = NO )
|
|
NOCOMPRESS
|
|
DISTRIBUTE BY HASH ("id");
|
|
CREATE INDEX "con_index" ON "public"."test_index_table02" USING GIN(to_tsvector(coalesce("content",'')));</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>
|
|
|