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?.
version |
---|
PostgreSQL 10.23 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-15), 64-bit |
SELECT 1
CREATE TABLE
INSERT 0 7
name | company_name | job | rn | node | lvl |
---|---|---|---|---|---|
Bob Ross | Painters | director | 1 | Bob Ross, Painters, director | 1 |
Carl | Painters | manager | 1-1 | Bob Ross, Painters, director - Carl, Painters, manager | 2 |
Carl | Sunny-D | administrator | 1-1-1 | Bob Ross, Painters, director - Carl, Painters, manager - Carl, Sunny-D, administrator | 3 |
Celine Dion | Sunny-D | director | 1-1-1-1 | Bob Ross, Painters, director - Carl, Painters, manager - Carl, Sunny-D, administrator - Celine Dion, Sunny-D, director | 4 |
Bob Ross | Painters | director | 1 | Bob Ross, Painters, director | 1 |
Johnny | Painters | worker | 1-2 | Bob Ross, Painters, director - Johnny, Painters, worker | 2 |
Johnny | X-factory | worker | 1-2-1 | Bob Ross, Painters, director - Johnny, Painters, worker - Johnny, X-factory, worker | 3 |
Celine Dion | X-factory | director | 1-2-1-1 | Bob Ross, Painters, director - Johnny, Painters, worker - Johnny, X-factory, worker - Celine Dion, X-factory, director | 4 |
SELECT 8