3 ms·Query optimization doesn't work because SQL is declarative2 points by jamii 2y agoidiocrat 2y agoMaybe the "query optimization works because sql is set-oriented"? The types of operations in SQL are limited to sets, therefore allowing certain optimizations.