explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tS8V

Settings
# exclusive inclusive rows x rows loops node
1. 57.294 3,989.337 ↓ 455.0 455 1

Nested Loop (cost=13,249.79..281,410.03 rows=1 width=5,181) (actual time=77.362..3,989.337 rows=455 loops=1)

2. 93.602 3,848.743 ↓ 83,300.0 83,300 1

Nested Loop Left Join (cost=13,249.37..281,409.51 rows=1 width=5,072) (actual time=71.049..3,848.743 rows=83,300 loops=1)

3. 23.252 3,588.541 ↓ 83,300.0 83,300 1

Nested Loop Left Join (cost=13,248.95..281,408.95 rows=1 width=3,981) (actual time=71.040..3,588.541 rows=83,300 loops=1)

4. 63.858 3,385.193 ↓ 60,032.0 60,032 1

Nested Loop Left Join (cost=13,248.53..281,408.42 rows=1 width=3,949) (actual time=71.035..3,385.193 rows=60,032 loops=1)

5. 63.846 3,201.271 ↓ 60,032.0 60,032 1

Nested Loop Left Join (cost=13,248.24..281,408.09 rows=1 width=2,826) (actual time=71.024..3,201.271 rows=60,032 loops=1)

6. 34.653 3,137.425 ↓ 60,032.0 60,032 1

Nested Loop Left Join (cost=13,247.81..281,407.05 rows=1 width=2,383) (actual time=71.022..3,137.425 rows=60,032 loops=1)

7. 0.000 2,922.676 ↓ 60,032.0 60,032 1

Nested Loop Anti Join (cost=13,247.39..281,406.53 rows=1 width=2,274) (actual time=71.013..2,922.676 rows=60,032 loops=1)

8. 188.057 2,402.599 ↓ 2.7 270,182 1

Nested Loop Left Join (cost=13,246.97..235,054.40 rows=99,135 width=1,183) (actual time=70.107..2,402.599 rows=270,182 loops=1)

9. 198.751 1,779.632 ↓ 2.2 217,455 1

Nested Loop Left Join (cost=13,246.54..183,408.81 rows=99,135 width=1,155) (actual time=70.098..1,779.632 rows=217,455 loops=1)

10. 439.126 1,145.971 ↓ 2.2 217,455 1

Hash Left Join (cost=13,246.11..80,129.09 rows=99,135 width=712) (actual time=70.082..1,145.971 rows=217,455 loops=1)

  • Hash Cond: (orders.buyer_vendor_id = buyer_vendors_public_orders_join.id)
11. 124.817 640.799 ↓ 2.2 217,455 1

Merge Join (cost=1.60..46,013.47 rows=99,135 width=603) (actual time=0.026..640.799 rows=217,455 loops=1)

  • Merge Cond: (order_milestones.order_id = orders.id)
12. 123.049 295.654 ↓ 2.2 217,455 1

Nested Loop (cost=0.42..15,377.04 rows=99,135 width=84) (actual time=0.021..295.654 rows=217,455 loops=1)

  • Join Filter: (order_milestones.milestone_id = milestones.id)
  • Rows Removed by Join Filter: 79952
13. 172.605 172.605 ↓ 1.0 297,407 1

Index Scan using index_order_milestones_on_order_id on order_milestones (cost=0.42..10,914.93 rows=297,405 width=32) (actual time=0.006..172.605 rows=297,407 loops=1)

14. 0.000 0.000 ↑ 1.0 1 297,407

Materialize (cost=0.00..1.04 rows=1 width=52) (actual time=0.000..0.000 rows=1 loops=297,407)

15. 0.016 0.016 ↑ 1.0 1 1

Seq Scan on milestones (cost=0.00..1.04 rows=1 width=52) (actual time=0.012..0.016 rows=1 loops=1)

  • Filter: ((name)::text = 'submitted'::text)
  • Rows Removed by Filter: 2
16. 220.328 220.328 ↓ 1.0 234,037 1

Index Scan using orders_pkey on orders (cost=0.42..28,814.71 rows=233,512 width=519) (actual time=0.004..220.328 rows=234,037 loops=1)

17. 41.716 66.046 ↓ 1.0 253,536 1

Hash (cost=5,865.34..5,865.34 rows=253,534 width=109) (actual time=66.046..66.046 rows=253,536 loops=1)

  • Buckets: 32768 Batches: 16 Memory Usage: 1990kB
18. 24.330 24.330 ↓ 1.0 253,536 1

Seq Scan on buyer_vendors buyer_vendors_public_orders_join (cost=0.00..5,865.34 rows=253,534 width=109) (actual time=0.005..24.330 rows=253,536 loops=1)

19. 434.910 434.910 ↑ 1.0 1 217,455

Index Scan using accounts_pkey on accounts (cost=0.43..1.03 rows=1 width=443) (actual time=0.002..0.002 rows=1 loops=217,455)

  • Index Cond: (id = buyer_vendors_public_orders_join.account_id)
20. 434.910 434.910 ↑ 2.0 1 217,455

Index Scan using index_account_assignments_on_account_id on account_assignments (cost=0.43..0.50 rows=2 width=28) (actual time=0.002..0.002 rows=1 loops=217,455)

  • Index Cond: (account_id = accounts.id)
21. 540.364 540.364 ↑ 1.0 1 270,182

Index Scan using users_pkey on users (cost=0.42..0.46 rows=1 width=1,091) (actual time=0.002..0.002 rows=1 loops=270,182)

  • Index Cond: (id = account_assignments.sales_rep_id)
22. 180.096 180.096 ↑ 1.0 1 60,032

Index Scan using buyer_vendors_pkey on buyer_vendors buyer_vendors_public_orders (cost=0.42..0.51 rows=1 width=109) (actual time=0.003..0.003 rows=1 loops=60,032)

  • Index Cond: (id = orders.buyer_vendor_id)
23. 0.000 0.000 ↓ 0.0 0 60,032

Index Scan using accounts_pkey on accounts accounts_buyer_buyer_vendors (cost=0.43..1.03 rows=1 width=443) (actual time=0.000..0.000 rows=0 loops=60,032)

  • Index Cond: (id = buyer_vendors_public_orders.account_id)
24. 120.064 120.064 ↑ 1.0 1 60,032

Index Scan using buyers_pkey on buyers (cost=0.29..0.32 rows=1 width=1,123) (actual time=0.002..0.002 rows=1 loops=60,032)

  • Index Cond: (id = buyer_vendors_public_orders.buyer_id)
25. 180.096 180.096 ↑ 2.0 1 60,032

Index Scan using index_order_milestones_on_order_id on order_milestones order_milestones_public_orders (cost=0.42..0.51 rows=2 width=32) (actual time=0.002..0.003 rows=1 loops=60,032)

  • Index Cond: (order_id = orders.id)
26. 166.600 166.600 ↑ 1.0 1 83,300

Index Scan using users_pkey on users created_bies_public_order_milestones (cost=0.42..0.55 rows=1 width=1,091) (actual time=0.002..0.002 rows=1 loops=83,300)

  • Index Cond: (id = order_milestones.created_by_id)
27. 83.300 83.300 ↓ 0.0 0 83,300

Index Scan using buyer_vendors_pkey on buyer_vendors (cost=0.42..0.51 rows=1 width=109) (actual time=0.001..0.001 rows=0 loops=83,300)

  • Index Cond: (id = orders.buyer_vendor_id)
  • Filter: (vendor_id = 30)
  • Rows Removed by Filter: 1