explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QKaU

Settings
# exclusive inclusive rows x rows loops node
1. 13.212 27,109.398 ↑ 1.0 112,169 1

Nested Loop (cost=1,918,132.71..1,988,296.14 rows=112,197 width=114) (actual time=26,060.815..27,109.398 rows=112,169 loops=1)

2. 0.054 0.054 ↑ 1.0 21 1

Seq Scan on currencies (cost=0.00..0.31 rows=21 width=600) (actual time=0.016..0.054 rows=21 loops=1)

3. 663.493 27,096.132 ↑ 1.0 5,341 21

Hash Join (cost=1,918,132.71..1,921,420.38 rows=5,343 width=34) (actual time=1,251.296..1,290.292 rows=5,341 loops=21)

  • Hash Cond: (services.currency_rate_id = cr.rate_id)
  • Join Filter: (currencies.id = services.currency_id)
  • Rows Removed by Join Filter: 106,828
4. 371.994 371.994 ↑ 1.0 112,169 21

Seq Scan on services (cost=0.00..1,464.47 rows=112,197 width=16) (actual time=0.004..17.714 rows=112,169 loops=21)

5. 10.033 26,060.645 ↑ 1.0 11,867 1

Hash (cost=1,917,984.37..1,917,984.37 rows=11,867 width=26) (actual time=26,060.645..26,060.645 rows=11,867 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 835kB
6. 11.120 26,050.612 ↑ 1.0 11,867 1

Nested Loop (cost=161.59..1,917,984.37 rows=11,867 width=26) (actual time=0.709..26,050.612 rows=11,867 loops=1)

7. 3.294 3.294 ↑ 1.0 11,867 1

Seq Scan on currencies_rates cr (cost=0.00..128.67 rows=11,867 width=15) (actual time=0.007..3.294 rows=11,867 loops=1)

8. 11.867 26,036.198 ↑ 1.0 1 11,867

Limit (cost=161.59..161.59 rows=1 width=11) (actual time=2.194..2.194 rows=1 loops=11,867)

9. 10,264.955 26,024.331 ↑ 3,956.0 1 11,867

Sort (cost=161.59..171.48 rows=3,956 width=11) (actual time=2.193..2.193 rows=1 loops=11,867)

  • Sort Key: cr_1.currency_day DESC
  • Sort Method: top-N heapsort Memory: 25kB
10. 15,759.376 15,759.376 ↓ 1.5 5,938 11,867

Index Scan using currencies_rates_currency_date_ukey on currencies_rates cr_1 (cost=0.29..141.81 rows=3,956 width=11) (actual time=0.007..1.328 rows=5,938 loops=11,867)

  • Index Cond: (currency_day <= cr.currency_day)
Planning time : 0.522 ms
Execution time : 27,114.164 ms