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?.
version |
---|
PostgreSQL 12.17 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20), 64-bit |
SELECT 1
CREATE TABLE
id | profile | age |
---|
SELECT 0
INSERT 0 1
id | profile | age |
---|---|---|
2eab2d99-167d-41b7-8227-d89ae45d3801 | {"fname":"Giri", "lname":"Pottepalem", "age":30} | 30 |
SELECT 1
INSERT 0 1
id | profile | age |
---|---|---|
2eab2d99-167d-41b7-8227-d89ae45d3801 | {"fname":"Giri", "lname":"Pottepalem", "age":30} | 30 |
2eab2d99-167d-41b7-8227-d89ae45d3802 | null | null |
SELECT 2
UPDATE 1
id | profile | age |
---|---|---|
2eab2d99-167d-41b7-8227-d89ae45d3801 | {"fname":"Giri", "lname":"Pottepalem", "age":30} | 30 |
2eab2d99-167d-41b7-8227-d89ae45d3802 | null | null |
SELECT 2
UPDATE 1
id | profile | age |
---|---|---|
2eab2d99-167d-41b7-8227-d89ae45d3801 | {"fname":"Giri", "lname":"Pottepalem", "age":30} | 30 |
2eab2d99-167d-41b7-8227-d89ae45d3802 | {"fname": "boo", "lname": "pottepalem"} | null |
SELECT 2
UPDATE 1
id | profile | age |
---|---|---|
2eab2d99-167d-41b7-8227-d89ae45d3801 | {"fname":"Giri", "lname":"Pottepalem", "age":30} | 30 |
2eab2d99-167d-41b7-8227-d89ae45d3802 | {"age": 15, "fname": "boo", "lname": "pottepalem"} | 15 |
SELECT 2
UPDATE 1
id | profile | age |
---|---|---|
2eab2d99-167d-41b7-8227-d89ae45d3801 | {"fname":"Giri", "lname":"Pottepalem", "age":30} | 30 |
2eab2d99-167d-41b7-8227-d89ae45d3802 | {"age": 18, "fname": "Bhuvan", "lname": "Pottepalem"} | 18 |
SELECT 2
UPDATE 1
id | profile | age |
---|---|---|
2eab2d99-167d-41b7-8227-d89ae45d3801 | {"fname":"Giri", "lname":"Pottepalem", "age":30} | 30 |
2eab2d99-167d-41b7-8227-d89ae45d3802 | {"age": 18, "fname": "boo", "lname": "potte", "address": "dummy address"} | 18 |
SELECT 2
UPDATE 1
id | profile | age |
---|---|---|
2eab2d99-167d-41b7-8227-d89ae45d3801 | {"fname":"Giri", "lname":"Pottepalem", "age":30} | 30 |
2eab2d99-167d-41b7-8227-d89ae45d3802 | {"age": 18, "fname": "boo", "lname": "potte"} | 18 |
SELECT 2
UPDATE 1
id | profile | age |
---|---|---|
2eab2d99-167d-41b7-8227-d89ae45d3801 | {"fname":"Giri", "lname":"Pottepalem", "age":30} | 30 |
2eab2d99-167d-41b7-8227-d89ae45d3802 | {"age": 19, "fname": "Bhuvan", "lname": "Pottepalem", "address": "dummy address"} | 19 |
SELECT 2
profile_json_with_id_added |
---|
{"id": "2eab2d99-167d-41b7-8227-d89ae45d3801", "age": 30, "fname": "Giri", "lname": "Pottepalem"} |
{"id": "2eab2d99-167d-41b7-8227-d89ae45d3802", "age": 19, "fname": "Bhuvan", "lname": "Pottepalem", "address": "dummy address"} |
SELECT 2