Marko Kreen markokr
Sun Jan 22 15:53:31 PST 2006
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: txid-v2.tgz
Type: application/x-gtar
Size: 6518 bytes
Desc: not available
Url : http://gborg.postgresql.org/pipermail/slony1-general/attachments/20060122/24907f03/txid-v2.gtar



More information about the Slony1-general mailing list