By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
6 rows affected
id | name | salary | department |
---|---|---|---|
1 | Bob | 1000000 | IT |
2 | John | 100000 | IT |
3 | Tom | 10000 | IT |
4 | Ann | 2000000 | HR |
5 | Tony | 200000 | HR |
6 | Mary | 20000 | HR |
department | count | sum | avg |
---|---|---|---|
IT | 3 | 1110000 | 370000.000000000000 |
HR | 3 | 2220000 | 740000.000000000000 |