explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PL8n

Settings
# exclusive inclusive rows x rows loops node
1. 1.127 388,999.708 ↓ 153.8 769 1

Unique (cost=241,525.82..241,525.86 rows=5 width=12) (actual time=388,997.705..388,999.708 rows=769 loops=1)

2. 46.368 388,998.581 ↓ 3,076.0 15,380 1

Sort (cost=241,525.82..241,525.83 rows=5 width=12) (actual time=388,997.703..388,998.581 rows=15,380 loops=1)

  • Sort Key: fo.orchestrator_order_id, fo.original_quantity
  • Sort Method: quicksort Memory: 1105kB
3. 36.711 388,952.213 ↓ 3,076.0 15,380 1

Nested Loop (cost=161,284.57..241,525.76 rows=5 width=12) (actual time=1,199.359..388,952.213 rows=15,380 loops=1)

4. 7.175 1,733.984 ↓ 2,811.0 2,811 1

Nested Loop (cost=161,284.14..179,338.09 rows=1 width=16) (actual time=952.042..1,733.984 rows=2,811 loops=1)

5. 63.252 1,646.425 ↓ 137.6 10,048 1

Subquery Scan on fo (cost=161,283.71..179,012.33 rows=73 width=16) (actual time=951.858..1,646.425 rows=10,048 loops=1)

  • Filter: ((NOT fo.is_handled) AND (fo.original_quantity > 2) AND (fo.rank = 1))
  • Rows Removed by Filter: 814168
6. 336.144 1,583.173 ↓ 1.6 824,216 1

WindowAgg (cost=161,283.71..171,414.35 rows=506,532 width=29) (actual time=951.786..1,583.173 rows=824,216 loops=1)

7. 739.352 1,247.029 ↓ 1.6 824,216 1

Sort (cost=161,283.71..162,550.04 rows=506,532 width=21) (actual time=951.761..1,247.029 rows=824,216 loops=1)

  • Sort Key: fulfillment_order.orchestrator_order_id, fulfillment_order.version DESC
  • Sort Method: external merge Disk: 24928kB
8. 507.677 507.677 ↓ 1.6 824,216 1

Index Scan using ix_process_id on fulfillment_order (cost=0.43..105,869.06 rows=506,532 width=21) (actual time=7.575..507.677 rows=824,216 loops=1)

  • Index Cond: (process_id = 573)
9. 80.384 80.384 ↓ 0.0 0 10,048

Index Scan using orchestrator_order_award_idx on fulfillment_order_award foa (cost=0.43..4.45 rows=1 width=8) (actual time=0.006..0.008 rows=0 loops=10,048)

  • Index Cond: ((orchestrator_order_id = fo.orchestrator_order_id) AND (prize_id = 7503852))
  • Filter: active
10. 387,181.518 387,181.518 ↑ 1.0 5 2,811

Index Only Scan using ix_customer_data on customer_data cd (cost=0.43..62,187.62 rows=5 width=4) (actual time=59.364..137.738 rows=5 loops=2,811)

  • Index Cond: (customer_registration_number = fo.customer_registration_number)
  • Heap Fetches: 2814
Planning time : 0.590 ms
Execution time : 389,007.133 ms