Re: Drawing a blank on some SQL

From: Samuel Gendler <sgendler(at)ideasculptor(dot)com>
To: Aaron Burnett <aburnett(at)bzzagent(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Drawing a blank on some SQL
Date: 2011-02-12 00:55:10
Message-ID: AANLkTikLJ6bqjasftLOPx0LV4mfw-ngBoPLw_FdDm9Lh@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Feb 11, 2011 at 12:47 PM, Aaron Burnett <aburnett(at)bzzagent(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jasen Betts 2011-02-12 08:09:21 Re: DELETE FROM takes forever
Previous Message Aaron Burnett 2011-02-11 20:47:45 Re: Drawing a blank on some SQL