explain.depesz.com

PostgreSQL's explain analyze made readable

Result: H2iv

Settings
# exclusive inclusive rows x rows loops node
1. 101.976 15,875.204 ↑ 1.0 1 1

Aggregate (cost=1,522,372.94..1,522,372.95 rows=1 width=8) (actual time=15,875.204..15,875.204 rows=1 loops=1)

2.          

CTE get_plan_info

3. 0.024 161.230 ↑ 1.5 2 1

Subquery Scan on p_info (cost=61,933.29..61,952.71 rows=3 width=44) (actual time=161.010..161.230 rows=2 loops=1)

  • Filter: (p_info.row_num = 1)
  • Rows Removed by Filter: 367
4. 0.212 161.206 ↑ 1.5 369 1

WindowAgg (cost=61,933.29..61,945.77 rows=555 width=418) (actual time=161.008..161.206 rows=369 loops=1)

5. 0.000 160.994 ↑ 1.5 369 1

Sort (cost=61,933.29..61,934.67 rows=555 width=52) (actual time=160.972..160.994 rows=369 loops=1)

  • Sort Key: pl_1.plan_uuid, (lower(pl_1.valid_range)) DESC
  • Sort Method: quicksort Memory: 53kB
6. 8.394 162.150 ↑ 1.5 369 1

Gather (cost=5,372.02..61,907.99 rows=555 width=52) (actual time=44.504..162.150 rows=369 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
7. 147.567 153.756 ↑ 1.9 74 5 / 5

Parallel Bitmap Heap Scan on plans pl_1 (cost=4,372.02..60,852.49 rows=139 width=52) (actual time=58.801..153.756 rows=74 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-03-17 16:49:36+00'::timestamp with time zone, now(), '[]'::text)))
  • Rows Removed by Filter: 53,808
  • Heap Blocks: exact=6,927
8. 6.189 6.189 ↓ 1.0 269,756 1 / 5

Bitmap Index Scan on plans_organization_uuid_idx (cost=0.00..4,371.88 rows=263,860 width=0) (actual time=30.946..30.946 rows=269,756 loops=1)

  • Index Cond: (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid)
9. 259.353 15,773.228 ↓ 7,716.4 1,543,290 1

Unique (cost=1,459,908.63..1,460,417.73 rows=200 width=428) (actual time=15,139.301..15,773.228 rows=1,543,290 loops=1)

10. 1,477.212 15,513.875 ↓ 15.2 1,543,290 1

Sort (cost=1,459,908.63..1,460,163.18 rows=101,821 width=428) (actual time=15,139.298..15,513.875 rows=1,543,290 loops=1)

  • Sort Key: e.event_uuid
  • Sort Method: external merge Disk: 51,384kB
11. 1,233.564 14,036.663 ↓ 15.2 1,543,290 1

Nested Loop Left Join (cost=0.51..1,438,686.32 rows=101,821 width=428) (actual time=182.683..14,036.663 rows=1,543,290 loops=1)

  • Join Filter: (pl.plan_uuid = e.plan_uuid)
  • Rows Removed by Join Filter: 1,543,290
12. 950.357 12,803.099 ↓ 15.2 1,543,290 1

Hash Semi Join (cost=0.51..1,431,813.37 rows=101,821 width=32) (actual time=182.672..12,803.099 rows=1,543,290 loops=1)

  • Hash Cond: (e.plan_uuid = get_plan_info.plan_uuid)
13. 640.642 11,691.498 ↓ 1.0 6,801,795 1

Append (cost=0.41..1,412,861.80 rows=6,788,083 width=32) (actual time=21.308..11,691.498 rows=6,801,795 loops=1)

  • Subplans Removed: 4
14. 0.092 0.092 ↓ 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 (cost=0.41..3.44 rows=1 width=32) (actual time=0.092..0.092 rows=0 loops=1)

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

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

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

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

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

  • Index Cond: (valid_range @> now())
  • Filter: (is_visible AND (created >= '2020-03-17 16:49:36+00'::timestamp with time zone) AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (created <= now()))
21. 0.056 0.056 ↓ 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_7 (cost=0.29..3.31 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-03-17 16:49:36+00'::timestamp with time zone) AND (organization_uuid = 'fcb0b139-ed68-4220-a7a6-7e56e8214519'::uuid) AND (created <= now()))
22. 1,737.917 1,737.917 ↓ 1.0 380,110 1

Index Scan using events_org_part_199_l3_t_202003_created_idx on events_org_part_199_l3_t_202003 e_8 (cost=0.43..98,933.19 rows=378,426 width=32) (actual time=20.802..1,737.917 rows=380,110 loops=1)

  • Index Cond: ((created >= '2020-03-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()))
23. 1,071.585 1,071.585 ↓ 1.0 790,644 1

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

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

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

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

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

  • Filter: (is_visible AND (created >= '2020-03-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. 2,140.438 2,140.438 ↑ 1.0 961,668 1

Seq Scan on events_org_part_199_l3_t_202007 e_12 (cost=0.00..196,896.23 rows=962,009 width=32) (actual time=0.056..2,140.438 rows=961,668 loops=1)

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

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

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

Seq Scan on events_org_part_199_l3_t_202009 e_14 (cost=0.00..202,719.33 rows=961,053 width=32) (actual time=0.070..1,163.201 rows=961,705 loops=1)

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

Seq Scan on events_org_part_199_l3_t_202010 e_15 (cost=0.00..97,219.93 rows=435,077 width=32) (actual time=0.067..827.234 rows=449,853 loops=1)

  • Filter: (is_visible AND (created >= '2020-03-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. 0.009 161.244 ↑ 1.5 2 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
31. 161.235 161.235 ↑ 1.5 2 1

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

32. 0.000 0.000 ↑ 1.5 2 1,543,290

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=1,543,290)

Planning time : 30.574 ms
Execution time : 15,893.233 ms