I have a (large) table with a composite primary key, composed of 5 columns (a, b, c, d, e).
I'd like to efficiently select all rows having two of those columns (a + e) to a given value.
In PostgreSQL, do I need an index for this? Or will the database use the primary key (even partly?)
I've seen the following post, which specify that MySQL can use the left-most part(s) of a multiple-column index for efficiently querying rows. But I did not find anything for PostgreSQL on composite primary keys.