Re: planning issue - Mailing list pgsql-general

From Alban Hertroys
Subject Re: planning issue
Date
Msg-id 45FE6078.5030306@magproductions.nl
Whole thread Raw
In response to planning issue  (Jonathan Vanasco <postgres@2xlp.com>)
List pgsql-general
Jonathan Vanasco wrote:
> hoping someone may be able to offer advice:.
>
> SELECT
>     *
> FROM
>     table_a
> WHERE
>     id != 10001
>     AND
>     (
>             (  field_1 ilike '123' )
>             OR
>             ( field_2 ilike 'abc' )
>     )

You seem to use that ilike expression merely as a case-insensitive
equals. May as well use that in combination with indices on
lower(field_[12]). It's probably faster than like or a regex match.

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
   7500 AK Enschede

// Integrate Your World //

pgsql-general by date:

Previous
From: Naz Gassiep
Date:
Subject: Re: Postgres Database size
Next
From: Alban Hertroys
Date:
Subject: Re: issue with SELECT settval(..);