SQL optimization - WHERE SomeField STARTING WITH ... - Mailing list pgsql-general

From Bill
Subject SQL optimization - WHERE SomeField STARTING WITH ...
Date
Msg-id 48B6EA27.30503@dbginc.com
Whole thread Raw
Responses Re: SQL optimization - WHERE SomeField STARTING WITH ...  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Re: SQL optimization - WHERE SomeField STARTING WITH ...  (Tino Wildenhain <tino@wildenhain.de>)
Re: SQL optimization - WHERE SomeField STARTING WITH ...  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
The SQL database servers I have worked with cannot use and index for a
SELECT of the form

SELECT * FROM ATABLE
WHERE AFIELD LIKE ?

because there is no way to know the location of the wild card until the
parameter value is known. InterBase and Firebird allow

SELECT * FROM ATABLE
WHERE AFIELD STARTING WITH ?

which is equivalent to LIKE  'ABC%' and will use an index on AFIELD. Is
there a similar syntax in PostgreSQL?

Bill

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: strange explain analyze output
Next
From: Tom Lane
Date:
Subject: Re: temp schemas