Re: Simple Question of Performance ILIKE or Lower

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Marcos <mjs_ops(at)gmx(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Simple Question of Performance ILIKE or Lower
Date: 2006-01-18 23:02:30
Message-ID: 20060118230230.GZ17896@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jim C. Nasby 2006-01-18 23:05:32 Re: 3WARE Card performance boost?
Previous Message Jim C. Nasby 2006-01-18 22:52:57 Re: Autovacuum / full vacuum (off-topic?)