Re: Much Ado About COUNT(*)

Поиск
Список
Период
Сортировка
От Manfred Koizar
Тема Re: Much Ado About COUNT(*)
Дата
Msg-id 42tbv0t8sp8af4vgh8arudal6fnhfpii83@email.aon.at
обсуждение исходный текст
Ответ на Re: Much Ado About COUNT(*)  ("Jonah H. Harris" <jharris@tvi.edu>)
Список pgsql-hackers
On Mon, 24 Jan 2005 08:28:09 -0700, "Jonah H. Harris" <jharris@tvi.edu>
wrote:
>            UPDATE pg_user_table_counts
>                SET rowcount = rowcount + 1
>                WHERE schemaname = this_schemaname
>                    AND tablename = TG_RELNAME;

This might work for small single user applications.  You'll have to keep
an eye on dead tuples in pg_user_table_counts though.

But as soon as there are several concurrent transactions doing both
INSERTs and DELETEs, your solution will in the best case serialise
access to test_tbl or it will break down because of deadlocks.

ServusManfred


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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Built-in casts for ltree
Следующее
От: Tom Lane
Дата:
Сообщение: Re: bug w/ cursors and savepoints