Re: Accelerating aggregates

Поиск
Список
Период
Сортировка
От Steve Atkins
Тема Re: Accelerating aggregates
Дата
Msg-id 20040611152604.GA14405@gp.word-to-the-wise.com
обсуждение исходный текст
Ответ на Re: Accelerating aggregates  (Richard Huxton <dev@archonet.com>)
Ответы Re: Accelerating aggregates  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers
On Fri, Jun 11, 2004 at 09:27:07AM +0100, Richard Huxton wrote:

> >If the transaction is rolled back, the local state variable is
> >thrown away. If the transaction is commited and the local state
> >variable has been invalidated then the global state variable is
> >invalidated, otherwise the global state variable is updated using
> >a a state merge function, specific to the aggregate.
> 
> Isn't this going to have visibility issues wrt other backends? How do I 
> know what transactions have updated the global and what haven't and 
> which I should currently be seeing?

The global is only updated at transaction commit.

So, if you take a local snapshot of the global at the beginning of
your transaction then the visible changes at any point are those from
transactions that commited before your transaction started. That's
well-defined, at least, and appears to be pretty much the same as the
standard read commited isolation level.

> I'm not sure that there is a solution simpler than the "insert +1/-1 
> into summary table" that gets discussed.

That's fairly slow and painful.

Cheers, Steve


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

Предыдущее
От: pgsql@mohawksoft.com
Дата:
Сообщение: Re: Accelerating aggregates
Следующее
От: pgsql@mohawksoft.com
Дата:
Сообщение: msession for PostgreSQL?