Re: Optimising outer joins in the presence of non-nullable references

2021-05-24 Thread Tom Lane
Philip Lykke Carlsen writes: > My question then is, shouldn't the inner and outer join queries be > semantically equivalent when the columns we are joining on are > non-nullable foreign keys? Maybe, but no such knowledge is built into the planner. > Is there some corner case I'm not considering?

Optimising outer joins in the presence of non-nullable references

2021-05-24 Thread Philip Lykke Carlsen
Hi list. I have a question about the different plans produced by postgres for an outer join versus an inner join. (complete sql script attached) Take these two tables: CREATE TABLE album ( id SERIAL PRIMARY KEY, title TEXT NOT NULL ); CREATE INDEX album_title ON albu