explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qXuK

Settings
# exclusive inclusive rows x rows loops node
1. 0.034 135,215.746 ↑ 1.0 5 1

Subquery Scan on stats_aggregate (cost=0.59..3.32 rows=5 width=121) (actual time=0.784..135,215.746 rows=5 loops=1)

2. 0.005 135,215.712 ↑ 1.0 5 1

Append (cost=0.59..3.25 rows=5 width=188) (actual time=0.782..135,215.712 rows=5 loops=1)

3. 0.005 209.614 ↑ 1.0 2 1

Result (cost=0.59..1.31 rows=2 width=188) (actual time=0.782..209.614 rows=2 loops=1)

4. 0.001 209.609 ↑ 1.0 2 1

Append (cost=0.59..1.28 rows=2 width=180) (actual time=0.781..209.609 rows=2 loops=1)

5. 0.053 0.780 ↑ 1.0 1 1

Result (cost=0.59..0.63 rows=1 width=180) (actual time=0.780..0.780 rows=1 loops=1)

6.          

Initplan (forResult)

7. 0.001 0.727 ↑ 1.0 1 1

Limit (cost=0.57..0.59 rows=1 width=8) (actual time=0.726..0.727 rows=1 loops=1)

8. 0.726 0.726 ↑ 193,995,136.0 1 1

Index Only Scan Backward using sale_hour_timeinhour_idx1 on sale_hour (cost=0.57..4,073,303.88 rows=193,995,136 width=8) (actual time=0.726..0.726 rows=1 loops=1)

  • Index Cond: (timeinhour IS NOT NULL)
  • Heap Fetches: 1
9. 0.041 208.828 ↑ 1.0 1 1

Result (cost=0.59..0.63 rows=1 width=180) (actual time=208.828..208.828 rows=1 loops=1)

10.          

Initplan (forResult)

11. 0.003 208.787 ↑ 1.0 1 1

Limit (cost=0.57..0.59 rows=1 width=8) (actual time=208.785..208.787 rows=1 loops=1)

12. 208.784 208.784 ↑ 125,116,360.0 1 1

Index Only Scan Backward using sale_day_timeinday_idx2 on sale_day (cost=0.57..2,670,333.04 rows=125,116,360 width=8) (actual time=208.784..208.784 rows=1 loops=1)

  • Index Cond: (timeinday IS NOT NULL)
  • Heap Fetches: 5860
13. 0.055 23,494.079 ↑ 1.0 1 1

Result (cost=0.59..0.63 rows=1 width=188) (actual time=23,494.078..23,494.079 rows=1 loops=1)

14.          

Initplan (forResult)

15. 0.002 23,494.024 ↑ 1.0 1 1

Limit (cost=0.57..0.59 rows=1 width=8) (actual time=23,494.023..23,494.024 rows=1 loops=1)

16. 23,494.022 23,494.022 ↑ 76,267,136.0 1 1

Index Only Scan Backward using sale_week_timeinweek_idx2 on sale_week (cost=0.57..1,825,358.96 rows=76,267,136 width=8) (actual time=23,494.022..23,494.022 rows=1 loops=1)

  • Index Cond: (timeinweek IS NOT NULL)
  • Heap Fetches: 1446739
17. 0.034 11,034.429 ↑ 1.0 1 1

Result (cost=0.59..0.62 rows=1 width=188) (actual time=11,034.429..11,034.429 rows=1 loops=1)

18.          

Initplan (forResult)

19. 0.007 11,034.395 ↑ 1.0 1 1

Limit (cost=0.57..0.59 rows=1 width=8) (actual time=11,034.388..11,034.395 rows=1 loops=1)

20. 11,034.388 11,034.388 ↑ 68,216,800.0 1 1

Index Only Scan Backward using sale_month_timeinmonth_idx2 on sale_month (cost=0.57..1,525,960.95 rows=68,216,800 width=8) (actual time=11,034.387..11,034.388 rows=1 loops=1)

  • Index Cond: (timeinmonth IS NOT NULL)
  • Heap Fetches: 1460340
21. 0.036 100,477.585 ↑ 1.0 1 1

Result (cost=0.62..0.65 rows=1 width=188) (actual time=100,477.585..100,477.585 rows=1 loops=1)

22.          

Initplan (forResult)

23. 0.008 100,477.549 ↑ 1.0 1 1

Limit (cost=0.57..0.62 rows=1 width=8) (actual time=100,477.547..100,477.549 rows=1 loops=1)

24. 100,477.541 100,477.541 ↑ 154,686,528.0 1 1

Index Only Scan Backward using sale_year_timeinyear_idx2 on sale_year (cost=0.57..6,966,588.37 rows=154,686,528 width=8) (actual time=100,477.540..100,477.541 rows=1 loops=1)

  • Index Cond: (timeinyear IS NOT NULL)
  • Heap Fetches: 59738974