explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uO5

Settings
# exclusive inclusive rows x rows loops node
1. 0.479 444.895 ↓ 451.0 451 1

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

  • Join Filter: (buyer_vendors_public_orders_join.id = buyer_vendors.id)
2. 0.411 443.514 ↓ 451.0 451 1

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

3. 0.331 440.397 ↓ 451.0 451 1

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

4. 0.128 439.316 ↓ 375.0 375 1

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

5. 0.076 438.813 ↓ 375.0 375 1

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

6. 0.045 437.987 ↓ 375.0 375 1

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

7. 5.844 437.192 ↓ 375.0 375 1

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

8. 6.325 420.050 ↓ 6.4 5,649 1

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

9. 1.986 391.189 ↓ 6.4 5,634 1

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

10. 1.774 372.301 ↓ 6.4 5,634 1

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

11. 1.890 353.625 ↓ 6.4 5,634 1

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

12. 5.660 290.729 ↓ 6.6 5,546 1

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

13. 5.031 268.404 ↓ 6.6 5,555 1

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

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

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

15. 4.359 104.309 ↓ 2.9 5,708 1

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

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

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

  • Hash Cond: (buyer_vendors_public_orders_join_2.id = buyer_vendors_public_orders_join.id)
17. 28.534 28.534 ↓ 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.006..28.534 rows=253,536 loops=1)

18. 0.724 5.611 ↓ 1.1 2,287 1

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

  • Buckets: 4096 Batches: 1 Memory Usage: 122kB
19. 4.677 4.887 ↓ 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.360..4.887 rows=2,287 loops=1)

  • Recheck Cond: (vendor_id = 30)
  • Heap Blocks: exact=1617
20. 0.210 0.210 ↓ 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.210..0.210 rows=2,289 loops=1)

  • Index Cond: (vendor_id = 30)
21. 36.592 36.592 ↑ 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.005..0.016 rows=2 loops=2,287)

  • Index Cond: (buyer_vendor_id = buyer_vendors_public_orders_join_2.id)
22. 154.116 154.116 ↑ 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.021..0.027 rows=1 loops=5,708)

  • Index Cond: (order_id = orders.id)
23. 0.002 0.027 ↑ 1.0 1 1

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

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

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

25. 0.015 0.015 ↑ 1.0 1 1

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

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

Seq Scan on milestones (cost=0.00..1.04 rows=1 width=4) (actual time=0.008..0.008 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. 61.006 61.006 ↑ 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.009..0.011 rows=1 loops=5,546)

  • Index Cond: (order_id = orders.id)
  • Filter: ((party)::text = 'vendor'::text)
  • Rows Removed by Filter: 1
29. 16.902 16.902 ↑ 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.003..0.003 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. 22.536 22.536 ↑ 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.004..0.004 rows=1 loops=5,634)

  • Index Cond: (account_id = accounts.id)
32. 11.298 11.298 ↑ 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.002..0.002 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.002..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. 0.750 0.750 ↑ 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.002..0.002 rows=1 loops=375)

  • Index Cond: (order_id = orders.id)
37. 2.706 2.706 ↑ 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.006..0.006 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)