explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Gjcp

Settings
# exclusive inclusive rows x rows loops node
1. 178.178 14,892.834 ↑ 1.0 1 1

Aggregate (cost=2,696,387.85..2,696,387.86 rows=1 width=8) (actual time=14,892.834..14,892.834 rows=1 loops=1)

2. 1,455.697 14,714.656 ↑ 1.0 2,734,747 1

Unique (cost=2,469,751.19..2,662,048.96 rows=2,747,111 width=973) (actual time=12,262.757..14,714.656 rows=2,734,747 loops=1)

3. 7,533.757 13,258.959 ↑ 1.0 2,734,747 1

Sort (cost=2,469,751.19..2,476,618.97 rows=2,747,111 width=973) (actual time=12,262.754..13,258.959 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, pl.plan_name, pl.integration_config_type, pl.icon_override
  • Sort Method: external merge Disk: 1,071,448kB
4. 1,144.598 5,725.202 ↑ 1.0 2,734,747 1

Hash Left Join (cost=39,787.15..666,920.26 rows=2,747,111 width=973) (actual time=251.878..5,725.202 rows=2,734,747 loops=1)

  • Hash Cond: (e.plan_uuid = pl.plan_uuid)
5. 267.404 4,329.062 ↑ 1.0 2,734,747 1

Append (cost=0.41..606,182.93 rows=2,747,111 width=940) (actual time=0.271..4,329.062 rows=2,734,747 loops=1)

  • Subplans Removed: 4
6. 0.069 0.069 ↓ 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.069..0.069 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.056 0.056 ↓ 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.056..0.056 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.058 0.058 ↓ 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.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()))
9. 0.043 0.043 ↓ 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.043..0.043 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,010.758 1,010.758 ↑ 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.042..1,010.758 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,052.639 1,052.639 ↓ 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.047..1,052.639 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,401.185 1,401.185 ↓ 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.028..1,401.185 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. 596.850 596.850 ↑ 1.0 449,853 1

Seq Scan on events_org_part_199_l3_t_202010 e_7 (cost=0.00..95,813.68 rows=461,067 width=935) (actual time=0.023..596.850 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.218 251.542 ↑ 9.8 808 1

Hash (cost=39,688.03..39,688.03 rows=7,897 width=48) (actual time=251.541..251.542 rows=808 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 123kB
15. 0.127 251.324 ↑ 9.8 808 1

Subquery Scan on pl (cost=39,464.55..39,688.03 rows=7,897 width=48) (actual time=236.621..251.324 rows=808 loops=1)

16. 5.662 251.197 ↑ 9.8 808 1

Unique (cost=39,464.55..39,609.06 rows=7,897 width=48) (actual time=236.617..251.197 rows=808 loops=1)

17. 58.741 245.535 ↓ 2.6 75,828 1

Sort (cost=39,464.55..39,536.80 rows=28,902 width=48) (actual time=236.616..245.535 rows=75,828 loops=1)

  • Sort Key: pl_1.plan_uuid
  • Sort Method: external merge Disk: 3,840kB
18. 81.110 186.794 ↓ 2.6 75,828 1

Bitmap Heap Scan on plans pl_1 (cost=9,685.55..37,323.07 rows=28,902 width=48) (actual time=107.907..186.794 rows=75,828 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
  • Heap Blocks: exact=13,576
19. 2.126 105.684 ↓ 0.0 0 1

BitmapAnd (cost=9,685.55..9,685.55 rows=29,115 width=0) (actual time=105.684..105.684 rows=0 loops=1)

20. 29.751 29.751 ↓ 1.0 269,754 1

Bitmap Index Scan on plans_organization_uuid_idx (cost=0.00..4,370.98 rows=263,740 width=0) (actual time=29.751..29.751 rows=269,754 loops=1)

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

Bitmap Index Scan on plans_valid_range_gist (cost=0.00..5,299.87 rows=222,194 width=0) (actual time=73.807..73.807 rows=239,238 loops=1)

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