postgres text search
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 o开发者_如何学Gor do I just need a regular index on the description col.
question 2. is there a tool that will generate 2m records.
Thanks in advance.
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
For generating test data, I have good experience with Benerator. It's a bit complicated to learn, but very powerful.
Alternatively you can use Datagenerator which is actually an Oracle tool, but can produce flat files as well that can be used with Postgres
When a "regular index" is a B-Tree-index, than this will not help in the search. You need FTS to search for content in a piece of text.
http://www.postgresql.org/docs/current/interactive/textsearch.html
精彩评论