explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7Ab9

Settings
# exclusive inclusive rows x rows loops node
1. 0.085 3.201 ↓ 1.9 178 1

Hash Left Join (cost=493.32..1,100.40 rows=95 width=294) (actual time=2.129..3.201 rows=178 loops=1)

  • Hash Cond: ("order".id = nsi_order.price_order_id)
2. 0.043 2.754 ↓ 1.9 178 1

Hash Left Join (cost=492.26..686.68 rows=95 width=290) (actual time=2.104..2.754 rows=178 loops=1)

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

Nested Loop Left Join (cost=462.31..653.79 rows=95 width=286) (actual time=2.014..2.625 rows=174 loops=1)

4. 0.031 2.539 ↓ 1.8 174 1

Hash Left Join (cost=462.04..604.00 rows=95 width=265) (actual time=2.010..2.539 rows=174 loops=1)

  • Hash Cond: ("order".charge_person = cu.id)
5. 0.050 1.669 ↓ 1.8 174 1

Hash Left Join (cost=298.05..439.64 rows=95 width=261) (actual time=1.167..1.669 rows=174 loops=1)

  • Hash Cond: ("order".user_id = u.id)
6. 0.042 0.922 ↓ 1.8 174 1

Hash Join (cost=134.06..274.46 rows=95 width=224) (actual time=0.466..0.922 rows=174 loops=1)

  • Hash Cond: ("order".customer_id = c.id)
7. 0.427 0.427 ↓ 1.8 174 1

Seq Scan on nsi_price_order "order" (cost=0.00..139.10 rows=95 width=199) (actual time=0.009..0.427 rows=174 loops=1)

  • Filter: ((status > 1) AND (11051 = ANY (potential_suppliers)))
  • Rows Removed by Filter: 1590
8. 0.168 0.453 ↑ 1.0 1,247 1

Hash (cost=118.47..118.47 rows=1,247 width=29) (actual time=0.453..0.453 rows=1,247 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 87kB
9. 0.285 0.285 ↑ 1.0 1,247 1

Seq Scan on contragents c (cost=0.00..118.47 rows=1,247 width=29) (actual time=0.002..0.285 rows=1,247 loops=1)

10. 0.283 0.697 ↑ 1.0 2,044 1

Hash (cost=138.44..138.44 rows=2,044 width=41) (actual time=0.697..0.697 rows=2,044 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 168kB
11. 0.414 0.414 ↑ 1.0 2,044 1

Seq Scan on users u (cost=0.00..138.44 rows=2,044 width=41) (actual time=0.001..0.414 rows=2,044 loops=1)

12. 0.488 0.839 ↑ 1.0 2,044 1

Hash (cost=138.44..138.44 rows=2,044 width=8) (actual time=0.839..0.839 rows=2,044 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 96kB
13. 0.351 0.351 ↑ 1.0 2,044 1

Seq Scan on users cu (cost=0.00..138.44 rows=2,044 width=8) (actual time=0.001..0.351 rows=2,044 loops=1)

14. 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)
15. 0.020 0.086 ↓ 1.0 174 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
16. 0.049 0.066 ↓ 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.023..0.066 rows=174 loops=1)

  • Recheck Cond: (contragent_id = 11051)
  • Heap Blocks: exact=18
17. 0.017 0.017 ↓ 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.017..0.017 rows=174 loops=1)

  • Index Cond: (contragent_id = 11051)
18. 0.001 0.006 ↑ 1.0 1 1

Hash (cost=1.04..1.04 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
19. 0.005 0.005 ↑ 1.0 1 1

Seq Scan on nsi_order (cost=0.00..1.04 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=1)

  • Filter: ((status <> 10) AND (supplier_id = 11051))
  • Rows Removed by Filter: 9
20.          

SubPlan (forHash Left Join)

21. 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)

22. 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