explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WJMr

Settings
# exclusive inclusive rows x rows loops node
1. 0.791 2,438.126 ↓ 451.0 451 1

Nested Loop (cost=3,208.07..16,633.95 rows=1 width=633) (actual time=36.323..2,438.126 rows=451 loops=1)

  • Join Filter: (buyer_vendors_public_orders_join.id = buyer_vendors.id)
2. 0.185 2,436.433 ↓ 451.0 451 1

Nested Loop Left Join (cost=3,207.65..16,633.43 rows=1 width=88) (actual time=36.308..2,436.433 rows=451 loops=1)

3. 0.363 2,434.895 ↓ 451.0 451 1

Nested Loop Left Join (cost=3,207.23..16,632.86 rows=1 width=79) (actual time=36.298..2,434.895 rows=451 loops=1)

4. 0.145 2,433.407 ↓ 375.0 375 1

Nested Loop Left Join (cost=3,206.81..16,632.34 rows=1 width=79) (actual time=36.290..2,433.407 rows=375 loops=1)

5. 0.095 2,432.887 ↓ 375.0 375 1

Nested Loop Left Join (cost=3,206.38..16,631.81 rows=1 width=83) (actual time=36.288..2,432.887 rows=375 loops=1)

6. 0.065 2,432.042 ↓ 375.0 375 1

Nested Loop Left Join (cost=3,205.96..16,630.77 rows=1 width=83) (actual time=36.285..2,432.042 rows=375 loops=1)

7. 3.612 2,431.227 ↓ 375.0 375 1

Nested Loop Anti Join (cost=3,205.54..16,630.26 rows=1 width=79) (actual time=36.281..2,431.227 rows=375 loops=1)

8. 4.995 2,410.668 ↓ 6.4 5,649 1

Nested Loop Left Join (cost=3,205.12..16,216.46 rows=885 width=83) (actual time=4.851..2,410.668 rows=5,649 loops=1)

9. 4.413 2,388.771 ↓ 6.4 5,634 1

Nested Loop Left Join (cost=3,204.69..15,755.41 rows=885 width=79) (actual time=4.845..2,388.771 rows=5,634 loops=1)

10. 11.487 2,367.456 ↓ 6.4 5,634 1

Nested Loop Left Join (cost=3,204.26..14,833.41 rows=885 width=60) (actual time=4.839..2,367.456 rows=5,634 loops=1)

11. 7.863 2,333.433 ↓ 6.4 5,634 1

Nested Loop Left Join (cost=3,203.84..14,376.31 rows=885 width=56) (actual time=4.830..2,333.433 rows=5,634 loops=1)

12. 5.104 262.458 ↓ 6.6 5,546 1

Nested Loop (cost=3,203.42..13,812.48 rows=841 width=56) (actual time=3.669..262.458 rows=5,546 loops=1)

13. 5.285 240.689 ↓ 6.6 5,555 1

Hash Join (cost=3,203.13..13,531.13 rows=843 width=41) (actual time=3.663..240.689 rows=5,555 loops=1)

  • Hash Cond: (order_milestones.milestone_id = milestones.id)
14. 5.033 235.372 ↓ 3.0 7,496 1

Nested Loop (cost=3,193.77..13,503.86 rows=2,528 width=49) (actual time=3.626..235.372 rows=7,496 loops=1)

15. 5.846 196.091 ↓ 2.9 5,708 1

Nested Loop (cost=3,193.35..12,453.85 rows=1,985 width=45) (actual time=3.620..196.091 rows=5,708 loops=1)

  • Join Filter: (buyer_vendors_public_orders_join.id = orders.buyer_vendor_id)
16. 33.529 96.478 ↓ 1.1 2,287 1

Hash Join (cost=3,192.93..10,030.57 rows=2,155 width=16) (actual time=2.292..96.478 rows=2,287 loops=1)

  • Hash Cond: (buyer_vendors_public_orders_join_2.id = buyer_vendors_public_orders_join.id)
17. 60.678 60.678 ↓ 1.0 253,536 1

Seq Scan on buyer_vendors buyer_vendors_public_orders_join_2 (cost=0.00..5,865.34 rows=253,534 width=8) (actual time=0.003..60.678 rows=253,536 loops=1)

18. 0.236 2.271 ↓ 1.1 2,287 1

Hash (cost=3,165.99..3,165.99 rows=2,155 width=8) (actual time=2.271..2.271 rows=2,287 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 122kB
19. 1.844 2.035 ↓ 1.1 2,287 1

Bitmap Heap Scan on buyer_vendors buyer_vendors_public_orders_join (cost=41.12..3,165.99 rows=2,155 width=8) (actual time=0.376..2.035 rows=2,287 loops=1)

  • Recheck Cond: (vendor_id = 30)
  • Heap Blocks: exact=1617
20. 0.191 0.191 ↓ 1.1 2,289 1

Bitmap Index Scan on index_buyer_vendors_on_vendor_id (cost=0.00..40.58 rows=2,155 width=0) (actual time=0.191..0.191 rows=2,289 loops=1)

  • Index Cond: (vendor_id = 30)
21. 93.767 93.767 ↑ 8.0 2 2,287

Index Scan using index_orders_on_buyer_vendor_id on orders (cost=0.42..0.92 rows=16 width=29) (actual time=0.029..0.041 rows=2 loops=2,287)

  • Index Cond: (buyer_vendor_id = buyer_vendors_public_orders_join_2.id)
22. 34.248 34.248 ↑ 2.0 1 5,708

Index Scan using index_order_milestones_on_order_id on order_milestones (cost=0.42..0.51 rows=2 width=8) (actual time=0.005..0.006 rows=1 loops=5,708)

  • Index Cond: (order_id = orders.id)
23. 0.001 0.032 ↑ 1.0 1 1

Hash (cost=9.34..9.34 rows=1 width=8) (actual time=0.032..0.032 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
24. 0.002 0.031 ↑ 1.0 1 1

Nested Loop (cost=0.28..9.34 rows=1 width=8) (actual time=0.030..0.031 rows=1 loops=1)

25. 0.022 0.022 ↑ 1.0 1 1

Index Only Scan using vendors_pkey on vendors (cost=0.28..8.29 rows=1 width=4) (actual time=0.022..0.022 rows=1 loops=1)

  • Index Cond: (id = 30)
  • Heap Fetches: 1
26. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on milestones (cost=0.00..1.04 rows=1 width=4) (actual time=0.006..0.007 rows=1 loops=1)

  • Filter: ((name)::text = 'submitted'::text)
  • Rows Removed by Filter: 2
27. 16.665 16.665 ↑ 1.0 1 5,555

Index Scan using buyers_pkey on buyers (cost=0.29..0.32 rows=1 width=23) (actual time=0.003..0.003 rows=1 loops=5,555)

  • Index Cond: (id = buyer_vendors_public_orders_join_2.buyer_id)
  • Filter: (NOT demo)
  • Rows Removed by Filter: 0
28. 2,063.112 2,063.112 ↑ 1.0 1 5,546

Index Scan using index_order_contacts_on_order_id on order_contacts (cost=0.42..0.66 rows=1 width=4) (actual time=0.300..0.372 rows=1 loops=5,546)

  • Index Cond: (order_id = orders.id)
  • Filter: ((party)::text = 'vendor'::text)
  • Rows Removed by Filter: 1
29. 22.536 22.536 ↑ 1.0 1 5,634

Index Scan using buyer_vendors_pkey on buyer_vendors buyer_vendors_public_orders_join_3 (cost=0.42..0.51 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=5,634)

  • Index Cond: (id = orders.buyer_vendor_id)
30. 16.902 16.902 ↑ 1.0 1 5,634

Index Scan using accounts_pkey on accounts (cost=0.43..1.03 rows=1 width=23) (actual time=0.003..0.003 rows=1 loops=5,634)

  • Index Cond: (id = buyer_vendors_public_orders_join_3.account_id)
31. 16.902 16.902 ↑ 2.0 1 5,634

Index Scan using index_account_assignments_on_account_id on account_assignments (cost=0.43..0.50 rows=2 width=8) (actual time=0.003..0.003 rows=1 loops=5,634)

  • Index Cond: (account_id = accounts.id)
32. 16.947 16.947 ↑ 1.0 1 5,649

Index Only Scan using users_pkey on users (cost=0.42..0.46 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=5,649)

  • Index Cond: (id = account_assignments.sales_rep_id)
  • Heap Fetches: 5274
33. 0.750 0.750 ↑ 1.0 1 375

Index Scan using buyer_vendors_pkey on buyer_vendors buyer_vendors_public_orders (cost=0.42..0.51 rows=1 width=12) (actual time=0.001..0.002 rows=1 loops=375)

  • Index Cond: (id = orders.buyer_vendor_id)
34. 0.750 0.750 ↑ 1.0 1 375

Index Only Scan using accounts_pkey on accounts accounts_buyer_buyer_vendors (cost=0.43..1.03 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=375)

  • Index Cond: (id = buyer_vendors_public_orders.account_id)
  • Heap Fetches: 302
35. 0.375 0.375 ↓ 0.0 0 375

Index Scan using index_account_assignments_on_account_id on account_assignments account_assignments_accounts_join (cost=0.43..0.50 rows=2 width=8) (actual time=0.001..0.001 rows=0 loops=375)

  • Index Cond: (account_id = accounts_buyer_buyer_vendors.id)
36. 1.125 1.125 ↑ 2.0 1 375

Index Scan using index_order_milestones_on_order_id on order_milestones order_milestones_public_orders (cost=0.42..0.51 rows=2 width=8) (actual time=0.003..0.003 rows=1 loops=375)

  • Index Cond: (order_id = orders.id)
37. 1.353 1.353 ↑ 1.0 1 451

Index Scan using users_pkey on users created_bies_public_order_milestones (cost=0.42..0.55 rows=1 width=17) (actual time=0.003..0.003 rows=1 loops=451)

  • Index Cond: (id = order_milestones_public_orders.created_by_id)
38. 0.902 0.902 ↑ 1.0 1 451

Index Scan using buyer_vendors_pkey on buyer_vendors (cost=0.42..0.50 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=451)

  • Index Cond: (id = buyer_vendors_public_orders_join_2.id)
  • Filter: (vendor_id = 30)