Re: Unusual slowdown using subselects

Поиск
Список
Период
Сортировка
От Steve Wolfe
Тема Re: Unusual slowdown using subselects
Дата
Msg-id 001b01c0de4f$60f7a940$50824e40@iboats.com
обсуждение исходный текст
Ответ на Unusual slowdown using subselects  (John Aughey <jha@washucsc.org>)
Список pgsql-general
> calendar=# explain select * from schedule where schedule.owner_id in
> (select group_id from groups where user_id=101);

> calendar=# explain select * from schedule where schedule.owner_id=101 or
> schedule.owner_id=102;

  A sub-select is different than a join, and is tretaed differently by the
database, and they are much, much slower than simply doing a join.  So, we
use subselects only when absolutely, positively necessary, otherwise, we
just do a join.

steve



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

Предыдущее
От: John Aughey
Дата:
Сообщение: Unusual slowdown using subselects
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Unusual slowdown using subselects