Re: spurious function execution in prepared statements. - Mailing list pgsql-performance

From Tom Lane
Subject Re: spurious function execution in prepared statements.
Date
Msg-id 16697.1096556521@sss.pgh.pa.us
Whole thread Raw
In response to Re: spurious function execution in prepared statements.  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
List pgsql-performance
"Merlin Moncure" <merlin.moncure@rcsonline.com> writes:
> Here is the actual query:
> select lock_cuid(id), *
> ...
>     order by wcl_vin_no, wcl_claim_no, id
>     limit 1

Looks like Stephan made the right guess.

Logically the LIMIT executes after the ORDER BY, so the sorted result
has to be formed completely.  The fact that we are able to optimize
this in some cases does not represent a promise that we can do it in
all cases.  Ergo, it's not a bug.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: spurious function execution in prepared statements.
Next
From: Mark Wong
Date:
Subject: Re: O_DIRECT setting