again, LIKE operator

From: "Andy Samuel" <andysamuel(at)geocities(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: again, LIKE operator
Date: 2002-01-12 04:35:14
Message-ID: 000a01c19b22$874194e0$0200a8c0@edpgm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear All

I've search the archive and manuals and it says I should use C locale in order to enable LIKE to use index.
Postgresql was installed after I set the locale to C. So I'm sure the initdb will use C.
From EXPLAIN I know that :

SELECT * FROM GuestProfile WHERE FirstName LIKE 'a' will use index on FirstName

but

SELECT * FROM GuestProfile WHERE FirstName LIKE 'a%' will not use Index on FirstName

I have 9,999,999 records and it was VACUUM ANALYZE-d.

How do I enforce the optimizer to use the index ?

Thank you in advance
Andy

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lenny Silver 2002-01-12 06:31:16 Re: problem making postgresql
Previous Message Sean Chittenden 2002-01-12 03:46:52 "IS NOT NULL" != "NOT NULL"