Re: how to help the planner

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marty Frasier <m(dot)frasier(at)escmatrix(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org, James Quinn <j(dot)quinn(at)escmatrix(dot)com>
Subject: Re: how to help the planner
Date: 2013-03-28 16:18:46
Message-ID: 868.1364487526@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Marty Frasier <m(dot)frasier(at)escmatrix(dot)com> writes:
> We've been using postgreSQL for a few years. This is my first post here
> and first real dive into query plans.

One quick thought is that it's probably worth cranking up
join_collapse_limit and/or from_collapse_limit, since the number of
relations in the query is considerably more than the default values of
those limits. This will make planning take longer but possibly find
better plans. I'm not sure it will help a lot, since most of the
problem is evidently bad rowcount estimates, but it might help.

Also it seems like the major rowcount failing is in the estimate for the
t12 subquery. I can't tell why that particular combination of WHERE
clauses is giving it such a hard time --- is there something odd about
the distribution of 'cahsee_ela' tests? Why is that particular subquery
grouped over school/student when all the others are grouped over just
student?

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message kelphet xiong 2013-03-28 19:07:01 Question about postmaster's CPU usage
Previous Message Marty Frasier 2013-03-28 15:59:05 how to help the planner