Ignoring hints
Yes, finally, really ignoring hints – but it’s a sort of bug, of course. Thanks to Timur Akhmadeev for telling us about bug 8432870 (you’ll need an account on MOS for the link) in his reply to Charles...
View ArticleHow to hint – 1
Here’s a quick tutorial in hinting, promped by a question on the OTN database forum. The OP has a hash semi-join and Oracle appears to be ignoring a hint to use a nested loop: > I tried forcing the...
View ArticleHinting
As I’ve often pointed out, this blog isn’t AskTom, or the OTN forum, so I don’t expect to have people asking me to solve their problems; neither do I answer email questions about specific problems....
View ArticleIndex Hints
A new form of index hint appeared in 10g – and it’s becoming more common to see it in production code; instead of naming indexes in index hints, we describe them. Consider the following hint (expressed...
View ArticleQuiz Night
Browsing a little history recently I came across a note I’d written about the new-style index hint. In that note I claimed that: … the index has to start with the columns (product_group, id) in that...
View ArticleSubquery Factoring
When I wrote a note last week about the fixes to the subquery factoring optimizer code in 11.2.0.3, I finished with a comment about having more to say on the test case if I materialized the subquery....
View ArticleLogical tuning
Here’s a model of a problem I solved quite recently at a client site. The client’s query was much more complex and the volume of data much larger, but this tiny, two table, example is sufficient to...
View ArticleSubquery Factoring
I have a small collection of postings where I’ve described anomalies or limitations in subquery factoring (the “with subquery”, or Common Table Expression (CTE) to give it the official ANSI name)....
View ArticleSTS, OFE and SPM
That’s SQL Tuning Sets, optimizer_features_enable, and SQL Plan Management. There’s a recent post on OTN describing an issue when using SQL Tuning Sets to enforce plan stability when upgrading from...
View ArticleDynamic Sampling – 2
I’ve written about dynamic sampling in the past, but here’s a little wrinkle that’s easy to miss. How do you get the optimizer to work out the correct cardinality for a query like (the table creation...
View ArticleHow to hint
Here’s a live example demonstrating a point I’ve often made – you have to be very detailed in your hinting or Oracle will find a way to obey your hints and do the wrong thing. A recent posting on the...
View ArticleHints again
A recent posting on OTN came up with a potentially interesting problem – it started roughly like this: I have two queries like this: select * from emp where dept_id=10 and emp_id=15; select * from emp...
View ArticleInvisible ?
I’ll probably have to file this one under “Optimizer ignoring hints” – except that it should also go under “bugs”, and that’s one of the get-out clauses I use in my “hints are not hints” argument....
View ArticleIndex Hints
In my last post I made a comment about how the optimizer will use the new format of the index hint to identify an index that is an exact match if it can, and any index that starts with the same columns...
View ArticleHash Joins
I’ve written notes about the different joins in the past – but such things are always worth revisiting, so here’s an accumulated bundle of comments about hash joins. A hash join takes two inputs that...
View ArticleHinting
I’ve spent so many years trying to explain that a “hint” to the Oracle optimizer is an order – if you know how to do it properly – that I finally decided to list the manual references that have made...
View ArticleUnnest Oddity
Here’s a little oddity I came across in 11.2.0.4 a few days ago – don’t worry too much about what the query is trying to do, or why it has been written the way I’ve done it, the only point I want to...
View ArticleIndex Hash
I’m afraid this is one of my bad puns again – an example of the optimizer making a real hash of the index hash join. I’m going to create a table with several indexes (some of them rather similar to...
View ArticleRAC Plans
Recently appeared on Mos – “Bug 18219084 : DIFFERENT EXECUTION PLAN ACROSS RAC INSTANCES” Now, I’m not going to claim that the following applies to this particular case – but it’s perfectly reasonable...
View ArticleCaution – hints
Here’s a little example of why you should be very cautious about implementing undocumented discoveries. If you take a look at the view v$sql_hints in 11.2.0.4 you’ll discover a hint...
View Article