Re: distinguish index cost component from table component

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: distinguish index cost component from table component
Дата
Msg-id CAMkU=1xcf-igvHSrta+gnTgE+K+Cnc-F=7z8G6YJTHwNSCyP1Q@mail.gmail.com
обсуждение исходный текст
Ответ на distinguish index cost component from table component  (Justin Pryzby <pryzby@telsasoft.com>)
Ответы Re: distinguish index cost component from table component  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-performance
On Fri, Jan 3, 2020 at 9:14 AM Justin Pryzby <pryzby@telsasoft.com> wrote:
Is it possible to tell what component of the cost estimate of an index scan is
from the index reads vs heap ?

Not that I have found, other than through sprinkling elog statements throughout the costing code.  Which is horrible, because then you get estimates for all the considered but rejected index scans as well, but without the context to know what they are for.  So it only works for toy queries where there are few possible indexes to consider.

It would help to be able to set enable_bitmapscan=FORCE (to make all index
scans go through a bitmap). 

Doesn't enable_indexscan=off accomplish this already?  It is possible but not terribly likely to switch from index to seq, rather than from index to bitmap.  (Unless the index scan was being used to obtain an ordered result, but a hypothetical enable_bitmapscan=FORCE can't fix that).

Of course this doesn't really answer your question, as the separately-reported costs of a bitmap heap and bitmap index scan are unlikely to match what the costs would be of a regular index scan, if they were reported separately.

Or maybe explain should report it.

I wouldn't be optimistic about getting such a backwards-incompatible change accepted (plus it would surely add some small accounting overhead, which again would probably not be acceptable). But if you do enough tuning work, perhaps it would be worth carrying an out-of-tree patch to implement that.  I wouldn't be so interested in writing such a patch, but would be interested in using one were it available somewhere.

Cheers,

Jeff

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

Предыдущее
От: Justin Pryzby
Дата:
Сообщение: distinguish index cost component from table component
Следующее
От: Justin Pryzby
Дата:
Сообщение: Re: distinguish index cost component from table component