explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GR5g

Settings
# exclusive inclusive rows x rows loops node
1. 30,956.198 88,977.005 ↓ 12.0 12 1

Merge Join (cost=42.48..2,535,394.89 rows=1 width=230) (actual time=88,976.111..88,977.005 rows=12 loops=1)

  • Merge Cond: (variables_values_1988.year = tt.year)
  • Join Filter: ((tt.id = variables_values_1988.id) AND (tt.entity_id = variables_values_1988.entity_id) AND (COALESCE(tt.entity_unit_id, '-99'::integer) = COALESCE(variables_values_1988.entity_unit_id, '-99'::integer)) AND (tt.dimension_id = variables_values_1988.dimension_id) AND (tt.variable_id = variables_values_1988.variable_id) AND ((tt.month)::text = (variables_values_1988.month)::text) AND ((tt.year_month)::numeric = variables_values_1988.year_month))
  • Rows Removed by Join Filter: 17833752
2. 26,207.852 45,292.052 ↑ 1.0 19,121,045 1

Append (cost=5.69..847,804.17 rows=19,122,424 width=93) (actual time=0.092..45,292.052 rows=19,121,045 loops=1)

3. 0.087 0.087 ↑ 195.0 2 1

Index Scan using variables_values_1988_year_idx on variables_values_1988 (cost=0.15..54.00 rows=390 width=177) (actual time=0.083..0.087 rows=2 loops=1)

4. 0.079 0.079 ↑ 195.0 2 1

Index Scan using variables_values_1998_year_idx on variables_values_1998 (cost=0.15..54.00 rows=390 width=177) (actual time=0.075..0.079 rows=2 loops=1)

5. 350.030 350.030 ↑ 1.0 360,652 1

Index Scan using variables_values_2008_year_idx on variables_values_2008 (cost=0.42..14,194.20 rows=360,652 width=93) (actual time=0.068..350.030 rows=360,652 loops=1)

6. 1,434.364 1,434.364 ↑ 1.0 1,487,677 1

Index Scan using variables_values_2009_year_idx on variables_values_2009 (cost=0.43..58,511.58 rows=1,487,677 width=93) (actual time=0.062..1,434.364 rows=1,487,677 loops=1)

7. 1,805.826 1,805.826 ↑ 1.0 1,852,029 1

Index Scan using variables_values_2010_year_idx on variables_values_2010 (cost=0.43..72,837.86 rows=1,852,029 width=93) (actual time=0.064..1,805.826 rows=1,852,029 loops=1)

8. 1,790.801 1,790.801 ↑ 1.0 1,855,511 1

Index Scan using variables_values_2011_year_idx on variables_values_2011 (cost=0.43..72,975.09 rows=1,855,511 width=93) (actual time=0.081..1,790.801 rows=1,855,511 loops=1)

9. 1,773.592 1,773.592 ↑ 1.0 1,855,638 1

Index Scan using variables_values_2012_year_idx on variables_values_2012 (cost=0.43..72,982.00 rows=1,855,638 width=93) (actual time=0.059..1,773.592 rows=1,855,638 loops=1)

10. 1,828.121 1,828.121 ↑ 1.0 1,855,654 1

Index Scan using variables_values_2013_year_idx on variables_values_2013 (cost=0.43..72,984.14 rows=1,855,714 width=93) (actual time=0.065..1,828.121 rows=1,855,654 loops=1)

11. 1,820.439 1,820.439 ↑ 1.0 1,855,654 1

Index Scan using variables_values_2014_year_idx on variables_values_2014 (cost=0.43..72,984.14 rows=1,855,714 width=93) (actual time=0.062..1,820.439 rows=1,855,654 loops=1)

12. 1,810.606 1,810.606 ↑ 1.0 1,855,639 1

Index Scan using variables_values_2015_year_idx on variables_values_2015 (cost=0.43..72,982.01 rows=1,855,639 width=93) (actual time=0.060..1,810.606 rows=1,855,639 loops=1)

13. 1,864.812 1,864.812 ↑ 1.0 1,855,663 1

Index Scan using variables_values_2016_year_idx on variables_values_2016 (cost=0.43..72,983.37 rows=1,855,663 width=93) (actual time=0.067..1,864.812 rows=1,855,663 loops=1)

14. 1,272.785 1,272.785 ↑ 1.0 1,309,966 1

Index Scan using variables_values_2017_year_idx on variables_values_2017 (cost=0.43..51,526.92 rows=1,309,966 width=93) (actual time=0.063..1,272.785 rows=1,309,966 loops=1)

15. 1,520.023 1,520.023 ↑ 1.0 1,490,810 1

Index Scan using variables_values_2018_year_idx on variables_values_2018 (cost=0.43..58,637.76 rows=1,490,822 width=93) (actual time=0.081..1,520.023 rows=1,490,810 loops=1)

16. 1,812.519 1,812.519 ↑ 1.0 1,486,147 1

Index Scan using variables_values_2019_year_idx on variables_values_2019 (cost=0.43..58,462.41 rows=1,486,532 width=93) (actual time=0.086..1,812.519 rows=1,486,147 loops=1)

17. 0.116 0.116 ↑ 86.0 1 1

Index Scan using variables_values_2020_year_idx on variables_values_2020 (cost=0.14..14.43 rows=86 width=81) (actual time=0.115..0.116 rows=1 loops=1)

18. 0.000 0.000 ↓ 0.0 0

Index Scan using variables_values_2021_year_idx on variables_values_2021 (cost=0.13..8.14 rows=1 width=177) (never executed)

19. 12,728.737 12,728.755 ↓ 33,362.5 16,347,618 1

Sort (cost=36.79..38.02 rows=490 width=137) (actual time=0.036..12,728.755 rows=16,347,618 loops=1)

  • Sort Key: tt.year
  • Sort Method: quicksort Memory: 26kB
20. 0.018 0.018 ↑ 40.8 12 1

Seq Scan on temp_table tt (cost=0.00..14.90 rows=490 width=137) (actual time=0.009..0.018 rows=12 loops=1)