explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oHqx

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Aggregate (cost=70,476.47..70,476.48 rows=1 width=32) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Limit (cost=70,475.87..70,475.97 rows=40 width=40) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=70,475.87..70,475.97 rows=40 width=40) (actual rows= loops=)

  • Sort Key: o.updated_at DESC
4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,840.25..70,474.81 rows=40 width=40) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=485.33..16,276.31 rows=40 width=465) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=472.33..15,754.81 rows=40 width=433) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=91.85..534.31 rows=40 width=401) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=91.57..519.89 rows=40 width=373) (actual rows= loops=)

  • Hash Cond: (o.vendor_id = v.id)
  • Filter: (('sacramento'::text <% (v.name)::text) OR ((o.repair_order ->> 'name'::text) = 'sacramento'::text) OR ('sacramento'::text = (o.invoice_number)::text) OR ('sacramento'::text = (o.confirmation_number)::text))
9. 0.000 0.000 ↓ 0.0

Seq Scan on "order" o (cost=0.00..411.45 rows=6,345 width=373) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash (cost=82.92..82.92 rows=692 width=24) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Seq Scan on vendor v (cost=0.00..82.92 rows=692 width=24) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Scan using vendor_id_index on vendor (cost=0.28..0.36 rows=1 width=36) (actual rows= loops=)

  • Index Cond: (o.vendor_id = id)
13.          

SubPlan (for Index Scan)

14. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=32) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Aggregate (cost=380.48..380.49 rows=1 width=32) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Seq Scan on order_item (cost=0.00..380.45 rows=2 width=38) (actual rows= loops=)

  • Filter: (o.id = order_id)
17.          

SubPlan (for Aggregate)

18. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=32) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Aggregate (cost=13.00..13.02 rows=1 width=32) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Seq Scan on message (cost=0.00..13.00 rows=1 width=0) (actual rows= loops=)

  • Filter: (o.id = order_id)
21. 0.000 0.000 ↓ 0.0

Aggregate (cost=1,354.92..1,354.93 rows=1 width=32) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Sort (cost=1,354.90..1,354.90 rows=1 width=40) (actual rows= loops=)

  • Sort Key: file.created_at DESC NULLS LAST
23. 0.000 0.000 ↓ 0.0

Seq Scan on file (cost=0.00..1,354.89 rows=1 width=40) (actual rows= loops=)

  • Filter: (o.id = order_id)
24.          

SubPlan (for Seq Scan)

25. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=32) (actual rows= loops=)

26.          

SubPlan (for Nested Loop Left Join)

27. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=32) (actual rows= loops=)