explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EoH5

Settings
# exclusive inclusive rows x rows loops node
1. 139.768 16,936.837 ↑ 1.0 1 1

Aggregate (cost=1,906,099.96..1,906,099.97 rows=1 width=8) (actual time=16,936.837..16,936.837 rows=1 loops=1)

2.          

CTE get_plan_info

3. 0.027 165.015 ↑ 1.5 2 1

Subquery Scan on p_info (cost=61,953.14..61,976.49 rows=3 width=44) (actual time=164.770..165.015 rows=2 loops=1)

  • Filter: (p_info.row_num = 1)
  • Rows Removed by Filter: 416
4. 0.227 164.988 ↑ 1.6 418 1

WindowAgg (cost=61,953.14..61,968.15 rows=667 width=418) (actual time=164.768..164.988 rows=418 loops=1)

5. 0.000 164.761 ↑ 1.6 418 1

Sort (cost=61,953.14..61,954.81 rows=667 width=52) (actual time=164.738..164.761 rows=418 loops=1)

  • Sort Key: pl_1.plan_uuid, (lower(pl_1.valid_range)) DESC
  • Sort Method: quicksort Memory: 57kB
6. 9.128 166.580 ↑ 1.6 418 1

Gather (cost=5,373.58..61,921.86 rows=667 width=52) (actual time=41.631..166.580 rows=418 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
7. 151.474 157.452 ↑ 2.0 84 5 / 5

Parallel Bitmap Heap Scan on plans pl_1 (cost=4,373.58..60,855.16 rows=167 width=52) (actual time=52.803..157.452 rows=84 loops=5)

  • Recheck Cond: (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid)
  • Filter: (is_visible AND (lower((name)::text) = 'mtech devops'::text) AND (valid_range && tstzrange('2020-01-17 16:49:36+00'::timestamp with time zone, now(), '[]'::text)))
  • Rows Removed by Filter: 53,798
  • Heap Blocks: exact=7,107
8. 5.978 5.978 ↓ 1.0 269,756 1 / 5

Bitmap Index Scan on plans_organization_uuid_idx (cost=0.00..4,373.41 rows=263,865 width=0) (actual time=29.888..29.888 rows=269,756 loops=1)

  • Index Cond: (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid)
9. 356.540 16,797.069 ↓ 10,811.2 2,162,242 1

Unique (cost=1,843,490.63..1,844,120.97 rows=200 width=428) (actual time=15,902.148..16,797.069 rows=2,162,242 loops=1)

10. 1,914.308 16,440.529 ↓ 17.2 2,162,242 1

Sort (cost=1,843,490.63..1,843,805.80 rows=126,068 width=428) (actual time=15,902.145..16,440.529 rows=2,162,242 loops=1)

  • Sort Key: e.event_uuid
  • Sort Method: external merge Disk: 71,984kB
11. 1,603.289 14,526.221 ↓ 17.2 2,162,242 1

Nested Loop Left Join (cost=0.51..1,817,019.75 rows=126,068 width=428) (actual time=165.811..14,526.221 rows=2,162,242 loops=1)

  • Join Filter: (pl.plan_uuid = e.plan_uuid)
  • Rows Removed by Join Filter: 2,162,242
12. 1,114.258 12,922.932 ↓ 17.2 2,162,242 1

Hash Semi Join (cost=0.51..1,808,510.13 rows=126,068 width=32) (actual time=165.805..12,922.932 rows=2,162,242 loops=1)

  • Hash Cond: (e.plan_uuid = get_plan_info.plan_uuid)
13. 754.290 11,643.641 ↓ 1.0 8,414,042 1

Append (cost=0.41..1,785,045.57 rows=8,404,553 width=32) (actual time=0.724..11,643.641 rows=8,414,042 loops=1)

  • Subplans Removed: 4
14. 0.086 0.086 ↓ 0.0 0 1

Index Scan using events_org_part_199_l3_f_202001_valid_range_idx on events_org_part_199_l3_f_202001 e (cost=0.41..3.44 rows=1 width=32) (actual time=0.086..0.086 rows=0 loops=1)

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

Index Scan using events_org_part_199_l3_f_202002_valid_range_idx on events_org_part_199_l3_f_202002 e_1 (cost=0.41..3.44 rows=1 width=32) (actual time=0.056..0.056 rows=0 loops=1)

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

Index Scan using events_org_part_199_l3_f_202003_valid_range_idx on events_org_part_199_l3_f_202003 e_2 (cost=0.41..3.44 rows=1 width=32) (actual time=0.084..0.084 rows=0 loops=1)

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

Index Scan using events_org_part_199_l3_f_202004_valid_range_idx on events_org_part_199_l3_f_202004 e_3 (cost=0.41..3.44 rows=1 width=32) (actual time=0.063..0.063 rows=0 loops=1)

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

Index Scan using events_org_part_199_l3_f_202005_valid_range_idx on events_org_part_199_l3_f_202005 e_4 (cost=0.41..3.44 rows=1 width=32) (actual time=0.074..0.074 rows=0 loops=1)

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

Index Scan using events_org_part_199_l3_f_202006_valid_range_idx on events_org_part_199_l3_f_202006 e_5 (cost=0.41..3.44 rows=1 width=32) (actual time=0.052..0.052 rows=0 loops=1)

  • Index Cond: (valid_range @> now())
  • Filter: (is_visible AND (created >= '2020-01-17 16:49:36+00'::timestamp with time zone) AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (created <= now()))
20. 0.061 0.061 ↓ 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_6 (cost=0.41..3.44 rows=1 width=32) (actual time=0.061..0.061 rows=0 loops=1)

  • Index Cond: (valid_range @> now())
  • Filter: (is_visible AND (created >= '2020-01-17 16:49:36+00'::timestamp with time zone) AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (created <= now()))
21. 0.074 0.074 ↓ 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_7 (cost=0.41..3.44 rows=1 width=32) (actual time=0.074..0.074 rows=0 loops=1)

  • Index Cond: (valid_range @> now())
  • Filter: (is_visible AND (created >= '2020-01-17 16:49:36+00'::timestamp with time zone) AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (created <= now()))
22. 0.056 0.056 ↓ 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_8 (cost=0.41..3.44 rows=1 width=32) (actual time=0.056..0.056 rows=0 loops=1)

  • Index Cond: (valid_range @> now())
  • Filter: (is_visible AND (created >= '2020-01-17 16:49:36+00'::timestamp with time zone) AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (created <= now()))
23. 0.049 0.049 ↓ 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_9 (cost=0.29..3.31 rows=1 width=32) (actual time=0.049..0.049 rows=0 loops=1)

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

Index Scan using events_org_part_199_l3_t_202001_created_idx on events_org_part_199_l3_t_202001 e_10 (cost=0.43..147,335.83 rows=423,538 width=32) (actual time=0.063..901.940 rows=420,744 loops=1)

  • Index Cond: ((created >= '2020-01-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()))
25. 1,494.231 1,494.231 ↓ 1.0 750,825 1

Seq Scan on events_org_part_199_l3_t_202002 e_11 (cost=0.00..145,671.80 rows=749,832 width=32) (actual time=0.021..1,494.231 rows=750,825 loops=1)

  • Filter: (is_visible AND (created >= '2020-01-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()))
26. 975.531 975.531 ↓ 1.0 820,788 1

Seq Scan on events_org_part_199_l3_t_202003 e_12 (cost=0.00..169,810.60 rows=820,104 width=32) (actual time=0.037..975.531 rows=820,788 loops=1)

  • Filter: (is_visible AND (created >= '2020-01-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()))
27. 850.823 850.823 ↓ 1.0 790,644 1

Seq Scan on events_org_part_199_l3_t_202004 e_13 (cost=0.00..154,579.88 rows=789,435 width=32) (actual time=0.043..850.823 rows=790,644 loops=1)

  • Filter: (is_visible AND (created >= '2020-01-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()))
28. 978.447 978.447 ↑ 1.0 891,589 1

Seq Scan on events_org_part_199_l3_t_202005 e_14 (cost=0.00..182,198.38 rows=894,935 width=32) (actual time=0.037..978.447 rows=891,589 loops=1)

  • Filter: (is_visible AND (created >= '2020-01-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()))
29. 1,438.013 1,438.013 ↑ 1.0 1,475,016 1

Seq Scan on events_org_part_199_l3_t_202006 e_15 (cost=0.00..266,372.10 rows=1,476,964 width=32) (actual time=0.041..1,438.013 rows=1,475,016 loops=1)

  • Filter: (is_visible AND (created >= '2020-01-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()))
30. 1,144.169 1,144.169 ↑ 1.0 961,668 1

Seq Scan on events_org_part_199_l3_t_202007 e_16 (cost=0.00..196,896.23 rows=962,009 width=32) (actual time=0.044..1,144.169 rows=961,668 loops=1)

  • Filter: (is_visible AND (created >= '2020-01-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()))
31. 950.699 950.699 ↓ 1.0 891,210 1

Seq Scan on events_org_part_199_l3_t_202008 e_17 (cost=0.00..179,962.30 rows=890,172 width=32) (actual time=0.025..950.699 rows=891,210 loops=1)

  • Filter: (is_visible AND (created >= '2020-01-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()))
32. 1,095.391 1,095.391 ↓ 1.0 961,705 1

Seq Scan on events_org_part_199_l3_t_202009 e_18 (cost=0.00..202,719.33 rows=961,053 width=32) (actual time=0.050..1,095.391 rows=961,705 loops=1)

  • Filter: (is_visible AND (created >= '2020-01-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()))
33. 1,059.452 1,059.452 ↓ 1.0 449,853 1

Seq Scan on events_org_part_199_l3_t_202010 e_19 (cost=0.00..97,429.43 rows=436,497 width=32) (actual time=0.059..1,059.452 rows=449,853 loops=1)

  • Filter: (is_visible AND (created >= '2020-01-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()))
34. 0.013 165.033 ↑ 1.5 2 1

Hash (cost=0.06..0.06 rows=3 width=16) (actual time=165.033..165.033 rows=2 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
35. 165.020 165.020 ↑ 1.5 2 1

CTE Scan on get_plan_info (cost=0.00..0.06 rows=3 width=16) (actual time=164.774..165.020 rows=2 loops=1)

36. 0.000 0.000 ↑ 1.5 2 2,162,242

CTE Scan on get_plan_info pl (cost=0.00..0.06 rows=3 width=16) (actual time=0.000..0.000 rows=2 loops=2,162,242)

Planning time : 33.004 ms
Execution time : 16,960.020 ms