CHAPTER 6Selectivity Issues

So far, I have stuck with all the easy options. I've been using numeric data, avoiding nulls, generating nice data distributions, and taking half a dozen other routes to making the optimizer behave well.

However, there are numerous ways in which the arithmetic works as I've described but still produces results that look completely wrong. In this chapter, I discuss the commonest reasons why the standard selectivity calculations produce unsuitable answers, and how you can (sometimes) bypass the problem. I also discuss a couple of features that may cause the optimizer to apply the arithmetic to the wrong predicates.

In Chapter 3, I avoided going into details about histograms. I'm still going to avoid them here. The effects ...

Get Cost-Based Oracle Fundamentals now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.