Re: Bitmap scans vs. the statistics views

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bitmap scans vs. the statistics views
Дата
Msg-id 12334.1114199603@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Bitmap scans vs. the statistics views  (Jan Wieck <JanWieck@Yahoo.com>)
Ответы Re: Bitmap scans vs. the statistics views  (Jan Wieck <JanWieck@Yahoo.com>)
Список pgsql-hackers
Jan Wieck <JanWieck@Yahoo.com> writes:
> tuples fetched is the number of raw, possibly dead tuples fetched from 
> the heap. Tuples returned is the number of alive tuples ... IIRC.

No, count_heap_fetch only counts tuples that have already passed the
snapshot test.  It could be that the places where the counts are
actually bumped don't line up with your original vision for the
stats design.

For a regular index scan, it seems to make sense to count (a) number of
TIDs returned by the index AM, and (b) number of tuples returned by the
IndexScan node.  There are several intermediate steps* does the tuple pass the snapshot test* does the tuple pass any
indexqualrechecks (for lossy indexes)* does the tuple pass any additional non-index restriction  conditions that are
beingenforced at the scan level
 
but I'm not sure that counting all the intermediate steps is interesting.

The places where the counts are actually taken don't quite line up with
this ... there are also some other macros like count_heap_scan and
count_index_scan that seem a bit randomly placed.  The description in
table 23-2 makes it sound like those should count once per scan, but
they are bumped inside the per-tuple loops ...
        regards, tom lane


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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Postgres: pg_hba.conf, md5, pg_shadow, encrypted passwords
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bitmap scans vs. the statistics views