Re: Best way to store case-insensitive data?

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Mike Christensen <mike(at)kitchenpc(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Best way to store case-insensitive data?
Date: 2010-06-10 21:42:17
Message-ID: AANLkTinF_1lh5LB8f51mHaeklFRZt3gq7XegsxDiuozZ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 10, 2010 at 3:34 PM, Mike Christensen <mike(at)kitchenpc(dot)com> wrote:
> From this site:
>
> http://developer.postgresql.org/pgdocs/postgres/citext.html
>
> I couldn't tell if you still had to create an index on the lower case
> value.  It seems that it basically mimics the WHERE LOWER(email) =
> LOWER(?) method.  Since this part is incredibly performance critical,
> maybe I'm better off storing my data all in lowercase and keeping the
> DB case sensitive.

of course you'd still need an index. whether you store it lower case
in regular text or mixed case in a citext, the db would need an index
for good performance. But you wouldn't have to store a lower() index
for citext, just an index.

BTW, citext it new for 8.4, so it's probably not an option for you if
you're on 8.3

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Aleksey Tsalolikhin 2010-06-10 21:49:58 Re: database response slows while pg_dump is running (8.4.2)
Previous Message Scott Marlowe 2010-06-10 21:37:58 Re: Postgresql packages in Solaris