From: Tom Lane <tgl@sss.pgh.pa.us>
To: Csaba Nagy <nagy@ecircle-ag.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: Searching for the cause of a bad plan
Date: Wed, 26 Sep 2007 11:22:17 -0400
Message-ID: <21582.1190820137@sss.pgh.pa.us> (raw)
In-Reply-To: <1190818357.5430.29.camel@PCD12478>
References: <1190369024.4661.173.camel@PCD12478>
<6175.1190390913@sss.pgh.pa.us>
<1190396352.4202.109.camel@ebony.site>
<13644.1190397220@sss.pgh.pa.us>
<1190399879.4202.127.camel@ebony.site>
<27857.1190417434@sss.pgh.pa.us>
<1190640429.4181.165.camel@ebony.site>
<1190818357.5430.29.camel@PCD12478>
Csaba Nagy <nagy@ecircle-ag.com> writes:
> db=# analyze verbose temp_table_a;
> INFO: analyzing "public.temp_table_a"
> INFO: "temp_table_a": scanned 3000 of 655299 pages, containing 1887000 live rows and 0 dead rows; 3000 rows in sample, 412183071 estimated total rows
Hmm. So the bottom line here is probably that that's not a big enough
sample to derive a realistic n_distinct value. Or maybe it is ... how
many values of "a" are there really, and what's the true distribution of
counts? Do the plan estimates get closer to reality if you set a higher
statistics target?
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, nagy@ecircle-ag.com, simon@2ndquadrant.com
Subject: Re: Searching for the cause of a bad plan
In-Reply-To: <21582.1190820137@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