explain.depesz.com

PostgreSQL's explain analyze made readable

Result: piRv

Settings
# exclusive inclusive rows x rows loops node
1. 180.961 17,023.442 ↑ 1.0 1 1

Aggregate (cost=1,306,143.71..1,306,143.72 rows=1 width=8) (actual time=17,023.442..17,023.442 rows=1 loops=1)

2. 1,465.290 16,842.481 ↓ 3.0 2,734,747 1

Unique (cost=1,230,598.22..1,294,697.43 rows=915,703 width=973) (actual time=14,395.219..16,842.481 rows=2,734,747 loops=1)

3. 8,173.904 15,377.191 ↓ 3.0 2,734,747 1

Sort (cost=1,230,598.22..1,232,887.47 rows=915,703 width=973) (actual time=14,395.215..15,377.191 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,200.351 7,203.287 ↓ 3.0 2,734,747 1

Hash Left Join (cost=39,787.17..636,908.42 rows=915,703 width=973) (actual time=298.658..7,203.287 rows=2,734,747 loops=1)

  • Hash Cond: (e.plan_uuid = pl.plan_uuid)
5. 270.408 5,704.411 ↓ 3.0 2,734,747 1

Append (cost=0.43..590,138.16 rows=915,703 width=940) (actual time=0.073..5,704.411 rows=2,734,747 loops=1)

  • Subplans Removed: 2
6. 2,045.580 2,045.580 ↓ 3.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 (cost=0.43..112,838.75 rows=144,937 width=937) (actual time=0.070..2,045.580 rows=431,979 loops=1)

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

Seq Scan on events_org_part_199_l3_t_202008 e_1 (cost=0.00..177,736.87 rows=296,724 width=942) (actual time=0.029..1,157.345 rows=891,210 loops=1)

  • Filter: (upper_inf(valid_range) 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. 1,478.816 1,478.816 ↓ 3.0 961,705 1

Seq Scan on events_org_part_199_l3_t_202009 e_2 (cost=0.00..200,316.69 rows=320,351 width=941) (actual time=0.045..1,478.816 rows=961,705 loops=1)

  • Filter: (upper_inf(valid_range) 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. 752.262 752.262 ↓ 2.9 449,853 1

Seq Scan on events_org_part_199_l3_t_202010 e_3 (cost=0.00..94,661.01 rows=153,689 width=935) (actual time=0.027..752.262 rows=449,853 loops=1)

  • Filter: (upper_inf(valid_range) 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. 0.232 298.525 ↑ 9.8 808 1

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

  • Buckets: 8,192 Batches: 1 Memory Usage: 123kB
11. 0.122 298.293 ↑ 9.8 808 1

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

12. 5.824 298.171 ↑ 9.8 808 1

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

13. 61.979 292.347 ↓ 2.6 75,828 1

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

  • Sort Key: pl_1.plan_uuid
  • Sort Method: external merge Disk: 3,840kB
14. 126.302 230.368 ↓ 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=106.305..230.368 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
15. 2.045 104.066 ↓ 0.0 0 1

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

16. 30.026 30.026 ↓ 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=30.026..30.026 rows=269,754 loops=1)

  • Index Cond: (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid)
17. 71.995 71.995 ↓ 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=71.995..71.995 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 : 12.578 ms
Execution time : 17,241.943 ms