小编Moh*_*han的帖子

AWS PostgresSQL RDS 实例是否可以提供停用词文件?

我需要提供自定义的停用词列表。从字典手册部分来看,执行此操作的方法是将一个停用词文件放入$SHAREDIR/tsearch_data/.

使用AWS时可以这样做吗?如果不是,是否可以通过命令行提供停用词文件?

postgresql full-text-search amazon-rds

5
推荐指数
1
解决办法
971
查看次数

为什么这个限制使 postgres 规划器使用更慢的索引扫描而不是更快的位图堆/索引扫描?

我在 Postgres 9.3.3 中有一个大约 700k 行的表,它具有以下结构:

Columns:
 content_body  - text                        
 publish_date  - timestamp without time zone 
 published     - boolean       

Indexes:
    "articles_pkey" PRIMARY KEY, btree (id)
    "article_text_gin" gin (article_text)
    "articles_publish_date_id_index" btree (publish_date DESC NULLS LAST, id DESC)
Run Code Online (Sandbox Code Playgroud)

我所做的查询有全文搜索查询和限制,如下所示:

当我在我的索引中搜索具有限制和顺序的字符串时,查询速度很快:

explain analyze select * from "articles" where article_text @@ plainto_tsquery('pg_catalog.simple', 'in_index') order by id limit 10;
                                                                QUERY PLAN                                                                
------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=0.42..1293.88 rows=10 width=1298) (actual time=2.073..9.837 rows=10 loops=1)
   ->  Index Scan using articles_pkey on articles  (cost=0.42..462150.49 rows=3573 width=1298) (actual time=2.055..9.711 rows=10 loops=1)
         Filter: …
Run Code Online (Sandbox Code Playgroud)

postgresql performance

4
推荐指数
1
解决办法
1574
查看次数