Re: [SOLVED?] Re: Disk wait problem... not hardware...

Поиск
Список
Период
Сортировка
От Ron
Тема Re: [SOLVED?] Re: Disk wait problem... not hardware...
Дата
Msg-id 39d83a8e-36ef-41f7-825c-4ce290b59fd4@gmail.com
обсуждение исходный текст
Ответ на Re: [SOLVED?] Re: Disk wait problem... not hardware...  (pf@pfortin.com)
Список pgsql-general
On 10/29/23 11:45, pf@pfortin.com wrote:
> On Sun, 29 Oct 2023 16:16:05 +0100 Peter J. Holzer wrote:
>
>> On 2023-10-29 09:21:46 -0400, pf@pfortin.com wrote:
>>> These are all static tables. Does PG maintain a table row count so as to
>>> avoid having to count each time?
>> No. To count the rows in a table, Postgres has to actually read the
>> whole table (or an index, if a suitable index (e.g. a primary key)
>> exists).
> Am I correct to assume count(fieldname) would only load that column for
> counting?

The OS reads (chunks of) blocks, not individual bytes, and Postgresql is 
record oriented, not column-oriented.

> In other words: we should be specific (avoid "*") in general?

No.

-- 
Born in Arizona, moved to Babylonia.



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

Предыдущее
От: pf@pfortin.com
Дата:
Сообщение: Re: [SOLVED?] Re: Disk wait problem... not hardware...
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: [SOLVED?] Re: Disk wait problem... not hardware...