explain.depesz.com

PostgreSQL's explain analyze made readable

Result: w4kK : Optimization for: plan #JDBt

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.007 0.114 ↓ 2.0 14 1

Nested Loop (cost=3.94..7.48 rows=7 width=464) (actual time=0.096..0.114 rows=14 loops=1)

2. 0.004 0.085 ↓ 2.0 2 1

HashAggregate (cost=3.65..3.66 rows=1 width=4) (actual time=0.084..0.085 rows=2 loops=1)

  • Group Key: es_event_1.order_id
3. 0.010 0.081 ↓ 2.0 2 1

GroupAggregate (cost=3.61..3.64 rows=1 width=12) (actual time=0.075..0.081 rows=2 loops=1)

  • Group Key: es_event_1.order_id, es_event_1.pair_start
  • Filter: ((max(es_event_1.pair_end) IS NULL) OR (max(es_event_1.pair_end) <= '2019-12-31 21:06:49'::timestamp without time zone))
  • Rows Removed by Filter: 3
4. 0.012 0.071 ↓ 10.0 10 1

Sort (cost=3.61..3.62 rows=1 width=20) (actual time=0.070..0.071 rows=10 loops=1)

  • Sort Key: es_event_1.order_id, es_event_1.pair_start
  • Sort Method: quicksort Memory: 25kB
5. 0.059 0.059 ↓ 10.0 10 1

Index Scan using es_event_pairing_idx on es_event es_event_1 (cost=0.29..3.60 rows=1 width=20) (actual time=0.027..0.059 rows=10 loops=1)

  • Index Cond: ((name = ANY ('{ORDER_IS_PAIR,ORDER_IS_UNPAIR}'::text[])) AND (mean_id = 7732) AND ('2019-12-31 21:06:49'::timestamp without time zone >= pair_start))
6. 0.022 0.022 ↑ 1.0 7 2

Index Scan using es_event_order_id_idx on es_event (cost=0.29..3.74 rows=7 width=464) (actual time=0.008..0.011 rows=7 loops=2)

  • Index Cond: (order_id = es_event_1.order_id)
Planning time : 0.419 ms
Execution time : 0.181 ms