explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Kmxk

Settings
# exclusive inclusive rows x rows loops node
1. 102.450 61,886.085 ↑ 1.0 1 1

Aggregate (cost=1,522,372.94..1,522,372.95 rows=1 width=8) (actual time=61,884.363..61,886.085 rows=1 loops=1)

2.          

CTE get_plan_info

3. 0.038 185.753 ↑ 1.5 2 1

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

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

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

5. 0.482 185.424 ↑ 1.5 369 1

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

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

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

  • Workers Planned: 4
  • Workers Launched: 4
7. 165.252 174.080 ↑ 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=74.501..174.080 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,692
8. 8.828 8.828 ↓ 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=44.141..44.141 rows=269,756 loops=1)

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

Unique (cost=1,459,908.63..1,460,417.73 rows=200 width=428) (actual time=61,185.445..61,783.635 rows=1,543,290 loops=1)

10. 1,603.254 61,536.089 ↓ 15.2 1,543,290 1

Sort (cost=1,459,908.63..1,460,163.18 rows=101,821 width=428) (actual time=61,185.444..61,536.089 rows=1,543,290 loops=1)

  • Sort Key: e.event_uuid
  • Sort Method: external merge Disk: 51,384kB
11. 1,351.180 59,932.835 ↓ 15.2 1,543,290 1

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

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

Hash Semi Join (cost=0.51..1,431,813.37 rows=101,821 width=32) (actual time=184.808..58,581.655 rows=1,543,290 loops=1)

  • Hash Cond: (e.plan_uuid = get_plan_info.plan_uuid)
13. 750.149 57,299.306 ↓ 1.0 6,801,795 1

Append (cost=0.41..1,412,861.80 rows=6,788,083 width=32) (actual time=0.694..57,299.306 rows=6,801,795 loops=1)

  • Subplans Removed: 4
14. 0.103 0.103 ↓ 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.103..0.103 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.078 0.078 ↓ 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.077..0.078 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.096 0.096 ↓ 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.095..0.096 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.048 0.048 ↓ 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.048..0.048 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.077 0.077 ↓ 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.076..0.077 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.084 0.084 ↓ 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.083..0.084 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.071 0.071 ↓ 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.071..0.071 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.079 0.079 ↓ 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.079..0.079 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. 12,735.557 12,735.557 ↓ 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=0.054..12,735.557 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. 7,859.147 7,859.147 ↓ 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=39.266..7,859.147 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. 9,541.893 9,541.893 ↑ 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=2.348..9,541.893 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. 13,578.580 13,578.580 ↑ 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=54.062..13,578.580 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. 9,227.869 9,227.869 ↑ 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=18.059..9,227.869 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,343.591 1,343.591 ↓ 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.014..1,343.591 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,539.989 1,539.989 ↓ 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.022..1,539.989 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. 721.895 721.895 ↓ 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.019..721.895 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.008 184.060 ↑ 1.5 2 1

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

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

CTE Scan on get_plan_info (cost=0.00..0.06 rows=3 width=16) (actual time=183.728..184.052 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.808 ms
Execution time : 61,903.097 ms