Using one of the indices to make query faster

Поиск
Список
Период
Сортировка
От Denis Perchine
Тема Using one of the indices to make query faster
Дата
Msg-id 00080313195204.22979@dyp.perchine.com
обсуждение исходный текст
Список pgsql-general
Hello,

Just small question about postgres query optimizer.
If I have a table with 2 fields a and b.
I have indices for both of them.
Table is quite large (> 100000).
I do:

select * from q where a = 10 and b = 20;
I know that the best solution is to build the index on both columns, but...
Will postgres consider to use one of the indices to make initial cut?

This should be quite useful...

One example where this will be useful is:
we have a query where one of the conditions is very restrivtive and
index can be used on it, another condition is complicated functional one.

If we use index on the first column and calculate all others this will be much
faster than sequence scan.

Any thoughts?

--
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------

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

Предыдущее
От: Daniel Betaille
Дата:
Сообщение: Documentation
Следующее
От: Alessio Bragadini
Дата:
Сообщение: Re: Re: Slash on PostgreSQL mailing list