explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NeZC

Settings
# exclusive inclusive rows x rows loops node
1. 0.682 239,360.276 ↓ 12.8 2,553 1

Subquery Scan on instruments_valuations_json (cost=1,784,777.33..1,784,867.91 rows=200 width=96) (actual time=239,331.151..239,360.276 rows=2,553 loops=1)

  • Functions: 27
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 2.876 ms, Inlining 24.664 ms, Optimization 229.907 ms, Emission 174.782 ms, Total 432.229 ms
2. 0.228 239,359.594 ↓ 12.8 2,553 1

Subquery Scan on aggregated_instrument_names (cost=1,784,777.33..1,784,864.91 rows=200 width=96) (actual time=239,331.148..239,359.594 rows=2,553 loops=1)

3. 28.085 239,359.366 ↓ 12.8 2,553 1

GroupAggregate (cost=1,784,777.33..1,784,862.91 rows=200 width=69) (actual time=239,331.147..239,359.366 rows=2,553 loops=1)

  • Group Key: collect_json_instruments.instrument_code
4. 1.076 239,331.281 ↑ 3.2 2,553 1

Sort (cost=1,784,777.33..1,784,797.98 rows=8,258 width=80) (actual time=239,331.130..239,331.281 rows=2,553 loops=1)

  • Sort Key: collect_json_instruments.instrument_code
  • Sort Method: quicksort Memory: 2809kB
5. 0.318 239,330.205 ↑ 3.2 2,553 1

Subquery Scan on collect_json_instruments (cost=1,781,762.80..1,784,240.09 rows=8,258 width=80) (actual time=239,275.979..239,330.205 rows=2,553 loops=1)

6. 53.597 239,329.887 ↑ 3.2 2,553 1

GroupAggregate (cost=1,781,762.80..1,784,157.51 rows=8,258 width=80) (actual time=239,275.978..239,329.887 rows=2,553 loops=1)

  • Group Key: instruments_with_groups.source_name, instruments_with_groups.instrument_code
7. 11.763 239,276.290 ↑ 12.2 6,792 1

Sort (cost=1,781,762.80..1,781,969.24 rows=82,576 width=99) (actual time=239,275.936..239,276.290 rows=6,792 loops=1)

  • Sort Key: instruments_with_groups.source_name, instruments_with_groups.instrument_code, (min(instruments_with_groups.date))
  • Sort Method: quicksort Memory: 1276kB
8. 392.553 239,264.527 ↑ 12.2 6,792 1

GroupAggregate (cost=1,749,030.89..1,770,500.55 rows=82,576 width=99) (actual time=238,416.066..239,264.527 rows=6,792 loops=1)

  • Group Key: instruments_with_groups.source_name, instruments_with_groups.instrument_code, instruments_with_groups.instrument_name, instruments_with_groups.issuer, instruments_with_groups.sect1, instruments_with_groups.sect2, instruments_with_groups.sect3, instruments_with_groups.code_grp
9. 9,148.207 238,871.974 ↓ 1.5 1,198,745 1

Sort (cost=1,749,030.89..1,751,095.28 rows=825,756 width=95) (actual time=238,416.042..238,871.974 rows=1,198,745 loops=1)

  • Sort Key: instruments_with_groups.source_name, instruments_with_groups.instrument_code, instruments_with_groups.instrument_name, instruments_with_groups.issuer, instruments_with_groups.sect1, instruments_with_groups.sect2, instruments_with_groups.sect3, instruments_with_groups.code_grp
  • Sort Method: external merge Disk: 126496kB
10. 132.159 229,723.767 ↓ 1.5 1,198,745 1

Subquery Scan on instruments_with_groups (cost=1,554,297.79..1,583,199.25 rows=825,756 width=95) (actual time=228,521.826..229,723.767 rows=1,198,745 loops=1)

11. 540.142 229,591.608 ↓ 1.5 1,198,745 1

WindowAgg (cost=1,554,297.79..1,574,941.69 rows=825,756 width=111) (actual time=228,521.824..229,591.608 rows=1,198,745 loops=1)

12. 7,990.636 229,051.466 ↓ 1.5 1,198,745 1

Sort (cost=1,554,297.79..1,556,362.18 rows=825,756 width=95) (actual time=228,521.805..229,051.466 rows=1,198,745 loops=1)

  • Sort Key: from_latest_source_valuations.source_name, from_latest_source_valuations.instrument_code, from_latest_source_valuations.date
  • Sort Method: external merge Disk: 126592kB
13. 881.212 221,060.830 ↓ 1.5 1,198,745 1

WindowAgg (cost=1,355,435.91..1,388,466.15 rows=825,756 width=95) (actual time=219,569.919..221,060.830 rows=1,198,745 loops=1)

14. 22,506.447 220,179.618 ↓ 1.5 1,198,745 1

Sort (cost=1,355,435.91..1,357,500.30 rows=825,756 width=87) (actual time=219,569.899..220,179.618 rows=1,198,745 loops=1)

  • Sort Key: from_latest_source_valuations.source_name, from_latest_source_valuations.instrument_code, from_latest_source_valuations.instrument_name, from_latest_source_valuations.issuer, from_latest_source_valuations.sect1, from_latest_source_valuations.sect2, from_latest_source_valuations.sect3, from_latest_source_valuations.date
  • Sort Method: external merge Disk: 114792kB
15. 3,197.328 197,673.171 ↓ 1.5 1,198,745 1

Unique (cost=0.56..1,186,995.71 rows=825,756 width=87) (actual time=52.796..197,673.171 rows=1,198,745 loops=1)

16. 194,475.843 194,475.843 ↑ 1.0 8,255,120 1

Index Only Scan using from_latest_source_valuations__index_on_source_name_instrument_ on from_latest_source_valuations (cost=0.56..1,021,844.59 rows=8,257,556 width=87) (actual time=52.793..194,475.843 rows=8,255,120 loops=1)

  • Heap Fetches: 8255120
Planning time : 215.904 ms
Execution time : 239,409.277 ms