Re: how to make query more efficient?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: how to make query more efficient?
Дата
Msg-id 200303191911.26641.dev@archonet.com
обсуждение исходный текст
Ответ на how to make query more efficient?  ("Johnson, Shaunn" <SJohnson6@bcbsm.com>)
Список pgsql-general
On Wednesday 19 Mar 2003 6:23 pm, Johnson, Shaunn wrote:
> Howdy:
>
> Running PostgreSQL 7.2.1 on RedHat Linux 7.2.
>
> I'm trying to run a query and it seems by using EXPLAIN
> that it will take a long time.  Is there a way to get the
> results in a more efficient manner?  Basically, I want
> a list of records that are NOT in the table ref_person.
>
> [snip query]
> explain
>
> select
...
> from
> ref_person x
> where
> x.contract not in

Try rewriting the IN as an EXISTS clause - PG has traditionally not been too
clever at handling IN (though I believe this is to improve in the next
version).

--
  Richard Huxton

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