explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jiEq

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 5,213.504 ↑ 3.6 5 1

Limit (cost=15,665,814.08..15,677,133.11 rows=18 width=6,134) (actual time=5,212.384..5,213.504 rows=5 loops=1)

2. 0.039 5,213.501 ↑ 3.6 5 1

Result (cost=15,665,814.08..15,677,133.11 rows=18 width=6,134) (actual time=5,212.381..5,213.501 rows=5 loops=1)

3. 0.019 5,212.019 ↑ 3.6 5 1

Sort (cost=15,665,814.08..15,665,814.12 rows=18 width=1,918) (actual time=5,212.018..5,212.019 rows=5 loops=1)

  • Sort Key: c.reception_date
  • Sort Method: quicksort Memory: 32kB
4. 0.027 5,212.000 ↑ 3.6 5 1

Nested Loop (cost=19,342.79..15,665,813.70 rows=18 width=1,918) (actual time=5,210.662..5,212.000 rows=5 loops=1)

5. 0.014 0.014 ↑ 1.0 1 1

Seq Scan on authority_abstract_t abstractau2_ (cost=0.00..1.85 rows=1 width=35) (actual time=0.009..0.014 rows=1 loops=1)

  • Filter: (id = 4)
  • Rows Removed by Filter: 67
6. 0.006 5,211.959 ↑ 3.6 5 1

Nested Loop Left Join (cost=19,342.79..15,665,811.18 rows=18 width=1,816) (actual time=5,210.640..5,211.959 rows=5 loops=1)

7. 0.102 5,211.918 ↑ 3.6 5 1

Nested Loop Left Join (cost=19,342.36..15,665,762.78 rows=18 width=1,816) (actual time=5,210.625..5,211.918 rows=5 loops=1)

  • Join Filter: (termdic.id = term.term_dictionary_id)
  • Rows Removed by Join Filter: 1172
8. 0.306 5,211.661 ↑ 3.6 5 1

Nested Loop Left Join (cost=19,342.36..15,665,691.39 rows=18 width=1,745) (actual time=5,210.570..5,211.661 rows=5 loops=1)

  • Join Filter: (term.id = tfc.term_id)
  • Rows Removed by Join Filter: 4087
9. 0.006 5,210.930 ↑ 3.6 5 1

Nested Loop Left Join (cost=19,342.36..15,665,427.68 rows=18 width=1,745) (actual time=5,210.536..5,210.930 rows=5 loops=1)

10. 0.244 5,210.874 ↑ 3.6 5 1

Nested Loop (cost=19,341.93..15,665,376.66 rows=18 width=1,737) (actual time=5,210.505..5,210.874 rows=5 loops=1)

  • Join Filter: (p.definition_id = pdt.id)
  • Rows Removed by Join Filter: 1470
11. 0.045 0.045 ↓ 1.0 295 1

Seq Scan on phase_definition_t pdt (cost=0.00..6.92 rows=292 width=18) (actual time=0.005..0.045 rows=295 loops=1)

12. 0.219 5,210.585 ↑ 3.6 5 295

Materialize (cost=19,341.93..15,665,290.94 rows=18 width=1,735) (actual time=15.559..17.663 rows=5 loops=295)

13. 1.038 5,210.366 ↑ 3.6 5 1

Nested Loop (cost=19,341.93..15,665,290.85 rows=18 width=1,735) (actual time=4,589.788..5,210.366 rows=5 loops=1)

14. 22.051 5,203.936 ↓ 9.6 1,348 1

Nested Loop Left Join (cost=19,341.50..15,664,110.80 rows=140 width=1,695) (actual time=61.960..5,203.936 rows=1,348 loops=1)

  • Join Filter: (c.version_id = vers.id)
  • Rows Removed by Join Filter: 248032
15. 4.313 5,171.101 ↓ 9.6 1,348 1

Nested Loop Left Join (cost=19,341.50..15,663,717.10 rows=140 width=1,596) (actual time=61.918..5,171.101 rows=1,348 loops=1)

  • Join Filter: (c.managing_authority_id = a.id)
  • Rows Removed by Join Filter: 36396
16. 1.517 5,165.440 ↓ 9.6 1,348 1

Nested Loop Left Join (cost=19,341.50..15,663,656.95 rows=140 width=556) (actual time=61.899..5,165.440 rows=1,348 loops=1)

17. 0.560 5,155.835 ↓ 9.6 1,348 1

Nested Loop Left Join (cost=19,341.07..15,662,472.55 rows=140 width=524) (actual time=61.884..5,155.835 rows=1,348 loops=1)

18. 0.689 5,151.231 ↓ 9.6 1,348 1

Nested Loop Left Join (cost=19,340.65..15,662,113.07 rows=140 width=349) (actual time=61.869..5,151.231 rows=1,348 loops=1)

19. 1.412 5,143.802 ↓ 9.6 1,348 1

Nested Loop Left Join (cost=19,340.22..15,660,957.72 rows=140 width=319) (actual time=61.852..5,143.802 rows=1,348 loops=1)

20. 1.526 5,141.042 ↓ 9.6 1,348 1

Nested Loop Left Join (cost=19,339.93..15,659,948.92 rows=140 width=295) (actual time=61.848..5,141.042 rows=1,348 loops=1)

21. 1.187 5,131.428 ↓ 9.6 1,348 1

Nested Loop Left Join (cost=19,339.50..15,659,461.58 rows=140 width=295) (actual time=61.830..5,131.428 rows=1,348 loops=1)

22. 1.573 5,122.153 ↓ 9.6 1,348 1

Nested Loop Left Join (cost=19,339.07..15,659,076.32 rows=140 width=295) (actual time=61.811..5,122.153 rows=1,348 loops=1)

23. 0.906 5,112.492 ↓ 9.6 1,348 1

Nested Loop Left Join (cost=19,338.64..15,658,686.21 rows=140 width=244) (actual time=61.794..5,112.492 rows=1,348 loops=1)

24. 1.202 5,104.846 ↓ 9.6 1,348 1

Nested Loop Left Join (cost=19,338.22..15,657,510.86 rows=140 width=228) (actual time=61.778..5,104.846 rows=1,348 loops=1)

25. 1.453 5,103.644 ↓ 9.6 1,348 1

Nested Loop (cost=19,337.78..15,657,129.93 rows=140 width=228) (actual time=61.776..5,103.644 rows=1,348 loops=1)

26. 0.902 5,094.103 ↓ 9.6 1,348 1

Nested Loop (cost=19,337.36..15,656,757.87 rows=140 width=220) (actual time=61.760..5,094.103 rows=1,348 loops=1)

27. 1.002 5,085.113 ↓ 9.6 1,348 1

Nested Loop Left Join (cost=19,336.93..15,655,598.52 rows=140 width=212) (actual time=61.746..5,085.113 rows=1,348 loops=1)

28. 1,517.117 5,077.371 ↓ 9.6 1,348 1

Bitmap Heap Scan on case_t c (cost=19,336.51..15,654,443.52 rows=140 width=202) (actual time=61.728..5,077.371 rows=1,348 loops=1)

  • Recheck Cond: (((case_type)::text = 'URBANISM'::text) AND (NOT deleted))
  • Filter: ((NOT a_new_version_exists) AND (f_unaccent(upper((SubPlan 18))) ~~ '%THOMAS%'::text))
  • Rows Removed by Filter: 437869
  • Heap Blocks: exact=24508
29. 52.702 52.702 ↓ 1.0 439,217 1

Bitmap Index Scan on case_unique_business_id_idx (cost=0.00..19,336.47 rows=438,339 width=0) (actual time=52.702..52.702 rows=439,217 loops=1)

  • Index Cond: ((case_type)::text = 'URBANISM'::text)
30.          

SubPlan (forBitmap Heap Scan)

31. 211.025 3,507.552 ↑ 1.0 1 438,444

Nested Loop Left Join (cost=1.56..35.34 rows=1 width=32) (actual time=0.007..0.008 rows=1 loops=438,444)

32. 211.025 3,069.108 ↑ 1.0 1 438,444

Nested Loop Left Join (cost=1.13..29.32 rows=1 width=8) (actual time=0.006..0.007 rows=1 loops=438,444)

33. 127.874 2,630.664 ↑ 1.0 1 438,444

Nested Loop (cost=0.85..29.00 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=438,444)

34. 1,753.776 1,753.776 ↑ 1.0 1 438,444

Index Scan using intervenor_case_idx on intervenor_t i_1 (cost=0.43..20.55 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=438,444)

  • Index Cond: (case_id = c.id)
  • Filter: ((((c.case_type)::text = ANY ('{URBANISM,GENERIC,ENVIRONMENT,ADMINISTRATIVE,SUBDIVISION,STATUTORY_PROVISIONING,GEN,PPAS,PAD}'::text[])) AND ((intervenor_role)::text = 'MANAGER_EXPERT'::text)) OR (((c.case_type)::text = ANY ('{REPORTING,INFRINGEMENT}'::text[])) AND ((intervenor_role)::text = 'INFRACTION_REPORTING_CONTROLLER_PU'::text)) OR (((c.case_type)::text = 'PEB'::text) AND ((intervenor_role)::text = 'MANAGER_PEB'::text)))
  • Rows Removed by Filter: 2
35. 749.014 749.014 ↑ 1.0 1 374,507

Index Scan using pk_intervening_user_t on intervening_user_t iu_1 (cost=0.42..8.45 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=374,507)

  • Index Cond: (id = i_1.id)
  • Filter: (on_behalf_of_authority_id = c.managing_authority_id)
  • Rows Removed by Filter: 0
36. 227.419 227.419 ↑ 1.0 1 227,419

Index Scan using pk_user_person_t on user_person_t up_1 (cost=0.28..0.30 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=227,419)

  • Index Cond: (id = iu_1.user_id)
37. 227.419 227.419 ↑ 1.0 1 227,419

Index Scan using pk_person_natural_t on person_natural_t p_1_1 (cost=0.42..6.00 rows=1 width=25) (actual time=0.001..0.001 rows=1 loops=227,419)

  • Index Cond: (id = up_1.abstract_person_id)
38. 6.740 6.740 ↑ 1.0 1 1,348

Index Scan using case_status_board_to_case_idx on case_status_board_t board (cost=0.42..8.24 rows=1 width=18) (actual time=0.005..0.005 rows=1 loops=1,348)

  • Index Cond: (c.id = case_id)
39. 8.088 8.088 ↑ 1.0 1 1,348

Index Scan using pk_configuration_t on configuration_t config (cost=0.42..8.27 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=1,348)

  • Index Cond: (id = c.configuration_id)
40. 8.088 8.088 ↑ 1.0 1 1,348

Index Scan using pk_phase_t on phase_t p (cost=0.43..2.65 rows=1 width=24) (actual time=0.006..0.006 rows=1 loops=1,348)

  • Index Cond: (id = config.current_phase_id)
41. 0.000 0.000 ↓ 0.0 0 1,348

Index Scan using pk_deadline_acm_t on deadline_acm_t d1 (cost=0.43..2.71 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=1,348)

  • Index Cond: (p.deadline_id = id)
42. 6.740 6.740 ↑ 1.0 1 1,348

Index Scan using geolocation__case_idx on geolocation_t g (cost=0.42..8.39 rows=1 width=24) (actual time=0.005..0.005 rows=1 loops=1,348)

  • Index Cond: (case_id = c.id)
43. 8.088 8.088 ↑ 1.0 1 1,348

Index Scan using pk_address_t on address_t ad (cost=0.43..2.78 rows=1 width=67) (actual time=0.006..0.006 rows=1 loops=1,348)

  • Index Cond: (id = g.target_principal_address_id)
44. 8.088 8.088 ↑ 1.0 1 1,348

Index Scan using geolocation_localization_context_geolocation_id_idx on geolocation_localization_context_t glc (cost=0.43..2.74 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=1,348)

  • Index Cond: (g.id = geolocation_id)
  • Filter: ((context_type)::text = 'TARGET'::text)
  • Rows Removed by Filter: 2
45. 8.088 8.088 ↑ 1.0 1 1,348

Index Only Scan using pk_localization_t on localization_t l (cost=0.43..3.47 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=1,348)

  • Index Cond: (id = glc.localization_id)
  • Heap Fetches: 1217
46. 1.348 1.348 ↓ 0.0 0 1,348

Index Scan using pk_environment_permit_request_t on environment_permit_request_t eprt (cost=0.29..7.20 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=1,348)

  • Index Cond: (c.id = id)
47. 6.740 6.740 ↑ 1.0 1 1,348

Index Scan using pk_permit_request_t on permit_request_t prt (cost=0.42..8.24 rows=1 width=38) (actual time=0.004..0.005 rows=1 loops=1,348)

  • Index Cond: (c.id = id)
48. 4.044 4.044 ↑ 1.0 1 1,348

Index Scan using pk_delivery_t on delivery_t del (cost=0.42..2.56 rows=1 width=191) (actual time=0.003..0.003 rows=1 loops=1,348)

  • Index Cond: (prt.delivery_id = id)
49. 8.088 8.088 ↑ 1.0 1 1,348

Index Scan using pk_reference_t on reference_t r (cost=0.43..8.45 rows=1 width=48) (actual time=0.006..0.006 rows=1 loops=1,348)

  • Index Cond: (c.main_reference_id = id)
50. 1.331 1.348 ↑ 1.0 28 1,348

Materialize (cost=0.00..1.42 rows=28 width=1,040) (actual time=0.000..0.001 rows=28 loops=1,348)

51. 0.017 0.017 ↑ 1.0 28 1

Seq Scan on authority_t a (cost=0.00..1.28 rows=28 width=1,040) (actual time=0.011..0.017 rows=28 loops=1)

52. 10.742 10.784 ↓ 1.0 185 1,348

Materialize (cost=0.00..7.76 rows=184 width=107) (actual time=0.000..0.008 rows=185 loops=1,348)

53. 0.042 0.042 ↓ 1.0 185 1

Seq Scan on version_t vers (cost=0.00..6.84 rows=184 width=107) (actual time=0.007..0.042 rows=185 loops=1)

54. 5.392 5.392 ↓ 0.0 0 1,348

Index Scan using pk_case_actor_authority on case_actor_authority_t actors1_ (cost=0.43..8.42 rows=1 width=40) (actual time=0.004..0.004 rows=0 loops=1,348)

  • Index Cond: ((case_id = c.id) AND (authority_abstract_id = 4))
55. 0.050 0.050 ↑ 1.0 1 5

Index Scan using term_for_case_pk on term_for_case_t tfc (cost=0.43..2.82 rows=1 width=24) (actual time=0.010..0.010 rows=1 loops=5)

  • Index Cond: (id = board.nearest_term_date_id)
56. 0.276 0.425 ↑ 1.1 818 5

Materialize (cost=0.00..25.37 rows=891 width=16) (actual time=0.003..0.085 rows=818 loops=5)

57. 0.149 0.149 ↑ 1.1 818 1

Seq Scan on term_t term (cost=0.00..20.91 rows=891 width=16) (actual time=0.011..0.149 rows=818 loops=1)

58. 0.091 0.155 ↑ 1.0 235 5

Materialize (cost=0.00..8.53 rows=235 width=87) (actual time=0.002..0.031 rows=235 loops=5)

59. 0.064 0.064 ↑ 1.0 235 1

Seq Scan on term_dictionary_t termdic (cost=0.00..7.35 rows=235 width=87) (actual time=0.008..0.064 rows=235 loops=1)

60. 0.035 0.035 ↑ 1.0 1 5

Index Scan using pk_deadline_acm_t on deadline_acm_t dacmterm (cost=0.43..2.68 rows=1 width=16) (actual time=0.007..0.007 rows=1 loops=5)

  • Index Cond: (id = tfc.deadline_id)
61.          

SubPlan (forResult)

62. 0.005 0.210 ↓ 0.0 0 5

Nested Loop (cost=1.70..38.39 rows=1 width=0) (actual time=0.042..0.042 rows=0 loops=5)

  • Join Filter: (intervp.person_id = pnat.id)
63. 0.010 0.175 ↑ 1.0 1 5

Nested Loop (cost=1.28..37.91 rows=1 width=16) (actual time=0.030..0.035 rows=1 loops=5)

64. 0.004 0.105 ↑ 1.0 1 5

Nested Loop (cost=0.85..37.36 rows=1 width=8) (actual time=0.018..0.021 rows=1 loops=5)

65. 0.035 0.035 ↑ 2.0 1 5

Index Scan using intervenor_case_idx on intervenor_t interv (cost=0.43..20.45 rows=2 width=8) (actual time=0.004..0.007 rows=1 loops=5)

  • Index Cond: (case_id = c.id)
  • Filter: is_primary
  • Rows Removed by Filter: 3
66. 0.066 0.066 ↑ 1.0 1 6

Index Scan using pk_intervening_person_t on intervening_person_t intervp (cost=0.42..8.45 rows=1 width=16) (actual time=0.011..0.011 rows=1 loops=6)

  • Index Cond: (id = interv.id)
  • Filter: ((intervening_person_context)::text = 'REQUESTER'::text)
67. 0.060 0.060 ↑ 1.0 1 5

Index Only Scan using pk_person_t on person_t pers (cost=0.42..0.53 rows=1 width=8) (actual time=0.011..0.012 rows=1 loops=5)

  • Index Cond: (id = intervp.person_id)
  • Heap Fetches: 5
68. 0.030 0.030 ↓ 0.0 0 5

Index Only Scan using pk_person_natural_t on person_natural_t pnat (cost=0.42..0.47 rows=1 width=8) (actual time=0.006..0.006 rows=0 loops=5)

  • Index Cond: (id = pers.id)
  • Heap Fetches: 1
69. 0.006 0.026 ↑ 1.0 1 1

Nested Loop (cost=1.70..38.40 rows=1 width=32) (actual time=0.018..0.026 rows=1 loops=1)

  • Join Filter: (intervp_1.person_id = pnat_1.id)
70. 0.001 0.018 ↑ 1.0 1 1

Nested Loop (cost=1.28..37.91 rows=1 width=16) (actual time=0.010..0.018 rows=1 loops=1)

71. 0.002 0.014 ↑ 1.0 1 1

Nested Loop (cost=0.85..37.36 rows=1 width=8) (actual time=0.007..0.014 rows=1 loops=1)

72. 0.009 0.009 ↑ 2.0 1 1

Index Scan using intervenor_case_idx on intervenor_t interv_1 (cost=0.43..20.45 rows=2 width=8) (actual time=0.002..0.009 rows=1 loops=1)

  • Index Cond: (case_id = c.id)
  • Filter: is_primary
  • Rows Removed by Filter: 4
73. 0.003 0.003 ↑ 1.0 1 1

Index Scan using pk_intervening_person_t on intervening_person_t intervp_1 (cost=0.42..8.45 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=1)

  • Index Cond: (id = interv_1.id)
  • Filter: ((intervening_person_context)::text = 'REQUESTER'::text)
74. 0.003 0.003 ↑ 1.0 1 1

Index Only Scan using pk_person_t on person_t pers_1 (cost=0.42..0.53 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=1)

  • Index Cond: (id = intervp_1.person_id)
  • Heap Fetches: 1
75. 0.002 0.002 ↑ 1.0 1 1

Index Scan using pk_person_natural_t on person_natural_t pnat_1 (cost=0.42..0.47 rows=1 width=25) (actual time=0.002..0.002 rows=1 loops=1)

  • Index Cond: (id = pers_1.id)
76. 0.020 0.128 ↑ 1.0 1 4

Nested Loop (cost=1.70..39.58 rows=1 width=32) (actual time=0.028..0.032 rows=1 loops=4)

  • Join Filter: (intervp_2.person_id = pleg.id)
77. 0.004 0.044 ↑ 1.0 1 4

Nested Loop (cost=1.28..37.91 rows=1 width=16) (actual time=0.008..0.011 rows=1 loops=4)

78. 0.006 0.032 ↑ 1.0 1 4

Nested Loop (cost=0.85..37.36 rows=1 width=8) (actual time=0.005..0.008 rows=1 loops=4)

79. 0.016 0.016 ↑ 2.0 1 4

Index Scan using intervenor_case_idx on intervenor_t interv_2 (cost=0.43..20.45 rows=2 width=8) (actual time=0.002..0.004 rows=1 loops=4)

  • Index Cond: (case_id = c.id)
  • Filter: is_primary
  • Rows Removed by Filter: 4
80. 0.010 0.010 ↑ 1.0 1 5

Index Scan using pk_intervening_person_t on intervening_person_t intervp_2 (cost=0.42..8.45 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=5)

  • Index Cond: (id = interv_2.id)
  • Filter: ((intervening_person_context)::text = 'REQUESTER'::text)
81. 0.008 0.008 ↑ 1.0 1 4

Index Only Scan using pk_person_t on person_t pers_2 (cost=0.42..0.53 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=4)

  • Index Cond: (id = intervp_2.person_id)
  • Heap Fetches: 4
82. 0.048 0.048 ↑ 1.0 1 4

Index Scan using pk_person_legal_t on person_legal_t pleg (cost=0.42..0.47 rows=1 width=33) (actual time=0.011..0.012 rows=1 loops=4)

  • Index Cond: (id = pers_2.id)
83.          

SubPlan (forNested Loop)

84. 0.016 0.016 ↑ 1.0 1 4

Seq Scan on juridical_form_t (cost=0.00..1.19 rows=1 width=516) (actual time=0.003..0.004 rows=1 loops=4)

  • Filter: (id = pleg.juridical_form_id)
  • Rows Removed by Filter: 14
85. 0.010 0.060 ↓ 0.0 0 5

Nested Loop (cost=1.70..38.39 rows=1 width=0) (actual time=0.012..0.012 rows=0 loops=5)

  • Join Filter: (intervp_3.person_id = pnat_2.id)
86. 0.000 0.045 ↑ 1.0 1 5

Nested Loop (cost=1.28..37.91 rows=1 width=16) (actual time=0.007..0.009 rows=1 loops=5)

87. 0.008 0.035 ↑ 1.0 1 5

Nested Loop (cost=0.85..37.36 rows=1 width=8) (actual time=0.005..0.007 rows=1 loops=5)

88. 0.015 0.015 ↑ 2.0 1 5

Index Scan using intervenor_case_idx on intervenor_t interv_3 (cost=0.43..20.45 rows=2 width=8) (actual time=0.002..0.003 rows=1 loops=5)

  • Index Cond: (case_id = c.id)
  • Filter: is_primary
  • Rows Removed by Filter: 3
89. 0.012 0.012 ↑ 1.0 1 6

Index Scan using pk_intervening_person_t on intervening_person_t intervp_3 (cost=0.42..8.45 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=6)

  • Index Cond: (id = interv_3.id)
  • Filter: ((intervening_person_context)::text = 'REQUESTER'::text)
90. 0.010 0.010 ↑ 1.0 1 5

Index Only Scan using pk_person_t on person_t pers_3 (cost=0.42..0.53 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=5)

  • Index Cond: (id = intervp_3.person_id)
  • Heap Fetches: 5
91. 0.005 0.005 ↓ 0.0 0 5

Index Only Scan using pk_person_natural_t on person_natural_t pnat_2 (cost=0.42..0.47 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=5)

  • Index Cond: (id = pers_3.id)
  • Heap Fetches: 1
92. 0.005 0.017 ↑ 1.0 1 1

Nested Loop (cost=1.70..38.40 rows=1 width=32) (actual time=0.014..0.017 rows=1 loops=1)

  • Join Filter: (intervp_4.person_id = pnat_3.id)
93. 0.000 0.011 ↑ 1.0 1 1

Nested Loop (cost=1.28..37.91 rows=1 width=16) (actual time=0.008..0.011 rows=1 loops=1)

94. 0.000 0.008 ↑ 1.0 1 1

Nested Loop (cost=0.85..37.36 rows=1 width=8) (actual time=0.006..0.008 rows=1 loops=1)

95. 0.004 0.004 ↑ 2.0 1 1

Index Scan using intervenor_case_idx on intervenor_t interv_4 (cost=0.43..20.45 rows=2 width=8) (actual time=0.002..0.004 rows=1 loops=1)

  • Index Cond: (case_id = c.id)
  • Filter: is_primary
  • Rows Removed by Filter: 4
96. 0.004 0.004 ↑ 1.0 1 1

Index Scan using pk_intervening_person_t on intervening_person_t intervp_4 (cost=0.42..8.45 rows=1 width=16) (actual time=0.003..0.004 rows=1 loops=1)

  • Index Cond: (id = interv_4.id)
  • Filter: ((intervening_person_context)::text = 'REQUESTER'::text)
97. 0.003 0.003 ↑ 1.0 1 1

Index Only Scan using pk_person_t on person_t pers_4 (cost=0.42..0.53 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=1)

  • Index Cond: (id = intervp_4.person_id)
  • Heap Fetches: 1
98. 0.001 0.001 ↑ 1.0 1 1

Index Scan using pk_person_natural_t on person_natural_t pnat_3 (cost=0.42..0.47 rows=1 width=25) (actual time=0.001..0.001 rows=1 loops=1)

  • Index Cond: (id = pers_4.id)
99. 0.024 0.072 ↑ 1.0 1 4

Nested Loop (cost=1.70..39.58 rows=1 width=32) (actual time=0.015..0.018 rows=1 loops=4)

  • Join Filter: (intervp_5.person_id = pleg_1.id)
100. 0.004 0.036 ↑ 1.0 1 4

Nested Loop (cost=1.28..37.91 rows=1 width=16) (actual time=0.006..0.009 rows=1 loops=4)

101. 0.002 0.028 ↑ 1.0 1 4

Nested Loop (cost=0.85..37.36 rows=1 width=8) (actual time=0.004..0.007 rows=1 loops=4)

102. 0.016 0.016 ↑ 2.0 1 4

Index Scan using intervenor_case_idx on intervenor_t interv_5 (cost=0.43..20.45 rows=2 width=8) (actual time=0.002..0.004 rows=1 loops=4)

  • Index Cond: (case_id = c.id)
  • Filter: is_primary
  • Rows Removed by Filter: 4
103. 0.010 0.010 ↑ 1.0 1 5

Index Scan using pk_intervening_person_t on intervening_person_t intervp_5 (cost=0.42..8.45 rows=1 width=16) (actual time=0.001..0.002 rows=1 loops=5)

  • Index Cond: (id = interv_5.id)
  • Filter: ((intervening_person_context)::text = 'REQUESTER'::text)
104. 0.004 0.004 ↑ 1.0 1 4

Index Only Scan using pk_person_t on person_t pers_5 (cost=0.42..0.53 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=4)

  • Index Cond: (id = intervp_5.person_id)
  • Heap Fetches: 4
105. 0.004 0.004 ↑ 1.0 1 4

Index Scan using pk_person_legal_t on person_legal_t pleg_1 (cost=0.42..0.47 rows=1 width=33) (actual time=0.001..0.001 rows=1 loops=4)

  • Index Cond: (id = pers_5.id)
106.          

SubPlan (forNested Loop)

107. 0.008 0.008 ↑ 1.0 1 4

Seq Scan on juridical_form_t juridical_form_t_1 (cost=0.00..1.19 rows=1 width=516) (actual time=0.002..0.002 rows=1 loops=4)

  • Filter: (id = pleg_1.juridical_form_id)
  • Rows Removed by Filter: 14
108. 0.010 0.090 ↑ 1.0 1 5

Nested Loop Left Join (cost=1.56..35.34 rows=1 width=32) (actual time=0.016..0.018 rows=1 loops=5)

109. 0.000 0.070 ↑ 1.0 1 5

Nested Loop Left Join (cost=1.13..29.32 rows=1 width=8) (actual time=0.012..0.014 rows=1 loops=5)

110. 0.006 0.060 ↑ 1.0 1 5

Nested Loop (cost=0.85..29.00 rows=1 width=8) (actual time=0.010..0.012 rows=1 loops=5)

111. 0.030 0.030 ↓ 2.0 2 5

Index Scan using intervenor_case_idx on intervenor_t i (cost=0.43..20.55 rows=1 width=8) (actual time=0.005..0.006 rows=2 loops=5)

  • Index Cond: (case_id = c.id)
  • Filter: ((((c.case_type)::text = ANY ('{URBANISM,GENERIC,ENVIRONMENT,ADMINISTRATIVE,SUBDIVISION,STATUTORY_PROVISIONING,GEN,PPAS,PAD}'::text[])) AND ((intervenor_role)::text = 'MANAGER_EXPERT'::text)) OR (((c.case_type)::text = ANY ('{REPORTING,INFRINGEMENT}'::text[])) AND ((intervenor_role)::text = 'INFRACTION_REPORTING_CONTROLLER_PU'::text)) OR (((c.case_type)::text = 'PEB'::text) AND ((intervenor_role)::text = 'MANAGER_PEB'::text)))
  • Rows Removed by Filter: 4
112. 0.024 0.024 ↑ 1.0 1 8

Index Scan using pk_intervening_user_t on intervening_user_t iu (cost=0.42..8.45 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=8)

  • Index Cond: (id = i.id)
  • Filter: (on_behalf_of_authority_id = c.managing_authority_id)
  • Rows Removed by Filter: 0
113. 0.010 0.010 ↑ 1.0 1 5

Index Scan using pk_user_person_t on user_person_t up (cost=0.28..0.30 rows=1 width=16) (actual time=0.001..0.002 rows=1 loops=5)

  • Index Cond: (id = iu.user_id)
114. 0.010 0.010 ↑ 1.0 1 5

Index Scan using pk_person_natural_t on person_natural_t p_1 (cost=0.42..6.00 rows=1 width=25) (actual time=0.002..0.002 rows=1 loops=5)

  • Index Cond: (id = up.abstract_person_id)
115. 0.005 0.185 ↑ 1.0 1 5

Limit (cost=0.43..45.09 rows=1 width=16) (actual time=0.037..0.037 rows=1 loops=5)

116. 0.180 0.180 ↑ 1.0 1 5

Index Scan using reference_case_idx on reference_t ref_muni (cost=0.43..45.09 rows=1 width=16) (actual time=0.036..0.036 rows=1 loops=5)

  • Index Cond: (external_id = c.id)
  • Filter: ((managing_authority_id = c.main_impacted_muni_id) AND (reference_type_id = 38))
  • Rows Removed by Filter: 9
117. 0.005 0.190 ↑ 1.0 1 5

Limit (cost=0.43..45.09 rows=1 width=16) (actual time=0.038..0.038 rows=1 loops=5)

118. 0.185 0.185 ↑ 1.0 1 5

Index Scan using reference_case_idx on reference_t ref_region (cost=0.43..45.09 rows=1 width=16) (actual time=0.037..0.037 rows=1 loops=5)

  • Index Cond: (external_id = c.id)
  • Filter: ((managing_authority_id = 20) AND (reference_type_id = 1))
  • Rows Removed by Filter: 12
119. 0.005 0.210 ↓ 0.0 0 5

Limit (cost=0.43..45.09 rows=1 width=16) (actual time=0.042..0.042 rows=0 loops=5)

120. 0.205 0.205 ↓ 0.0 0 5

Index Scan using reference_case_idx on reference_t ref_ibge (cost=0.43..45.09 rows=1 width=16) (actual time=0.041..0.041 rows=0 loops=5)

  • Index Cond: (external_id = c.id)
  • Filter: ((managing_authority_id = 21) AND (reference_type_id = 28))
  • Rows Removed by Filter: 29
121. 0.005 0.070 ↓ 0.0 0 5

Limit (cost=0.43..45.09 rows=1 width=16) (actual time=0.014..0.014 rows=0 loops=5)

122. 0.065 0.065 ↓ 0.0 0 5

Index Scan using reference_case_idx on reference_t ref_spec (cost=0.43..45.09 rows=1 width=16) (actual time=0.013..0.013 rows=0 loops=5)

  • Index Cond: (external_id = c.id)
  • Filter: ((managing_authority_id = 20) AND (reference_type_id = 50))
  • Rows Removed by Filter: 29
123. 0.005 0.035 ↑ 1.0 1 5

Limit (cost=0.43..45.09 rows=1 width=24) (actual time=0.006..0.007 rows=1 loops=5)

124. 0.030 0.030 ↑ 1.0 1 5

Index Scan using reference_case_idx on reference_t ref_muni_1 (cost=0.43..45.09 rows=1 width=24) (actual time=0.006..0.006 rows=1 loops=5)

  • Index Cond: (external_id = c.id)
  • Filter: ((managing_authority_id = c.main_impacted_muni_id) AND (reference_type_id = 38))
  • Rows Removed by Filter: 9
125. 0.000 0.035 ↑ 1.0 1 5

Limit (cost=0.43..45.09 rows=1 width=24) (actual time=0.007..0.007 rows=1 loops=5)

126. 0.035 0.035 ↑ 1.0 1 5

Index Scan using reference_case_idx on reference_t ref_region_1 (cost=0.43..45.09 rows=1 width=24) (actual time=0.007..0.007 rows=1 loops=5)

  • Index Cond: (external_id = c.id)
  • Filter: ((managing_authority_id = 20) AND (reference_type_id = 1))
  • Rows Removed by Filter: 12
127. 0.000 0.055 ↓ 0.0 0 5

Limit (cost=0.43..45.09 rows=1 width=24) (actual time=0.011..0.011 rows=0 loops=5)

128. 0.055 0.055 ↓ 0.0 0 5

Index Scan using reference_case_idx on reference_t ref_ibge_1 (cost=0.43..45.09 rows=1 width=24) (actual time=0.011..0.011 rows=0 loops=5)

  • Index Cond: (external_id = c.id)
  • Filter: ((managing_authority_id = 21) AND (reference_type_id = 28))
  • Rows Removed by Filter: 29
129. 0.005 0.060 ↓ 0.0 0 5

Limit (cost=0.43..45.09 rows=1 width=24) (actual time=0.012..0.012 rows=0 loops=5)

130. 0.055 0.055 ↓ 0.0 0 5

Index Scan using reference_case_idx on reference_t ref_spec_1 (cost=0.43..45.09 rows=1 width=24) (actual time=0.011..0.011 rows=0 loops=5)

  • Index Cond: (external_id = c.id)
  • Filter: ((managing_authority_id = 20) AND (reference_type_id = 50))
  • Rows Removed by Filter: 29
Planning time : 43.786 ms