Re: EXPLAIN SELECT .. does not return

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Link <dlink(at)soundscan(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: EXPLAIN SELECT .. does not return
Date: 2006-03-30 03:10:46
Message-ID: 9146.1143688246@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Link <dlink(at)soundscan(dot)com> writes:
> The following large EXPLAIN SELECT Statement fails to return, but
> continues to take up processing time until it is killed.
> [ 52-way join... ]

Am I right in guessing that all the sales_xxx tables are the same size
and have similar statistics? I think the problem is that the planner is
faced with a large set of essentially equivalent plans and isn't pruning
the list aggressively enough. That's something we fixed in 8.0.

> Postgresql 7.4.8

You really oughta try something newer. On my machine, 7.4.12 plans a
52-way join in about a minute, and 8.0 and 8.1 in under a second.

I wonder also if there's not a better way to design the query...
maybe a UNION ALL would work better than nested joins.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message kurt _ 2006-03-30 06:08:18 PSQL Data Type: text vs. varchar(n)
Previous Message raj 2006-03-30 01:59:57 Re: checking data type