Re: specify whitch index to use

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: specify whitch index to use
Дата
Msg-id 20061112164740.GA31433@KanotixBox
обсуждение исходный текст
Ответ на specify whitch index to use  ("pgsql-general@list.coretech.ro" <pgsql-general@list.coretech.ro>)
Ответы Re: specify whitch index to use
Список pgsql-general
pgsql-general@list.coretech.ro <pgsql-general@list.coretech.ro> schrieb:
> I have two indexes on a table on cols col1 and col2, the table has ~10M
> rows on pg v8.1.4
>
> when I use "where col1 = val1" the query is fast and returns 0 rows
> when I use "where col2 > val2" the query is slow and returns ~1M rows
>
> in both cases the corresponding indexes are used.
> when I use "where col1 = val1 and col2 > val2" the query is slow and
> returns 0 rows using the index on col2
>
> is there any way for postgres to use both indexes when relevant columns are
> present in a where clause ?
> is it possible to specify which index to use in a query ?

Can you do a 'explain analyse select ...' and tell us the output from
this? Do you have a recent vacuum?

8.1 *should* use both indexes in a bitmap index scan.


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

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

Предыдущее
От: "pgsql-general@list.coretech.ro"
Дата:
Сообщение: specify whitch index to use
Следующее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Why overlaps is not working