index usage

From: Ben <bench(at)silentmedia(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: index usage
Date: 2006-07-28 19:21:14
Message-ID: Pine.LNX.4.64.0607281216300.11400@GRD.cube42.tai.silentmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I have a table with 37000 rows, an integer column, and an index on that
column. I've got a function that returns an integer. When I do a select
where I restrict that column to being equal to a static number, explain
tells me the index will be used. When I do the same thing but use the
function instead of a static number, explain shows me a full scan on the
table.

I must be missing something, because my understanding is that the function
will be evaluated once for the statement and then collapsed into a static
number for the filtering. But the results of the explain seem to imply
that's not the case....?

Browse pgsql-performance by date

  From Date Subject
Next Message Luke Lonergan 2006-07-28 19:22:28 Re: Performance with 2 AMD/Opteron 2.6Ghz and 8gig
Previous Message Mark Lewis 2006-07-28 18:01:54 Re: Performance with 2 AMD/Opteron 2.6Ghz and 8gig