Search Postgresql Archives

Re: Index on substring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





2011/6/5 HÃvard Wahl KongsgÃrd <haavard.kongsgaard@xxxxxxxxx>
Hi, my database performance badly on substring comparison between two very large tables.Â
In postgresql 8.4 is it possible to create a index on aÂsubstring, or must I create an new field for the substring match ( and then create a new index for that field)?

--
HÃvard Wahl KongsgÃrd

http://havard.security-review.net/



Hi,
I've checked that for 9.0, however for 8.4 should work as well:

CREATE INDEXÂÂi_test_sbstr ON test( substring(t, 5, 3) );

It is important that the substring() parameters in the index definition are the same as you use in your query.

regards
Szymon

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux