Re: Unpredicatable behavior of volatile functions used

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Aleksander Kmetec <aleksander(dot)kmetec(at)intera(dot)si>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Unpredicatable behavior of volatile functions used
Date: 2007-01-15 16:27:42
Message-ID: 16491.1168878462@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Aleksander Kmetec <aleksander(dot)kmetec(at)intera(dot)si> writes:
> Some quick testing shows that util.row_number() only gets re-evaluated at every call if the subquery contains an ORDER
> BY clause. Now we can predict whether we need to compensate for that just by looking at the original query.

If you're going to use a cursor, I don't understand why you don't just
MOVE FORWARD ALL and look at the returned rowcount to determine how
many rows in the query. This won't be any more expensive than fetching
the last row ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Teodor Sigaev 2007-01-15 16:30:11 Re: Avoiding empty queries in tsearch
Previous Message Tom Lane 2007-01-15 16:21:47 Re: Glacially slow nested SELECT