From: | Kevin Grittner <kgrittn(at)ymail(dot)com> |
---|---|
To: | Franck Routier <franck(dot)routier(at)axege(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org> |
Subject: | Re: What happens between end of explain analyze and end of query execution ? |
Date: | 2013-04-06 15:26:31 |
Message-ID: | 1365261991.56886.YahooMailNeo@web162905.mail.bf1.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Franck Routier <franck(dot)routier(at)axege(dot)com> wrote:
> Ok, the problem definitely comes from the
> default_statistics_target which is obviously too high on the
> database.
> Now... can someone help me understand what happens ? Where can I
> look (in pg_stats ?) to see the source of the problem ? maybe a
> column with a huge list of different values the palnner has to
> parse ?
This is a fundamental issue in query planning -- how much work do
you want to do to try to come up with the best plan? Too little,
and the plan can be unacceptably slow; too much and you spend more
extra time on planning than the improvement in the plan (if any)
saves you. Reading and processing statistics gets more expensive
as you boost the volume.
What I would suggest is taking the default_statistics_target for
the cluster back down to the default, and selectviely boosting the
statistics target for individual columns as you find plans which
benefit. Don't set it right at the edge of the tipping point, but
don't automatically jump to 5000 every time either.
--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2013-04-06 16:27:21 | Re: What happens between end of explain analyze and end of query execution ? |
Previous Message | Julien Cigar | 2013-04-06 14:43:50 | Re: slow joins? |