explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wMBs

Settings
# exclusive inclusive rows x rows loops node
1. 0.194 0.640 ↓ 53.0 53 1

Seq Scan on operation_registration (cost=3.50..618.94 rows=1 width=103) (actual time=0.170..0.640 rows=53 loops=1)

  • Filter: (($4 = 'admin'::text) AND ((SubPlan 9) <@ ANY ($15)))
  • Rows Removed by Filter: 145
2.          

Initplan (forSeq Scan)

3. 0.000 0.032 ↑ 3.0 1 1

Subquery Scan on whoami (cost=0.85..0.99 rows=3 width=32) (actual time=0.019..0.032 rows=1 loops=1)

4. 0.001 0.032 ↑ 3.0 1 1

Result (cost=0.85..0.96 rows=3 width=80) (actual time=0.019..0.032 rows=1 loops=1)

5.          

CTE admin

6. 0.004 0.018 ↑ 1.0 1 1

Nested Loop (cost=0.15..0.60 rows=1 width=64) (actual time=0.015..0.018 rows=1 loops=1)

7. 0.009 0.009 ↑ 1.0 1 1

Seq Scan on response_area_user (cost=0.00..0.24 rows=1 width=16) (actual time=0.007..0.009 rows=1 loops=1)

  • Filter: ((role = 'admin'::text) AND (id = (current_setting('request.jwt.claim.user_id'::text, true))::uuid))
  • Rows Removed by Filter: 6
8. 0.005 0.005 ↑ 1.0 1 1

Index Scan using response_area_pkey on response_area (cost=0.15..0.37 rows=1 width=48) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (id = response_area_user.response_area_id)
9.          

CTE clerk

10. 0.009 0.009 ↓ 0.0 0 1

Seq Scan on response_area_user response_area_user_1 (cost=0.00..0.24 rows=1 width=102) (actual time=0.009..0.009 rows=0 loops=1)

  • Filter: ((role = ANY ('{clerk,testing}'::text[])) AND (id = (current_setting('request.jwt.claim.user_id'::text, true))::uuid))
  • Rows Removed by Filter: 7
11.          

CTE anonymous

12. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=64) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: (current_setting('request.jwt.claim.role'::text, true) = 'anonymous'::text)
13. 0.000 0.031 ↑ 3.0 1 1

Append (cost=0.00..0.07 rows=3 width=32) (actual time=0.018..0.031 rows=1 loops=1)

14. 0.020 0.020 ↑ 1.0 1 1

CTE Scan on admin (cost=0.00..0.02 rows=1 width=32) (actual time=0.017..0.020 rows=1 loops=1)

15. 0.009 0.009 ↓ 0.0 0 1

CTE Scan on clerk (cost=0.00..0.02 rows=1 width=32) (actual time=0.009..0.009 rows=0 loops=1)

16. 0.002 0.002 ↓ 0.0 0 1

CTE Scan on anonymous (cost=0.00..0.02 rows=1 width=32) (actual time=0.002..0.002 rows=0 loops=1)

17. 0.001 0.018 ↑ 300.0 1 1

ProjectSet (cost=0.85..2.51 rows=300 width=32) (actual time=0.008..0.018 rows=1 loops=1)

18. 0.001 0.017 ↑ 3.0 1 1

Result (cost=0.85..0.96 rows=3 width=80) (actual time=0.007..0.017 rows=1 loops=1)

19.          

CTE admin

20. 0.001 0.007 ↑ 1.0 1 1

Nested Loop (cost=0.15..0.60 rows=1 width=64) (actual time=0.006..0.007 rows=1 loops=1)

21. 0.004 0.004 ↑ 1.0 1 1

Seq Scan on response_area_user response_area_user_4 (cost=0.00..0.24 rows=1 width=16) (actual time=0.003..0.004 rows=1 loops=1)

  • Filter: ((role = 'admin'::text) AND (id = (current_setting('request.jwt.claim.user_id'::text, true))::uuid))
  • Rows Removed by Filter: 6
22. 0.002 0.002 ↑ 1.0 1 1

Index Scan using response_area_pkey on response_area response_area_2 (cost=0.15..0.37 rows=1 width=48) (actual time=0.002..0.002 rows=1 loops=1)

  • Index Cond: (id = response_area_user_4.response_area_id)
23.          

CTE clerk

24. 0.007 0.007 ↓ 0.0 0 1

Seq Scan on response_area_user response_area_user_5 (cost=0.00..0.24 rows=1 width=102) (actual time=0.007..0.007 rows=0 loops=1)

  • Filter: ((role = ANY ('{clerk,testing}'::text[])) AND (id = (current_setting('request.jwt.claim.user_id'::text, true))::uuid))
  • Rows Removed by Filter: 7
25.          

CTE anonymous

26. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=64) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: (current_setting('request.jwt.claim.role'::text, true) = 'anonymous'::text)
27. 0.000 0.016 ↑ 3.0 1 1

Append (cost=0.00..0.07 rows=3 width=32) (actual time=0.007..0.016 rows=1 loops=1)

28. 0.008 0.008 ↑ 1.0 1 1

CTE Scan on admin admin_2 (cost=0.00..0.02 rows=1 width=32) (actual time=0.007..0.008 rows=1 loops=1)

29. 0.007 0.007 ↓ 0.0 0 1

CTE Scan on clerk clerk_2 (cost=0.00..0.02 rows=1 width=32) (actual time=0.007..0.007 rows=0 loops=1)

30. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on anonymous anonymous_2 (cost=0.00..0.02 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=1)

31.          

SubPlan (forSeq Scan)

32. 0.375 0.396 ↓ 0.0 0 198

Index Scan using address_element_pkey on address_element (cost=2.79..3.02 rows=1 width=45) (actual time=0.002..0.002 rows=0 loops=198)

  • Index Cond: (operation_registration.site_address_id = id)
  • Filter: (division_code <@ ANY ($10))
  • Rows Removed by Filter: 1
33.          

Initplan (forIndex Scan)

34. 0.002 0.021 ↑ 300.0 1 1

ProjectSet (cost=0.85..2.51 rows=300 width=32) (actual time=0.010..0.021 rows=1 loops=1)

35. 0.001 0.019 ↑ 3.0 1 1

Result (cost=0.85..0.96 rows=3 width=80) (actual time=0.008..0.019 rows=1 loops=1)

36.          

CTE admin

37. 0.002 0.008 ↑ 1.0 1 1

Nested Loop (cost=0.15..0.60 rows=1 width=64) (actual time=0.006..0.008 rows=1 loops=1)

38. 0.004 0.004 ↑ 1.0 1 1

Seq Scan on response_area_user response_area_user_2 (cost=0.00..0.24 rows=1 width=16) (actual time=0.003..0.004 rows=1 loops=1)

  • Filter: ((role = 'admin'::text) AND (id = (current_setting('request.jwt.claim.user_id'::text, true))::uuid))
  • Rows Removed by Filter: 6
39. 0.002 0.002 ↑ 1.0 1 1

Index Scan using response_area_pkey on response_area response_area_1 (cost=0.15..0.37 rows=1 width=48) (actual time=0.002..0.002 rows=1 loops=1)

  • Index Cond: (id = response_area_user_2.response_area_id)
40.          

CTE clerk

41. 0.007 0.007 ↓ 0.0 0 1

Seq Scan on response_area_user response_area_user_3 (cost=0.00..0.24 rows=1 width=102) (actual time=0.007..0.007 rows=0 loops=1)

  • Filter: ((role = ANY ('{clerk,testing}'::text[])) AND (id = (current_setting('request.jwt.claim.user_id'::text, true))::uuid))
  • Rows Removed by Filter: 7
42.          

CTE anonymous

43. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.01..0.01 rows=1 width=64) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: (current_setting('request.jwt.claim.role'::text, true) = 'anonymous'::text)
44. 0.000 0.018 ↑ 3.0 1 1

Append (cost=0.00..0.07 rows=3 width=32) (actual time=0.007..0.018 rows=1 loops=1)

45. 0.009 0.009 ↑ 1.0 1 1

CTE Scan on admin admin_1 (cost=0.00..0.02 rows=1 width=32) (actual time=0.007..0.009 rows=1 loops=1)

46. 0.008 0.008 ↓ 0.0 0 1

CTE Scan on clerk clerk_1 (cost=0.00..0.02 rows=1 width=32) (actual time=0.008..0.008 rows=0 loops=1)

47. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on anonymous anonymous_1 (cost=0.00..0.02 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=1)

Planning time : 1.239 ms
Execution time : 0.766 ms