Jeremy Jongsma <jeremy(at)jongsma(dot)org> writes:
> My questions are:
> 1) How can #3 take 30 times as long as #2, given that in my databse they
> have the exact same number of rows returned and are drawn from the exact
> same tables?
> 2) How is it possible for #3, a subset of #1 with a very simple WHERE
> clause, to take three times longer than #1 to execute?
> I can provide table definitions if needed.
What would be more useful is EXPLAIN ANALYZE output (and you have
ANALYZEd all the underlying tables, no?). This is a bit off topic
for pgsql-general though, please take it to pgsql-performance.
regards, tom lane