Re: Postgres code for a query intermediate dataset - Mailing list pgsql-hackers

From Atri Sharma
Subject Re: Postgres code for a query intermediate dataset
Date
Msg-id CAOeZVidenRCTO98bBz3J6v96Zf21-joXp_YGbOE1k7xjotXZ+g@mail.gmail.com
Whole thread Raw
In response to Re: Postgres code for a query intermediate dataset  (Mark Kirkwood <mark.kirkwood@catalyst.net.nz>)
Responses Re: Postgres code for a query intermediate dataset  (Mark Kirkwood <mark.kirkwood@catalyst.net.nz>)
List pgsql-hackers


On Sunday, September 14, 2014, Mark Kirkwood <mark.kirkwood@catalyst.net.nz> wrote:
On 14/09/14 05:36, Rohit Goyal wrote:
Hi All,

I want to work on the code of intermediate dataset of select and update
query.

For example.

Rohit's salary has been updated 4 times, so it has 4 different version
of salary.

I want to select  salary of person named Rohit. Now suppose , in
intermediate result, I found 4 different versions of the data. I want to
know the code portion which i need to look for working on all 4 versions
in dataset. :)



Hi Rohit,

Currently in Postgres, these intermediate versions all exist - however a given session can only see one of them. Also VACUUM is allowed to destroy versions that no other transactions can see.

So if I'm understanding you correctly, you would like to have some way for a session to see *all* these versions (and I guess preventing VACUUM from destroying them).



Any modifications of that sort are bound to introduce lots of pain, not to mention performance degradation and the added responsibility of ensuring that dead tuples don't bloat up the system (prevent vacuum from running at regular intervals and you can have a xid wraparound).

I just mentioned that in case you are planning to go in that direction. If you only want the data, use the triggers as Gavin mentioned.

Regards,

Atri 


--
Regards,
 
Atri
l'apprenant

pgsql-hackers by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: Scaling shared buffer eviction
Next
From: Fabien COELHO
Date:
Subject: Re: run xmllint during build (was Re: need xmllint on borka)