explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YMe1 : remote query

Settings
# exclusive inclusive rows x rows loops node
1. 0.048 10,323.743 ↓ 23.2 255 1

Subquery Scan on __unnamed_subquery_0 (cost=50.52..50.74 rows=11 width=104) (actual time=10,323.638..10,323.743 rows=255 loops=1)

  • rows=81 loops=1)
2. 0.323 10,323.695 ↓ 23.2 255 1

HashAggregate (cost=50.52..50.63 rows=11 width=80) (actual time=10,323.637..10,323.695 rows=255 loops=1)

  • Group Key: kcr.from_currency_id, kcr.to_currency_id, kcr.currency_rate, kcr.ason_date
3. 13.301 10,323.372 ↓ 23.2 255 1

Append (cost=15.00..50.41 rows=11 width=80) (actual time=583.505..10,323.372 rows=255 loops=1)

  • -> Foreign Scan on _dblink_kco_currency_rates_cbsl_1 kcr (cost=15.00..25.00 rows=10 width=68) (actual time=583.505..10322.609
  • Filter: ((trunc(ason_date) <= trunc(to_date('27-12-17'::character varying))) AND (1 = (SubPlan 1)))
  • Rows Removed by Filter: 1626
  • Remote Query: SELECT from_currency_id, to_currency_id, currency_rate, ason_date FROM kco_currency_rates_cbsl
4. 0.057 0.713 ↓ 174.0 174 1

Subquery Scan on *SELECT* 2 (cost=25.19..25.25 rows=1 width=80) (actual time=0.592..0.713 rows=174 loops=1)

5. 0.055 0.656 ↓ 174.0 174 1

Unique (cost=25.19..25.24 rows=1 width=52) (actual time=0.590..0.656 rows=174 loops=1)

6. 0.105 0.601 ↓ 17.4 174 1

Sort (cost=25.19..25.22 rows=10 width=52) (actual time=0.589..0.601 rows=174 loops=1)

  • Sort Key: kcm.currency_id
  • Sort Method: quicksort Memory: 38kB
7. 0.496 0.496 ↓ 17.4 174 1

Result (cost=15.00..25.02 rows=10 width=52) (actual time=0.149..0.496 rows=174 loops=1)

  • One-Time Filter: (trunc(to_date('27-12-17'::character varying)) <= trunc(to_date('27-12-17'::character
  • -> Foreign Scan on _dblink_kco_currency_2 kcm (cost=15.00..25.00 rows=10 width=20) (actual time=0.142
  • Remote Query: SELECT currency_id FROM kco_currency
8.          

SubPlan (for Append)

9. 10,309.358 10,309.358 ↑ 1.0 1 1,706

Aggregate (cost=25.02..25.04 rows=1 width=8) (actual time=6.042..6.043 rows=1 loops=1,706)

  • -> Foreign Scan on _dblink_kco_currency_rates_cbsl_1 sub (cost=15.00..25.00 rows=10 width=20) (actual time=0.57
  • Filter: ((ason_date >= kcr.ason_date) AND (from_currency_id = kcr.from_currency_id) AND (to_currency_id = k
  • Rows Removed by Filter: 1676
  • Remote Query: SELECT currency_rate_id, from_currency_id, to_currency_id, ason_date FROM kco_currency_rates_