Re: Postgres doesn't remove useless join when using partial unique index

2019-01-20 Thread David Rowley
On Mon, 21 Jan 2019 at 09:51, Kim Rose Carlsen wrote: > remove_useless_join does not prove uniqueness if the unique index is partial, > and therefore wont remove the join if no columns are referenced (see example > in bottom). > > I have been trying to look around the source code and from what I

Postgres doesn't remove useless join when using partial unique index

2019-01-20 Thread Kim Rose Carlsen
Hi remove_useless_join does not prove uniqueness if the unique index is partial, and therefore wont remove the join if no columns are referenced (see example in bottom). I have been trying to look around the source code and from what I have identified the problem seems to be that "check_index_