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 50 100 2.5
2 50 100 2.5
3 50 100 2.5
4 50 100 2.5
5 50 100 2.5
6 50 100 2.5
SELECT 6
TRUNCATE TABLE
ALTER TABLE
INSERT 0 100
id contract amount0 amount1 price
1 xyz 60 80 2.5
2 klm 80 200 1.5
3 abc 60 100 1.8
4 abc 60 60 2.5
5 xyz 50 80 1.8
6 abc 60 50 1.8
SELECT 6
combination count
(klm,80,100,2.1) 3
(abc,60,100,1.8) 2
(klm,80,60,2.1) 2
(xyz,80,80,2.1) 2
(klm,50,100,2.1) 2
(abc,60,80,2.1) 2
(klm,200,100,2.1) 2
(klm,100,50,2.1) 2
(xyz,100,80,2.1) 2
(xyz,100,100,2.1) 2
(xyz,60,100,1.5) 2
(abc,80,100,1.5) 1
(abc,60,80,1.8) 1
(abc,80,100,1.8) 1
(abc,80,60,2.5) 1
(abc,80,60,1.8) 1
(abc,60,60,2.5) 1
(abc,50,80,2.1) 1
(abc,100,100,1.5) 1
(abc,80,50,1.8) 1
(abc,100,80,2.1) 1
(abc,100,100,2.1) 1
(abc,100,200,1.8) 1
(abc,200,50,2.1) 1
(abc,200,80,2.1) 1
(abc,200,100,2.1) 1
(abc,200,200,2.1) 1
(klm,50,60,2.1) 1
(klm,50,60,2.5) 1
(abc,100,80,1.5) 1
SELECT 30