Re: CTID issues and a soc student in need of help - Mailing list pgsql-hackers

From Tom Lane
Subject Re: CTID issues and a soc student in need of help
Date
Msg-id 13316.1149180326@sss.pgh.pa.us
Whole thread Raw
In response to Re: CTID issues and a soc student in need of help  (Tzahi Fadida <tzahi.ml@gmail.com>)
Responses Re: CTID issues and a soc student in need of help  (Tzahi Fadida <tzahi.ml@gmail.com>)
List pgsql-hackers
Tzahi Fadida <tzahi.ml@gmail.com> writes:
> I am not sure about the definition of a context of a single SQL command.

Well, AFAICS selecting a disjunction ought to qualify as a single SQL
command using a single snapshot.  It's not that different from a JOIN
or UNION operation, no?

> Inside C-language FullDisjunctions() function i repeatedly call, using
> SPI:
> SELECT * FROM Relation1;
> SELECT * FROM Relation2;
> SELECT * FROM Relation1 WHERE...;
> SELECT * FROM Relation3;
> ....

You would need to force all these operations to be done with the same
snapshot; should be possible with SPI_execute_snapshot.  But really the
above sounds like a toy prototype implementation to me.  Why aren't you
building this as executor plan-tree machinery?

> p.s.: In a different version of the function i create a temporary
> relation and insert tuples in it, but it is exclusively used and
> destroyed by the specific instance of that function.

Why?  You could use a tuplestore for transient data.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tzahi Fadida
Date:
Subject: Re: CTID issues and a soc student in need of help
Next
From: Josh Berkus
Date:
Subject: Re: More thoughts about planner's cost estimates