That’s pretty funny! I’ve seen optimizations like this for reporting systems where rather than taking the top N item matching filter X, they cheat by taking the top M (where M > N) items and then filter it client side to N items matching filter X.
As long as the results are enough to populate the page you don’t notice the difference and it’s usually faster as you reuse the prior ranking.
Imagine the filter is not trivial but instead involves deep inspection of each item and calls to an external service. Bounding the max number of expensive calls and enabling parallelism is more important than returning exactly the requested number of items.
For a real world example, imagine a personalized search query that ranks and filters based on the user’s history.
Was thinking it just means that HN used to reuse the query results for the stories of the frontpage (which this person said was limited to 1500). That way, they don't have run a separate query for the Ask HN's section, since running an extra query is typically a lot slower than running some fairly straightforward code. But this is just my interpretation of what the OP was saying.
As long as the results are enough to populate the page you don’t notice the difference and it’s usually faster as you reuse the prior ranking.
But if not, you get this exact situation.
Replies (1)
Replies (3)
For a real world example, imagine a personalized search query that ranks and filters based on the user’s history.
Replies (1)