Postgres文字搜寻 [英] postgres text search

查看:75
本文介绍了Postgres文字搜寻的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们具有搜索功能,允许用户根据产品描述进行搜索。该表可以计数约200万行。我是否需要为此执行全文搜索,还是只需要在描述栏上使用常规索引。

We have a search feature that allows users to search based on product description. The table could countain around 2m rows. Do i need to implement full text search for this or do I just need a regular index on the description col.

问题2。是否有一个工具可以生成200万条记录。

question 2. is there a tool that will generate 2m records.

预先感谢。

推荐答案

我同意弗兰克(Frank)的观点:没有全文本搜索,您将走不远。 常规索引根本无济于事,因为任何用户友好搜索都需要进行部分匹配( LIKE'%somevalue%'),并且永远不会使用索引

I agree with Frank: you will not get far without full-text search. A "regular index" will not help at all because any "user-friendly" search needs to do partial matching (LIKE '%somevalue%') and this will never use an index

对于生成测试数据,我对 Benerator 有很好的经验。学习起来有点复杂,但是功能非常强大。

For generating test data, I have good experience with Benerator. It's a bit complicated to learn, but very powerful.

或者,您可以使用数据生成器实际上是一个Oracle工具,但也可以生成平面文件,也可以与Postgres一起使用

Alternatively you can use Datagenerator which is actually an Oracle tool, but can produce flat files as well that can be used with Postgres

这篇关于Postgres文字搜寻的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆