Re: Fast statement but slow function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Beutin <tyrone(at)laokoon(dot)IN-Berlin(dot)DE>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Fast statement but slow function
Date: 2002-05-08 16:53:19
Message-ID: 3297.1020876799@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Beutin <tyrone(at)laokoon(dot)IN-Berlin(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jason Earl 2002-05-08 17:34:45 Re: Contrib reindex script:
Previous Message Randall Perry 2002-05-08 16:03:48 Re: Can this be done in one query?