explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fIeB

Settings
# exclusive inclusive rows x rows loops node
1. 0.212 1.918 ↓ 1.9 178 1

Nested Loop Left Join (cost=86.96..1,663.16 rows=95 width=294) (actual time=0.212..1.918 rows=178 loops=1)

  • Join Filter: ("order".id = nsi_order.price_order_id)
  • Rows Removed by Join Filter: 177
2. 0.096 1.350 ↓ 1.9 178 1

Hash Left Join (cost=86.83..1,241.28 rows=95 width=290) (actual time=0.190..1.350 rows=178 loops=1)

  • Hash Cond: ("order".id = pos.price_order_id)
3. 0.076 1.167 ↓ 1.8 174 1

Nested Loop Left Join (cost=56.88..1,208.39 rows=95 width=286) (actual time=0.097..1.167 rows=174 loops=1)

4. 0.080 1.091 ↓ 1.8 174 1

Nested Loop Left Join (cost=56.60..1,158.60 rows=95 width=265) (actual time=0.096..1.091 rows=174 loops=1)

5. 0.101 1.011 ↓ 1.8 174 1

Nested Loop Left Join (cost=56.33..825.62 rows=95 width=261) (actual time=0.096..1.011 rows=174 loops=1)

6. 0.002 0.736 ↓ 1.8 174 1

Nested Loop (cost=56.05..492.65 rows=95 width=224) (actual time=0.092..0.736 rows=174 loops=1)

7. 0.317 0.386 ↓ 1.8 174 1

Bitmap Heap Scan on nsi_price_order "order" (cost=55.77..175.67 rows=95 width=199) (actual time=0.083..0.386 rows=174 loops=1)

  • Recheck Cond: (status > 1)
  • Filter: (11051 = ANY (potential_suppliers))
  • Rows Removed by Filter: 826
  • Heap Blocks: exact=47
8. 0.069 0.069 ↓ 1.0 1,006 1

Bitmap Index Scan on nsi_price_order_status_idx (cost=0.00..55.75 rows=996 width=0) (actual time=0.069..0.069 rows=1,006 loops=1)

  • Index Cond: (status > 1)
9. 0.348 0.348 ↑ 1.0 1 174

Index Scan using contragents_pkey on contragents c (cost=0.28..3.33 rows=1 width=29) (actual time=0.001..0.002 rows=1 loops=174)

  • Index Cond: (id = "order".customer_id)
10. 0.174 0.174 ↑ 1.0 1 174

Index Scan using users_pkey on users u (cost=0.28..3.49 rows=1 width=41) (actual time=0.001..0.001 rows=1 loops=174)

  • Index Cond: ("order".user_id = id)
11. 0.000 0.000 ↓ 0.0 0 174

Index Scan using users_pkey on users cu (cost=0.28..3.49 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=174)

  • Index Cond: (id = "order".charge_person)
12. 0.000 0.000 ↓ 0.0 0 174

Index Scan using contragents_pkey on contragents cc (cost=0.28..0.51 rows=1 width=29) (actual time=0.000..0.000 rows=0 loops=174)

  • Index Cond: (id = cu.contragent_id)
13. 0.020 0.087 ↓ 1.0 174 1

Hash (cost=27.78..27.78 rows=173 width=8) (actual time=0.087..0.087 rows=174 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
14. 0.052 0.067 ↓ 1.0 174 1

Bitmap Heap Scan on nsi_price_order_supplier pos (cost=5.62..27.78 rows=173 width=8) (actual time=0.018..0.067 rows=174 loops=1)

  • Recheck Cond: (contragent_id = 11051)
  • Heap Blocks: exact=18
15. 0.015 0.015 ↓ 1.0 174 1

Bitmap Index Scan on nsi_price_order_supplier_contragent_id_idx (cost=0.00..5.58 rows=173 width=0) (actual time=0.015..0.015 rows=174 loops=1)

  • Index Cond: (contragent_id = 11051)
16. 0.000 0.000 ↑ 1.0 1 178

Materialize (cost=0.13..8.16 rows=1 width=8) (actual time=0.000..0.000 rows=1 loops=178)

17. 0.006 0.006 ↑ 1.0 1 1

Index Scan using nsi_order_supplier_id_idx on nsi_order (cost=0.13..8.15 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=1)

  • Index Cond: (supplier_id = 11051)
  • Filter: (status <> 10)
  • Rows Removed by Filter: 1
18.          

SubPlan (forNested Loop Left Join)

19. 0.178 0.356 ↑ 1.0 1 178

Aggregate (cost=4.32..4.33 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=178)

20. 0.178 0.178 ↑ 1.0 2 178

Index Only Scan using nsi_price_order_positions_order_id_idx_btree on nsi_price_order_positions popos (cost=0.28..4.31 rows=2 width=0) (actual time=0.001..0.001 rows=2 loops=178)

  • Index Cond: (price_order_id = "order".id)
  • Heap Fetches: 96