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?.
3 rows affected
3 rows affected
6 rows affected
brand_id | name | created_at |
---|---|---|
1 | Apple | 2020-01-01 00:00:00 |
2 | 2020-01-02 00:00:00 | |
3 | Microsoft | 2020-01-03 00:00:00 |
category_id | name |
---|---|
1 | laptops |
2 | phones |
3 | tablets |
product_id | brand_id | category_id | title | created_at |
---|---|---|---|---|
1 | 1 | 1 | Macbook Pro | 2020-01-01 00:00:00 |
2 | 1 | 2 | iPhone SE | 2020-01-02 00:00:00 |
3 | 1 | 3 | iPad Air | 2020-01-03 00:00:00 |
4 | 2 | 1 | Pixelbook GO | 2020-01-04 00:00:00 |
5 | 2 | 2 | Pixel 5 | 2020-01-05 00:00:00 |
6 | 3 | 1 | Surface 3 | 2020-01-06 00:00:00 |
product_id | brand_id | category_id | title | created_at | category_id | name |
---|---|---|---|---|---|---|
1 | 1 | 1 | Macbook Pro | 2020-01-01 00:00:00 | 1 | laptops |
2 | 1 | 2 | iPhone SE | 2020-01-02 00:00:00 | 2 | phones |
3 | 1 | 3 | iPad Air | 2020-01-03 00:00:00 | 3 | tablets |
4 | 2 | 1 | Pixelbook GO | 2020-01-04 00:00:00 | 1 | laptops |
5 | 2 | 2 | Pixel 5 | 2020-01-05 00:00:00 | 2 | phones |
6 | 3 | 1 | Surface 3 | 2020-01-06 00:00:00 | 1 | laptops |
product_id | brand_id | category_id | title | created_at | brand_id | name | created_at |
---|---|---|---|---|---|---|---|
1 | 1 | 1 | Macbook Pro | 2020-01-01 00:00:00 | 1 | Apple | 2020-01-01 00:00:00 |
3 rows affected
3 rows affected
a | b | t1 | t2 |
---|---|---|---|
1 | 2 | t1 | null |
7 | 8 | null | t2 |