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 12.0 (Debian 12.0-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit |
4 rows affected
author_id | author_name | author_name_no |
---|---|---|
1 | Paul | 1 |
2 | Jim | 1 |
3 | Mary | 1 |
4 | Fred | 1 |
4 rows affected
subject_id | subject_name |
---|---|
1 | Genetics |
2 | Maths |
3 | Economics |
4 | Comp_Sci |
21 rows affected
work_id | work_title | work_type |
---|---|---|
1 | G_1 | Book |
2 | G_2 | Journal |
3 | M_1 | Book |
4 | M_2 | Journal |
5 | M_3 | Journal |
6 | E_1 | Book |
7 | CS_1 | Book |
8 | CS_2 | Book |
9 | CS_3 | Journal |
10 | G_CS_1 | Book |
11 | G_CS_2 | Journal |
12 | G_CS_3 | Journal |
13 | G_M_1 | Journal |
14 | G_M_2 | Journal |
15 | M_E_1 | Book |
16 | M_E_2 | Book |
17 | M_E_3 | Journal |
18 | E_CS_1 | Journal |
19 | E_CS_2 | Book |
20 | E_CS_3 | Journal |
21 | G_M_CS_1 | Book |
34 rows affected
work_id | subject_id |
---|---|
1 | 1 |
2 | 1 |
3 | 2 |
4 | 2 |
5 | 2 |
6 | 3 |
7 | 4 |
8 | 4 |
9 | 4 |
10 | 1 |
10 | 4 |
11 | 1 |
11 | 4 |
12 | 1 |
12 | 2 |
13 | 1 |
13 | 2 |
14 | 1 |
14 | 2 |
15 | 2 |
15 | 3 |
16 | 2 |
16 | 3 |
17 | 2 |
17 | 3 |
18 | 3 |
18 | 4 |
19 | 3 |
19 | 4 |
20 | 3 |
20 | 4 |
21 | 1 |
21 | 2 |
21 | 4 |
32 rows affected
work_id | author_id |
---|---|
1 | 1 |
2 | 1 |
2 | 3 |
3 | 3 |
4 | 3 |
4 | 4 |
5 | 3 |
5 | 4 |
6 | 4 |
7 | 2 |
8 | 2 |
9 | 1 |
9 | 2 |
10 | 1 |
11 | 1 |
11 | 2 |
12 | 1 |
12 | 2 |
13 | 3 |
14 | 1 |
14 | 3 |
15 | 2 |
15 | 4 |
16 | 2 |
17 | 4 |
18 | 2 |
18 | 4 |
19 | 4 |
20 | 2 |
21 | 1 |
21 | 2 |
21 | 3 |
count |
---|
8 |
count |
---|
8 |
author_id | waw | author_name | work_title | work_type |
---|---|---|---|---|
1 | 1 | Paul | G_1 | Book |
1 | 2 | Paul | G_2 | Journal |
3 | 2 | Mary | G_2 | Journal |
2 | 7 | Jim | CS_1 | Book |
2 | 8 | Jim | CS_2 | Book |
1 | 9 | Paul | CS_3 | Journal |
2 | 9 | Jim | CS_3 | Journal |
1 | 10 | Paul | G_CS_1 | Book |
1 | 11 | Paul | G_CS_2 | Journal |
2 | 11 | Jim | G_CS_2 | Journal |
1 | 12 | Paul | G_CS_3 | Journal |
2 | 12 | Jim | G_CS_3 | Journal |
3 | 13 | Mary | G_M_1 | Journal |
1 | 14 | Paul | G_M_2 | Journal |
3 | 14 | Mary | G_M_2 | Journal |
2 | 18 | Jim | E_CS_1 | Journal |
4 | 18 | Fred | E_CS_1 | Journal |
4 | 19 | Fred | E_CS_2 | Book |
2 | 20 | Jim | E_CS_3 | Journal |
1 | 21 | Paul | G_M_CS_1 | Book |
2 | 21 | Jim | G_M_CS_1 | Book |
3 | 21 | Mary | G_M_CS_1 | Book |
names | title |
---|---|
Jim,Mary,Paul | G_M_CS_1 |