Comment by weberc2
7 years ago
That's only true tautologically--i.e., if you decide to constrain "its purpose" to the set of things SQL does well. If you want to do something perfectly reasonable--like programmatically building queries to access data of arbitrary (read "unknown at compile time") schema, you'll find it's quite hard to do this, at least if you care about performance at all. Largely because SQL doesn't compose well.
Optimization requires knowing the schema, and query usage patterns, and data stats - which competent RDBMS engines use to great effect already.
Sounds like you're looking for a magic silver bullet - there's no free lunch in our field though.
Lastly, the comment I was replying to can be paraphrased as "well is SQL is so great why aren't RDBMS' built using SQL, huh?". Which is a ridiculous question since SQL isn't the right tool for that job - its very name tells you that.
If you want to continue arguing against strawmen do it with someone else.