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 9.5.18 on x86_64-pc-linux-gnu (Debian 9.5.18-1.pgdg80+1), compiled by gcc (Debian 4.9.2-10+deb8u2) 4.9.2, 64-bit |
3 rows affected
store_nbr | zipcode | distance |
---|---|---|
123 | 76135 | 2.356 |
456 | 76135 | 3.002 |
789 | 76135 | 9.521 |
store_nbr | zipcode | distance | row_rank | d_rank | r_rank |
---|---|---|---|---|---|
123 | 76135 | 2.356 | 1 | 1 | 1 |
456 | 76135 | 3.002 | 2 | 2 | 2 |
789 | 76135 | 9.521 | 3 | 3 | 3 |