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?.
SELECT 4
CREATE TABLE
INSERT 0 4
BEGIN
tableoid | ctid |
---|---|
x | (0,1) |
y | (0,1) |
x | (0,2) |
y | (0,2) |
DELETE 4
count |
---|
2 |
SELECT 1
count |
---|
2 |
SELECT 1
ROLLBACK
BEGIN
tableoid | ctid |
---|---|
x | (0,1) |
x | (0,2) |
DELETE 2
count |
---|
2 |
SELECT 1
count |
---|
4 |
SELECT 1
ROLLBACK
BEGIN
tableoid | ctid |
---|---|
x | (0,1) |
x | (0,2) |
DELETE 2
count |
---|
2 |
SELECT 1
count |
---|
4 |
SELECT 1
ROLLBACK
setseed |
---|
SELECT 1
CREATE TABLE
CREATE TABLE
CREATE TABLE
tableoid | ctid | c |
---|---|---|
z1 | (0,1) | 1 |
z1 | (0,2) | 1 |
z0 | (0,1) | 2 |
z0 | (0,2) | 0 |
INSERT 0 4
BEGIN
tableoid | ctid | c |
---|
DELETE 0
ROLLBACK
BEGIN
tableoid | ctid | c |
---|---|---|
z1 | (0,1) | 1 |
z0 | (0,1) | 2 |
z1 | (0,2) | 1 |
z0 | (0,2) | 0 |
DELETE 4
ROLLBACK
BEGIN
tableoid | ctid | c |
---|---|---|
z1 | (0,1) | 1 |
z1 | (0,2) | 1 |
DELETE 2
ROLLBACK