Re: index scan with functional indexes

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: index scan with functional indexes
Date: 2004-01-27 18:02:03
Message-ID: 20040127180203.GB22417@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 27, 2004 at 12:41:41PM -0500, Dave Cramer wrote:

> davec=# explain analyze select * from url where fn_strrev(url) like
> '%beta12.html';

Reverse the constant too:

davec=# explain analyze select * from url where fn_strrev(url) like
fn_strrev('%beta12.html');

You won't get an indexscan if you have a % in front of the string.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Hay quien adquiere la mala costumbre de ser infeliz" (M. A. Evans)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-01-27 18:02:51 Re: index scan with functional indexes
Previous Message Stephan Szabo 2004-01-27 18:01:07 Re: index scan with functional indexes