O'Reilly logo

Joe Celko's SQL for Smarties, 4th Edition by Joe Celko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

39

Optimizing SQL

There is no set of rules for writing code that will take the best advantage of every query optimizer on every SQL product every time. The query optimizers depend on the underlying architecture and are simply too different for many universal rules; however, we can make a few general statements. Just remember that you have to test code. What would improve performance in one SQL implementation might not do anything at all in another or make the performance worse. Even worse, the next release of the same SQL can perform differently.

There are two kinds of optimizers: cost-based and rule-based. A rule-based optimizer (such as Oracle before Version 7.0) will parse a query and execute it in the order in which it was written, perhaps ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required