Set cost for a specific index scan

Поиск
Список
Период
Сортировка
От Thomas Strunz
Тема Set cost for a specific index scan
Дата
Msg-id DUB114-W66B02A150DD17B07CE9A53EE620@phx.gbl
обсуждение исходный текст
Список pgsql-general
Hi all,

I'm using an open-source "extension"  that creates an index for special type of search and you need to use a custom operator to run queries. Anyway If I run an according query with multiple filters as example also range of primary key  PostgreSQL almost always selects this 3rd party index as the first index to scan. However this index is almost always slower than a "normal" index. This leads to queries with a filter primary_key < 10 taking several seconds because the 3rd party index  taking that much time. In the explain plan it is visible that PostgreSQL seems to prefer this index over other indexes.

Is there any way to increase the cost for this specific index (or operator) so that any other index is always used first?

Beat Regards,

Thomas

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

Предыдущее
От: Paul Maddock
Дата:
Сообщение: Postgresql, sql client and I/O exceptions
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Postgresql, sql client and I/O exceptions