Re: Query with rightmost function does not use index - Mailing list pgsql-general

From Pavel Stehule
Subject Re: Query with rightmost function does not use index
Date
Msg-id CAFj8pRD8FgZ=NF4XsvWvnDWUt01yseEeHSSSi1dspchjQ0KJfA@mail.gmail.com
Whole thread Raw
In response to Query with rightmost function does not use index  (- - <loh.law@hotmail.com>)
Responses Re: Query with rightmost function does not use index
Re: Query with rightmost function does not use index
Re: Query with rightmost function does not use index
List pgsql-general
Hello

use a functional index

http://www.postgresql.org/docs/8.4/interactive/indexes-expressional.html

Regards

Pavel Stehule

2011/8/8 - - <loh.law@hotmail.com>:
> For a table where column col has an index, the query:
>      SELECT ... FROM ... WHERE col = MD5('')
> doesn't seem to use an index but
>      SELECT ... FROM ... WHERE col = 'd41d8cd98f00b204e9800998ecf8427e'
> does.
>
> Is this a gotcha?
> I'm using PostgreSQL 8.4.8 on i686-pc-linux-gnu, compiled by GCC
> gcc-4.5.real (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2, 32-bit
>
>
>

pgsql-general by date:

Previous
From: David Johnston
Date:
Subject: Re: table / query as a prameter for PL/pgSQL function
Next
From: Adarsh Sharma
Date:
Subject: Granting Privileges in Postgres