Re: index usage in joins q'n

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: index usage in joins q'n
Дата
Msg-id 20071103084919.GA9036@svana.org
обсуждение исходный текст
Ответ на index usage in joins q'n  (rihad <rihad@mail.ru>)
Список pgsql-general
On Sat, Nov 03, 2007 at 11:42:39AM +0400, rihad wrote:
> Does this mean that a condition like "WHERE ... [AND] lhs.a=rhs.b [AND]
> ..." where rhs.b is already unique-indexed, also requires (non-unique)
> index on lhs.a for maximal join speed? Otherwise why would they want to
> say that?

No, as long as one of the two columns is indexed it can help. An index
on both might help if you need a lot of rows but it's a bit hard to
construct a situation where it'd be obvious.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Вложения

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

Предыдущее
От: rihad
Дата:
Сообщение: index usage in joins q'n
Следующее
От: Shane Ambler
Дата:
Сообщение: Re: Populating large DB from Perl script