Re: not using index through procedure - Mailing list pgsql-general

From Robin Ericsson
Subject Re: not using index through procedure
Date
Msg-id i5la0q.7aku8p@webmail.zint.profecta.se
Whole thread Raw
In response to Re: not using index through procedure  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: not using index through procedure  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.org> wrote:

> One's marked VOLATILE, the other is marked IMMUTABLE. This affects
> whether it's considered a constant, the planner estimates and hence
> whether it uses the index.

Is there even a way to solve it this way via a procedure?

I've tried different approaches, with moving the ago outside the procedure,
having the procedure take timestamp as argument instead of interval, but still
no luck.

However, remove the $1 argument all together and replace that with ago('60
seconds') makes the procedure fly.


Regards,
Robin
_________________________________________________________
This mail sent using V-webmail - http://www.v-webmail.org


pgsql-general by date:

Previous
From: David Rysdam
Date:
Subject: Re: tcl bindings for 8.0
Next
From: Josh Close
Date:
Subject: dirty reads