> select key from inv_word_i where word='whatever' order by count desc ; > > and this is fast, however, if I use: > > select key from inv_word_i where word~'^whatever.*' order by count desc ; > > it is very slow. Did you try '^whatever' instead of '^whatever.*'? Based on common sense, the former should be much faster than the latter, which would match any cahracter any number of times, unless the regexp is optimized to avoid that. --Gene ************
- [GENERAL] indexed regex select optimisation missing? Stuart Woolford
- Re: [GENERAL] indexed regex select optimisation mis... Gene Selkov, Jr.
- Re: [GENERAL] indexed regex select optimisation... Stuart Woolford
- Re: [GENERAL] indexed regex select optimisa... Peter Eisentraut
- Re: [GENERAL] indexed regex select opti... Gene Selkov, Jr.
- Re: [GENERAL] indexed regex select... Stuart Woolford
- Re: [GENERAL] indexed regex se... Ross J. Reedstrom
- Re: [GENERAL] indexed rege... Stuart Woolford