Re: [GENERAL] indexed regex select optimisation missing? - Mailing list pgsql-general

From Gene Selkov, Jr.
Subject Re: [GENERAL] indexed regex select optimisation missing?
Date
Msg-id 199911040622.AAA23488@antares
Whole thread Raw
In response to indexed regex select optimisation missing?  (Stuart Woolford <stuartw@newmail.net>)
Responses Re: [GENERAL] indexed regex select optimisation missing?  (Stuart Woolford <stuartw@newmail.net>)
List pgsql-general
> 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

pgsql-general by date:

Previous
From: "Yury Don"
Date:
Subject: Plpgsql qestion
Next
From: Roomi
Date:
Subject: !!! Urgent: btree: lost page