Re: how to help the planner - Mailing list pgsql-performance

From Tom Lane
Subject Re: how to help the planner
Date
Msg-id 868.1364487526@sss.pgh.pa.us
Whole thread Raw
In response to how to help the planner  (Marty Frasier <m.frasier@escmatrix.com>)
Responses Re: how to help the planner  (Marty Frasier <m.frasier@escmatrix.com>)
List pgsql-performance
Marty Frasier <m.frasier@escmatrix.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


pgsql-performance by date:

Previous
From: Marty Frasier
Date:
Subject: how to help the planner
Next
From: kelphet xiong
Date:
Subject: Question about postmaster's CPU usage