Re: index usage - Mailing list pgsql-performance

From Daniel Caune
Subject Re: index usage
Date
Msg-id 1E293D3FF63A3740B10AD5AAD88535D202B655F1@UBIMAIL1.ubisoft.org
Whole thread Raw
In response to index usage  (Ben <bench@silentmedia.com>)
Responses Re: index usage
List pgsql-performance
> De : pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-
> owner@postgresql.org] De la part de Ben
> Envoyé : vendredi, juillet 28, 2006 15:21
> À : pgsql-performance@postgresql.org
> Objet : [PERFORM] index usage
>
> 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....?
>

Is your function IMMUTABLE, STABLE or VOLATILE?

--
Daniel

pgsql-performance by date:

Previous
From: Ben
Date:
Subject: index usage
Next
From: "Luke Lonergan"
Date:
Subject: Re: Performance with 2 AMD/Opteron 2.6Ghz and 8gig