Re: intercepting where clause on a view or other performance tweak - Mailing list pgsql-performance

From Tom Lane
Subject Re: intercepting where clause on a view or other performance tweak
Date
Msg-id 14368.1353078307@sss.pgh.pa.us
Whole thread Raw
In response to intercepting where clause on a view or other performance tweak  (Russell Keane <Russell.Keane@inps.co.uk>)
Responses Re: intercepting where clause on a view or other performance tweak  (Russell Keane <Russell.Keane@inps.co.uk>)
List pgsql-performance
Russell Keane <Russell.Keane@inps.co.uk> writes:
> Running the following query takes 56+ ms as it does a seq scan of the whole table:
> SELECT CODE FROM stuff
>    WHERE SEARCH_KEY LIKE 'AAAAAA%'

Why don't you create an index on search_key, and forget all these other
machinations?  (If your locale isn't C you'll need to use a
varchar_pattern_ops index.)

            regards, tom lane


pgsql-performance by date:

Previous
From: Russell Keane
Date:
Subject: intercepting where clause on a view or other performance tweak
Next
From: Russell Keane
Date:
Subject: Re: intercepting where clause on a view or other performance tweak