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?.
CREATE TYPE
CREATE TABLE
INSERT 0 7
id | company_id | connection_count | state |
---|---|---|---|
1 | 1 | 0 | up |
2 | 1 | 0 | up |
3 | 1 | 0 | up |
4 | 1 | 0 | up |
5 | 2 | 0 | up |
6 | 1 | 1 | up |
7 | 1 | 0 | down |
SELECT 7
UPDATE 2
id | company_id | connection_count | state |
---|---|---|---|
1 | 1 | 0 | down |
2 | 1 | 0 | down |
3 | 1 | 0 | up |
4 | 1 | 0 | up |
5 | 2 | 0 | up |
6 | 1 | 1 | up |
7 | 1 | 0 | down |
SELECT 7