Re: Searching for the cause of a bad plan - Mailing list pgsql-performance

From Tom Lane
Subject Re: Searching for the cause of a bad plan
Date
Msg-id 21582.1190820137@sss.pgh.pa.us
Whole thread Raw
In response to Re: Searching for the cause of a bad plan  (Csaba Nagy <nagy@ecircle-ag.com>)
Responses Re: Searching for the cause of a bad plan  (Csaba Nagy <nagy@ecircle-ag.com>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Csaba Nagy
Date:
Subject: Re: Searching for the cause of a bad plan
Next
From: pgdba
Date:
Subject: Re: Incorrect row estimates in plan?