explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wRfn

Settings
# exclusive inclusive rows x rows loops node
1. 307,946.355 330,136.235 ↑ 4.6 465,396 1

Nested Loop (cost=158,583.18..1,622,547.06 rows=2,148,752 width=152) (actual time=20,468.545..330,136.235 rows=465,396 loops=1)

2. 3.761 20,500.346 ↓ 6.5 966 1

Nested Loop (cost=158,582.75..158,964.18 rows=149 width=976) (actual time=20,465.792..20,500.346 rows=966 loops=1)

3. 4.337 20,475.333 ↓ 6.5 966 1

Finalize GroupAggregate (cost=158,582.32..158,600.76 rows=149 width=24) (actual time=20,465.771..20,475.333 rows=966 loops=1)

  • Group Key: o_1.id, e.mean_id, e.pair_start
4. 70.191 20,470.996 ↓ 13.4 1,666 1

Gather Merge (cost=158,582.32..158,598.03 rows=124 width=24) (actual time=20,465.762..20,470.996 rows=1,666 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 0.844 20,400.805 ↓ 9.0 555 3 / 3

Partial GroupAggregate (cost=157,582.30..157,583.69 rows=62 width=24) (actual time=20,399.613..20,400.805 rows=555 loops=3)

  • Group Key: o_1.id, e.mean_id, e.pair_start
6. 1.276 20,399.961 ↓ 10.5 648 3 / 3

Sort (cost=157,582.30..157,582.45 rows=62 width=24) (actual time=20,399.604..20,399.961 rows=648 loops=3)

  • Sort Key: o_1.id, e.mean_id, e.pair_start
  • Sort Method: quicksort Memory: 62kB
  • Worker 0: Sort Method: quicksort Memory: 69kB
  • Worker 1: Sort Method: quicksort Memory: 63kB
7. 181.845 20,398.685 ↓ 10.5 648 3 / 3

Hash Join (cost=314.60..157,580.45 rows=62 width=24) (actual time=1,392.503..20,398.685 rows=648 loops=3)

  • Hash Cond: ((o_1.agency_id)::numeric = a.id)
8. 391.906 20,212.238 ↓ 4.9 162,916 3 / 3

Nested Loop (cost=0.98..157,174.95 rows=33,384 width=28) (actual time=1.017..20,212.238 rows=162,916 loops=3)

9. 12,977.846 12,977.846 ↓ 4.9 162,916 3 / 3

Parallel Index Scan using es_event_pairing_idx on es_event e (cost=0.56..100,573.46 rows=33,384 width=24) (actual time=0.698..12,977.846 rows=162,916 loops=3)

  • Index Cond: ((name = ANY ('{ORDER_IS_PAIR,ORDER_IS_UNPAIR}'::text[])) AND (pair_start >= '2019-12-01 00:00:00'::timestamp without time zone))
10. 6,842.486 6,842.486 ↑ 1.0 1 488,749 / 3

Index Scan using es_order_pk on es_order o_1 (cost=0.42..1.70 rows=1 width=8) (actual time=0.042..0.042 rows=1 loops=488,749)

  • Index Cond: (id = e.order_id)
11. 0.015 4.602 ↑ 1.0 9 3 / 3

Hash (cost=313.50..313.50 rows=9 width=5) (actual time=4.601..4.602 rows=9 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 4.587 4.587 ↑ 1.0 9 3 / 3

Seq Scan on agencies a (cost=0.00..313.50 rows=9 width=5) (actual time=3.601..4.587 rows=9 loops=3)

  • Filter: (organization_id = '5660'::numeric)
  • Rows Removed by Filter: 5173
13. 21.252 21.252 ↑ 1.0 1 966

Index Scan using es_order_pk on es_order o (cost=0.42..2.43 rows=1 width=956) (actual time=0.022..0.022 rows=1 loops=966)

  • Index Cond: (id = o_1.id)
14. 183.540 1,689.534 ↑ 1.8 482 966

Append (cost=0.43..728.63 rows=875 width=28) (actual time=0.100..1.749 rows=482 loops=966)

15. 9.660 9.660 ↓ 0.0 0 966

Index Scan using _hyper_1_248_chunk_position_reorder_chunk_idx on _hyper_1_248_chunk p (cost=0.43..88.21 rows=104 width=28) (actual time=0.010..0.010 rows=0 loops=966)

  • Index Cond: ((mean_id = e.mean_id) AND (position_ts >= e.pair_start) AND (position_ts <= (max(e.pair_end))) AND (position_ts >= '2019-12-01 00:00:00'::timestamp without time zone))
16. 8.694 8.694 ↓ 0.0 0 966

Index Scan using _hyper_1_213_chunk_position_reorder_chunk_idx on _hyper_1_213_chunk p_1 (cost=0.43..95.09 rows=114 width=28) (actual time=0.009..0.009 rows=0 loops=966)

  • Index Cond: ((mean_id = e.mean_id) AND (position_ts >= e.pair_start) AND (position_ts <= (max(e.pair_end))) AND (position_ts >= '2019-12-01 00:00:00'::timestamp without time zone))
17. 7.728 7.728 ↓ 0.0 0 966

Index Scan using _hyper_1_207_chunk_position_reorder_chunk_idx on _hyper_1_207_chunk p_2 (cost=0.43..95.00 rows=114 width=28) (actual time=0.008..0.008 rows=0 loops=966)

  • Index Cond: ((mean_id = e.mean_id) AND (position_ts >= e.pair_start) AND (position_ts <= (max(e.pair_end))) AND (position_ts >= '2019-12-01 00:00:00'::timestamp without time zone))
18. 113.022 113.022 ↑ 3.4 28 966

Index Scan using _hyper_1_192_chunk_position_reorder_chunk_idx on _hyper_1_192_chunk p_3 (cost=0.43..74.83 rows=94 width=28) (actual time=0.010..0.117 rows=28 loops=966)

  • Index Cond: ((mean_id = e.mean_id) AND (position_ts >= e.pair_start) AND (position_ts <= (max(e.pair_end))) AND (position_ts >= '2019-12-01 00:00:00'::timestamp without time zone))
19. 9.660 9.660 ↓ 0.0 0 966

Index Scan using _hyper_1_270_chunk_position_reorder_chunk_idx on _hyper_1_270_chunk p_4 (cost=0.42..15.62 rows=20 width=28) (actual time=0.010..0.010 rows=0 loops=966)

  • Index Cond: ((mean_id = e.mean_id) AND (position_ts >= e.pair_start) AND (position_ts <= (max(e.pair_end))) AND (position_ts >= '2019-12-01 00:00:00'::timestamp without time zone))
20. 539.028 539.028 ↓ 2.2 197 966

Index Scan using _hyper_1_182_chunk_position_reorder_chunk_idx on _hyper_1_182_chunk p_5 (cost=0.43..75.49 rows=89 width=28) (actual time=0.017..0.558 rows=197 loops=966)

  • Index Cond: ((mean_id = e.mean_id) AND (position_ts >= e.pair_start) AND (position_ts <= (max(e.pair_end))) AND (position_ts >= '2019-12-01 00:00:00'::timestamp without time zone))
21. 2.898 2.898 ↓ 0.0 0 966

Index Scan using _hyper_1_41_chunk_position_reorder_chunk_idx on _hyper_1_41_chunk p_6 (cost=0.12..0.17 rows=1 width=28) (actual time=0.003..0.003 rows=0 loops=966)

  • Index Cond: ((mean_id = e.mean_id) AND (position_ts >= e.pair_start) AND (position_ts <= (max(e.pair_end))) AND (position_ts >= '2019-12-01 00:00:00'::timestamp without time zone))
22. 8.694 8.694 ↓ 0.0 0 966

Index Scan using _hyper_1_202_chunk_position_reorder_chunk_idx on _hyper_1_202_chunk p_7 (cost=0.43..89.28 rows=111 width=28) (actual time=0.009..0.009 rows=0 loops=966)

  • Index Cond: ((mean_id = e.mean_id) AND (position_ts >= e.pair_start) AND (position_ts <= (max(e.pair_end))) AND (position_ts >= '2019-12-01 00:00:00'::timestamp without time zone))
23. 7.728 7.728 ↓ 0.0 0 966

Index Scan using _hyper_1_197_chunk_position_reorder_chunk_idx on _hyper_1_197_chunk p_8 (cost=0.43..63.21 rows=83 width=28) (actual time=0.008..0.008 rows=0 loops=966)

  • Index Cond: ((mean_id = e.mean_id) AND (position_ts >= e.pair_start) AND (position_ts <= (max(e.pair_end))) AND (position_ts >= '2019-12-01 00:00:00'::timestamp without time zone))
24. 275.310 275.310 ↓ 1.5 81 966

Index Scan using _hyper_1_178_chunk_position_reorder_chunk_idx on _hyper_1_178_chunk p_9 (cost=0.43..49.61 rows=53 width=28) (actual time=0.014..0.285 rows=81 loops=966)

  • Index Cond: ((mean_id = e.mean_id) AND (position_ts >= e.pair_start) AND (position_ts <= (max(e.pair_end))) AND (position_ts >= '2019-12-01 00:00:00'::timestamp without time zone))
25. 523.572 523.572 ↓ 1.9 176 966

Index Scan using _hyper_1_187_chunk_position_reorder_chunk_idx on _hyper_1_187_chunk p_10 (cost=0.43..77.74 rows=92 width=28) (actual time=0.017..0.542 rows=176 loops=966)

  • Index Cond: ((mean_id = e.mean_id) AND (position_ts >= e.pair_start) AND (position_ts <= (max(e.pair_end))) AND (position_ts >= '2019-12-01 00:00:00'::timestamp without time zone))
Planning time : 3.346 ms
Execution time : 330,240.917 ms