Seeking for the fore-part of the key

From: Havasvölgyi Ottó <havasvolgyi(dot)otto(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Seeking for the fore-part of the key
Date: 2009-01-11 20:50:19
Message-ID: 34608c0c0901111250o3bfb3cbcqb21b235d5631a26d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

Let's assume I have a table (called tbl) with a column 'name' and an index
on it.
How to optimally find records whose name column begins with - say - "Pre"?
I know it can be done with LIKE (WHERE name LIKE 'Pre%'), but will this use
the index mentioned above to optimize the search?

Thanks,
Otto

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Kretschmer 2009-01-11 21:17:48 Re: Seeking for the fore-part of the key
Previous Message Scott Marlowe 2009-01-11 18:19:19 Re: some howto/theory book/tutorial on practical problem solving in SQL