Home > Archive > Slony1 PostgreSQL Replication > January 2006 > txid module v2









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author txid module v2
Marko Kreen

2006-01-22, 8:24 pm

The first variant I sent was broken, as I decided
to clean up the module before public posting...
Sorry about that.

This is a fixed version that has also has interface
cleanup and smaller binary representation. I hope
the added regression tests will give it better mileage.

My app needs to know "active TXIDs in snap1 that were
commited in snap2" for faster searching. For that I had
a ugly C function that calculated those. Now I figured
out a way to do it in pure SQL, so I ripped it out.
That gives pretty clean interface:

get_current_txid() returns int8

Current transaction ID

get_current_snapshot
() returns txid_snapshot

Current snapshot

get_snapshot_xmin( [snap] ) returns int8

Smallest TXID in snapshot. TXID's smaller than this
are all visible in snapshot. Without argument uses
current snapshot.

get_snapshot_xmax( [snap] ) returns int8

Largest TXID in snapshot. TXID's starting from this one are
all invisible in snapshot. Without argument uses current snapshot.

get_snapshot_values(
[snap] ) setof int8

List of uncommitted TXID's in snapshot, that are invisible
in snapshot. Values are between xmin and xmax. Without
argument uses current snapshot.

txid_in_snapshot(id,
snap) returns bool

Is TXID visible in snapshot?

txid_not_in_snapshot
(id, snap) returns bool

Is TXID invisible in snapshot?


Note that this is indeed work-in-progress, so I'm just
looking if there is any outside interest on this topic.

--
marko

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com