From: Tom Lane <tgl@sss.pgh.pa.us>
To: John A Meinel <john@arbash-meinel.com>
Cc: Shoaib Burq (VPAC) <sab@vpac.org>
Cc: Russell Smith <mr-russ@pws.com.au>
Cc: Jeff <threshar@torgo.978.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: two queries and dual cpu (perplexed)
Date: Sat, 23 Apr 2005 20:10:05 -0400
Message-ID: <24112.1114301405@sss.pgh.pa.us> (raw)
In-Reply-To: <4267C34D.9010705@arbash-meinel.com>
References: <Pine.LNX.4.44.0504220054350.6980-100000@hp.vpac.org>
<4267C34D.9010705@arbash-meinel.com>
John A Meinel <john@arbash-meinel.com> writes:
> Actually, you probably don't want enable_seqscan=off, you should try:
> SET enable_nestloop TO off.
> The problem is that it is estimating there will only be 44 rows, but in
> reality there are 13M rows. It almost definitely should be doing a
> seqscan with a sort and merge join.
Not nestloops anyway.
> I don't understand how postgres could get the number of rows that wrong.
No stats, or out-of-date stats is the most likely bet.
> I can't figure out exactly what is where from the formatting, but the query that seems misestimated is:
> -> Index Scan using "IX_ClimateId" on "ClimateChangeModel40" (cost=0.00..1063711.75 rows=265528 width=20) (actual time=28.311..17212.703 rows=13276368 loops=1)
> Index Cond: ("outer"."ClimateId" = "ClimateChangeModel40"."ClimateId")
Yeah, that's what jumped out at me too. It's not the full explanation
for the join number being so far off, but this one at least you have a
chance to fix by updating the stats on ClimateChangeModel40.
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, john@arbash-meinel.com, sab@vpac.org, mr-russ@pws.com.au, threshar@torgo.978.org
Subject: Re: two queries and dual cpu (perplexed)
In-Reply-To: <24112.1114301405@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