add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
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 100
id amount0 amount1 price
1 60 60 1.5
2 60 60 1.5
3 60 60 1.5
4 60 60 1.5
5 60 60 1.5
6 60 60 1.5
SELECT 6
TRUNCATE TABLE
ALTER TABLE
INSERT 0 100
id contract amount0 amount1 price
1 abc 100 100 1.5
2 abc 60 60 2.5
3 xyz 60 50 2.1
4 klm 100 60 2.1
5 klm 200 200 1.5
6 klm 80 80 1.8
SELECT 6
combination count
(abc,60,60,2.1) 1
(abc,60,100,1.8) 1
(klm,50,200,2.5) 1
(abc,80,80,2.5) 1
(klm,50,60,2.1) 1
(abc,50,100,1.5) 1
SELECT 6
TRUNCATE TABLE
ALTER TABLE
INSERT 0 602
combination count
(xyz,60,100,2.1) 3
(abc,80,200,2.5) 3
(abc,50,60,1.5) 2
(xyz,200,80,2.5) 2
(klm,200,80,1.5) 2
(klm,80,60,2.5) 2
SELECT 6