explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3iV0H

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Unique (cost=290,507.00..291,450.79 rows=94,379 width=112) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=290,507.00..290,742.95 rows=94,379 width=112) (actual rows= loops=)

  • Sort Key: shiftoccurrence.start_date, shiftoccurrence.end_date, s.shift_uuid, (lower(s.valid_range)) DESC
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,006.37..279,182.63 rows=94,379 width=112) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,005.95..273,954.65 rows=1,764 width=64) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Gather (cost=1,000.00..30,643.78 rows=14,464 width=48) (actual rows= loops=)

  • Workers Planned: 3
6. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on shift_occurrence_org_part_41 shiftoccurrence (cost=0.00..28,197.38 rows=4,666 width=48) (actual rows= loops=)

  • Filter: ((organization_uuid = '8d3a618b-96c0-4af3-a2fb-d10df4e12b6e'::uuid) AND ((tstzrange((start_date)::timestamp with time zone, (end_date)::timestamp with time zone, '[)'::text) @> '2019-12-31 16:00:00-08'::timestamp with time zone) OR (tstzrange((start_date)::timestamp with time zone, (end_date)::timestamp with time zone, '[)'::text) @> '2020-02-11 15:59:59-08'::timestamp with time zone) OR (tstzrange((start_date)::timestamp with time zone, (end_date)::timestamp with time zone, '[)'::text) <@ '["2019-12-31 16:00:00-08","2020-02-11 15:59:59-08"]'::tstzrange)))
7. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on groups_org_part_72 g (cost=5.95..16.81 rows=1 width=67) (actual rows= loops=)

  • Recheck Cond: ((group_uuid = shiftoccurrence.group_uuid) AND ((valid_range @> (shiftoccurrence.end_date)::timestamp with time zone) OR (revision_uuid = (SubPlan 2))))
  • Filter: ((is_visible IS TRUE) AND (organization_uuid = '8d3a618b-96c0-4af3-a2fb-d10df4e12b6e'::uuid) AND ((valid_range @> (shiftoccurrence.end_date)::timestamp with time zone) OR ((NOT (SubPlan 1)) AND (revision_uuid = (SubPlan 2)))))
8. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=5.95..5.95 rows=1 width=0) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on groups_org_part_72_group_uuid_idx (cost=0.00..0.31 rows=3 width=0) (actual rows= loops=)

  • Index Cond: (group_uuid = shiftoccurrence.group_uuid)
10. 0.000 0.000 ↓ 0.0

BitmapOr (cost=5.39..5.39 rows=36 width=0) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on groups_org_part_72_valid_range_idx (cost=0.00..0.42 rows=35 width=0) (actual rows= loops=)

  • Index Cond: (valid_range @> (shiftoccurrence.end_date)::timestamp with time zone)
12. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on groups_org_part_72_revision_uuid_uidx (cost=0.00..4.97 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (revision_uuid = (SubPlan 2))
13.          

SubPlan (for Bitmap Heap Scan)

14. 0.000 0.000 ↓ 0.0

Index Scan using groups_org_part_72_organization_uuid_group_uuid_sequence_lo_idx on groups_org_part_72 (cost=0.28..4.67 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((organization_uuid = '8d3a618b-96c0-4af3-a2fb-d10df4e12b6e'::uuid) AND (group_uuid = shiftoccurrence.group_uuid))
  • Filter: ((is_visible IS TRUE) AND (valid_range @> (shiftoccurrence.end_date)::timestamp with time zone))
15. 0.000 0.000 ↓ 0.0

Limit (cost=4.67..4.67 rows=1 width=35) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Sort (cost=4.67..4.68 rows=3 width=35) (actual rows= loops=)

  • Sort Key: groups_org_part_72_1.valid_range
17. 0.000 0.000 ↓ 0.0

Index Scan using groups_org_part_72_organization_uuid_group_uuid_sequence_lo_idx on groups_org_part_72 groups_org_part_72_1 (cost=0.28..4.66 rows=3 width=35) (actual rows= loops=)

  • Index Cond: ((organization_uuid = '8d3a618b-96c0-4af3-a2fb-d10df4e12b6e'::uuid) AND (group_uuid = shiftoccurrence.group_uuid))
  • Filter: (is_visible IS TRUE)
18. 0.000 0.000 ↓ 0.0

Index Scan using shifts_org_part_default_pkey on shifts_org_part_default s (cost=0.43..2.69 rows=1 width=69) (actual rows= loops=)

  • Index Cond: ((organization_uuid = '8d3a618b-96c0-4af3-a2fb-d10df4e12b6e'::uuid) AND (revision_uuid = shiftoccurrence.shift_revision_uuid))
  • Filter: (is_visible IS TRUE)