explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TFC0

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.003 3.373 ↑ 1.0 10 1

Limit (cost=137.38..137.40 rows=10 width=12) (actual time=3.365..3.373 rows=10 loops=1)

2. 0.433 3.370 ↑ 98.5 10 1

Sort (cost=137.38..139.84 rows=985 width=12) (actual time=3.364..3.370 rows=10 loops=1)

  • Sort Key: tr.created_at DESC
  • Sort Method: top-N heapsort Memory: 25kB
3. 0.529 2.937 ↓ 1.0 989 1

Hash Left Join (cost=28.00..116.09 rows=985 width=12) (actual time=0.210..2.937 rows=989 loops=1)

  • Hash Cond: ((tr.user2_id)::text = ((svc.id)::character varying)::text)
4. 0.666 2.379 ↓ 1.0 989 1

Hash Left Join (cost=15.75..87.83 rows=985 width=12) (actual time=0.171..2.379 rows=989 loops=1)

  • Hash Cond: ((tr.user2_id)::text = ((api.id)::character varying)::text)
5. 0.517 1.697 ↓ 1.0 989 1

Hash Left Join (cost=4.62..60.70 rows=985 width=12) (actual time=0.146..1.697 rows=989 loops=1)

  • Hash Cond: ((tr.order_id)::text = ((inv.id)::character varying)::text)
6. 0.808 1.101 ↓ 1.0 989 1

Hash Left Join (cost=1.36..42.80 rows=985 width=13) (actual time=0.057..1.101 rows=989 loops=1)

  • Hash Cond: ((tr.user2_id)::text = ((u2.id)::character varying)::text)
7. 0.263 0.263 ↓ 1.0 989 1

Seq Scan on transactions tr (cost=0.00..31.85 rows=985 width=21) (actual time=0.013..0.263 rows=989 loops=1)

8. 0.017 0.030 ↑ 1.0 16 1

Hash (cost=1.16..1.16 rows=16 width=4) (actual time=0.030..0.030 rows=16 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.013 0.013 ↑ 1.0 16 1

Seq Scan on users u2 (cost=0.00..1.16 rows=16 width=4) (actual time=0.007..0.013 rows=16 loops=1)

10. 0.045 0.079 ↓ 1.1 62 1

Hash (cost=2.56..2.56 rows=56 width=8) (actual time=0.079..0.079 rows=62 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
11. 0.034 0.034 ↓ 1.1 62 1

Seq Scan on invoices inv (cost=0.00..2.56 rows=56 width=8) (actual time=0.018..0.034 rows=62 loops=1)

12. 0.007 0.016 ↑ 16.7 3 1

Hash (cost=10.50..10.50 rows=50 width=4) (actual time=0.016..0.016 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.009 0.009 ↑ 16.7 3 1

Seq Scan on api_users api (cost=0.00..10.50 rows=50 width=4) (actual time=0.007..0.009 rows=3 loops=1)

14. 0.017 0.029 ↑ 3.8 26 1

Hash (cost=11.00..11.00 rows=100 width=4) (actual time=0.029..0.029 rows=26 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.012 0.012 ↑ 3.8 26 1

Seq Scan on services svc (cost=0.00..11.00 rows=100 width=4) (actual time=0.004..0.012 rows=26 loops=1)