Re: Searching for the cause of a bad plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Searching for the cause of a bad plan
Date: 2007-09-26 15:22:17
Message-ID: 21582.1190820137@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Csaba Nagy <nagy(at)ecircle-ag(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message pgdba 2007-09-26 15:24:01 Re: Incorrect row estimates in plan?
Previous Message Csaba Nagy 2007-09-26 14:52:37 Re: Searching for the cause of a bad plan