News for hackers. Stuff that matters.
Re:SQL is 43 years old – Here’s why we still use it today by dragonwriter on Tuesday May 02, 2017 @12:45PM (#14248001)
> I don't see how your example doesn't require an index, specifically because, as you said, indexes are a tool to allow for optimizing lookups.

If you never lookup by a column alone, you don't need a single-column index on that column. An FK need not ever be a lookup target (the target column[s] it references are necessarily a lookup target, but not necessarily vice versa.)

An FK is probably usually going to want some kind of index, but it's not nonsensical to have a non-indexed FK.

There are no comments on this comment yet.