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.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1), 64-bit |
5 rows affected
4 rows affected
customer | order_no | charges |
---|---|---|
Customer1 | 250 | 50 |
Customer1 | 150 | 45 |
Customer2 | 250 | 50 |
Customer2 | 250 | 45 |
Customer2 | 500 | 40 |
Customer2 | 200 | 30 |
Customer3 | 40 | 50 |
Customer4 | 250 | 50 |
Customer4 | 250 | 45 |
Customer4 | 500 | 40 |
Customer4 | 1000 | 30 |
Customer5 | 250 | 50 |
Customer5 | 250 | 45 |
Customer5 | 200 | 40 |