Re: Drawing a blank on some SQL

Поиск
Список
Период
Сортировка
От Samuel Gendler
Тема Re: Drawing a blank on some SQL
Дата
Msg-id AANLkTikLJ6bqjasftLOPx0LV4mfw-ngBoPLw_FdDm9Lh@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Drawing a blank on some SQL  (Aaron Burnett <aburnett@bzzagent.com>)
Список pgsql-sql
On Fri, Feb 11, 2011 at 12:47 PM, Aaron Burnett <aburnett@bzzagent.com> wrote:


Thank you all very much for your help.

The suggestion from Osvaldo below was the best for my situation (not having any soret of xref table to join)...



It may work well for now, but if that foo_activity table has the potential to get large with only a relatively small percentage of rows fitting in the date range, it will get very slow compared to the left join, as it requires loading every row in the table, instead of being able to use an index to pull just the rows from the date range and then join to the list of valid activities.  

--sam

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

Предыдущее
От: Aaron Burnett
Дата:
Сообщение: Re: Drawing a blank on some SQL
Следующее
От: Jasen Betts
Дата:
Сообщение: Re: DELETE FROM takes forever