Jan Wieck wrote:
>
> > And so for deffered rules rewrite system will:
> >
> > 1. set t2' RTE snapshot pointer to NULL - this will guarantee
> > that snapshot of execution time (commit or set immediate time)
> > will be used;
> > 2. set t1' RTE snapshot pointer to current QuerySnapshot
> > (and increment its refcount).
>
> At parse/rewrite time there is no actual snapshot. And for
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oh, you're right. This is true for prepared plans.
> SPI prepared plan, the snapshot to use will be different for
> each execution. The RTE cannot hold the snapshot itself. It
> could only tell, which of all the snapshots created during a
> transaction to use for it.
>
...
>
> Maybe I'm not able to explain exactly enough what I have
> vaguely in mind how it could work. But after you've helped
> not to forget prepared plans I think I have all the odds and
> ends to build it.
>
> I'll hack around a little. Then let's discuss the final
> details while having a prototype to look at.
Ok. If you feel that QueryIds is easier way to go then do it.
In any case some preprocessing of plan tree just before execution
will be required.
BTW, why not use CommandIds ?
Vadim