explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lqAR

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 233.497 38,343.494 ↑ 2.0 394,655 1

GroupAggregate (cost=44,687,106.62..46,063,198.29 rows=803,000 width=31) (actual time=37,850.648..38,343.494 rows=394,655 loops=1)

  • Group Key: beleg.tattag, times."time", beleg.verband_kenner
2.          

CTE times

3. 0.803 0.803 ↑ 3.5 289 1

Function Scan on generate_series t (cost=0.00..12.50 rows=1,000 width=8) (actual time=0.019..0.803 rows=289 loops=1)

4. 1,229.627 38,109.997 ↑ 72.3 1,512,503 1

Sort (cost=44,687,094.12..44,960,304.95 rows=109,284,333 width=15) (actual time=37,850.633..38,109.997 rows=1,512,503 loops=1)

  • Sort Key: beleg.tattag, times."time", beleg.verband_kenner
  • Sort Method: external merge Disk: 38,560kB
5. 17,876.824 36,880.370 ↑ 72.3 1,512,503 1

Nested Loop (cost=0.00..24,492,759.49 rows=109,284,333 width=15) (actual time=0.350..36,880.370 rows=1,512,503 loops=1)

  • Join Filter: ((beleg.tatzeit >= times."time") AND (beleg.tatzeit <= (times."time" + '@ 5 mins'::interval)))
  • Rows Removed by Join Filter: 282,736,048
6. 1.218 1.218 ↑ 3.5 289 1

CTE Scan on times (cost=0.00..20.00 rows=1,000 width=8) (actual time=0.020..1.218 rows=289 loops=1)

7. 18,888.283 19,002.328 ↑ 1.0 983,559 289

Materialize (cost=0.00..25,821.39 rows=983,559 width=15) (actual time=0.004..65.752 rows=983,559 loops=289)

8. 114.045 114.045 ↑ 1.0 983,559 1

Seq Scan on beleg (cost=0.00..16,100.59 rows=983,559 width=15) (actual time=0.016..114.045 rows=983,559 loops=1)

Planning time : 0.114 ms
Execution time : 38,363.117 ms