Hacker News new | ask | show | jobs
by smcq 5959 days ago
Do the same thing you would do in SQL, run the efficient query (you're almost guaranteed have a view for date limited for a specific customer) then filter it based on product. This is exactly what your RDBMS does, and I don't see how you're gaining anything except a different language.
1 comments

2 words: Query Optimizer http://en.wikipedia.org/wiki/Query_optimizer

If you think you're doing exactly that an RDBMS does, you're kidding yourself. Even if you do, you're still wasting effort re-coding something that already exists.

The fact is, running the query on the order and filtering on the product may not be the most efficient way of getting the data. It might be faster query on the product and then filter based on the order. RDBMS's make those sorts of decisions all the time.

Look, I'm not going to argue with you because you have no idea what you're talking about. Go away.