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 3
CREATE TABLE
INSERT 0 3
CREATE TABLE
INSERT 0 3
CREATE TABLE
INSERT 0 4
id | title | image | reviews | liked | totallikes |
---|---|---|---|---|---|
2 | Book | book.jpg | [{"id":3,"product_id":2,"user_id":1,"review":"Could be better"},{"id":3,"product_id":2,"user_id":1,"review":"Could be better"}] | f | 2 |
1 | Photo | photo.jpg | [{"id":2,"product_id":1,"user_id":2,"review":"Looks Great"},{"id":1,"product_id":1,"user_id":1,"review":"Great Product!"},{"id":2,"product_id":1,"user_id":2,"review":"Looks Great"},{"id":1,"product_id":1,"user_id":1,"review":"Great Product!"}] | f | 4 |
3 | Table | table.jpg | [null] | f | 0 |
SELECT 3
id | title | image | reviews | liked | totallikes |
---|---|---|---|---|---|
1 | Photo | photo.jpg | [{"id":1,"product_id":1,"user_id":1,"review":"Great Product!"},{"id":2,"product_id":1,"user_id":2,"review":"Looks Great"}] | f | 2 |
2 | Book | book.jpg | [{"id":3,"product_id":2,"user_id":1,"review":"Could be better"}] | f | 2 |
3 | Table | table.jpg | null | f | 0 |
SELECT 3