Re: [postgresql-it] Problema performance query

  • From: "Riccardo (SCASI)" <r.penco@xxxxxxxxxxxx>
  • To: postgresql-it <postgresql-it@xxxxxxxxxxxxx>
  • Date: Wed, 16 Apr 2008 12:51:17 +0200

Chris Mair ha scritto:

Ciao,
[...]
potresti postarci il risultato di "explain analyze <query>" anziche`
solo "explain <query>" per i dure casi?

Bye,
Chris.

certo, eccole

Aggregate (cost=821350.49..821350.50 rows=1 width=0) (actual time=1576.193..1576.194 rows=1 loops=1)
-> Nested Loop (cost=0.00..820653.98 rows=278604 width=0) (actual time=241.917..1352.760 rows=257612 loops=1)
-> Index Scan using idx_data on rilevamenti r (cost=0.00..1546.23 rows=2741 width=8) (actual time=213.049..396.893 rows=2500 loops=1)
Index Cond: ((datain >= '2007-12-01 00:00:00'::timestamp without time zone) AND (datain <= '2007-12-11 00:00:00'::timestamp without time zone))
-> Index Scan using idx_rilev on dettagliorilevamenti dr (cost=0.00..224.01 rows=5986 width=4) (actual time=0.034..0.207 rows=103 loops=2500)
              Index Cond: ("outer".id = dr.id_rilev)
Total runtime: 1576.296 ms


Aggregate (cost=829889.59..829889.60 rows=1 width=0) (actual time=357782.693..357782.694 rows=1 loops=1)
-> Merge Join (cost=1869.01..829123.45 rows=306454 width=0) (actual time=314676.095..357512.113 rows=304670 loops=1)
        Merge Cond: ("outer".id_rilev = "inner".id)
-> Index Scan using idx_rilev on dettagliorilevamenti dr (cost=0.00..767437.41 rows=22245028 width=4) (actual time=0.150..336587.891 rows=21122995 loops=1)
-> Sort (cost=1869.01..1876.54 rows=3015 width=8) (actual time=12.443..264.220 rows=304670 loops=1)
              Sort Key: r.id
-> Index Scan using idx_data on rilevamenti r (cost=0.00..1694.77 rows=3015 width=8) (actual time=0.016..6.559 rows=2937 loops=1)"
Index Cond: ((datain >= '2007-12-01 00:00:00'::timestamp without time zone) AND (datain <= '2007-12-12 00:00:00'::timestamp without time zone))
Total runtime: 357839.175 ms


grazie, riki

Other related posts: