Re: problem with slow select - Mailing list pgsql-sql

From francescosaf
Subject Re: problem with slow select
Date
Msg-id francescosaf.15irmp@mail.webservertalk.com
Whole thread Raw
In response to problem with slow select  (francescosaf <francescosaf.152kao@mail.webservertalk.com>)
List pgsql-sql
thank you for answer and excuse me for later

this is query plan:



QUERY PLAN                                          

---------------------------------------------------------------------------------------------------------------------------------------------------------------
Nested Loop  (cost=10564.42..10853.74 rows=1 width=150) (actual
time=11626.89..12060.36 rows=6 loops=1)
->  Merge Join  (cost=10564.42..10820.69 rows=6 width=131) (actual
time=11626.45..12058.84 rows=6 loops=1)
Merge Cond: (("outer".idcode = "inner".idcode) AND
("outer".time = "inner".time))
->  Sort  (cost=7550.07..7675.40 rows=50134 width=104) (actual
time=8910.91..9031.23 rows=49293 loops=1)
Sort Key: XXXX.idcode, XXXX.time
->  Seq Scan on XXXX  (cost=0.00..1586.34 rows=50134
width=104) (actual time=0.10..852.78 rows=50515 loops=1)
->  Sort  (cost=3014.35..3017.11 rows=1102 width=31) (actual
time=2419.43..2419.45 rows=6 loops=1)
Sort Key: temptable.idcode, temptable.time
->  Subquery Scan temptable  (cost=2876.08..2958.70
rows=1102 width=31) (actual time=2154.84..2419.15 rows=6 loops=1)
->  Aggregate  (cost=2876.08..2958.70 rows=1102
width=31) (actual time=2154.83..2419.10 rows=6 loops=1)
->  Group  (cost=2876.08..2931.16 rows=11016
width=31) (actual time=2066.58..2389.91 rows=19486 loops=1)
->  Sort  (cost=2876.08..2903.62
rows=11016 width=31) (actual time=2066.55..2106.39 rows=19486 loops=1)
Sort Key: XXXX.idcode
->  Hash Join 
(cost=36.50..2136.54 rows=11016 width=31) (actual time=3.41..765.49
rows=19486 loops=1)
Hash Cond: ("outer".idcode
= "inner".idcode)
->  Seq Scan on XXXX 
(cost=0.00..1586.34 rows=50134 width=21) (actual time=0.12..301.87
rows=50515 loops=1)
->  Hash 
(cost=36.48..36.48 rows=7 width=10) (actual time=3.10..3.10 rows=0
loops=1)
->  Seq Scan on YYYY
(cost=0.00..36.48 rows=7 width=10) (actual time=0.13..3.04 rows=6
loops=1)
Filter:
((idazien = 8::numeric) OR (idazien = 1019::numeric))
->  Index Scan using YYYY_pkey on YYYY  (cost=0.00..5.46 rows=1
width=19) (actual time=0.17..0.18 rows=1 loops=6)
Index Cond: (YYYY.idcode = "outer".idcode)
Filter: ((idazien = 8::numeric) OR (idazien = 1019::numeric))
Total runtime: 12065.05 msec
(23 rows)



--
francescosaf
------------------------------------------------------------------------
Posted via http://www.webservertalk.com
------------------------------------------------------------------------
View this thread: http://www.webservertalk.com/message189539.html


pgsql-sql by date:

Previous
From: Marcus Krause
Date:
Subject: Problem with a "blocking period" Trigger
Next
From: cookfire
Date:
Subject: Bacula