Skip site navigation (1) Skip section navigation (2)

Re: Please help with this explain analyse...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bricklen Anderson <BAnderson(at)PresiNET(dot)com>
Cc: David Gagnon <dgagnon(at)siunik(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Please help with this explain analyse...
Date: 2005-11-29 00:00:30
Message-ID: 17298.1133222430@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Bricklen Anderson <BAnderson(at)PresiNET(dot)com> writes:
> Your loops are what is causing the time spent.
> eg. "actual time=0.127..17.379 rows=1154 loops=8335)" ==
> 8335*(17.379-0.127)/1000=>143 secs (if my math is correct).

As for where the problem is, I think it's the horrid misestimate of the
number of matching rows in cs_pk:

>> "                    ->  Index Scan using cs_pk on cs  (cost=0.00..12.83 
>> rows=2 width=144) (actual time=0.087..444.999 rows=13587 loops=1)"
>> "                          Index Cond: (('M'::text = (cs.csypnum)::text) 
>> AND ((cs.csglnum)::text = ("outer".glnum)::text))"

Has that table been ANALYZEd recently?  How about the gl table?

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: David GagnonDate: 2005-11-29 02:16:52
Subject: Re: Please help with this explain analyse...
Previous:From: Bricklen AndersonDate: 2005-11-28 23:46:14
Subject: Re: Please help with this explain analyse...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group