explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xEp9E

Settings
# exclusive inclusive rows x rows loops node
1. 40.997 210.630 ↓ 171.0 44,116 1

Hash Right Join (cost=50,693.00..96,196.73 rows=258 width=113) (actual time=145.836..210.630 rows=44,116 loops=1)

  • Output: w.team_member_ids[1], CASE w.status WHEN 'STARTED'::workflow_status THEN ((((('/records/'::text || insecure_transition_events.record_type) || '/'::text) || (insecure_transition_events.record_id)::text) || '/workflows/'::text) || w.workflow_template_api_name) ELSE NULL::text END, w.status, insecure_transition_events.record_type, insecure_transition_events.workflow_template_api_name, insecure_transition_events.record_id, insecure_transition_events."timestamp", insecure_transition_events.from_stage, insecure_transition_events.to_stage
  • Hash Cond: ((w_1.record_type = insecure_transition_events.record_type) AND (w_1.workflow_template_api_name = insecure_transition_events.workflow_template_api_name) AND (w_1.record_id = insecure_transition_events.record_id) AND (w_1.stage_api_name = insecure_transition_events.to_stage))
2. 9.182 23.879 ↓ 4.1 19,403 1

Nested Loop (cost=0.71..45,403.60 rows=4,784 width=41) (actual time=0.040..23.879 rows=19,403 loops=1)

  • Output: w_1.record_type, w_1.workflow_template_api_name, w_1.record_id, w_1.stage_api_name
3. 0.067 0.067 ↓ 3.5 14 1

Index Scan using insecure_workflow_templates_organization_id_record_type_sub_idx on records.insecure_workflow_templates wt_1 (cost=0.29..45,349.91 rows=4 width=64) (actual time=0.021..0.067 rows=14 loops=1)

  • Output: wt_1.record_type, wt_1.api_name
  • Index Cond: (wt_1.organization_id = (current_setting('lanetix.organization_id'::text))::integer)
  • Filter: (((current_setting('lanetix.permissions'::text))::text[] && '{customer-administrator,lanetix-staff}'::text[]) OR (SubPlan 12))
4.          

SubPlan (for Index Scan)

5. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=5,662.12..6,299.15 rows=249 width=0) (never executed)

  • Filter: ((COALESCE((CASE WHEN NULLIF((NOT users_3.active), false) THEN 'archived'::group_status ELSE NULL::group_status END), g_3.status) <> 'principal'::group_status) OR (alternatives: SubPlan 7 or hashed SubPlan 8))
6.          

Initplan (for Nested Loop Left Join)

7. 0.000 0.000 ↓ 0.0 0

Merge Left Join (cost=4,790.53..5,660.94 rows=103 width=4) (never executed)

  • Output: g_2.id
  • Merge Cond: (g_2.id = insecure_temp_user_group_8.group_id)
  • Filter: (COALESCE((CASE WHEN NULLIF((NOT users_2.active), false) THEN 'archived'::group_status ELSE NULL::group_status END), g_2.status) = 'everyone'::group_status)
8. 0.000 0.000 ↓ 0.0 0

Index Scan using insecure_temp_group_pkey on records.insecure_temp_group g_2 (cost=0.29..503.28 rows=3,205 width=8) (never executed)

  • Output: g_2.organization_id, g_2.id, g_2.status, g_2.name, g_2.description, g_2.reference_metadata
  • Index Cond: (g_2.organization_id = (current_setting('lanetix.organization_id'::text))::integer)
9. 0.000 0.000 ↓ 0.0 0

Sort (cost=4,790.23..4,796.91 rows=2,672 width=8) (never executed)

  • Output: insecure_temp_user_group_8.group_id, (CASE WHEN NULLIF((NOT users_2.active), false) THEN 'archived'::group_status ELSE NULL::group_status END)
  • Sort Key: insecure_temp_user_group_8.group_id
10. 0.000 0.000 ↓ 0.0 0

Hash Right Join (cost=156.73..4,638.15 rows=2,672 width=8) (never executed)

  • Output: insecure_temp_user_group_8.group_id, (CASE WHEN NULLIF((NOT users_2.active), false) THEN 'archived'::group_status ELSE NULL::group_status END)
  • Hash Cond: (users_2.id = insecure_temp_user_group_8.user_id)
11. 0.000 0.000 ↓ 0.0 0

Index Scan using users_organization_id on public.users users_2 (cost=0.29..4,467.44 rows=2,953 width=8) (never executed)

  • Output: users_2.id, CASE WHEN NULLIF((NOT users_2.active), false) THEN 'archived'::group_status ELSE NULL::group_status END
  • Index Cond: (users_2.organization_id = (current_setting('lanetix.organization_id'::text))::integer)
12. 0.000 0.000 ↓ 0.0 0

Hash (cost=123.03..123.03 rows=2,672 width=8) (never executed)

  • Output: insecure_temp_user_group_8.group_id, insecure_temp_user_group_8.user_id
13. 0.000 0.000 ↓ 0.0 0

Index Only Scan using insecure_temp_user_group_organization_id_user_id_group_id_idx on records.insecure_temp_user_group insecure_temp_user_group_8 (cost=0.29..123.03 rows=2,672 width=8) (never executed)

  • Output: insecure_temp_user_group_8.group_id, insecure_temp_user_group_8.user_id
  • Index Cond: (insecure_temp_user_group_8.organization_id = (current_setting('lanetix.organization_id'::text))::integer)
  • Heap Fetches: 0
14. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.60..137.56 rows=39 width=8) (never executed)

  • Output: g_3.id, g_3.status
15. 0.000 0.000 ↓ 0.0 0

Index Scan using insecure_temp_group_permissio_organization_id_schema_permis_idx on records.insecure_temp_group_permission p_1 (cost=0.31..129.23 rows=1 width=4) (never executed)

  • Output: p_1.organization_id, p_1.schema, p_1.group_id, p_1.permission
  • Index Cond: ((p_1.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (p_1.schema = 'records'::text) AND (p_1.permission = (((('recordType'::ltree || (wt_1.record_type)::ltree) || 'workflow'::ltree) || ("substring"(lower(wt_1.api_name), 1, 31))::ltree) || 'permissions.read'::ltree)))
  • Filter: ((p_1.group_id = $14) OR (alternatives: SubPlan 10 or hashed SubPlan 11))
16.          

SubPlan (for Index Scan)

17. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.72..120.90 rows=1 width=0) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Index Only Scan using insecure_temp_user_group_organization_id_user_id_group_id_idx on records.insecure_temp_user_group insecure_temp_user_group_9 (cost=0.30..8.32 rows=1 width=4) (never executed)

  • Output: insecure_temp_user_group_9.organization_id, insecure_temp_user_group_9.user_id, insecure_temp_user_group_9.group_id
  • Index Cond: ((insecure_temp_user_group_9.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (insecure_temp_user_group_9.user_id = (current_setting('lanetix.user_id'::text))::integer))
  • Heap Fetches: 0
19. 0.000 0.000 ↓ 0.0 0

Index Scan using organization_id_descendent_id on records.insecure_temp_group_closure insecure_temp_group_closure_2 (cost=0.42..112.57 rows=1 width=4) (never executed)

  • Output: insecure_temp_group_closure_2.organization_id, insecure_temp_group_closure_2.ancestor_id, insecure_temp_group_closure_2.descendent_id
  • Index Cond: ((insecure_temp_group_closure_2.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (insecure_temp_group_closure_2.descendent_id = insecure_temp_user_group_9.group_id))
  • Filter: (insecure_temp_group_closure_2.ancestor_id = p_1.group_id)
20. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.72..121.16 rows=202 width=4) (never executed)

  • Output: insecure_temp_group_closure_3.ancestor_id
21. 0.000 0.000 ↓ 0.0 0

Index Only Scan using insecure_temp_user_group_organization_id_user_id_group_id_idx on records.insecure_temp_user_group insecure_temp_user_group_10 (cost=0.30..8.32 rows=1 width=4) (never executed)

  • Output: insecure_temp_user_group_10.organization_id, insecure_temp_user_group_10.user_id, insecure_temp_user_group_10.group_id
  • Index Cond: ((insecure_temp_user_group_10.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (insecure_temp_user_group_10.user_id = (current_setting('lanetix.user_id'::text))::integer))
  • Heap Fetches: 0
22. 0.000 0.000 ↓ 0.0 0

Index Scan using organization_id_descendent_id on records.insecure_temp_group_closure insecure_temp_group_closure_3 (cost=0.42..112.48 rows=36 width=8) (never executed)

  • Output: insecure_temp_group_closure_3.organization_id, insecure_temp_group_closure_3.ancestor_id, insecure_temp_group_closure_3.descendent_id
  • Index Cond: ((insecure_temp_group_closure_3.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (insecure_temp_group_closure_3.descendent_id = insecure_temp_user_group_10.group_id))
23. 0.000 0.000 ↓ 0.0 0

Index Scan using insecure_temp_group_pkey on records.insecure_temp_group g_3 (cost=0.29..8.31 rows=1 width=8) (never executed)

  • Output: g_3.organization_id, g_3.id, g_3.status, g_3.name, g_3.description, g_3.reference_metadata
  • Index Cond: ((g_3.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (g_3.id = p_1.group_id))
24. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.58..4.51 rows=1 width=8) (never executed)

  • Output: insecure_temp_user_group_11.group_id, (CASE WHEN NULLIF((NOT users_3.active), false) THEN 'archived'::group_status ELSE NULL::group_status END)
25. 0.000 0.000 ↓ 0.0 0

Index Scan using insecure_temp_user_group_organization_id_group_id_idx on records.insecure_temp_user_group insecure_temp_user_group_11 (cost=0.29..0.40 rows=1 width=8) (never executed)

  • Output: insecure_temp_user_group_11.organization_id, insecure_temp_user_group_11.user_id, insecure_temp_user_group_11.group_id
  • Index Cond: ((insecure_temp_user_group_11.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (insecure_temp_user_group_11.group_id = g_3.id))
26. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on public.users users_3 (cost=0.29..4.10 rows=1 width=8) (never executed)

  • Output: users_3.id, CASE WHEN NULLIF((NOT users_3.active), false) THEN 'archived'::group_status ELSE NULL::group_status END
  • Index Cond: (users_3.id = insecure_temp_user_group_11.user_id)
  • Filter: (users_3.organization_id = (current_setting('lanetix.organization_id'::text))::integer)
27.          

SubPlan (for Nested Loop Left Join)

28. 0.000 0.000 ↓ 0.0 0

Index Only Scan using insecure_temp_user_group_organization_id_group_id_idx on records.insecure_temp_user_group insecure_temp_user_group_6 (cost=0.29..8.31 rows=1 width=0) (never executed)

  • Index Cond: ((insecure_temp_user_group_6.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (insecure_temp_user_group_6.group_id = g_3.id))
  • Heap Fetches: 0
29. 0.000 0.000 ↓ 0.0 0

Index Only Scan using insecure_temp_user_group_organization_id_group_id_idx on records.insecure_temp_user_group insecure_temp_user_group_7 (cost=0.29..111.03 rows=2,672 width=4) (never executed)

  • Output: insecure_temp_user_group_7.group_id
  • Index Cond: (insecure_temp_user_group_7.organization_id = (current_setting('lanetix.organization_id'::text))::integer)
  • Heap Fetches: 0
30. 14.630 14.630 ↓ 1,386.0 1,386 14

Index Scan using insecure_workflows_pkey on records.insecure_workflows w_1 (cost=0.43..13.41 rows=1 width=41) (actual time=0.008..1.045 rows=1,386 loops=14)

  • Output: w_1.organization_id, w_1.record_type, w_1.workflow_template_api_name, w_1.record_id, w_1.stage_api_name, w_1.team_member_ids, w_1.status, w_1.planning_input_date, w_1.enable_auto_replanning, w_1.enable_workflow_planning, w_1.timezone
  • Index Cond: ((w_1.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (w_1.record_type = wt_1.record_type) AND (w_1.workflow_template_api_name = wt_1.api_name))
31. 29.209 145.754 ↓ 171.0 44,116 1

Hash (cost=50,687.12..50,687.12 rows=258 width=120) (actual time=145.754..145.754 rows=44,116 loops=1)

  • Output: insecure_transition_events.record_type, insecure_transition_events.record_id, insecure_transition_events.workflow_template_api_name, insecure_transition_events."timestamp", insecure_transition_events.from_stage, insecure_transition_events.to_stage, w.team_member_ids, w.status, w.workflow_template_api_name
  • Buckets: 65536 (originally 1024) Batches: 2 (originally 1) Memory Usage: 6479kB
32. 42.039 116.545 ↓ 171.0 44,116 1

Merge Join (cost=45,696.55..50,687.12 rows=258 width=120) (actual time=39.887..116.545 rows=44,116 loops=1)

  • Output: insecure_transition_events.record_type, insecure_transition_events.record_id, insecure_transition_events.workflow_template_api_name, insecure_transition_events."timestamp", insecure_transition_events.from_stage, insecure_transition_events.to_stage, w.team_member_ids, w.status, w.workflow_template_api_name
  • Merge Cond: ((insecure_transition_events.record_type = wt.record_type) AND (insecure_transition_events.record_id = w.record_id))
  • Join Filter: (wt.api_name = insecure_transition_events.workflow_template_api_name)
  • Rows Removed by Join Filter: 3291
33. 23.263 23.263 ↓ 1.1 44,116 1

Index Only Scan using insecure_transition_events_pkey on records.insecure_transition_events (cost=0.56..4,752.43 rows=40,524 width=73) (actual time=0.023..23.263 rows=44,116 loops=1)

  • Output: insecure_transition_events.organization_id, insecure_transition_events.record_type, insecure_transition_events.record_id, insecure_transition_events.from_stage, insecure_transition_events.to_stage, insecure_transition_events.workflow_template_api_name, insecure_transition_events."timestamp
  • Index Cond: (insecure_transition_events.organization_id = (current_setting('lanetix.organization_id'::text))::integer)
  • Heap Fetches: 8893
34. 25.396 51.243 ↓ 9.9 47,407 1

Sort (cost=45,696.00..45,707.96 rows=4,784 width=124) (actual time=39.858..51.243 rows=47,407 loops=1)

  • Output: w.team_member_ids, w.status, w.workflow_template_api_name, w.record_type, w.record_id, wt.record_type, wt.api_name
  • Sort Key: w.record_type, w.record_id
  • Sort Method: quicksort Memory: 3577kB
35. 9.980 25.847 ↓ 4.1 19,403 1

Nested Loop (cost=0.71..45,403.60 rows=4,784 width=124) (actual time=0.037..25.847 rows=19,403 loops=1)

  • Output: w.team_member_ids, w.status, w.workflow_template_api_name, w.record_type, w.record_id, wt.record_type, wt.api_name
36. 0.061 0.061 ↓ 3.5 14 1

Index Only Scan using insecure_workflow_templates_pkey on records.insecure_workflow_templates wt (cost=0.29..45,349.91 rows=4 width=64) (actual time=0.017..0.061 rows=14 loops=1)

  • Output: wt.organization_id, wt.record_type, wt.api_name
  • Index Cond: (wt.organization_id = (current_setting('lanetix.organization_id'::text))::integer)
  • Filter: (((current_setting('lanetix.permissions'::text))::text[] && '{customer-administrator,lanetix-staff}'::text[]) OR (SubPlan 6))
  • Heap Fetches: 14
37.          

SubPlan (for Index Only Scan)

38. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=5,662.12..6,299.15 rows=249 width=0) (never executed)

  • Filter: ((COALESCE((CASE WHEN NULLIF((NOT users_1.active), false) THEN 'archived'::group_status ELSE NULL::group_status END), g_1.status) <> 'principal'::group_status) OR (alternatives: SubPlan 1 or hashed SubPlan 2))
39.          

Initplan (for Nested Loop Left Join)

40. 0.000 0.000 ↓ 0.0 0

Merge Left Join (cost=4,790.53..5,660.94 rows=103 width=4) (never executed)

  • Output: g.id
  • Merge Cond: (g.id = insecure_temp_user_group_2.group_id)
  • Filter: (COALESCE((CASE WHEN NULLIF((NOT users.active), false) THEN 'archived'::group_status ELSE NULL::group_status END), g.status) = 'everyone'::group_status)
41. 0.000 0.000 ↓ 0.0 0

Index Scan using insecure_temp_group_pkey on records.insecure_temp_group g (cost=0.29..503.28 rows=3,205 width=8) (never executed)

  • Output: g.organization_id, g.id, g.status, g.name, g.description, g.reference_metadata
  • Index Cond: (g.organization_id = (current_setting('lanetix.organization_id'::text))::integer)
42. 0.000 0.000 ↓ 0.0 0

Sort (cost=4,790.23..4,796.91 rows=2,672 width=8) (never executed)

  • Output: insecure_temp_user_group_2.group_id, (CASE WHEN NULLIF((NOT users.active), false) THEN 'archived'::group_status ELSE NULL::group_status END)
  • Sort Key: insecure_temp_user_group_2.group_id
43. 0.000 0.000 ↓ 0.0 0

Hash Right Join (cost=156.73..4,638.15 rows=2,672 width=8) (never executed)

  • Output: insecure_temp_user_group_2.group_id, (CASE WHEN NULLIF((NOT users.active), false) THEN 'archived'::group_status ELSE NULL::group_status END)
  • Hash Cond: (users.id = insecure_temp_user_group_2.user_id)
44. 0.000 0.000 ↓ 0.0 0

Index Scan using users_organization_id on public.users (cost=0.29..4,467.44 rows=2,953 width=8) (never executed)

  • Output: users.id, CASE WHEN NULLIF((NOT users.active), false) THEN 'archived'::group_status ELSE NULL::group_status END
  • Index Cond: (users.organization_id = (current_setting('lanetix.organization_id'::text))::integer)
45. 0.000 0.000 ↓ 0.0 0

Hash (cost=123.03..123.03 rows=2,672 width=8) (never executed)

  • Output: insecure_temp_user_group_2.group_id, insecure_temp_user_group_2.user_id
46. 0.000 0.000 ↓ 0.0 0

Index Only Scan using insecure_temp_user_group_organization_id_user_id_group_id_idx on records.insecure_temp_user_group insecure_temp_user_group_2 (cost=0.29..123.03 rows=2,672 width=8) (never executed)

  • Output: insecure_temp_user_group_2.group_id, insecure_temp_user_group_2.user_id
  • Index Cond: (insecure_temp_user_group_2.organization_id = (current_setting('lanetix.organization_id'::text))::integer)
  • Heap Fetches: 0
47. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.60..137.56 rows=39 width=8) (never executed)

  • Output: g_1.id, g_1.status
48. 0.000 0.000 ↓ 0.0 0

Index Scan using insecure_temp_group_permissio_organization_id_schema_permis_idx on records.insecure_temp_group_permission p (cost=0.31..129.23 rows=1 width=4) (never executed)

  • Output: p.organization_id, p.schema, p.group_id, p.permission
  • Index Cond: ((p.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (p.schema = 'records'::text) AND (p.permission = (((('recordType'::ltree || (wt.record_type)::ltree) || 'workflow'::ltree) || ("substring"(lower(wt.api_name), 1, 31))::ltree) || 'permissions.read'::ltree)))
  • Filter: ((p.group_id = $2) OR (alternatives: SubPlan 4 or hashed SubPlan 5))
49.          

SubPlan (for Index Scan)

50. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.72..120.90 rows=1 width=0) (never executed)

51. 0.000 0.000 ↓ 0.0 0

Index Only Scan using insecure_temp_user_group_organization_id_user_id_group_id_idx on records.insecure_temp_user_group insecure_temp_user_group_3 (cost=0.30..8.32 rows=1 width=4) (never executed)

  • Output: insecure_temp_user_group_3.organization_id, insecure_temp_user_group_3.user_id, insecure_temp_user_group_3.group_id
  • Index Cond: ((insecure_temp_user_group_3.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (insecure_temp_user_group_3.user_id = (current_setting('lanetix.user_id'::text))::integer))
  • Heap Fetches: 0
52. 0.000 0.000 ↓ 0.0 0

Index Scan using organization_id_descendent_id on records.insecure_temp_group_closure (cost=0.42..112.57 rows=1 width=4) (never executed)

  • Output: insecure_temp_group_closure.organization_id, insecure_temp_group_closure.ancestor_id, insecure_temp_group_closure.descendent_id
  • Index Cond: ((insecure_temp_group_closure.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (insecure_temp_group_closure.descendent_id = insecure_temp_user_group_3.group_id))
  • Filter: (insecure_temp_group_closure.ancestor_id = p.group_id)
53. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.72..121.16 rows=202 width=4) (never executed)

  • Output: insecure_temp_group_closure_1.ancestor_id
54. 0.000 0.000 ↓ 0.0 0

Index Only Scan using insecure_temp_user_group_organization_id_user_id_group_id_idx on records.insecure_temp_user_group insecure_temp_user_group_4 (cost=0.30..8.32 rows=1 width=4) (never executed)

  • Output: insecure_temp_user_group_4.organization_id, insecure_temp_user_group_4.user_id, insecure_temp_user_group_4.group_id
  • Index Cond: ((insecure_temp_user_group_4.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (insecure_temp_user_group_4.user_id = (current_setting('lanetix.user_id'::text))::integer))
  • Heap Fetches: 0
55. 0.000 0.000 ↓ 0.0 0

Index Scan using organization_id_descendent_id on records.insecure_temp_group_closure insecure_temp_group_closure_1 (cost=0.42..112.48 rows=36 width=8) (never executed)

  • Output: insecure_temp_group_closure_1.organization_id, insecure_temp_group_closure_1.ancestor_id, insecure_temp_group_closure_1.descendent_id
  • Index Cond: ((insecure_temp_group_closure_1.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (insecure_temp_group_closure_1.descendent_id = insecure_temp_user_group_4.group_id))
56. 0.000 0.000 ↓ 0.0 0

Index Scan using insecure_temp_group_pkey on records.insecure_temp_group g_1 (cost=0.29..8.31 rows=1 width=8) (never executed)

  • Output: g_1.organization_id, g_1.id, g_1.status, g_1.name, g_1.description, g_1.reference_metadata
  • Index Cond: ((g_1.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (g_1.id = p.group_id))
57. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.58..4.51 rows=1 width=8) (never executed)

  • Output: insecure_temp_user_group_5.group_id, (CASE WHEN NULLIF((NOT users_1.active), false) THEN 'archived'::group_status ELSE NULL::group_status END)
58. 0.000 0.000 ↓ 0.0 0

Index Scan using insecure_temp_user_group_organization_id_group_id_idx on records.insecure_temp_user_group insecure_temp_user_group_5 (cost=0.29..0.40 rows=1 width=8) (never executed)

  • Output: insecure_temp_user_group_5.organization_id, insecure_temp_user_group_5.user_id, insecure_temp_user_group_5.group_id
  • Index Cond: ((insecure_temp_user_group_5.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (insecure_temp_user_group_5.group_id = g_1.id))
59. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on public.users users_1 (cost=0.29..4.10 rows=1 width=8) (never executed)

  • Output: users_1.id, CASE WHEN NULLIF((NOT users_1.active), false) THEN 'archived'::group_status ELSE NULL::group_status END
  • Index Cond: (users_1.id = insecure_temp_user_group_5.user_id)
  • Filter: (users_1.organization_id = (current_setting('lanetix.organization_id'::text))::integer)
60.          

SubPlan (for Nested Loop Left Join)

61. 0.000 0.000 ↓ 0.0 0

Index Only Scan using insecure_temp_user_group_organization_id_group_id_idx on records.insecure_temp_user_group (cost=0.29..8.31 rows=1 width=0) (never executed)

  • Index Cond: ((insecure_temp_user_group.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (insecure_temp_user_group.group_id = g_1.id))
  • Heap Fetches: 0
62. 0.000 0.000 ↓ 0.0 0

Index Only Scan using insecure_temp_user_group_organization_id_group_id_idx on records.insecure_temp_user_group insecure_temp_user_group_1 (cost=0.29..111.03 rows=2,672 width=4) (never executed)

  • Output: insecure_temp_user_group_1.group_id
  • Index Cond: (insecure_temp_user_group_1.organization_id = (current_setting('lanetix.organization_id'::text))::integer)
  • Heap Fetches: 0
63. 15.806 15.806 ↓ 1,386.0 1,386 14

Index Scan using insecure_workflows_pkey on records.insecure_workflows w (cost=0.43..13.41 rows=1 width=60) (actual time=0.009..1.129 rows=1,386 loops=14)

  • Output: w.organization_id, w.record_type, w.workflow_template_api_name, w.record_id, w.stage_api_name, w.team_member_ids, w.status, w.planning_input_date, w.enable_auto_replanning, w.enable_workflow_planning, w.timezone
  • Index Cond: ((w.organization_id = (current_setting('lanetix.organization_id'::text))::integer) AND (w.record_type = wt.record_type) AND (w.workflow_template_api_name = wt.api_name))
Planning time : 7.709 ms
Execution time : 219.563 ms