From: | Russell Smith <mr-russ(at)pws(dot)com(dot)au> |
---|---|
To: | "Shoaib Burq (VPAC)" <sab(at)vpac(dot)org> |
Cc: | Jeff <threshar(at)torgo(dot)978(dot)org>, pgsql-performance(at)postgresql(dot)org |
Subject: | Re: two queries and dual cpu (perplexed) |
Date: | 2005-04-21 13:29:05 |
Message-ID: | 200504212329.06343.mr-russ@pws.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
On Thu, 21 Apr 2005 10:44 pm, Shoaib Burq (VPAC) wrote:
> -> Nested Loop (cost=2.19..1069345.29 rows=16 width=58) (actual time=135.390..366902.373 rows=13276368 loops=1)
> -> Nested Loop (cost=2.19..1067304.07 rows=44 width=68) (actual time=107.627..186390.137 rows=13276368 loops=1)
> -> Nested Loop (cost=2.19..1067038.94 rows=44 width=52) (actual time=87.255..49743.796 rows=13276368 loops=1)
OUCH, OUCH, OUCH.
Most if not all of the time is going on nested loop joins. The tuple estimates are off by a factore of 10^6 which is means it's chosing the wrong
join type.
you could set enable_seqscan to OFF; to test what he performance is like with a different plan, and then set it back on.
However you really need to get the row count estimates up to something comparable. within a factor of 10 at least.
A number of the other rows estimates seem to be off by a reasonable amount too. You may want to bump up the statistics on the relevant
columns. I can't find what they are from looking at that, I probably should be able too, but it's late.
If you get the stats up to something near the real values, then the planner will choose a different plan, which should give a huge performance
increase.
Regards
Russell Smith.
From | Date | Subject | |
---|---|---|---|
Next Message | Shoaib Burq (VPAC) | 2005-04-21 13:32:06 | Re: two queries and dual cpu (perplexed) |
Previous Message | Andreas Pflug | 2005-04-21 13:05:46 | Re: Joel's Performance Issues WAS : Opteron vs Xeon |