explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RaHf

Settings
# exclusive inclusive rows x rows loops node
1. 2.072 4,333.352 ↓ 218.9 2,189 1

Unique (cost=5,964.47..5,964.65 rows=10 width=442) (actual time=4,327.624..4,333.352 rows=2,189 loops=1)

2.          

CTE ca

3. 1.506 23.476 ↑ 3.1 1,545 1

HashAggregate (cost=2,856.53..2,915.58 rows=4,724 width=36) (actual time=22.906..23.476 rows=1,545 loops=1)

  • Group Key: tac_1.pasak_id, ('CA-'::text || (cav.cav_name)::text)
4. 1.199 21.970 ↑ 1.0 4,646 1

Hash Join (cost=1,358.62..2,832.91 rows=4,724 width=36) (actual time=12.564..21.970 rows=4,646 loops=1)

  • Hash Cond: (tacs_1.activity_cmprt = tac_1.id)
5. 5.283 16.304 ↑ 1.0 4,646 1

Hash Join (cost=732.21..2,182.29 rows=4,724 width=12) (actual time=7.921..16.304 rows=4,646 loops=1)

  • Hash Cond: (tacs_1.id = tvin.act_nogab)
6. 3.165 3.165 ↑ 1.0 54,656 1

Seq Scan on tbl_activities_compartments tacs_1 (cost=0.00..1,129.56 rows=54,656 width=8) (actual time=0.009..3.165 rows=54,656 loops=1)

7. 0.776 7.856 ↑ 1.0 4,646 1

Hash (cost=673.16..673.16 rows=4,724 width=12) (actual time=7.856..7.856 rows=4,646 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 264kB
8. 1.965 7.080 ↑ 1.0 4,646 1

Hash Join (cost=328.09..673.16 rows=4,724 width=12) (actual time=3.376..7.080 rows=4,646 loops=1)

  • Hash Cond: (tvin.id = tcn.iesn_nogab_id)
9. 1.790 1.790 ↑ 1.0 10,606 1

Seq Scan on tbl_vmd_iesniegums_nogab tvin (cost=0.00..258.06 rows=10,606 width=8) (actual time=0.017..1.790 rows=10,606 loops=1)

10. 0.592 3.325 ↑ 1.0 4,646 1

Hash (cost=269.04..269.04 rows=4,724 width=12) (actual time=3.324..3.325 rows=4,646 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 264kB
11. 1.188 2.733 ↑ 1.0 4,646 1

Hash Join (cost=80.26..269.04 rows=4,724 width=12) (actual time=0.752..2.733 rows=4,646 loops=1)

  • Hash Cond: (tcn.cav_id = cav.id)
12. 0.819 0.819 ↑ 1.0 9,880 1

Seq Scan on tbl_cav_nogabali tcn (cost=0.00..162.80 rows=9,880 width=8) (actual time=0.016..0.819 rows=9,880 loops=1)

13. 0.179 0.726 ↑ 1.0 1,214 1

Hash (cost=65.09..65.09 rows=1,214 width=12) (actual time=0.726..0.726 rows=1,214 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 69kB
14. 0.547 0.547 ↑ 1.0 1,214 1

Seq Scan on tbl_cav cav (cost=0.00..65.09 rows=1,214 width=12) (actual time=0.017..0.547 rows=1,214 loops=1)

  • Filter: ((statuss = ANY ('{1,4,7,8}'::integer[])) OR (statuss IS NULL))
  • Rows Removed by Filter: 1,325
15. 2.597 4.467 ↑ 1.0 22,418 1

Hash (cost=346.18..346.18 rows=22,418 width=8) (actual time=4.467..4.467 rows=22,418 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,132kB
16. 1.870 1.870 ↑ 1.0 22,418 1

Seq Scan on tbl_activities_compartment tac_1 (cost=0.00..346.18 rows=22,418 width=8) (actual time=0.010..1.870 rows=22,418 loops=1)

17. 34.335 4,331.280 ↓ 699.0 6,990 1

Sort (cost=3,048.90..3,048.92 rows=10 width=442) (actual time=4,327.622..4,331.280 rows=6,990 loops=1)

  • Sort Key: b.gid, b.the_geom, ks.kods, ks.nosaukums, tat.statuss, ca.cav_name
  • Sort Method: external merge Disk: 7,320kB
18. 2.783 4,296.945 ↓ 699.0 6,990 1

Hash Join (cost=2,914.07..3,048.73 rows=10 width=442) (actual time=4,143.232..4,296.945 rows=6,990 loops=1)

  • Hash Cond: (f_zemesgabali_query.mip_id = f_ipasumi_query.mip_id)
19. 3.940 4,276.775 ↓ 3,510.0 7,020 1

Nested Loop (cost=2,891.32..3,025.63 rows=2 width=446) (actual time=4,125.840..4,276.775 rows=7,020 loops=1)

20. 2.254 4,132.435 ↓ 3,510.0 7,020 1

Hash Join (cost=2,891.32..3,003.56 rows=2 width=65) (actual time=4,125.480..4,132.435 rows=7,020 loops=1)

  • Hash Cond: (tat.activity_k_id = ks.id)
21. 3.618 4,130.144 ↓ 1,353.8 13,538 1

Hash Right Join (cost=2,889.75..3,001.96 rows=10 width=48) (actual time=4,125.431..4,130.144 rows=13,538 loops=1)

  • Hash Cond: (ca.pasak_id = tat.id)
22. 24.011 24.011 ↑ 3.1 1,545 1

CTE Scan on ca (cost=0.00..94.48 rows=4,724 width=36) (actual time=22.909..24.011 rows=1,545 loops=1)

23. 7.200 4,102.515 ↓ 1,319.1 13,191 1

Hash (cost=2,889.62..2,889.62 rows=10 width=20) (actual time=4,102.515..4,102.515 rows=13,191 loops=1)

  • Buckets: 16,384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 798kB
24. 13.442 4,095.315 ↓ 1,319.1 13,191 1

Nested Loop (cost=1.12..2,889.62 rows=10 width=20) (actual time=31.317..4,095.315 rows=13,191 loops=1)

25. 10.475 3,977.845 ↓ 1,300.3 52,014 1

Nested Loop (cost=0.83..2,874.86 rows=40 width=12) (actual time=28.455..3,977.845 rows=52,014 loops=1)

26. 127.005 3,863.264 ↓ 1,301.3 52,053 1

Nested Loop (cost=0.54..2,862.11 rows=40 width=8) (actual time=28.448..3,863.264 rows=52,053 loops=1)

27. 77.021 3,058.498 ↓ 1,269.2 677,761 1

Nested Loop (cost=0.25..2,690.39 rows=534 width=8) (actual time=28.278..3,058.498 rows=677,761 loops=1)

28. 46.797 46.797 ↓ 1,784.0 8,920 1

Function Scan on f_zemesgabali_query (cost=0.25..12.75 rows=5 width=8) (actual time=28.223..46.797 rows=8,920 loops=1)

  • Filter: (zg_status = 0)
  • Rows Removed by Filter: 324
29. 312.200 2,934.680 ↑ 1.7 76 8,920

Append (cost=0.00..534.22 rows=131 width=8) (actual time=0.030..0.329 rows=76 loops=8,920)

30. 0.000 0.000 ↓ 0.0 0 8,920

Seq Scan on tbl_management_units b2 (cost=0.00..0.00 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=8,920)

  • Filter: (f_zemesgabali_query.zgab_id = cadastral_sys_id)
31. 383.560 428.160 ↑ 1.4 10 8,920

Bitmap Heap Scan on tbl_management_units_1_0_lv b2_1 (cost=4.40..59.01 rows=14 width=8) (actual time=0.016..0.048 rows=10 loops=8,920)

  • Recheck Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
  • Heap Blocks: exact=38,762
32. 44.600 44.600 ↑ 1.4 10 8,920

Bitmap Index Scan on idx_cadastral_sys_id_1_0_lv (cost=0.00..4.40 rows=14 width=0) (actual time=0.005..0.005 rows=10 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
33. 8.920 8.920 ↓ 0.0 0 8,920

Index Scan using idx_cadastral_sys_id_0_ee on tbl_management_units_0_ee b2_2 (cost=0.14..4.16 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
34. 8.920 8.920 ↓ 0.0 0 8,920

Index Scan using idx_cadastral_sys_id_0_lt on tbl_management_units_0_lt b2_3 (cost=0.14..4.16 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
35. 231.920 231.920 ↑ 1.0 3 8,920

Index Scan using idx_cadastral_sys_id_0_lv on tbl_management_units_0_lv b2_4 (cost=0.29..16.26 rows=3 width=8) (actual time=0.012..0.026 rows=3 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
36. 8.920 8.920 ↓ 0.0 0 8,920

Index Scan using idx_cadastral_sys_id_1_0_ee on tbl_management_units_1_0_ee b2_5 (cost=0.14..4.16 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
37. 8.920 8.920 ↓ 0.0 0 8,920

Index Scan using idx_cadastral_sys_id_1_0_lt on tbl_management_units_1_0_lt b2_6 (cost=0.14..4.16 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
38. 8.920 8.920 ↓ 0.0 0 8,920

Index Scan using idx_cadastral_sys_id_1_1_ee on tbl_management_units_1_1_ee b2_7 (cost=0.14..4.16 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
39. 8.920 8.920 ↓ 0.0 0 8,920

Index Scan using idx_cadastral_sys_id_1_1_lt on tbl_management_units_1_1_lt b2_8 (cost=0.14..4.16 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
40. 1,480.720 1,480.720 ↑ 1.5 58 8,920

Index Scan using idx_cadastral_sys_id_1_1_lv on tbl_management_units_1_1_lv b2_9 (cost=0.42..345.92 rows=87 width=8) (actual time=0.018..0.166 rows=58 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
41. 8.920 8.920 ↓ 0.0 0 8,920

Index Scan using idx_cadastral_sys_id_1_proj_ee on tbl_management_units_1_proj_ee b2_10 (cost=0.14..4.16 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
42. 8.920 8.920 ↓ 0.0 0 8,920

Index Scan using idx_cadastral_sys_id_1_proj_lt on tbl_management_units_1_proj_lt b2_11 (cost=0.14..4.16 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
43. 8.920 8.920 ↓ 0.0 0 8,920

Index Scan using idx_cadastral_sys_id_1_proj_lv on tbl_management_units_1_proj_lv b2_12 (cost=0.14..4.16 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
44. 17.840 26.760 ↓ 0.0 0 8,920

Bitmap Heap Scan on tbl_management_units_3_0 b2_13 (cost=1.76..9.02 rows=2 width=8) (actual time=0.002..0.003 rows=0 loops=8,920)

  • Recheck Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
  • Heap Blocks: exact=305
45. 8.920 8.920 ↓ 0.0 0 8,920

Bitmap Index Scan on idx_cadastral_sys_id_3_0 (cost=0.00..1.76 rows=2 width=0) (actual time=0.001..0.001 rows=0 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
46. 44.600 62.440 ↓ 0.0 0 8,920

Bitmap Heap Scan on tbl_management_units_3_1 b2_14 (cost=4.33..30.82 rows=7 width=8) (actual time=0.003..0.007 rows=0 loops=8,920)

  • Recheck Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
  • Heap Blocks: exact=3,235
47. 17.840 17.840 ↓ 0.0 0 8,920

Bitmap Index Scan on idx_cadastral_sys_id_3_1 (cost=0.00..4.33 rows=7 width=0) (actual time=0.002..0.002 rows=0 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
48. 8.920 8.920 ↓ 0.0 0 8,920

Index Scan using idx_cadastral_sys_id_3_proj on tbl_management_units_3_proj b2_15 (cost=0.14..4.16 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
49. 276.520 303.280 ↑ 1.8 4 8,920

Bitmap Heap Scan on tbl_management_units_sketches b2_16 (cost=4.34..31.58 rows=7 width=8) (actual time=0.009..0.034 rows=4 loops=8,920)

  • Recheck Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
  • Heap Blocks: exact=33,437
50. 26.760 26.760 ↑ 1.8 4 8,920

Bitmap Index Scan on idx_cadastral_sys_id_sketches (cost=0.00..4.34 rows=7 width=0) (actual time=0.003..0.003 rows=4 loops=8,920)

  • Index Cond: (cadastral_sys_id = f_zemesgabali_query.zgab_id)
51. 677.761 677.761 ↓ 0.0 0 677,761

Index Scan using nogab_gid_idx on tbl_activities_compartments tacs (cost=0.29..0.31 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=677,761)

  • Index Cond: (nogab_gid = b2.gid)
52. 104.106 104.106 ↑ 1.0 1 52,053

Index Scan using tbl_activities_compartments_pkey on tbl_activities_compartment tac (cost=0.29..0.32 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=52,053)

  • Index Cond: (id = tacs.activity_cmprt)
53. 104.028 104.028 ↓ 0.0 0 52,014

Index Scan using tbl_activities_teritorial_id_idx on tbl_activities_teritorial tat (cost=0.29..0.37 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=52,014)

  • Index Cond: (id = tac.pasak_id)
  • Filter: (statuss < 3)
  • Rows Removed by Filter: 1
54. 0.003 0.037 ↓ 1.2 6 1

Hash (cost=1.51..1.51 rows=5 width=25) (actual time=0.037..0.037 rows=6 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
55. 0.034 0.034 ↓ 1.2 6 1

Seq Scan on klas_saimndarbibas ks (cost=0.00..1.51 rows=5 width=25) (actual time=0.028..0.034 rows=6 loops=1)

  • Filter: (((kods)::text >= '300'::text) AND ((kods)::text < '500'::text) AND (nozare = 1))
  • Rows Removed by Filter: 23
56. 77.220 140.400 ↑ 17.0 1 7,020

Append (cost=0.00..10.86 rows=17 width=385) (actual time=0.019..0.020 rows=1 loops=7,020)

57. 0.000 0.000 ↓ 0.0 0 7,020

Seq Scan on tbl_management_units b (cost=0.00..0.00 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=7,020)

  • Filter: (tac.nogab_gid = gid)
58. 7.020 7.020 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_1_0_lv_gid_idx on tbl_management_units_1_0_lv b_1 (cost=0.29..2.16 rows=1 width=305) (actual time=0.001..0.001 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
59. 0.000 0.000 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_0_ee_gid_idx on tbl_management_units_0_ee b_2 (cost=0.14..0.16 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
60. 0.000 0.000 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_0_lt_gid_idx on tbl_management_units_0_lt b_3 (cost=0.14..0.16 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
61. 7.020 7.020 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_0_lv_gid_idx on tbl_management_units_0_lv b_4 (cost=0.29..1.23 rows=1 width=1,432) (actual time=0.001..0.001 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
62. 0.000 0.000 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_1_0_ee_gid_idx on tbl_management_units_1_0_ee b_5 (cost=0.14..0.16 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
63. 0.000 0.000 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_1_0_lt_gid_idx on tbl_management_units_1_0_lt b_6 (cost=0.14..0.16 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
64. 0.000 0.000 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_1_1_ee_gid_idx on tbl_management_units_1_1_ee b_7 (cost=0.14..0.16 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
65. 0.000 0.000 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_1_1_lt_gid_idx on tbl_management_units_1_1_lt b_8 (cost=0.14..0.16 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
66. 14.040 14.040 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_1_1_lv_gid_idx on tbl_management_units_1_1_lv b_9 (cost=0.42..4.06 rows=1 width=302) (actual time=0.002..0.002 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
67. 0.000 0.000 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_1_proj_ee_gid_idx on tbl_management_units_1_proj_ee b_10 (cost=0.14..0.16 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
68. 0.000 0.000 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_1_proj_lt_gid_idx on tbl_management_units_1_proj_lt b_11 (cost=0.14..0.16 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
69. 0.000 0.000 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_1_proj_lv_gid_idx on tbl_management_units_1_proj_lv b_12 (cost=0.14..0.16 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
70. 7.020 7.020 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_3_0_gid_idx on tbl_management_units_3_0 b_13 (cost=0.15..0.19 rows=1 width=2,987) (actual time=0.001..0.001 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
71. 7.020 7.020 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_3_1_gid_idx on tbl_management_units_3_1 b_14 (cost=0.28..0.52 rows=1 width=2,854) (actual time=0.001..0.001 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
72. 0.000 0.000 ↓ 0.0 0 7,020

Index Scan using tbl_management_units_3_proj_gid_idx on tbl_management_units_3_proj b_15 (cost=0.14..0.16 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
73. 21.060 21.060 ↑ 1.0 1 7,020

Index Scan using tbl_management_units_sketches_gid_idx on tbl_management_units_sketches b_16 (cost=0.29..1.09 rows=1 width=588) (actual time=0.003..0.003 rows=1 loops=7,020)

  • Index Cond: (gid = tac.nogab_gid)
74. 0.567 17.387 ↓ 5.7 5,667 1

Hash (cost=10.25..10.25 rows=1,000 width=4) (actual time=17.387..17.387 rows=5,667 loops=1)

  • Buckets: 8,192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 264kB
75. 16.820 16.820 ↓ 5.7 5,667 1

Function Scan on f_ipasumi_query (cost=0.25..10.25 rows=1,000 width=4) (actual time=16.372..16.820 rows=5,667 loops=1)

Planning time : 8.210 ms
Execution time : 4,338.452 ms