Re: pgstats_initstats() cost

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgstats_initstats() cost
Дата
Msg-id 1136.1060696147@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pgstats_initstats() cost  (Gavin Sherry <swm@linuxworld.com.au>)
Ответы Re: pgstats_initstats() cost  (Gavin Sherry <swm@linuxworld.com.au>)
Re: pgstats_initstats() cost  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Gavin Sherry <swm@linuxworld.com.au> writes:
> but pgstat_initstats() caught my eye. This gets called about 6 times per
> insert (I did 100000 inserts) and the major cost appears to relate to the
> linear pgStatTabstatMessages. The comparative performance of
> hash_search() suggests that pgStatTabstatMessages may benefit from use of
> a hash. However, it seems unreasonable that we're doing work at all in
> pgstat_initstats() if the user is not interested in query/block/tuple
> stats.

The coding in the search loop could perhaps be tightened a little, but
I'd think the last point should be addressed by dropping out via the
"no_stats" exit if stats aren't being gathered.

I doubt a hash is worth maintaining, because the active tabstat entries
should only be for tables that are being touched in the current command
(thus, there are not more than six in your example).  I'm not sure why
it takes so much time to look through six entries though ...
        regards, tom lane


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

Предыдущее
От: Gavin Sherry
Дата:
Сообщение: regression test code coverage
Следующее
От: Gavin Sherry
Дата:
Сообщение: Re: pgstats_initstats() cost