explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rl2s

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 48.870 ↑ 1.0 1 1

Aggregate (cost=15,829.55..15,829.56 rows=1 width=8) (actual time=48.870..48.870 rows=1 loops=1)

2. 31.315 64.173 ↑ 3.1 14 1

Gather (cost=1,000.86..15,829.45 rows=43 width=6) (actual time=6.963..64.173 rows=14 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.007 32.858 ↑ 3.6 5 3 / 3

Nested Loop (cost=0.85..14,825.15 rows=18 width=6) (actual time=11.122..32.858 rows=5 loops=3)

  • Join Filter: (po.id = op.production_order_id)
4. 0.060 32.824 ↓ 1.5 3 3 / 3

Nested Loop (cost=0.42..14,660.49 rows=2 width=12) (actual time=11.104..32.824 rows=3 loops=3)

5. 32.347 32.347 ↓ 1.0 104 3 / 3

Parallel Seq Scan on production_order po (cost=0.00..13,831.09 rows=100 width=6) (actual time=0.460..32.347 rows=104 loops=3)

  • Filter: ((reproduction_statuses IS NULL) AND (NOT bulk_order) AND (pharmacy_id = '10317'::numeric) AND (actual_status_id = ANY ('{5,6,4}'::numeric[])))
  • Rows Removed by Filter: 74240
6. 0.417 0.417 ↓ 0.0 0 313 / 3

Index Only Scan using pk_production_order_status_history on production_order_status_history h (cost=0.42..8.28 rows=1 width=6) (actual time=0.004..0.004 rows=0 loops=313)

  • Index Cond: ((production_order_id = po.id) AND (changed >= '2020-01-01 00:00:00'::timestamp without time zone) AND (changed < '2020-01-31 23:59:59'::timestamp without time zone) AND (status_id = '4'::numeric))
  • Heap Fetches: 6
7. 0.027 0.027 ↑ 25.0 2 8 / 3

Index Scan using idx_op_po_id on order_proposal op (cost=0.43..81.70 rows=50 width=12) (actual time=0.010..0.010 rows=2 loops=8)

  • Index Cond: (production_order_id = h.production_order_id)