explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ytq1

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 5,555.900 ↑ 1.0 1 1

Limit (cost=1,003.37..8,345.06 rows=1 width=76) (actual time=5,555.900..5,555.900 rows=1 loops=1)

  • Output: series.source_id, (array_agg(DISTINCT series.region_id)), (array_agg(DISTINCT series.item_id)), (min(series.start_date)), (max(series.end_date))
  • Buffers: shared hit=2,765,319
2. 0.138 5,555.899 ↑ 1.0 1 1

GroupAggregate (cost=1,003.37..8,345.06 rows=1 width=76) (actual time=5,555.899..5,555.899 rows=1 loops=1)

  • Output: series.source_id, array_agg(DISTINCT series.region_id), array_agg(DISTINCT series.item_id), min(series.start_date), max(series.end_date)
  • Group Key: series.source_id
  • Buffers: shared hit=2,765,319
3. 126.286 5,555.761 ↓ 44.0 44 1

Nested Loop Semi Join (cost=1,003.37..8,345.04 rows=1 width=20) (actual time=13.258..5,555.761 rows=44 loops=1)

  • Output: series.source_id, series.region_id, series.item_id, series.start_date, series.end_date
  • Join Filter: (series.region_id = regions.id)
  • Rows Removed by Join Filter: 126,318
  • Buffers: shared hit=2,765,319
4. 0.466 2.741 ↓ 478.0 478 1

Nested Loop (cost=3.37..9.26 rows=1 width=20) (actual time=0.033..2.741 rows=478 loops=1)

  • Output: series.source_id, series.region_id, series.item_id, series.start_date, series.end_date
  • Buffers: shared hit=611
5. 0.001 0.023 ↑ 1.0 1 1

Limit (cost=2.80..2.81 rows=1 width=4) (actual time=0.021..0.023 rows=1 loops=1)

  • Output: series_1.source_id
  • Buffers: shared hit=7
6. 0.001 0.022 ↑ 1.0 1 1

Unique (cost=2.80..2.81 rows=1 width=4) (actual time=0.021..0.022 rows=1 loops=1)

  • Output: series_1.source_id
  • Buffers: shared hit=7
7. 0.005 0.021 ↑ 1.0 1 1

Sort (cost=2.80..2.81 rows=1 width=4) (actual time=0.021..0.021 rows=1 loops=1)

  • Output: series_1.source_id
  • Sort Key: series_1.source_id
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=7
8. 0.016 0.016 ↑ 1.0 1 1

Index Scan using series_1217781310 on data.series series_1 (cost=0.56..2.79 rows=1 width=4) (actual time=0.014..0.016 rows=1 loops=1)

  • Output: series_1.source_id
  • Index Cond: ((series_1.metric_id = 860,032) AND (series_1.item_id = 1,721) AND (series_1.region_id = 18) AND (series_1.frequency_id = 9))
  • Filter: ((series_1.end_date >= '1955-01-01'::date) AND (series_1.start_date <= '2020-10-08'::date))
  • Buffers: shared hit=7
9. 2.252 2.252 ↓ 478.0 478 1

Index Scan using series_1217781310 on data.series (cost=0.56..6.43 rows=1 width=20) (actual time=0.010..2.252 rows=478 loops=1)

  • Output: series.metric_id, series.item_id, series.region_id, series.partner_region_id, series.frequency_id, series.source_id, series.start_date, series.end_date, series.data_count, series.hierarchy_id, series.time_stamp
  • Index Cond: ((series.metric_id = 860,032) AND (series.item_id = 1,721) AND (series.frequency_id = 9) AND (series.source_id = series_1.source_id))
  • Filter: ((series.end_date >= '1955-01-01'::date) AND (series.start_date <= '2020-10-08'::date))
  • Buffers: shared hit=604
10. 12.428 5,426.734 ↑ 1.1 264 478

Limit (cost=1,000.00..8,329.38 rows=284 width=4) (actual time=0.927..11.353 rows=264 loops=478)

  • Output: regions.id
  • Buffers: shared hit=2,747,310
11. 1,180.182 5,414.306 ↑ 1.1 264 478

Gather (cost=1,000.00..8,329.38 rows=284 width=4) (actual time=0.926..11.327 rows=264 loops=478)

  • Output: regions.id
  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=2,747,310
12. 4,234.124 4,234.124 ↑ 1.3 88 1,434 / 3

Parallel Seq Scan on ontology.regions (cost=0.00..7,300.98 rows=118 width=4) (actual time=2.643..8.858 rows=88 loops=1,434)

  • Output: regions.id
  • Filter: (regions.level = 3)
  • Rows Removed by Filter: 64,917
  • Buffers: shared hit=2,764,708
  • Worker 0: actual time=5.697..7.940 rows=17 loops=478
  • Buffers: shared hit=443,674
  • Worker 1: actual time=2.228..8.332 rows=49 loops=478
  • Buffers: shared hit=591,613