开发者

Storing tri-grams in database or generate on-the-fly?

I'm trying to create an application which uses trigrams for approximate string matching. Now all the records are in the database and i want to be able to search the records on a fixed column. Is it best to have an additional field whihc contains the hashed version of the value i want to search (if so, whats the best way to store it?) or is it better to generate t开发者_StackOverflow社区he trigrams on the fly?


Which database are you using?

PostgreSQL has trigram functions built in which work off of GiST or GiN indexes.

In SQL, I'm using CLR to create and compare trigram sets, works much, much faster than SQL code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜