explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cmmF

Settings
# exclusive inclusive rows x rows loops node
1. 39.873 6,041.670 ↓ 455.0 455 1

Nested Loop (cost=59,124.14..208,823.15 rows=1 width=633) (actual time=2,683.212..6,041.670 rows=455 loops=1)

2. 16.090 5,918.497 ↓ 83,300.0 83,300 1

Nested Loop Left Join (cost=59,123.72..208,822.62 rows=1 width=80) (actual time=1,643.795..5,918.497 rows=83,300 loops=1)

3. 12.484 5,722.311 ↓ 60,032.0 60,032 1

Nested Loop Left Join (cost=59,123.29..208,822.09 rows=1 width=84) (actual time=1,643.782..5,722.311 rows=60,032 loops=1)

4. 0.000 5,469.699 ↓ 60,032.0 60,032 1

Nested Loop Left Join (cost=59,123.00..208,821.76 rows=1 width=69) (actual time=1,643.775..5,469.699 rows=60,032 loops=1)

5. 159.948 5,231.945 ↓ 60,032.0 60,032 1

Hash Anti Join (cost=59,122.58..208,821.24 rows=1 width=65) (actual time=1,643.766..5,231.945 rows=60,032 loops=1)

  • Hash Cond: (account_assignments.sales_rep_id = users.id)
6. 173.148 4,629.957 ↓ 2.7 270,182 1

Nested Loop Left Join (cost=47,192.08..193,800.98 rows=99,135 width=56) (actual time=1,197.230..4,629.957 rows=270,182 loops=1)

7. 734.289 2,499.714 ↓ 2.2 217,455 1

Hash Right Join (cost=47,191.65..142,155.39 rows=99,135 width=52) (actual time=1,197.214..2,499.714 rows=217,455 loops=1)

  • Hash Cond: (accounts.id = buyer_vendors_public_orders_join.account_id)
8. 573.717 573.717 ↑ 1.0 1,784,136 1

Seq Scan on accounts (cost=0.00..50,140.91 rows=1,784,191 width=23) (actual time=1.197..573.717 rows=1,784,136 loops=1)

9. 44.828 1,191.708 ↓ 2.2 217,455 1

Hash (cost=45,177.47..45,177.47 rows=99,135 width=33) (actual time=1,191.708..1,191.708 rows=217,455 loops=1)

  • Buckets: 65536 (originally 65536) Batches: 32 (originally 2) Memory Usage: 3810kB
10. 104.180 1,146.880 ↓ 2.2 217,455 1

Hash Left Join (cost=30,463.58..45,177.47 rows=99,135 width=33) (actual time=869.218..1,146.880 rows=217,455 loops=1)

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

Hash Join (cost=20,438.07..31,441.85 rows=99,135 width=29) (actual time=660.863..834.928 rows=217,455 loops=1)

  • Hash Cond: (order_milestones.order_id = orders.id)
12. 44.604 67.881 ↓ 2.2 217,455 1

Hash Join (cost=1.05..7,268.72 rows=99,135 width=4) (actual time=0.365..67.881 rows=217,455 loops=1)

  • Hash Cond: (order_milestones.milestone_id = milestones.id)
13. 22.924 22.924 ↓ 1.0 297,407 1

Seq Scan on order_milestones (cost=0.00..5,161.05 rows=297,405 width=12) (actual time=0.006..22.924 rows=297,407 loops=1)

14. 0.004 0.353 ↑ 1.0 1 1

Hash (cost=1.04..1.04 rows=1 width=4) (actual time=0.353..0.353 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.349 0.349 ↑ 1.0 1 1

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

  • Filter: ((name)::text = 'submitted'::text)
  • Rows Removed by Filter: 2
16. 90.095 658.248 ↑ 1.0 233,428 1

Hash (cost=15,921.12..15,921.12 rows=233,512 width=29) (actual time=658.248..658.248 rows=233,428 loops=1)

  • Buckets: 65536 Batches: 8 Memory Usage: 2323kB
17. 568.153 568.153 ↑ 1.0 233,428 1

Seq Scan on orders (cost=0.00..15,921.12 rows=233,512 width=29) (actual time=0.335..568.153 rows=233,428 loops=1)

18. 56.536 207.772 ↓ 1.0 253,536 1

Hash (cost=5,865.34..5,865.34 rows=253,534 width=8) (actual time=207.771..207.772 rows=253,536 loops=1)

  • Buckets: 131072 Batches: 4 Memory Usage: 3473kB
19. 151.236 151.236 ↓ 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=8) (actual time=0.015..151.236 rows=253,536 loops=1)

20. 1,957.095 1,957.095 ↑ 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=8) (actual time=0.008..0.009 rows=1 loops=217,455)

  • Index Cond: (account_id = accounts.id)
21. 46.756 442.040 ↑ 1.0 133,073 1

Hash (cost=9,486.89..9,486.89 rows=133,089 width=17) (actual time=442.040..442.040 rows=133,073 loops=1)

  • Buckets: 65536 Batches: 4 Memory Usage: 2205kB
22. 395.284 395.284 ↑ 1.0 133,073 1

Seq Scan on users (cost=0.00..9,486.89 rows=133,089 width=17) (actual time=0.009..395.284 rows=133,073 loops=1)

23. 240.128 240.128 ↑ 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=12) (actual time=0.004..0.004 rows=1 loops=60,032)

  • Index Cond: (id = orders.buyer_vendor_id)
24. 240.128 240.128 ↑ 1.0 1 60,032

Index Scan using buyers_pkey on buyers (cost=0.29..0.32 rows=1 width=23) (actual time=0.004..0.004 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 Only Scan using index_order_milestones_on_order_id on order_milestones order_milestones_public_orders (cost=0.42..0.51 rows=2 width=4) (actual time=0.003..0.003 rows=1 loops=60,032)

  • Index Cond: (order_id = orders.id)
  • Heap Fetches: 83300
26. 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=4) (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