Re: Question about (probably wrong) index scan cost for conditional indexes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question about (probably wrong) index scan cost for conditional indexes
Дата
Msg-id 22022.1327885348@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Question about (probably wrong) index scan cost for conditional indexes  (Maxim Boguk <maxim.boguk@gmail.com>)
Ответы Re: Question about (probably wrong) index scan cost for conditional indexes  (Maxim Boguk <maxim.boguk@gmail.com>)
Список pgsql-general
Maxim Boguk <maxim.boguk@gmail.com> writes:
> Seems previous test case not clear demonstrate the problem which i have
> stuck with.
> Now much better and close to reality test case:

AFAICT, these behaviors all boil down to the fact that contrib/intarray
doesn't provide a real cost estimator for its && operator.  It's using
the "contsel" stub function, which provides a fixed selectivity of
0.001.  In your test case, with 1000000 rows in the table, the estimate
for the number of rows satisfying "sections && '{2}'" thus comes out to
exactly 1000.  Unfortunately, the true number is around 100000, and it's
that discrepancy that is leading to all of these bad cost estimates.

What I'd like to see done about this is for somebody to adapt the
work Jan Urbanski did on tsvector stats collection and estimation
so that it works for the anyarray operators.  It's a bit too late
to imagine that that'll get done for 9.2, but maybe for 9.3.

            regards, tom lane

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

Предыдущее
От: "Adam Rich"
Дата:
Сообщение: Re: Interval ordering
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: MS Access easier with PostgreSQL or MySQL?