{"id":6981,"date":"2021-07-01T16:48:00","date_gmt":"2021-07-01T08:48:00","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=6981"},"modified":"2021-07-01T17:27:55","modified_gmt":"2021-07-01T09:27:55","slug":"gbase-8a%e5%85%a8%e6%96%87%e7%b4%a2%e5%bc%95%e5%88%9b%e5%bb%ba%e3%80%81%e6%9b%b4%e6%96%b0%e5%92%8c%e5%88%a0%e9%99%a4%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/6981","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a\u5168\u6587\u7d22\u5f15\u521b\u5efa\u3001\u66f4\u65b0\u548c\u5220\u9664\u65b9\u6cd5"},"content":{"rendered":"<p>\u672c\u6587\u4ecb\u7ecdGBase 8a MPP\u6570\u636e\u5e93\u96c6\u7fa4\u5168\u6587\u7d22\u5f15FULLTEXT\u7684\u521b\u5efa\u7d22\u5f15\uff0c\u66f4\u65b0\u7d22\u5f15\u548c\u5220\u9664\u7d22\u5f15\u7684\u65b9\u6cd5\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Directory Navigation<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2b299bb7363\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2b299bb7363\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.gbase8.cn\/en\/6981\/#%E5%8F%82%E8%80%83\" >\u53c2\u8003<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/6981\/#%E5%88%9B%E5%BB%BA%E5%85%A8%E6%96%87%E7%B4%A2%E5%BC%95\" >\u521b\u5efa\u5168\u6587\u7d22\u5f15<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.gbase8.cn\/en\/6981\/#%E6%9F%A5%E7%9C%8B%E5%85%A8%E6%96%87%E7%B4%A2%E5%BC%95%E5%88%97%E8%A1%A8\" >\u67e5\u770b\u5168\u6587\u7d22\u5f15\u5217\u8868<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.gbase8.cn\/en\/6981\/#%E6%9F%A5%E7%9C%8B%E5%85%A8%E6%96%87%E7%B4%A2%E5%BC%95%E7%9A%84%E5%BB%BA%E8%A1%A8%E8%AF%AD%E5%8F%A5\" >\u67e5\u770b\u5168\u6587\u7d22\u5f15\u7684\u5efa\u8868\u8bed\u53e5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.gbase8.cn\/en\/6981\/#%E6%9B%B4%E6%96%B0%E5%85%A8%E6%96%87%E7%B4%A2%E5%BC%95%E6%95%B0%E6%8D%AE\" >\u66f4\u65b0\u5168\u6587\u7d22\u5f15\u6570\u636e<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.gbase8.cn\/en\/6981\/#%E5%88%A0%E9%99%A4%E5%85%A8%E6%96%87%E7%B4%A2%E5%BC%95\" >\u5220\u9664\u5168\u6587\u7d22\u5f15<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83\"><\/span>\u53c2\u8003<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/www.gbase8.cn\/en\/6779\/\"><a href=\"https:\/\/www.gbase8.cn\/en\/6779\/\">GBase 8a\u5168\u6587\u7d22\u5f15\u529f\u80fd\u5b89\u88c5\u90e8\u7f72\u65b9\u6cd5<\/a><br><a href=\"https:\/\/www.gbase8.cn\/en\/6981\/\">GBase 8a\u5168\u6587\u7d22\u5f15\u521b\u5efa\u3001\u66f4\u65b0\u548c\u5220\u9664\u65b9\u6cd5<br><\/a><a href=\"https:\/\/www.gbase8.cn\/en\/6939\/\">GBase 8a\u5168\u6587\u7d22\u5f15\u5e38\u7528\u914d\u7f6e\u6587\u4ef6\u548c\u914d\u7f6e\u53c2\u6570<br><\/a><a href=\"https:\/\/www.gbase8.cn\/en\/6863\/\">GBase 8a\u5168\u6587\u7d22\u5f15\u63d0\u9ad8\u6a21\u7cca\u67e5\u8be2\u6027\u80fd\u4f7f\u7528\u6837\u4f8b<\/a><br><a href=\"https:\/\/www.gbase8.cn\/en\/6997\/\">GBase 8a\u5168\u6587\u7d22\u5f15\u591a\u5206\u8bcd\u5668\u7684\u529f\u80fd\u4ecb\u7ecd\u548c\u4f7f\u7528<\/a><\/a><a href=\"https:\/\/www.gbase8.cn\/en\/6997\/\"><br><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%88%9B%E5%BB%BA%E5%85%A8%E6%96%87%E7%B4%A2%E5%BC%95\"><\/span>\u521b\u5efa\u5168\u6587\u7d22\u5f15<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE FULLTEXT INDEX index_name ON table_name (column_name) &#91;INDEX_DATA_PATH='path'] &#91;WITH PARSER seg_name]<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>index_name : \u5168\u6587\u7d22\u5f15\u540d\u5b57\uff0c\u4e00\u5f20\u8868\u5185\u5fc5\u987b\u552f\u4e00<\/li><li>table_name \uff1a \u8868\u540d\u5b57<\/li><li>column_name \uff1a\u5217\u540d\u5b57\uff0c\u53ea\u652f\u6301\u5355\u5217<\/li><li>INDEX_DATA_PATH\uff1a\u53ef\u9009\u9879\uff0c\u8bbe\u7f6e\u7d22\u5f15\u6570\u636e\u8def\u5f84\u6807\u5fd7\u3002\u5982\u4e0d\u586b\u5199\uff0c\u5219\u7d22\u5f15\u6570\u636e\u4fdd\u5b58\u5728\u9ed8\u8ba4\u8def\u5f84\u4e0a<\/li><li>WITH PARSER \uff1a\u6307\u5b9a\u5206\u8bcd\u5668\u7684\u540d\u5b57\u3002\u4e0d\u6307\u5b9a\u5219\u4f7f\u7528\u9ed8\u8ba4\u5206\u8bcd\u5668\u3002<\/li><\/ul>\n\n\n\n<p>\u5982\u4e0b\u662f\u4f7f\u7528\u9ed8\u8ba4\u5206\u8bcd\u5668\u548c\u6307\u5b9a\u5206\u8bcd\u5668\u7684\u6837\u4f8b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; create fulltext index idx_name on t1(name);\nQuery OK, 0 rows affected (Elapsed: 00:00:00.18)\nRecords: 0  Duplicates: 0  Warnings: 0\n\ngbase&gt; create fulltext index idx_memo on t1(memo) with parser part4;\nQuery OK, 0 rows affected (Elapsed: 00:00:00.16)\nRecords: 0  Duplicates: 0  Warnings: 0\n<\/code><\/pre>\n\n\n\n<p>\u521b\u5efa\u6307\u5b9a\u7d22\u5f15\u6570\u636e\u8def\u5f84\u7684\u4f8b\u5b50<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; create fulltext index idx_name on t1(name) INDEX_DATA_PATH='\/home\/gbase\/gbasefulltextdata' with parser part2;\nQuery OK, 0 rows affected (Elapsed: 00:00:00.29)\nRecords: 0  Duplicates: 0  Warnings: 0\n\ngbase&gt; update index idx_name on t1;\nQuery OK, 7 rows affected (Elapsed: 00:00:01.27)\n\ngbase&gt; system ls -l \/home\/gbase\/gbasefulltextdata\ntotal 0\ndrwx------. 3 gbase gbase 59 Jul  1 16:46 gbase_testdb_t1_n1_C00001.FTD\ndrwx------. 2 gbase gbase  6 Jul  1 16:46 gbase_testdb_t1_n2_C00001.FTD\ndrwx------. 2 gbase gbase  6 Jul  1 16:46 gbase_vc00001_testdb_t1_C00001.FTD\ngbase&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E5%85%A8%E6%96%87%E7%B4%A2%E5%BC%95%E5%88%97%E8%A1%A8\"><\/span>\u67e5\u770b\u5168\u6587\u7d22\u5f15\u5217\u8868<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u901a\u8fc7show index from TABLE_NAME\u67e5\u770b\u8be5\u8868\u7684\u7d22\u5f15\u4fe1\u606f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; show index from t1;\n+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+\n| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |\n+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+\n| t1    |          1 | idx_memo |            1 | memo        | NULL      |        NULL |     NULL | NULL   | YES  | FULLTEXT   |         |\n| t1    |          1 | idx_name |            1 | name        | NULL      |        NULL |     NULL | NULL   | YES  | FULLTEXT   |         |\n+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+\n2 rows in set (Elapsed: 00:00:00.00)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E5%85%A8%E6%96%87%E7%B4%A2%E5%BC%95%E7%9A%84%E5%BB%BA%E8%A1%A8%E8%AF%AD%E5%8F%A5\"><\/span>\u67e5\u770b\u5168\u6587\u7d22\u5f15\u7684\u5efa\u8868\u8bed\u53e5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5176\u4e2d\u5305\u542b\u4e86\u7d22\u5f15\u6570\u636e\u4f4d\u7f6e\uff0c\u5206\u8bcd\u540d\u5b57\u7b49\u4fe1\u606f\u3002\u6ca1\u6709\u7684\u5219\u7528\u9ed8\u8ba4\u503c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; show create table t1;\n\u3002\u3002\u3002\u3002\n| t1    | CREATE TABLE \"t1\" (\n  \"id\" int(11) DEFAULT NULL,\n  \"name\" varchar(100) DEFAULT NULL,\n  \"dept\" int(11) DEFAULT NULL,\n  \"birth\" date DEFAULT NULL,\n  \"memo\" longtext,\n  FULLTEXT \"idx_memo\" (\"memo\") WITH PARSER \"part4\",\n  FULLTEXT \"idx_name\" (\"name\")INDEX_DATA_PATH='\/home\/gbase\/gbasefulltextdata' WITH PARSER \"part2\"\n) ENGINE=EXPRESS DEFAULT CHARSET=utf8 TABLESPACE='sys_tablespace' |\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9B%B4%E6%96%B0%E5%85%A8%E6%96%87%E7%B4%A2%E5%BC%95%E6%95%B0%E6%8D%AE\"><\/span>\u66f4\u65b0\u5168\u6587\u7d22\u5f15\u6570\u636e<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>UPDATE INDEX index_name ON table_name &#91;WITH ANALYZE];<\/code><\/pre>\n\n\n\n<p>\u5176\u4e2dWITH ANALYZE\u5206\u6790\u6307\u4ee4\uff0c\u52a0\u5165\u540e\u66f4\u65b0\u5168\u6587\u7d22\u65f6\u4f1a\u5bf9\u4e0d\u8fde\u7eed\u6570\u636e\u91cd\u6574\uff0c\u63d0\u5347I\/O \u901f\u5ea6\uff0c\u4ece\u800c\u63d0\u5347\u6027\u80fd\u3002\u4f46\u91cd\u5efa\u65f6\u9700\u8981\u65f6\u95f4\u548c\u8d44\u6e90\u7684\uff0c\u5efa\u8bae\u6839\u636e\u7cfb\u7edf\u8d1f\u8f7d\uff0c\u627e\u95f2\u6687\u65f6\u5b9a\u671f\u6267\u884c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; update index idx_memo on t1;\nQuery OK, 7 rows affected (Elapsed: 00:00:01.10)\n\ngbase&gt; update index idx_name on t1;\nQuery OK, 7 rows affected (Elapsed: 00:00:01.15)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%88%A0%E9%99%A4%E5%85%A8%E6%96%87%E7%B4%A2%E5%BC%95\"><\/span>\u5220\u9664\u5168\u6587\u7d22\u5f15<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u548c\u5220\u9664\u5176\u5b83\u7d22\u5f15\u4e00\u6837\u7684\u8bed\u6cd5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DROP INDEX index_name ON table_name<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; drop index idx_memo on t1;\nQuery OK, 0 rows affected (Elapsed: 00:00:00.39)\nRecords: 0  Duplicates: 0  Warnings: 0\n\ngbase&gt; drop index idx_name on t1;\nQuery OK, 0 rows affected (Elapsed: 00:00:00.13)\nRecords: 0  Duplicates: 0  Warnings: 0\n<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u4ecb\u7ecdGBase 8a MPP\u6570\u636e\u5e93\u96c6\u7fa4\u5168\u6587\u7d22\u5f15FULLTEXT\u7684\u521b\u5efa\u7d22\u5f15\uff0c\u66f4\u65b0\u7d22\u5f15\u548c\u5220\u9664\u7d22\u5f15\u7684\u65b9\u6cd5\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[104],"class_list":["post-6981","post","type-post","status-publish","format-standard","hentry","category-gbase8a","tag-104"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/6981","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=6981"}],"version-history":[{"count":25,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/6981\/revisions"}],"predecessor-version":[{"id":7060,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/6981\/revisions\/7060"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=6981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=6981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=6981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}