From: Tom Lane <tgl@sss.pgh.pa.us>
To: dwinner-lists@att.net
Cc: pgsql-performance@postgresql.org
Subject: Re: slow queries after ANALYZE
Date: Fri, 11 Nov 2005 14:32:10 -0500
Message-ID: <21006.1131737530@sss.pgh.pa.us> (raw)
In-Reply-To: <4374EDF1.5010709@att.net>
References: <4374EDF1.5010709@att.net>
DW <dwinner-lists@att.net> writes:
> I'm perplexed. I'm trying to find out why some queries are taking a long
> time, and have found that after running analyze, one particular query
> becomes slow.
This implies that the planner's default choice of plan (without any
statistics) is better than its choice when informed by statistics.
This is undesirable but not unheard of :-(
It would be interesting to see EXPLAIN ANALYZE results in both cases,
plus the contents of the relevant pg_stats rows. (BTW, you need not
dump and reload to get back to the virgin state --- just delete the
relevant rows from pg_statistic.) Also we'd want to know exactly what
PG version this is, and on what sort of platform.
You might be able to fix things by increasing the statistics targets or
tweaking planner cost parameters, but it'd be best to investigate before
trying to fix.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, dwinner-lists@att.net
Subject: Re: slow queries after ANALYZE
In-Reply-To: <21006.1131737530@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox