explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vOoT

Settings
# exclusive inclusive rows x rows loops node
1. 16.142 122.592 ↓ 1.0 28,994 1

Sort (cost=12,303.78..12,376.10 rows=28,929 width=33) (actual time=120.902..122.592 rows=28,994 loops=1)

  • Sort Key: sale_order_line__order_id.date_order DESC, sale_order_line__order_id.id DESC, sale_order_line__lot_id.id, (COALESCE(sale_order_line.is_expense, false)), sale_order_line__layout_category_id.sequence, sale_order_line__layout_category_id.id, sale_order_line.sequence, sale_order_line.id
  • Sort Method: quicksort Memory: 3034kB
2. 4.864 106.450 ↓ 1.0 28,994 1

Hash Left Join (cost=5,205.66..10,160.10 rows=28,929 width=33) (actual time=48.440..106.450 rows=28,994 loops=1)

  • Hash Cond: (sale_order_line.layout_category_id = sale_order_line__layout_category_id.id)
3. 13.335 101.579 ↓ 1.0 28,994 1

Hash Left Join (cost=5,204.62..10,083.12 rows=28,929 width=29) (actual time=48.423..101.579 rows=28,994 loops=1)

  • Hash Cond: (sale_order_line.lot_id = sale_order_line__lot_id.id)
4. 10.849 65.829 ↓ 1.0 28,994 1

Hash Left Join (cost=2,725.64..7,528.21 rows=28,929 width=29) (actual time=25.892..65.829 rows=28,994 loops=1)

  • Hash Cond: (sale_order_line.order_id = sale_order_line__order_id.id)
5. 29.153 29.153 ↓ 1.0 28,994 1

Seq Scan on sale_order_line (cost=0.00..4,726.60 rows=28,929 width=21) (actual time=0.019..29.153 rows=28,994 loops=1)

  • Filter: is_expense
  • Rows Removed by Filter: 55822
6. 10.043 25.827 ↑ 1.0 17,362 1

Hash (cost=2,508.62..2,508.62 rows=17,362 width=12) (actual time=25.827..25.827 rows=17,362 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1003kB
7. 15.784 15.784 ↑ 1.0 17,362 1

Seq Scan on sale_order sale_order_line__order_id (cost=0.00..2,508.62 rows=17,362 width=12) (actual time=0.007..15.784 rows=17,362 loops=1)

8. 11.556 22.415 ↑ 1.0 64,310 1

Hash (cost=1,675.10..1,675.10 rows=64,310 width=4) (actual time=22.415..22.415 rows=64,310 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2773kB
9. 10.859 10.859 ↑ 1.0 64,310 1

Seq Scan on sale_order_lot sale_order_line__lot_id (cost=0.00..1,675.10 rows=64,310 width=4) (actual time=0.038..10.859 rows=64,310 loops=1)

10. 0.001 0.007 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=8) (actual time=0.007..0.007 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.006 0.006 ↑ 1.0 2 1

Seq Scan on sale_layout_category sale_order_line__layout_category_id (cost=0.00..1.02 rows=2 width=8) (actual time=0.005..0.006 rows=2 loops=1)