Hacker News new | ask | show | jobs
by Gonsalu 5538 days ago
That doesn't seem more helpful to me... it's just making the worst case worser.

In a situation which other queries would benefit from the id1, id2 order, and it wouldn't pay off creating another index, using a index seek instead a table scan is way better.

1 comments

Making the worst case worser is the point. My assumption here was that the issue was catching this type of optimization problem during development, in which case using row values would help. The idea isn't that a table scan is better than an index scan, but that an index scan that isn't very selective will progressively get worse in terms of performance as the table grows, and possibly not be caught during development. Row values are the developer's way of saying "I want this condition to match an index on all columns, or not match at all".