Set Operations
A recent post on the OTN database forum highlights a couple of important points ideas for optimising SQL. There are: (a) is there a logically equivalent way of stating the SQL and (b) is there a...
View ArticleDebugging
The OTN database forum supplied a little puzzle a few days ago – starting with the old, old, question:“Why is the plan with the higher cost taking less time to run?”The standard (usually correct)...
View ArticleE-rows / A-rows
A recent post on the OTN database forum reminded me how easy it is to forget to keep repeating a piece of information after the first couple of hundred times you’ve explained it. No matter how...
View Articledbms_xplan
My favourite format options for dbms_xplan.display_cursor().This is another of those posts where I tell you about something that I’ve frequently mentioned but never documented explicitly as a good (or,...
View ArticleUniquely parallel
Here’s a surprising (to me) execution plan from 12.1.0.2 – parallel execution to find one row in a table using a unique scan of a unique index – produced by running the following script (data creation...
View ArticleConditional SQL- 6
An odd little anomaly showed up on the OTN database forum a few days ago where a query involving a table covered by Oracle Label Security (OLS) seemed to wrap itself into a non-mergeable view when...
View ArticlePlan Shapes
There are a number of articles, webinars, and blogs online about how to read execution plans, but many of them seem to stop after the the minimum description of the simplest type of plan, so I thought...
View ArticleIOT limitation
In the right circumstances Index Organized Tables (IOTs) give us tremendous benefits – provided you use them in the ideal fashion. Like so many features in Oracle, though, you often have to compromise...
View ArticleFixed Stats
There are quite a lot of systems around the world that aren’t using the AWR(automatic workload repository) and ASH (active session history) tools to help them with trouble shooting because of the...
View ArticleFilter Subquery
There’s a current thread on the OTN database forum showing an execution plan with a slightly unusual feature. It looks like this:read more
View ArticleJoin Elimination 12.2
From time to time someone comes up with the question about whether or not the order of tables in the from clause of a SQL statement should make a difference to execution plans and performance. Broadly...
View ArticleBand Join 12c
One of the optimizer enhancements that appeared in 12.2 for SQL is the “band join”. that makes certain types of merge join much more efficient. Consider the following query (I’ll supply the SQL to...
View ArticleCost is Time (again)
The hoary old question about lower cost queries running faster or slower that higher cost queries has appeared once again on the OTN database forum. It’s one I’ve addressed numerous times in the past –...
View ArticleI don’t know (yet)
Here’s a question that came to mind while reading a recent question on the OTN database forum. It’s a question to which I don’t know the answer and, at present, I don’t really want to bother modelling...
View ArticleJoin Elimination
A question has just appeared on OTN describing a problem where code that works in 11g doesn’t work in 12c (exact versions not specified). The code in question is a C-based wrapper for some SQL, and the...
View Articlemin/max Upgrade
A question came up on the OTN database forum a little while ago about a very simple query that was taking different execution paths on two databases with the same table and index definitions and...
View ArticleAliases
Here’s a performance problem that came up on OTN recently. The following query (reformatted) takes “ages” to run – how do you address the problem: SELECT COUNT(*) FROM smp_dbuser2.workflow_step_report...
View Articledbms_sqldiag
If you’re familiar with SQL Profiles and SQL Baselines you may also know about SQL Patches – a feature that allows you to construct hints that you can attach to SQL statements at run-time without...
View ArticleUnpivot
An interesting observation appeared recently as a side-channel on a question on the OTN database forum– how does Oracle execute an unpivot() operation. Here’s an example of such a query:read more
View Article