explain.depesz.com

A tool for finding a real cause for slow queries.

Result: dc3 : query builder

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 5.655 10940.131 ↑ 154.8 11 1

Hash Left Join (cost=196696.13..758051.02 rows=1703 width=1053) (actual time=10833.601..10940.131 rows=11 loops=1)

  • Hash Cond: ((dlk_poly.cazi = (gkdpatb.dpa_cazicazi)::bpchar) AND ((polygons.codamm)::bpchar = (gkdpatb.dpa_ccomammi)::bpchar) AND (dlk_poly.cimm = gkdpatb.dpa_ckimcimm))
2. 12.651 10758.008 ↑ 154.8 11 1

Hash Join (cost=190724.92..751344.94 rows=1703 width=1043) (actual time=10657.066..10758.008 rows=11 loops=1)

  • Hash Cond: ((dlk_poly.cimm = gkimmtb.imm_ckimcimm) AND (dlk_poly.cazi = (gkimmtb.imm_cazicazi)::bpchar) AND ((polygons.codamm)::bpchar = (gkimmtb.imm_ccomammi)::bpchar))
3. 53.424 10650.844 ↑ 90.6 25773 1

Merge Left Join (cost=187474.36..222719.01 rows=2334926 width=1029) (actual time=10538.030..10650.844 rows=25773 loops=1)

  • Merge Cond: ((polygons.codamm)::bpchar = (com_nascita.coi_ccoiccoi)::bpchar)
4. 221.836 10541.396 ↑ 1.7 25773 1

Sort (cost=185715.90..185826.27 rows=44151 width=1029) (actual time=10491.810..10541.396 rows=25773 loops=1)

  • Sort Key: polygons.codamm
  • Sort Method: external merge Disk: 6200kB
5. 2813.148 10319.560 ↑ 1.7 25773 1

Hash Join (cost=118724.21..142465.61 rows=44151 width=1029) (actual time=7731.755..10319.560 rows=25773 loops=1)

  • Hash Cond: (dlk_poly.gid = polygons.gid)
6. 107.581 2084.548 ↑ 1.0 44151 1

Hash Left Join (cost=2.21..2329.54 rows=44151 width=14) (actual time=0.065..2084.548 rows=44151 loops=1)

  • Hash Cond: ((btrim((dlk_poly.cazi)::text) = btrim((gkdsrtb.dsr_cazicazi)::text)) AND ((dlk_poly.cmp)::text = (gkdsrtb.dsr_ccmpccmp)::text) AND ((dlk_poly.cdsr)::text = (gkdsrtb.dsr_cdsrcdsr)::text))
7. 48.359 1976.949 ↑ 1.0 44151 1

Hash Left Join (cost=1.07..1664.65 rows=44151 width=25) (actual time=0.030..1976.949 rows=44151 loops=1)

  • Hash Cond: ((dlk_poly.cmp)::text = (gkcmptb.cmp_ccmpccmp)::text)
8. 1928.582 1928.582 ↑ 1.0 44151 1

Seq Scan on dlk_poly (cost=0.00..1056.51 rows=44151 width=25) (actual time=0.006..1928.582 rows=44151 loops=1)

9. 0.003 0.008 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=11) (actual time=0.008..0.008 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
10. 0.005 0.005 ↑ 1.0 3 1

Seq Scan on gkcmptb (cost=0.00..1.03 rows=3 width=11) (actual time=0.003..0.005 rows=3 loops=1)

11. 0.013 0.018 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=16) (actual time=0.018..0.018 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
12. 0.005 0.005 ↑ 1.0 5 1

Seq Scan on gkdsrtb (cost=0.00..1.05 rows=5 width=16) (actual time=0.003..0.005 rows=5 loops=1)

13. 4488.266 5421.864 ↑ 1.0 155805 1

Hash (cost=96356.18..96356.18 rows=159266 width=1019) (actual time=5421.864..5421.864 rows=155805 loops=1)

  • Buckets: 1024 Batches: 256 Memory Usage: 144kB
14. 933.598 933.598 ↑ 1.0 155805 1

Seq Scan on polygons (cost=0.00..96356.18 rows=159266 width=1019) (actual time=0.036..933.598 rows=155805 loops=1)

  • Filter: ((new_path_file IS NULL) AND ((layer)::text = 'FABBRICATO'::text))
15. 17.991 56.024 ↓ 3.4 35573 1

Sort (cost=1758.46..1784.91 rows=10577 width=32) (actual time=46.072..56.024 rows=35573 loops=1)

  • Sort Key: com_nascita.coi_ccoiccoi
  • Sort Method: quicksort Memory: 670kB
16. 6.220 38.033 ↑ 1.0 10577 1

Subquery Scan on com_nascita (cost=0.00..1051.46 rows=10577 width=32) (actual time=0.090..38.033 rows=10577 loops=1)

17. 24.883 31.813 ↑ 1.0 10577 1

GroupAggregate (cost=0.00..945.69 rows=10577 width=17) (actual time=0.087..31.813 rows=10577 loops=1)

18. 6.930 6.930 ↑ 1.0 11949 1

Index Scan using gkcoitb_coicoi_idx on gkcoitb (cost=0.00..697.42 rows=11949 width=17) (actual time=0.022..6.930 rows=11949 loops=1)

19. 0.049 94.513 ↑ 336.4 25 1

Hash (cost=3103.40..3103.40 rows=8409 width=30) (actual time=94.513..94.513 rows=25 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
20. 0.045 94.464 ↑ 336.4 25 1

Hash Left Join (cost=2371.80..3103.40 rows=8409 width=30) (actual time=90.300..94.464 rows=25 loops=1)

  • Hash Cond: ((gksogtb.sog_csogsede)::bpchar = (com_sede.coi_ccoiccoi)::bpchar)
21. 0.059 49.490 ↑ 6.4 25 1

Hash Left Join (cost=1188.12..1624.96 rows=159 width=31) (actual time=45.350..49.490 rows=25 loops=1)

  • Hash Cond: ((gksogtb.sog_csogluna)::bpchar = (com_nascita.coi_ccoiccoi)::bpchar)
22. 0.056 4.449 ↓ 8.3 25 1

Nested Loop Left Join (cost=4.45..435.72 rows=3 width=35) (actual time=0.349..4.449 rows=25 loops=1)

23. 0.066 3.543 ↓ 8.3 25 1

Nested Loop Left Join (cost=4.45..414.81 rows=3 width=50) (actual time=0.315..3.543 rows=25 loops=1)

  • Join Filter: (((gkimmtb.imm_cazicazi)::text = (gkkimtb.kim_cazicazi)::text) AND ((gkimmtb.imm_ccomammi)::text = (gkkimtb.kim_ccomammi)::text) AND ((gkimmtb.imm_ckimcsez)::text = (gkkimtb.kim_ckimcsez)::text) AND ((gkimmtb.imm_ckimtipo)::text = (gkkimtb.kim_ckimtipo)::text))
24. 0.065 3.302 ↓ 8.3 25 1

Nested Loop (cost=4.45..393.98 rows=3 width=38) (actual time=0.303..3.302 rows=25 loops=1)

25. 0.036 1.362 ↑ 1.2 25 1

Nested Loop (cost=4.45..151.46 rows=29 width=47) (actual time=0.263..1.362 rows=25 loops=1)

26. 0.794 0.878 ↑ 1.8 4 1

Bitmap Heap Scan on gksogtb (cost=4.45..92.46 rows=7 width=34) (actual time=0.162..0.878 rows=4 loops=1)

  • Recheck Cond: ((sog_csognome)::text = 'NULLO'::text)
  • Filter: (sog_cmutafin = 0)
27. 0.084 0.084 ↑ 1.8 13 1

Bitmap Index Scan on gksogtb_nome (cost=0.00..4.45 rows=24 width=0) (actual time=0.084..0.084 rows=13 loops=1)

  • Index Cond: ((sog_csognome)::text = 'NULLO'::text)
28. 0.448 0.448 ↓ 6.0 6 4

Index Scan using gktittb_p1 on gktittb (cost=0.00..8.41 rows=1 width=28) (actual time=0.079..0.112 rows=6 loops=4)

  • Index Cond: (((gktittb.tit_cazicazi)::text = (gksogtb.sog_cazicazi)::text) AND ((gktittb.tit_ccomammi)::text = (gksogtb.sog_ccomammi)::text) AND ((gktittb.tit_ckimcsez)::text = (gksogtb.sog_ckimcsez)::text) AND ((gktittb.tit_csogtipo)::text = (gksogtb.sog_csogtipo)::text) AND (gktittb.tit_csogcsog = gksogtb.sog_csogcsog))
  • Filter: (gktittb.tit_cmutafin = 0)
29. 1.875 1.875 ↑ 1.0 1 25

Index Scan using gkimmtb_p1 on gkimmtb (cost=0.00..8.34 rows=1 width=19) (actual time=0.074..0.075 rows=1 loops=25)

  • Index Cond: (((gkimmtb.imm_cazicazi)::text = (gktittb.tit_cazicazi)::text) AND ((gkimmtb.imm_ccomammi)::text = (gktittb.tit_ccomammi)::text) AND ((gkimmtb.imm_ckimcsez)::text = (gktittb.tit_ckimcsez)::text) AND ((gkimmtb.imm_ckimtipo)::text = (gktittb.tit_ckimtipo)::text) AND (gkimmtb.imm_ckimcimm = gktittb.tit_ckimcimm) AND (gkimmtb.imm_nimmpsta = gktittb.tit_ntitpsta))
  • Filter: (gkimmtb.imm_cmutafin = 0)
30. 0.175 0.175 ↑ 1.0 1 25

Index Scan using gkkimtb_cimm on gkkimtb (cost=0.00..6.92 rows=1 width=15) (actual time=0.006..0.007 rows=1 loops=25)

  • Index Cond: (gkimmtb.imm_ckimcimm = gkkimtb.kim_ckimcimm)
31. 0.850 0.850 ↑ 1.0 1 25

Index Scan using gkdpatb_cazi_comammi_sez_tip_cimm on gkdpatb (cost=0.00..6.95 rows=1 width=15) (actual time=0.033..0.034 rows=1 loops=25)

  • Index Cond: (((gkkimtb.kim_cazicazi)::text = (gkdpatb.dpa_cazicazi)::text) AND ((gkkimtb.kim_ccomammi)::text = (gkdpatb.dpa_ccomammi)::text) AND ((gkkimtb.kim_ckimcsez)::text = (gkdpatb.dpa_ckimcsez)::text) AND ((gkkimtb.kim_ckimtipo)::text = (gkdpatb.dpa_ckimtipo)::text) AND (gkkimtb.kim_ckimcimm = gkdpatb.dpa_ckimcimm))
32. 6.116 44.982 ↑ 1.0 10577 1

Hash (cost=1051.46..1051.46 rows=10577 width=32) (actual time=44.982..44.982 rows=10577 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 300kB
33. 6.312 38.866 ↑ 1.0 10577 1

Subquery Scan on com_nascita (cost=0.00..1051.46 rows=10577 width=32) (actual time=0.023..38.866 rows=10577 loops=1)

34. 25.653 32.554 ↑ 1.0 10577 1

GroupAggregate (cost=0.00..945.69 rows=10577 width=17) (actual time=0.021..32.554 rows=10577 loops=1)

35. 6.901 6.901 ↑ 1.0 11949 1

Index Scan using gkcoitb_coicoi_idx on gkcoitb (cost=0.00..697.42 rows=11949 width=17) (actual time=0.011..6.901 rows=11949 loops=1)

36. 6.066 44.929 ↑ 1.0 10577 1

Hash (cost=1051.46..1051.46 rows=10577 width=32) (actual time=44.929..44.929 rows=10577 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 300kB
37. 6.274 38.863 ↑ 1.0 10577 1

Subquery Scan on com_sede (cost=0.00..1051.46 rows=10577 width=32) (actual time=0.034..38.863 rows=10577 loops=1)

38. 25.664 32.589 ↑ 1.0 10577 1

GroupAggregate (cost=0.00..945.69 rows=10577 width=17) (actual time=0.033..32.589 rows=10577 loops=1)

39. 6.925 6.925 ↑ 1.0 11949 1

Index Scan using gkcoitb_coicoi_idx on gkcoitb (cost=0.00..697.42 rows=11949 width=17) (actual time=0.023..6.925 rows=11949 loops=1)

40. 33.023 176.468 ↓ 1.0 41680 1

Hash (cost=5000.30..5000.30 rows=41538 width=22) (actual time=176.468..176.468 rows=41680 loops=1)

  • Buckets: 4096 Batches: 2 Memory Usage: 989kB
41. 64.795 143.445 ↓ 1.0 41680 1

Hash Join (cost=1260.80..5000.30 rows=41538 width=22) (actual time=41.088..143.445 rows=41680 loops=1)

  • Hash Cond: (((gkdpatb.dpa_cazicazi)::text = (gkpartb.par_cazicazi)::text) AND ((gkdpatb.dpa_cparcpar)::text = (gkpartb.par_cparcpar)::text))
42. 38.135 38.135 ↓ 1.0 41680 1

Seq Scan on gkdpatb (cost=0.00..2070.05 rows=41538 width=22) (actual time=0.015..38.135 rows=41680 loops=1)

  • Filter: ((dpa_ckimtipo)::bpchar = 'F'::bpchar)
43. 19.446 40.515 ↑ 1.0 29229 1

Hash (cost=679.36..679.36 rows=29229 width=13) (actual time=40.515..40.515 rows=29229 loops=1)

  • Buckets: 4096 Batches: 2 Memory Usage: 530kB
44. 21.069 21.069 ↑ 1.0 29229 1

Seq Scan on gkpartb (cost=0.00..679.36 rows=29229 width=13) (actual time=0.480..21.069 rows=29229 loops=1)

  • Filter: (par_cmutafin = 0)