Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

Next:From: Tom LaneDate: 2004-01-27 18:02:51
Subject: Re: index scan with functional indexes
Previous:From: Stephan SzaboDate: 2004-01-27 18:01:07
Subject: Re: index scan with functional indexes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group