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 TABLE
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
serialnr | nodeaddress | connection_status | temperature | humidity | lux | battery | conn_lastupdated | temp_lastupdated | hum_lastupdated | lux_lastupdated | batt_lastupdated |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | 00:0a:95:9d:68:17 | null | null | null | null | null | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 |
2 | 00:0a:95:9d:68:18 | null | null | null | null | null | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 |
3 | 00:0a:95:9d:68:19 | null | null | null | null | null | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 |
4 | 00:0a:95:9d:68:20 | null | null | null | null | null | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 |
SELECT 4
CREATE PROCEDURE
serialnr | nodeaddress | connection_status | temperature | humidity | lux | battery | conn_lastupdated | temp_lastupdated | hum_lastupdated | lux_lastupdated | batt_lastupdated |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | 00:0a:95:9d:68:17 | null | null | null | null | null | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 |
2 | 00:0a:95:9d:68:18 | null | null | null | null | null | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 |
3 | 00:0a:95:9d:68:19 | null | null | null | null | null | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 |
4 | 00:0a:95:9d:68:20 | null | null | null | null | null | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 |
SELECT 4
UPDATE 1
serialnr | nodeaddress | connection_status | temperature | humidity | lux | battery | conn_lastupdated | temp_lastupdated | hum_lastupdated | lux_lastupdated | batt_lastupdated |
---|---|---|---|---|---|---|---|---|---|---|---|
2 | 00:0a:95:9d:68:18 | null | null | null | null | null | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 |
3 | 00:0a:95:9d:68:19 | null | null | null | null | null | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 |
4 | 00:0a:95:9d:68:20 | null | null | null | null | null | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 |
1 | 00:0a:95:9d:68:17 | null | 20 | null | null | null | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 | 2022-11-07 12:39:09.285829 |
SELECT 4