pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ignore case in where clause
3+ messages / 2 participants
[nested] [flat]

* ignore case in where clause
@ 2012-03-22 20:26 Edward W. Rouse <erouse@comsquared.com>
  2012-03-22 20:38 ` Re: ignore case in where clause Guillaume Lelarge <guillaume@lelarge.info>
  0 siblings, 1 reply; 3+ messages in thread

From: Edward W. Rouse @ 2012-03-22 20:26 UTC (permalink / raw)
  To: pgsql-sql

I am currently using lower(column) = '' for matching case insensitive. I
know that there are ways to do this with regular expressions too. I recently
noticed that including even one lower causes severe performance issues (from
290ms to over 80Kms).

What is the best way, performance wise, to do case insensitive matching? I
could spend a few hours testing if I have to, but I'm hoping someone knows
off the top of their heads.

Using 8.3 currently. I am a programmer, not a database person; but we don't
really have a DB here, so I do what I can.

Thanks.

Edward W. Rouse
Comsquared System, Inc.
770-734-5301






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: ignore case in where clause
  2012-03-22 20:26 ignore case in where clause Edward W. Rouse <erouse@comsquared.com>
@ 2012-03-22 20:38 ` Guillaume Lelarge <guillaume@lelarge.info>
  2012-03-22 21:05   ` Re: ignore case in where clause Edward W. Rouse <erouse@comsquared.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Guillaume Lelarge @ 2012-03-22 20:38 UTC (permalink / raw)
  To: Edward W. Rouse <erouse@comsquared.com>; +Cc: pgsql-sql

On Thu, 2012-03-22 at 16:26 -0400, Edward W. Rouse wrote:
> I am currently using lower(column) = '' for matching case insensitive. I
> know that there are ways to do this with regular expressions too. I recently
> noticed that including even one lower causes severe performance issues (from
> 290ms to over 80Kms).
> 

Probably because it cannot use the index anymore. Try creating an index
on lower(column), and see if it helps.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: ignore case in where clause
  2012-03-22 20:26 ignore case in where clause Edward W. Rouse <erouse@comsquared.com>
  2012-03-22 20:38 ` Re: ignore case in where clause Guillaume Lelarge <guillaume@lelarge.info>
@ 2012-03-22 21:05   ` Edward W. Rouse <erouse@comsquared.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Edward W. Rouse @ 2012-03-22 21:05 UTC (permalink / raw)
  To: pgsql-sql

That was exactly it, Thanks.

> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-
> owner@postgresql.org] On Behalf Of Guillaume Lelarge
> Sent: Thursday, March 22, 2012 4:39 PM
> To: Edward W. Rouse
> Cc: pgsql-sql@postgresql.org
> Subject: Re: [SQL] ignore case in where clause
> 
> On Thu, 2012-03-22 at 16:26 -0400, Edward W. Rouse wrote:
> > I am currently using lower(column) = '' for matching case
> insensitive. I
> > know that there are ways to do this with regular expressions too. I
> recently
> > noticed that including even one lower causes severe performance
> issues (from
> > 290ms to over 80Kms).
> >
> 
> Probably because it cannot use the index anymore. Try creating an index
> on lower(column), and see if it helps.
> 
> 
> --
> Guillaume
> http://blog.guillaume.lelarge.info
> http://www.dalibo.com
> 
> 
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2012-03-22 21:05 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-03-22 20:26 ignore case in where clause Edward W. Rouse <erouse@comsquared.com>
2012-03-22 20:38 ` Guillaume Lelarge <guillaume@lelarge.info>
2012-03-22 21:05   ` Edward W. Rouse <erouse@comsquared.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox