Re: Simple Question of Performance ILIKE or Lower - Mailing list pgsql-performance

From Jim C. Nasby
Subject Re: Simple Question of Performance ILIKE or Lower
Date
Msg-id 20060118230230.GZ17896@pervasive.com
Whole thread Raw
In response to Simple Question of Performance ILIKE or Lower  (Marcos <mjs_ops@gmx.net>)
List pgsql-performance
On Wed, Jan 18, 2006 at 09:10:30AM +0000, Marcos wrote:
> Hi,
>
> I have a simple question about performance using two resources.
>
> What's have the best performance?
>
> lower( col1 ) LIKE lower( 'myquestion%' )
>
> OR
>
> col1 ILIKE 'myquestion%'

If you index lower( col1 ), then the former would likely perform better
(if the optimizer knows it could use the index in that case). Otherwise
I suspect they'd be the same.

Try it and find out.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-performance by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Autovacuum / full vacuum (off-topic?)
Next
From: Chris Browne
Date:
Subject: Re: Autovacuum / full vacuum (off-topic?)