Re: *sigh*

Поиск
Список
Период
Сортировка
От Christopher Browne
Тема Re: *sigh*
Дата
Msg-id m3r7zqa42j.fsf@wolfe.cbbrowne.com
обсуждение исходный текст
Ответ на *sigh*  (Thomas Zehetbauer <thomasz@hostmaster.org>)
Список pgsql-hackers
Oops! mendola@bigfoot.com (Gaetano Mendola) was seen spray-painting on a wall:
> Doug McNaught wrote:
>> Randolf Richardson <rr@8x.ca> writes:
>>
>>>        What about adding a "total number of rows" value to the
>>> internal header of each table which gets incremented/decremented
>>> after each row is INSERT/DELETE has been committed.  This way, a
>>> generic "count(*)" by itself could simply return this value without
>>> any delay at all.
>> Because different sessions have a (validly) different concept of what
>> that number should be, due to MVCC.
>
> The count(*) information can be revisioned too, am I wrong ? I'm able to
> create a trigger that store the count(*) information in a special table,
> why not implement the same in a way "builded in" ?

You could do this; the cost would be pretty high, as there would be an
extra table update done every time rows were inserted or deleted.
Doing it on _every_ table would be a heavy overhead that is not
worthwhile.

What might make sense would be to set up triggers to do this on those
large tables where you frequently need COUNT(*).
-- 
"cbbrowne","@","cbbrowne.com"
http://www.ntlug.org/~cbbrowne/lisp.html
As of next month, MACLISP "/" will be flushed in favor of "\".
Please update the WORLD.


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

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: *sigh*
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [BUGS] 7.4: CHAR padding inconsistency