explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Sxcb

Settings
# exclusive inclusive rows x rows loops node
1. 70.090 11,753.838 ↓ 5.0 1,001 1

HashAggregate (cost=722,955.32..722,957.82 rows=200 width=40) (actual time=11,753.660..11,753.838 rows=1,001 loops=1)

  • Group Key: tr.user_id
2. 6.617 11,683.748 ↑ 1.0 86,412 1

Nested Loop Left Join (cost=8.32..722,307.23 rows=86,412 width=68) (actual time=0.054..11,683.748 rows=86,412 loops=1)

3. 11.511 11.511 ↑ 1.0 86,412 1

Seq Scan on transactions tr (cost=0.00..1,415.12 rows=86,412 width=60) (actual time=0.006..11.511 rows=86,412 loops=1)

4. 86.412 11,665.620 ↑ 1.0 1 86,412

Limit (cost=8.32..8.32 rows=1 width=40) (actual time=0.134..0.135 rows=1 loops=86,412)

5. 3,542.892 11,579.208 ↑ 1.0 1 86,412

Sort (cost=8.32..8.32 rows=1 width=40) (actual time=0.134..0.134 rows=1 loops=86,412)

  • Sort Key: er.ts DESC NULLS LAST
  • Sort Method: top-N heapsort Memory: 25kB
6. 8,036.316 8,036.316 ↓ 367.0 367 86,412

Index Scan using idx_ts_from_to on exchange_rates er (cost=0.28..8.31 rows=1 width=40) (actual time=0.012..0.093 rows=367 loops=86,412)

  • Index Cond: ((ts <= tr.ts) AND ((from_currency)::text = (tr.currency)::text))
Planning time : 0.485 ms
Execution time : 11,753.951 ms