Re: Query Problem

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Query Problem
Дата
Msg-id 39F86FFA.A1499290@agliodbs.com
обсуждение исходный текст
Ответ на Query Problem  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-sql
Michael,

> SELECT Data
> FROM Table A
> WHERE NOT EXISTS (
>     SELECT * FROM Table_B, Table_C
>     WHERE Table_B.GroupID = TableC.GroupID
>     AND TableC.AccountID = 11
> )
> 
> I think that the not exists is a bit quicker than the NOT IN.  Give it
> a whirl.

A *lot* faster.  Like, 7x as fast. I'd forgotten about EXISTS, since I
so seldom have a use for it ... but this is shy it was created, I guess.

Thanks so much for your help!
                -Josh Berkus
-- 
______AGLIO DATABASE SOLUTIONS___________________________                                       Josh Berkus  Complete
informationtechnology      josh@agliodbs.com   and data management solutions       (415) 436-9166  for law firms, small
businesses      fax  436-0137   and non-profit organizations.       pager 338-4078                               San
Francisco


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

Предыдущее
От: "Brian C. Doyle"
Дата:
Сообщение: Re: Alternate Database Locations
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Alternate Database Locations