Re: Fast statement but slow function - Mailing list pgsql-general

From Tom Lane
Subject Re: Fast statement but slow function
Date
Msg-id 3297.1020876799@sss.pgh.pa.us
Whole thread Raw
In response to Fast statement but slow function  (Thomas Beutin <tyrone@laokoon.IN-Berlin.DE>)
List pgsql-general
Thomas Beutin <tyrone@laokoon.IN-Berlin.DE> writes:
> Is this a bug in my function or in my mind or in postgres?
> Are functions using indexes?

The planning context is different because the planner cannot see a
specific constant in the WHERE clause, only a parameter placeholder.
This might affect the choice of plan --- but without knowing what
indexes you have and what choices are being made, it's hard to say
much.

One question worth asking is whether you've declared the type of
the parameter to agree with the type of the column it's being
compared to.

            regards, tom lane

pgsql-general by date:

Previous
From: Randall Perry
Date:
Subject: Re: Can this be done in one query?
Next
From: Chris Gamache
Date:
Subject: timestamp in 7.1 vs 7.2