Re: Please help with this explain analyse...
| От | Tom Lane |
|---|---|
| Тема | Re: Please help with this explain analyse... |
| Дата | |
| Msg-id | 17298.1133222430@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Please help with this explain analyse... (Bricklen Anderson <BAnderson@PresiNET.com>) |
| Ответы |
Re: Please help with this explain analyse...
|
| Список | pgsql-performance |
Bricklen Anderson <BAnderson@PresiNET.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
В списке pgsql-performance по дате отправления: