explain.depesz.com

PostgreSQL's explain analyze made readable

Result: f3HP

Settings
# exclusive inclusive rows x rows loops node
1. 182.517 22,388.367 ↑ 1.0 1 1

Aggregate (cost=2,610,588.08..2,610,588.09 rows=1 width=8) (actual time=22,388.367..22,388.367 rows=1 loops=1)

2. 6,252.335 22,205.850 ↓ 1.0 2,734,747 1

Unique (cost=2,406,504.01..2,576,574.07 rows=2,721,121 width=941) (actual time=14,884.805..22,205.850 rows=2,734,747 loops=1)

3. 8,851.335 15,953.515 ↓ 1.0 2,734,747 1

Sort (cost=2,406,504.01..2,413,306.81 rows=2,721,121 width=941) (actual time=14,884.780..15,953.515 rows=2,734,747 loops=1)

  • Sort Key: e.event_uuid, e.event_id, e.submitter_uuid, e.priority, e.incident_id, e.override_device_restrictions, e.escalation_override, e.bypass_phone_intro, e.require_phone_password, e.conference_properties, e.created, e.status, e.terminated, e.request_uuid, e.sequence, e.revision_uuid, e.event_type, e.system_event_type, e.form_uuid, e.plan_uuid, e.choices, (lower(e.valid_range)), (upper(e.valid_range)), e.recipients
  • Sort Method: external merge Disk: 1,026,152kB
4. 987.337 7,102.180 ↓ 1.0 2,734,747 1

Hash Left Join (cost=37,476.25..668,748.23 rows=2,721,121 width=941) (actual time=288.780..7,102.180 rows=2,734,747 loops=1)

  • Hash Cond: (e.plan_uuid = p_info.plan_uuid)
5. 260.203 5,826.422 ↓ 1.0 2,734,747 1

Append (cost=0.41..607,459.23 rows=2,721,121 width=940) (actual time=0.330..5,826.422 rows=2,734,747 loops=1)

  • Subplans Removed: 4
6. 0.073 0.073 ↓ 0.0 0 1

Index Scan using events_org_part_199_l3_f_202007_valid_range_idx on events_org_part_199_l3_f_202007 e (cost=0.41..3.44 rows=1 width=942) (actual time=0.073..0.073 rows=0 loops=1)

  • Index Cond: (valid_range @> now())
  • Filter: (is_visible AND (created >= '2020-07-17 16:49:36+00'::timestamp with time zone) AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (created <= now()))
7. 0.080 0.080 ↓ 0.0 0 1

Index Scan using events_org_part_199_l3_f_202008_valid_range_idx on events_org_part_199_l3_f_202008 e_1 (cost=0.41..3.44 rows=1 width=946) (actual time=0.080..0.080 rows=0 loops=1)

  • Index Cond: (valid_range @> now())
  • Filter: (is_visible AND (created >= '2020-07-17 16:49:36+00'::timestamp with time zone) AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (created <= now()))
8. 0.055 0.055 ↓ 0.0 0 1

Index Scan using events_org_part_199_l3_f_202009_valid_range_idx on events_org_part_199_l3_f_202009 e_2 (cost=0.41..3.44 rows=1 width=946) (actual time=0.055..0.055 rows=0 loops=1)

  • Index Cond: (valid_range @> now())
  • Filter: (is_visible AND (created >= '2020-07-17 16:49:36+00'::timestamp with time zone) AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (created <= now()))
9. 0.058 0.058 ↓ 0.0 0 1

Index Scan using events_org_part_199_l3_f_202010_valid_range_idx on events_org_part_199_l3_f_202010 e_3 (cost=0.29..3.31 rows=1 width=940) (actual time=0.058..0.058 rows=0 loops=1)

  • Index Cond: (valid_range @> now())
  • Filter: (is_visible AND (created >= '2020-07-17 16:49:36+00'::timestamp with time zone) AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (created <= now()))
10. 1,654.166 1,654.166 ↑ 1.0 431,979 1

Index Scan using events_org_part_199_l3_t_202007_created_idx on events_org_part_199_l3_t_202007 e_4 (cost=0.43..113,925.77 rows=434,811 width=937) (actual time=0.061..1,654.166 rows=431,979 loops=1)

  • Index Cond: ((created >= '2020-07-17 16:49:36+00'::timestamp with time zone) AND (created <= now()))
  • Filter: (is_visible AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (valid_range @> now()))
11. 1,117.268 1,117.268 ↓ 1.0 891,210 1

Seq Scan on events_org_part_199_l3_t_202008 e_5 (cost=0.00..179,962.30 rows=890,172 width=942) (actual time=0.031..1,117.268 rows=891,210 loops=1)

  • Filter: (is_visible AND (created >= '2020-07-17 16:49:36+00'::timestamp with time zone) AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (valid_range @> now()) AND (created <= now()))
12. 1,301.226 1,301.226 ↓ 1.0 961,705 1

Seq Scan on events_org_part_199_l3_t_202009 e_6 (cost=0.00..202,719.33 rows=961,053 width=941) (actual time=0.066..1,301.226 rows=961,705 loops=1)

  • Filter: (is_visible AND (created >= '2020-07-17 16:49:36+00'::timestamp with time zone) AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (valid_range @> now()) AND (created <= now()))
13. 1,493.293 1,493.293 ↓ 1.0 449,853 1

Seq Scan on events_org_part_199_l3_t_202010 e_7 (cost=0.00..97,219.93 rows=435,077 width=935) (actual time=0.079..1,493.293 rows=449,853 loops=1)

  • Filter: (is_visible AND (created >= '2020-07-17 16:49:36+00'::timestamp with time zone) AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (valid_range @> now()) AND (created <= now()))
14. 0.015 288.421 ↓ 2.0 2 1

Hash (cost=37,475.82..37,475.82 rows=1 width=16) (actual time=288.421..288.421 rows=2 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
15. 0.013 288.406 ↓ 2.0 2 1

Subquery Scan on p_info (cost=37,470.75..37,475.82 rows=1 width=16) (actual time=288.320..288.406 rows=2 loops=1)

  • Filter: (p_info.row_num = 1)
  • Rows Removed by Filter: 143
16. 0.087 288.393 ↑ 1.0 145 1

WindowAgg (cost=37,470.75..37,474.01 rows=145 width=486) (actual time=288.318..288.393 rows=145 loops=1)

17. 0.188 288.306 ↑ 1.0 145 1

Sort (cost=37,470.75..37,471.11 rows=145 width=24) (actual time=288.298..288.306 rows=145 loops=1)

  • Sort Key: pl.plan_uuid, (lower(pl.valid_range)) DESC
  • Sort Method: quicksort Memory: 36kB
18. 181.728 288.118 ↑ 1.0 145 1

Bitmap Heap Scan on plans pl (cost=9,672.43..37,465.54 rows=145 width=24) (actual time=111.522..288.118 rows=145 loops=1)

  • Recheck Cond: ((organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (valid_range && tstzrange('2020-07-17 16:49:36+00'::timestamp with time zone, now(), '[]'::text)))
  • Filter: (is_visible AND (lower((name)::text) = 'mtech devops'::text))
  • Rows Removed by Filter: 75,684
  • Heap Blocks: exact=13,577
19. 2.228 106.390 ↓ 0.0 0 1

BitmapAnd (cost=9,672.43..9,672.43 rows=29,125 width=0) (actual time=106.390..106.390 rows=0 loops=1)

20. 29.293 29.293 ↓ 1.0 269,756 1

Bitmap Index Scan on plans_organization_uuid_idx (cost=0.00..4,371.66 rows=263,831 width=0) (actual time=29.293..29.293 rows=269,756 loops=1)

  • Index Cond: (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid)
21. 74.869 74.869 ↓ 1.1 239,972 1

Bitmap Index Scan on plans_valid_range_gist (cost=0.00..5,300.45 rows=222,271 width=0) (actual time=74.869..74.869 rows=239,972 loops=1)

  • Index Cond: (valid_range && tstzrange('2020-07-17 16:49:36+00'::timestamp with time zone, now(), '[]'::text))
Planning time : 22.442 ms
Execution time : 22,655.511 ms