Re: Comparing txid and xmin (under BDR)

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Comparing txid and xmin (under BDR)
Дата
Msg-id CAMsr+YFjmojJZfz7c_YmNbd8N7=XbrJXgPa0PwJ4DKjObNhcpQ@mail.gmail.com
обсуждение исходный текст
Ответ на Comparing txid and xmin (under BDR)  (Peter Mogensen <apm@one.com>)
Ответы Re: Comparing txid and xmin (under BDR)
Re: Comparing txid and xmin (under BDR)
Список pgsql-general


On 11 May 2015 at 21:10, Peter Mogensen <apm@one.com> wrote:
Hi,

I would really like to be able to externally to Postgres at some point in time later, be able to compare the txid of 2 queries.

Namely:
The INSERT transaction for a certain row in a table,  and
The SELECT transaction reading some other data.

With the one caveat that this has to work with BDR.

So ... I can easily get the current txid of the SELECT transaction by calling txid_current().

Note that by doing so, you force txid allocation for a read-only query that might otherwise not need one, which increases your txid burn rate and decreases time until you need to do wraparound-protection vacuuming.

However, - I can't in general compare it to the xmin of the table row.
BDR does ensure (it seems) that xmin is meaningfull within the local node xid context.

Or, rather, it doesn't do anything different to what PostgreSQL its self does.

I'm still not at all convinced that your desire to use transaction IDs for the cache invalidation stuff you're doing makes sense or will work sensibly even in a single-node environment. It's certainly not going to when comparing between nodes, especially in an async system.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

В списке pgsql-general по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: RPM building tools and info missing?
Следующее
От: Peter Mogensen
Дата:
Сообщение: Re: Comparing txid and xmin (under BDR)