We have contrib/wildspeed extension which uses new partial
match feature of GIN index. See our presentation
http://www.pgcon.org/2008/schedule/events/58.en.html
It index all permutations, so index is very big, but for not
long read-only sstring it works fast.
Oleg
On Tue, 22 Jul 2008, Stefan Sturm wrote:
Hello,
I'm developing a autocomplete Feature using php and PostgreSQL 8.3.
To fill the autocomplete box I use the following SQL Statement:
select * from _table_ where upper( _field_ ) like '%STRING%';
This SQL Statement takes 900 ms on a Table with 300.000 entries.
What can I do to speed up the Statement? What Index can I set?
Thanks for your Help,
Stefan Sturm
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg@xxxxxxxxxx, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83