Search

OakieTags

Who's online

There are currently 0 users and 39 guests online.

Recent comments

Affiliations

Oracle Indexes

Big Tables, Sorts and Indexes Quiz (Candidate)

Following on from the previous quiz on Descending indexes. Simple scenario. You have a huge table, 10 Million plus rows. You have an index on a column with a NOT NULL constraint but there are various other columns in the table not included in the index. You want to select all columns and all rows [...]

Descending Indexes Solution (Yellow Submarine)

Answers to the quiz on Descending Indexes and hopefully some useful dangers and tips on using them. The answer to the first question is Yes, a “normal” Ascending Index can be used by the CBO to retrieve data in descending order and hence possibly avoid a sort. The reason being that leaf blocks in the [...]

Descending Indexes Quiz (Up On The Ladder)

OK, you won’t find the answer to these questions on my blog, so using my search facility won’t be of any help Actually, it’s quite an easy one this, honest If you have a query such as: SELECT * FROM bowie WHERE id BETWEEN 42 and 84 ORDER BY id DESC; 1) Can a default B-Tree index on [...]

Best Method To Select One Row From Small Table – Solution (Revolution 1)

OK, time for some answers, although of course regular readers of this blog will already know the answer :) When selecting one row from the small table as in the quiz in my previous post, the correct order is as follows: 1) PK access of an Index Organized Table. This option only requires just the 1 consistent [...]

Best Method To Select One Row From Small Table Quiz (Each Small Candle)

Assume you have a tiny little table with just 42 rows (naturally) that all fit in one table block. Order the following options in order of “efficiency” (most efficient option first) when accessing just one of these rows: 1) Full Table Scan of Heap Table 2) PK access of an Index Organised Table 3) Index access [...]

METHOD_OPT=> SIZE AUTO Quiz Solution (The Trickster)

I was going to leave it for a few days but there have already been so many comments and discussions on all this, I thought I better write something up. In case anyone was wondering, yes I probably am driving my colleagues at work mad with my “Question of the Day” !! Unfortunately, some might [...]

METHOD_OPT => SIZE AUTO Quiz (Automatic For The People)

OK, a nice, easy, simple one today. No tricks, honest You have a table with 3 columns and lets say 1M rows. Column 1 is effectively unique, so it has 1M distinct values. Let’s say 1 – 1000000, not that it really matters. Column 2 has 254 distinct values, all evenly distributed so it has [...]

MIN / MAX Quiz Answer (One Shot)

Not only are my regular blog readers a good deal better looking than the average person, but they’re quite a bit smarter as well As most people have correctly identified, the answer I was after to my previous Min/Max Quiz is that Option 1 is indeed the odd one out, as it’s the only option [...]

MIN/MAX Quiz (Funtime)

At my work I’ve recently introduced a little “Question of the Day” for my fellow DBAs, hopefully to pass on a few interesting little titbits of information and have a bit of fun along the way. I was going to just write a blog article on the following topic of how Oracle deals with MIN and [...]

BLEVEL 1 => BLEVEL 2 (Teenage Wildlife)

Jonathan Lewis recently wrote a really nice blog piece blevel=1 on the dangers of an index toggling between BLEVEL 1 and BLEVEL 2. I thought it would be useful to demonstrate this issue with a quick demo (Note: this example is on 11.2.0.1, with an 8K block size).   First, create a simple little table with 336,000 rows [...]