Re: partitioning and locking problems

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: partitioning and locking problems
Дата
Msg-id 307.1138807221@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: partitioning and locking problems  ("Marc Morin" <marc@sandvine.com>)
Ответы Re: partitioning and locking problems  ("Jim C. Nasby" <jnasby@pervasive.com>)
Список pgsql-performance
"Marc Morin" <marc@sandvine.com> writes:
> Do you mean it would be impossible to change the code so that existing
> selects continue to use the pre-truncated table until they commit?

Yes, because that table won't exist any more (as in the file's been
unlinked) once the TRUNCATE commits.

> The update/insert rule change appears to be more more doable? No?

You've still got race conditions there: do onlooker transactions see the
old set of rules, or the new set, or some unholy mixture?  Removing the
lock as you suggest would make it possible for the rule rewriter to pick
up non-self-consistent data from the system catalogs, leading to
arbitrarily bad behavior ... if you're lucky, it'll just crash, if
you're not lucky the incorrect rule will do a fandango on your data.

            regards, tom lane

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

Предыдущее
От: "Marc Morin"
Дата:
Сообщение: Re: partitioning and locking problems
Следующее
От: Tom Lane
Дата:
Сообщение: Re: execution plan : Oracle vs PostgreSQL