Search Postgresql Archives

Re: index scan and functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 19, 2010 at 05:55:48PM +0200, arno wrote:
> But when using a custom function to compute my where parameter

> inet_to_bigint is a function that transform an inet address its integer representation.

> Is there a way, either to put function return value in a variable, or to tell
> postgres to still use a sequential scan ?

I'd guess your function is labeled as "VOLATILE".  This is saying that
the function has "side effects", but from the function's name I'd guess
that it doesn't and the only purpose of calling the function is to get
its return value.  I'd expect that labeling it as STABLE would cause PG
to do what you're expecting.  More details here:

  http://www.postgresql.org/docs/current/static/xfunc-volatility.html

-- 
  Sam  http://samason.me.uk/

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux