query evaluation

From: "Ravi Chemudugunta" <chemuduguntar(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: query evaluation
Date: 2008-11-27 01:36:52
Message-ID: 7a4208ef0811261736y3eae99e9w674930829efb4120@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I have the following query.

select part_id, consume_part(part_id) from part where in_use = false;

does it:
a/ iterate over all parts, calling consume on them and then show the
records where in_use is false (i.e. all parts have been consumed by the SP
consume_part) or

b/ filter the list using in_use = false and apply consume_part SP to
those part_id's ?

It is very _scary_ to imagine the first prospect, worse is if it did a mix
of a/ and b/ ... where it does not apply consume_part on all parts but a
partial set of parts that are exclusive of the set provided by SP, because
then it would be unknown how the query worked (atleast if it consumed all
parts then you could do something).

--
:wq

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Klint Gore 2008-11-27 01:51:05 Re: Group by clause creating "ERROR: wrong record type supplied in RETURN NEXT" (version 8.1.11 -- grr...)
Previous Message Webb Sprague 2008-11-27 01:18:40 Group by clause creating "ERROR: wrong record type supplied in RETURN NEXT" (version 8.1.11 -- grr...)