In this short post I would like to point out a non-obvious issue that one of my customers recently hit. On the one hand, it’s a typical case where the query optimizer generates a different (suboptimal) execution plan even though nothing relevant (of course, at first sight only) was changed. On the other hand, in […]
Wrong Results Involving INDEX FULL SCAN (MIN/MAX) in 12.1.0.2
One of my customers that recently upgraded to 12c hit a bug (22913528) that I think is good to be aware of. Note that as the title of this post states, the problem only occur in 12.1.0.2. At least, I wasn’t able to reproduce it in any other version. To reproduce it you simply need […]
Exadata Storage Index Min/Max Optimization
Before discussing the Exadata-specific feature, let’s review what the database engine can do independently of whether Exadata is used. To execute queries containing the min or max functions efficiently, two specific operations are available with B-tree indexes defined on the column referenced in the min or max function. The first, INDEX FULL SCAN (MIN/MAX), is […]
Challenges and Chances of the 11g Query Optimizer
Challenges and Chances of the 11g Query Optimizer is the name of a presentation I gave at several events (e.g. Trivadis Performance Days, Oracle OpenWorld, DOAG Konferenz, UKOUG Conference) throughout 2011. Its abstract is the following: With every new release, the query optimizer is enhanced. Oracle Database 11g Release 1 and Release 2 are no […]
IS NULL Conditions and B-tree Indexes
At page 383 of my book I wrote the following sentence (BTW, the same information is also provided by Table 9-3 at page 381): With B-tree indexes, IS NULL conditions can be applied only through composite B-tree indexes when several SQL conditions are applied and at least one of them is not based on IS […]
Parallel Full Table Scans Do Not Always Perform Direct Reads
Even though in general parallel full table scans performs direct reads, some exceptions exist. The aim of this post is to show such an exception. For test purposes I build in my own schema a copy of the SH.SALES table (the one distributed by Oracle with the demo schemas…). On that table I build an […]
Partially Index a Table
Recenty the following question was posted on oracle-l (I paraphrase…): With Oracle Database it is possible to create something similar to Teradata’s sparse indexes? Since the question is an interesting one, I decided to write this short post. First of all, I have to say that such a feature is not supported by the CREATE […]
Does CREATE INDEX Gather Global Statistics?
You can add the COMPUTE STATISTICS clause to the CREATE INDEX statement. It instructs the SQL statement to gather and store index statistics in the data dictionary, while creating the index. This is useful because the overhead associated with the gathering of statistics while executing this SQL statement is negligible. In Oracle9i, the gathering of […]
Zero-Size Unusable Indexes and the Query Optimizer
Zero-size unusable indexes and index partions is a small but useful feature of Oracle Database 11g Release 2. Simply put, its aim is to save space in the database by immediately releasing the segment associated to unusable indexes or index partitions. To illustrate this, let’s have a look to an example… Create a partitioned table, […]
Invisible Indexes and Hints
In this post I would like to remove some misinformation about the utilization of hints with invisible indexes. Let’s start by providing you what two sources say about that topic: Oracle Database 11g: New Features for DBAs and Developers (by Sam R. Alapati and Charles Kim, page 132) “If you want the optimizer to take […]