Re: Why is the wrong index used? (with "gist" index)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why is the wrong index used? (with "gist" index)
Дата
Msg-id 17994.1347902617@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Why is the wrong index used? (with "gist" index)  (Christian Hammers <ch@lathspell.de>)
Список pgsql-general
Christian Hammers <ch@lathspell.de> writes:
> Just because I added a "LIMIT 1" to the following query, PostgreSQL decided to
> use a different index which gives a far worse performance :-(

The problem is the off-by-four-orders-of-magnitude rowcount estimate
(20949 rows estimated to match, only 2 actually do).  You need to get
that to be closer to reality.  I'm not sure if increasing the statistics
target would help --- it depends on whether the prefix extension has any
non-dummy selectivity estimation support.  If not, you might want to
consider switching to a more-fully-supported data type.

            regards, tom lane


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

Предыдущее
От: Christian Hammers
Дата:
Сообщение: Why is the wrong index used? (with "gist" index)
Следующее
От: Dann Corbit
Дата:
Сообщение: Re: Slow counting still true?