explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QHor

Settings
# exclusive inclusive rows x rows loops node
1. 0.837 14.429 ↓ 3.1 619 1

Sort (cost=1,933.39..1,933.49 rows=200 width=108) (actual time=14.369..14.429 rows=619 loops=1)

  • Sort Key: diff_report.volume, diff_report.date
  • Sort Method: quicksort Memory: 73kB
2.          

CTE first_run

3. 0.679 5.852 ↑ 1.0 1 1

Aggregate (cost=917.52..917.53 rows=1 width=48) (actual time=5.852..5.852 rows=1 loops=1)

4. 5.173 5.173 ↓ 1.0 1,130 1

Seq Scan on stats_history (cost=0.00..915.84 rows=1,126 width=25) (actual time=0.439..5.173 rows=1,130 loops=1)

  • Filter: ("volume name" = 'windows2008_c'::text)
  • Rows Removed by Filter: 21,252
5.          

CTE diff_report

6. 1.532 5.528 ↓ 1.1 1,130 1

WindowAgg (cost=959.65..976.80 rows=1,039 width=62) (actual time=3.933..5.528 rows=1,130 loops=1)

7. 0.537 3.996 ↓ 1.1 1,130 1

Sort (cost=959.65..960.17 rows=1,039 width=35) (actual time=3.863..3.996 rows=1,130 loops=1)

  • Sort Key: stats_history_1.run_time
  • Sort Method: quicksort Memory: 137kB
8. 3.459 3.459 ↓ 1.1 1,130 1

Seq Scan on stats_history stats_history_1 (cost=0.00..949.24 rows=1,039 width=35) (actual time=0.358..3.459 rows=1,130 loops=1)

  • Filter: (("volume name" = 'windows2008_c'::text) AND (run_time >= (now() - '700 days'::interval)))
  • Rows Removed by Filter: 21,252
9. 1.544 13.592 ↓ 3.1 619 1

HashAggregate (cost=34.83..37.53 rows=200 width=108) (actual time=13.085..13.592 rows=619 loops=1)

  • Group Key: diff_report.volume, diff_report.date, first_run.first_date
10. 0.178 12.048 ↓ 1.1 1,130 1

Nested Loop (cost=0.00..31.19 rows=1,039 width=124) (actual time=9.794..12.048 rows=1,130 loops=1)

11. 5.855 5.855 ↑ 1.0 1 1

CTE Scan on first_run (cost=0.00..0.02 rows=1 width=48) (actual time=5.855..5.855 rows=1 loops=1)

12. 6.015 6.015 ↓ 1.1 1,130 1

CTE Scan on diff_report (cost=0.00..20.78 rows=1,039 width=76) (actual time=3.936..6.015 rows=1,130 loops=1)