explain.depesz.com

PostgreSQL's explain analyze made readable

Result: erQu

Settings
# exclusive inclusive rows x rows loops node
1. 8.097 178,481.385 ↓ 523.0 523 1

GroupAggregate (cost=9,300.77..9,301.12 rows=1 width=174) (actual time=178,473.387..178,481.385 rows=523 loops=1)

2. 4.543 178,473.288 ↓ 689.0 689 1

Sort (cost=9,300.77..9,300.77 rows=1 width=174) (actual time=178,472.837..178,473.288 rows=689 loops=1)

  • Sort Key: lottim.codlotp, giacese.codubi, ubicaz.descrizio, sped.codice, righesped.codcate
  • Sort Method: quicksort Memory: 208kB
3. 32.429 178,468.745 ↓ 689.0 689 1

Nested Loop (cost=8,570.18..9,300.76 rows=1 width=174) (actual time=177,787.427..178,468.745 rows=689 loops=1)

4. 69.697 178,270.441 ↓ 33,175.0 33,175 1

Nested Loop Left Join (cost=8,569.90..9,294.02 rows=1 width=161) (actual time=177,767.064..178,270.441 rows=33,175 loops=1)

5. 88.379 178,101.219 ↓ 33,175.0 33,175 1

Nested Loop Left Join (cost=8,569.62..9,286.44 rows=1 width=161) (actual time=177,767.019..178,101.219 rows=33,175 loops=1)

6. 96.340 177,880.140 ↓ 33,175.0 33,175 1

Hash Right Join (cost=8,569.34..9,278.50 rows=1 width=135) (actual time=177,766.989..177,880.140 rows=33,175 loops=1)

  • Hash Cond: ((righesped.codcate)::text = (lottim.codlotp)::text)
7. 17.028 17.028 ↓ 1.0 25,031 1

Seq Scan on righesped (cost=0.00..615.57 rows=24,957 width=15) (actual time=0.009..17.028 rows=25,031 loops=1)

8. 129.404 177,766.772 ↓ 33,141.0 33,141 1

Hash (cost=8,569.32..8,569.32 rows=1 width=120) (actual time=177,766.772..177,766.772 rows=33,141 loops=1)

  • Buckets: 1,024 Batches: 8 (originally 1) Memory Usage: 1,025kB
9. 157.228 177,637.368 ↓ 33,141.0 33,141 1

Nested Loop Left Join (cost=284.84..8,569.32 rows=1 width=120) (actual time=19.714..177,637.368 rows=33,141 loops=1)

10. 22,277.801 176,916.743 ↓ 33,141.0 33,141 1

Nested Loop Left Join (cost=284.55..8,561.33 rows=1 width=88) (actual time=19.668..176,916.743 rows=33,141 loops=1)

  • Join Filter: ((es_anagrgenclifor.codiceanaggen)::text = (ordprod.codcli)::text)
  • Rows Removed by Join Filter: 24,789,473
11. 177.652 1,991.496 ↓ 33,141.0 33,141 1

Nested Loop (cost=1.14..8,103.48 rows=1 width=64) (actual time=0.590..1,991.496 rows=33,141 loops=1)

12. 178.439 1,250.447 ↓ 33,141.0 33,141 1

Nested Loop (cost=0.85..8,095.45 rows=1 width=63) (actual time=0.537..1,250.447 rows=33,141 loops=1)

13. 336.240 336.240 ↓ 269.7 33,444 1

Index Scan using ix_lottim_wflag on lottim (cost=0.43..7,080.27 rows=124 width=49) (actual time=0.470..336.240 rows=33,444 loops=1)

  • Index Cond: ((wflag)::text = 'P'::text)
  • Filter: ((codlotp)::text <> ''::text)
  • Rows Removed by Filter: 923
14. 735.768 735.768 ↑ 1.0 1 33,444

Index Scan using ix_giacese_codlot on giacese (cost=0.41..8.18 rows=1 width=25) (actual time=0.020..0.022 rows=1 loops=33,444)

  • Index Cond: ((codlot)::text = (lottim.codice)::text)
15. 563.397 563.397 ↑ 1.0 1 33,141

Index Scan using ordprod_pkey on ordprod (cost=0.29..8.02 rows=1 width=37) (actual time=0.015..0.017 rows=1 loops=33,141)

  • Index Cond: ((codop)::text = (lottim.procord)::text)
16. 83,368.625 152,647.446 ↑ 1.0 749 33,141

Hash Join (cost=283.41..444.75 rows=749 width=31) (actual time=0.016..4.606 rows=749 loops=33,141)

  • Hash Cond: (es_anagrgenindirizzi.idanaggen = es_anagrgenclifor_1.idanaggen)
17. 69,264.690 69,264.690 ↑ 1.0 2,311 33,141

Seq Scan on es_anagrgenindirizzi (cost=0.00..145.18 rows=2,311 width=31) (actual time=0.014..2.090 rows=2,311 loops=33,141)

  • Filter: (numprogr = 0)
  • Rows Removed by Filter: 503
18. 0.887 14.131 ↑ 1.0 749 1

Hash (cost=274.05..274.05 rows=749 width=16) (actual time=14.131..14.131 rows=749 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 36kB
19. 2.978 13.244 ↑ 1.0 749 1

Hash Join (cost=181.79..274.05 rows=749 width=16) (actual time=8.442..13.244 rows=749 loops=1)

  • Hash Cond: (es_anagrgenclifor_1.idanaggen = es_anagrgenclifor.idanaggen)
20. 1.870 1.870 ↑ 1.0 2,311 1

Seq Scan on es_anagrgenclifor es_anagrgenclifor_1 (cost=0.00..76.11 rows=2,311 width=4) (actual time=0.018..1.870 rows=2,311 loops=1)

21. 0.790 8.396 ↑ 1.0 749 1

Hash (cost=172.42..172.42 rows=749 width=12) (actual time=8.396..8.396 rows=749 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 33kB
22. 3.323 7.606 ↑ 1.0 749 1

Hash Join (cost=77.27..172.42 rows=749 width=12) (actual time=2.281..7.606 rows=749 loops=1)

  • Hash Cond: (es_anagrgenclifor.idanaggen = es_clientifornitori.idanaggen)
23. 2.031 2.031 ↑ 1.0 2,311 1

Seq Scan on es_anagrgenclifor (cost=0.00..76.11 rows=2,311 width=8) (actual time=0.004..2.031 rows=2,311 loops=1)

24. 0.773 2.252 ↑ 1.0 749 1

Hash (cost=67.91..67.91 rows=749 width=4) (actual time=2.252..2.252 rows=749 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 27kB
25. 1.479 1.479 ↑ 1.0 749 1

Seq Scan on es_clientifornitori (cost=0.00..67.91 rows=749 width=4) (actual time=0.008..1.479 rows=749 loops=1)

  • Filter: (((dbgruppo)::text = 'XS'::text) AND (tipoanagrafica = 1))
  • Rows Removed by Filter: 1,378
26. 563.397 563.397 ↑ 1.0 1 33,141

Index Scan using pk_catego on catego (cost=0.29..7.98 rows=1 width=47) (actual time=0.016..0.017 rows=1 loops=33,141)

  • Index Cond: ((lottim.codart)::text = (codice)::text)
27. 132.700 132.700 ↑ 1.0 1 33,175

Index Scan using odporvmapping_pkey on odporvmapping (cost=0.29..7.93 rows=1 width=34) (actual time=0.003..0.004 rows=1 loops=33,175)

  • Index Cond: (ordprod.iddoc = idodp)
28. 99.525 99.525 ↑ 1.0 1 33,175

Index Only Scan using pk_sped_codice on sped (cost=0.28..7.57 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=33,175)

  • Index Cond: (codice = righesped.codsped)
  • Heap Fetches: 26,809
29. 165.875 165.875 ↓ 0.0 0 33,175

Index Scan using ix_ubicaz_codice on ubicaz (cost=0.27..6.73 rows=1 width=20) (actual time=0.005..0.005 rows=0 loops=33,175)

  • Index Cond: ((codice)::text = (giacese.codubi)::text)
  • Filter: (((giacese.codubi)::text = '1.1'::text) OR ((codriso)::text = '1.1'::text))
  • Rows Removed by Filter: 1