Re: different queries and their efficiencies

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Welton <davidnwelton(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: different queries and their efficiencies
Date: 2005-11-24 17:35:10
Message-ID: 14747.1132853710@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Welton <davidnwelton(at)gmail(dot)com> writes:
> I'm curious as to what the general opinion is on these different
> queries and their relative merits, especially in terms of speed:

You really should do EXPLAIN ANALYZE rather than assuming that the
planner's estimates are reliable.

The NOT IN case, at least, could be improved by increasing work_mem
to the point where the subquery fits into an in-memory hash table.
Larger work_mem would probably help the sorts used in the other
plans too.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Harald Armin Massa 2005-11-24 19:30:30 pg_dump --data-only: is dump ordered to keep foreign-key-relations loadable?
Previous Message Tom Lane 2005-11-24 17:28:07 Re: "invalid page header in block 597621 of relation..."error