Search Postgresql Archives

SQL optimization - WHERE SomeField STARTING WITH ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux