Search

OakieTags

Who's online

There are currently 0 users and 18 guests online.

Recent comments

Affiliations

October 2010

Presenting at Croatian Oracle User Group - HROUG


This week I'll be presenting at Croatian Oracle User Group Conference (HROUG) which will take place in Rovinj in Croatia, a beautiful old city in Istria at the Adriatic coast.

HROUG is a very strong and active user group. Every year they organize excellent conference, so this year it is already the 15th. Last year I was presenting about execution plan stability and my presentation was selected as the best presentation in the "Database and Technology" track.

Query Transformations - follow up

Despite the doubts about the topic "Query Transformations" (described in my previous post) presented at OOW which was quite technical I found extremely nice comments in different blog posts written by the attendees of my presentation. Thanks for sharing that with others. I was really happy and at same time surprised to have the room almost full and I hope everybody has learned at least something useful.

Sydney – Day Off…

This is my second trip to Sydney. The first time I came I managed to do a lot of the tourist stuff, but I never managed a trip up the Sydney Tower or Taronga Zoo. I did both of those yesterday. Here are some photos.

The tower gives an excellent view of the city. It’s worth doing that as your first activity, so you can get a feel for that you are getting yourself in for. As part of the trip you also get to ride on OzTreck, a virtual tour of Australia. This was actually a lot of fun. It’s certainly worth 10 minutes of your time.

Next stop was the zoo. I bought a zoo pass that includes the ferry, skyride and zoo entrance. If you have a concession ticket there are cheaper ways to get in. On the one had I dislike zoos because they have animals in captivity. On the other hand, I love them. Taronga Zoo has a nice feel about it, but some of the exhibits seem a little small compared to other zoos I’ve been to. The advantage is that you get a good view of the animals. The downside is I’m not sure it is a great environment for some of the animals.

The information desk suggested I should try and see the bird show, which didn’t strike me as sounding too interesting, but it was in the direction I was walking and started just as I got to the show ground. Well, I couldn’t have been more wrong. If you are going to the zoo you should definitely see the show. I don’t know about you, but I’ve never had a bird of prey with a 2 metre wing span fly a couple of inches above my head before. Very impressive. It was a really good show for adults and kids alike.

After the zoo it was a train ride back to the hotel in North Ryde and an early night before todays session. Unfortunately I only managed about 4 hour sleep, which included 5 hour gap in the middle of it. :(

So today is day 1 of my PL/SQL course in Sydney, followed immediately by a trip into town to speak at the Sydney meetup organised by the guys from Pythian.

Cheers

Tim…

The 3 Letters Which Can Put an American DBA to Sleep are NL…zzzzz

Pity us poor US DBAs — safely secure using our ancient, many-times-upgraded Oracle 6 databases with their US7ASCII character sets.

We knew that ASCII only covered 0-127, but who could blame us when we started putting WE8MSWIN1252 "international" characters into those fields — the database let us, and it felt kind of sexy putting in cool European characters with umlauts and accents on them.

Besides, all of our business was with other American companies, and if someone had some "funny" characters in their name, then they just had to change them!

Of course, all of this is said with tongue firmly planted in cheek.  Nowadays you’d better be able to handle Unicode in your database if you want to have a prayer of not being labeled as something older than teleprinters and typewriters.

I first encountered this situation when working with a US7ASCII database where we started using XMLTYPE columns — little did I know that XMLTYPE columns actually validated the character set of the XML document coming in — one of our fields was the country name.

Everything was fine until February 13th, 2004 — the day ISO added an entry for the Aland Islands… (which has an A with a diacritical ring above it).

We started seeing errors inserting our XML documents — all due to strict validation of the character set.  Did we change character sets?  No — we stopped using the XMLTYPE columns :-(

Fast forward a few years and now I’m lucky enough to work with proper databases created with the AL32UTF8 character set — so now I can store my friend Mogens Noorgard name correctly (or I would if I could spell it…)

However, little did I realize that I needed to declare my columns differently…

You see, back in the day, VARCHAR2(10) meant that I wanted to store up to 10 characters in the column gosh darn it — I didn’t worry about bytes vs. characters — same thing right?

Er, no.

So in a brand new database with an AL32UTF8 character set, why was I getting column length errors trying to insert the string H,U,”Y with an umlaut” into a VARCHAR2(3) field?

Heck, isn’t “Y with an umlaut” just another character? It’s just WESMSWIN1252 character 255, right?

Don’t tell me it’s a character set issue — I’ve been trying to avoid opening up that NLS manual for years…

Ok, ok — open the manual and start reading about Unicode — specifically UTF-8.  Uh-oh, I read the words "variable-length encoding" and the light starts to dawn…

Turns out that “Y with an umlaut” is 1 byte in WESMSWIN1252 (specifically 0xFF), but it’s 2 bytes in UTF-8 (0xC3BF).

But didn’t I declare the column to be 3 characters in length?  So why does it care about the underlying encoding?

Enter NLSLENGTHSEMANTICS and the fact that the default is set to BYTE.

From the documentation:

http://download.oracle.com/docs/cd/E1188201/server.112/e10729/ch3globenv.htm#NLSPG235

NLSLENGTHSEMANTICS

Property
Description

Parameter type
String

Parameter scope
Environment variable, initialization parameter, and ALTER SESSION

Default value
BYTE

Range of values
BYTE or CHAR

By default, the character data types CHAR and VARCHAR2 are specified in bytes, not characters. Hence, the specification CHAR(20) in a table definition allows 20 bytes for storing character data.

This works well if the database character set uses a single-byte character encoding scheme because the number of characters is the same as the number of bytes. If the database character set uses a multibyte character encoding scheme, then the number of bytes no longer equals the number of characters because a character can consist of one or more bytes. Thus, column widths must be chosen with care to allow for the maximum possible number of bytes for a given number of characters. You can overcome this problem by switching to character semantics when defining the column size.

NLSLENGTHSEMANTICS enables you to create CHAR, VARCHAR2, and LONG columns using either byte or character length semantics. NCHAR, NVARCHAR2, CLOB, and NCLOB columns are always character-based. Existing columns are not affected.

You may be required to use byte semantics in order to maintain compatibility with existing applications.

NLSLENGTHSEMANTICS does not apply to tables in SYS and SYSTEM. The data dictionary always uses byte semantics.

Note that if the NLSLENGTHSEMANTICS environment variable is not set on the client, then the client session defaults to the value for NLSLENGTHSEMANTICS on the database server. This enables all client sessions on the network to have the same NLSLENGTH_SEMANTICS behavior. Setting the environment variable on an individual client enables the server initialization parameter to be overridden for that client.

 

Sigh…

 

Can anyone tell me why the default would be BYTE?  Why would I want to declare character fields with BYTE lengths?  Thank goodness it’s not in bits…

Anyway, we adjusted our standard to make sure that DDL always specifies BYTE or CHAR in the declaration now:

VARCHAR2(10 CHAR) instead of VARCHAR2(10), so now we can be sure…

Virtual Oracle Conference

Tanel Poder has put together an Online Virtual Oracle Conference and he asked me to participate. I had to think about it for about 2 seconds before I said yes. The speakers are Tanel, Cary Millsap, Jonathan Lewis and myself. Wow! How did I sneak into that line up you might wonder. Apparently Tanel asked Tom Kyte first, but Tom had to decline. It’s not the first time I’ve played second fiddle to Tom – and hopefully won’t be the last. I feel like I’m in pretty tall cotton (as we say in Texas).

Here’s how Tanel pitched the idea to me:

My reasoning is that we start from higher level and then drill down:

1) Cary talking about how to approach things right (and eventually find the problem SQL or operations)
2) I’m drilling down inside a SQL with row-source profiling (and eventually find where is the problem)
3) Jonathan talks why it happens and what to do about it (how to help CBO by writing better SQL)
4) Kerry talks how to help CBO and fix SQL when you can’t actually change the SQL text to any better

The whole idea of running a seminar on-line without anyone traveling is a very interesting topic. The technology has progressed to the point where it is quite possible. The idea of a short conference with multiple pretty well known speakers is also pretty cool. It will be interesting to see what kind of participation we get.

The conference is scheduled to be 8 hours spread over two days, Nov. 18 and 19. Follow the link below to read more about the event including the schedule, cost, how to sign up and abstracts for the talks.

Virtual Oracle Conference

Hope to see you there!

P.S. – There is a pretty good discount if you sign up before Nov. 1.

Read currently running SQL statement’s bind variable values using V$SQL_MONITOR.BIND_XML in Oracle 11.2

The title pretty much says it. In Oracle 11.2, if you have the Diag+Tuning Pack licenses and the SQL monitoring kicks in for your SQL statement, then instead of the old fashioned ERRORSTACK dump reading you can just query the V$SQL_MONITOR.BIND_XML to find the values and metadata of your SQL statement’s bind variables.

I’ve written an example here:

And a related comment – V$SQL_BIND_CAPTURE is not a reliable way for identifying the current bind variable values in use. Oracle’s bind capture mechanism does not capture every single bind variable into SGA (it would slow down apps which run lots of short statements with bind variables). The bind capture only selectively samples bind values, during the first execution of a new cursor and then every 15 minutes from there (controlled by _cursor_bind_capture_interval parameter), assuming that new executions of that same cursor are still being started (the capture happens only when execution starts, not later during the execution).

Share

Few new blogs worth checking out

Here are few blogs which I’ve found lately and think that you should also check out if you’re interested in Oracle stuff (and take time to read blogs :)

Oracle performance & Grid Control
http://juliandontcheff.wordpress.com/

Oracle Exadata
http://ferhatsengonul.wordpress.com/

Oracle, Unix, storage (for DW)
http://dsstos.blogspot.com/

Oracle, Storage & Virtualization (VMWare)
http://oraclestorageguy.typepad.com/

Julian Dyke’s new blog (RAC, Data Guard so far – probably internals later :-)
http://juliandyke.wordpress.com/

Share

The quick guide to being as annoying as possible on a plane…

If you are flying cattle-class it’s pretty easy to get annoyed, but here are a few things that really get on my nerves…

Hand Luggage

  • The correct way to remove your luggage from the overhead compartment does not include bouncing it off my head! The item in question was a solid hand-luggage bag with reinforced corners. The word, “Shit”, came out of my mouth at high volume as I checked my head for bleeding.
  • When they tell you one piece per passenger, that is what they mean. Not three pieces of hand luggage and a suit holder. If you are going to bring that much with you (assuming you are let on the flight with it), don’t you dare complain about there being no room in the over head compartment above your seat you selfish git.
  • Hand luggage does not mean full size cases, fragile items or wedding cakes. If you do decide to attempt to transport a wedding cake as hand luggage, don’t get all uptight with the flight attendants because there is nowhere safe to put it.

Aisle Etiquette

  • When you are walking up the aisle, don’t grab my head rest and pull on it with all your might. It’s really annoying, especially when I have raised my head rest and in grabbing it you push it back down again.
  • When you are walking past the exit row seats, don’t steady yourself on my pull-out screen so your fingers cover half the screen and leave what I can only assume is post-toilet visit residue on the screen.
  • When you are walking up the aisle, don’t grab my shoulder to steady yourself. It’s even more annoying than the head rest or the screen incidents.
  • If you insist on sleeping with your legs and/or head blocking the aisle, don’t give me (or the flight attendants) evils if I/they wake you up as I/they walk past.

Headphones

  • When you see the flight attendent coming to serve you food or drinks, remove your headphones! Don’t sit there squinting at him/her saying, “What?”, repeatedly. The reason you can’t hear them is you have the volume set to 11/10 on your earphones you daft old bat.
  • Remove your headphones before starting a conversation with your partner. The rest of the cabin are not interested in that “funny” scene in the rom-com you are watching. If they were I’m sure the captain would announce it.

Hygiene

  • Use deodorant. Nuff said.
  • When you are sitting next to me, don’t constantly huff and puff and generally cover me with your stank breath. I’m not enjoying the flight either, but I’m not getting on your tits.
  • Leave the toilets in the state you would expect to find them. I’m sick of having to clean them up for fear of the next person thinking it’s me that made that mess. They do provide bins you know!
  • If you are going to cough, sneeze or hock a loogie please use a tissue. I am constantly ill these days and I’m guessing most of it comes from the dirty air in planes.

Flight Attendants

  • You may not know this, but the flight attendants are not your personal slaves. If you get off your lazy fat ass once in while you might manage to avoid DVT.
  • When the flight attendant asks you to do something, you should do it. That includes not getting out of your seat to retrieve your hand luggage while the plane is still moving.

Seats

  • When you see the flight attendants serving food, it’s a nice gesture to put your seat upright. It makes life a lot easier for the person behind you.
  • Just because you’ve finished eating it doesn’t mean the person behind you has, so you might want to think twice before attempting a new world record for speed seat reclining.
  • I’ve paid for my seat so don’t steal my space by leaning on me or sticking your elbows into my ribs. I’m fat and if I can manage to stay within my allotted space you sure as hell can.

Volume

  • You don’t need to shout to talk to the person sitting next to you (see headphones).
  • Business people. I’m sure your companies and your clients would not be pleased to know the amount of information you are passing out to strangers by speaking loudly about your latest deal/budget. I sat behind two guys recently who were obviously playing, “my job is more important that yours”, with each other. During several minutes I was clearly able to hear the companies they worked for, the clients their companies were working with and some of the deals they had struck, including the profit margins involved. I was severely tempted to write it all down and phone the companies in question and tell them what I had heard. In summary, it’s not big, it’s not clever and it makes you look like an insecure prick!

Exiting the Plane

  • Removing your hand luggage while the plane is moving is a bad idea. I’m sure if you injure someone doing it you could find yourself with a hefty legal bill.
  • When the time comes to leave the plane, pushing and shoving to try and move one space forward in the queue is really stupid. If you are lucky you will get out 3 seconds earlier, where you will find yourself in a queue for customs and baggage claim. It’s really not worth the effort of trampling me.

These and many more annoying habits can be found in the economy class seating of your favorite airline.

Cheers

Tim…

Singapore Update

Call me paranoid, but when I started filling in a customs declaration that mentions the death penalty for drug traffickers, I suddenly got worried about the cold cures and vitamin C pills in my bag.

When I walked out of the airport in Singapore I couldn’t believe how humid it was. Dubai is hot, and Washington was very humid this year, but Singapore was something else.

I got to the hotel pretty late and I was teaching the next day, so I went straight to bed. The Oracle University office was about 1 km from the hotel so I walked to it. By the time I got there I felt like I needed a shower. Even at 08:00 in the morning it felt like hard work. After a couple of hundred yards I could feel myself panting like a dog.

The class was pretty small, with nine paying attendees and one Oracle University instructor who came along for the ride. Big classes can be exciting, but small classes feel more informal, so either way it’s pretty cool. We went out as a group at lunch time on both days, so there was plenty of time for gossiping, as well as the teaching stuff.

Singapore is full of restaurants. It feels like every building has a food court in it, and most of the places are busy. Speaking to a couple of people on the course, it seems many of the people never cook. Eating out is so cheap that unless you are cooking for about 6 people, it’s cheaper to eat out that cook at home. Sounds good to me. :)

On the first evening I went for a walk around the bay area. It was dark by the time I got out, so all the photos are night shots. I’m not great with a camera at the best of times, but add in darkness and you know it’s going to go wrong. I took a lot of shots, but I’ve deleted most of them because they were just too blurry. The best of them made it here. The “altitude” shots, where you can see my reflection in the glass, were taken from the Singapore Flyer. My photos don’t do it justice.

The skyline would make you believe the place is like a scene out of Blade Runner, but when you are walking around the central business district it actually feels quite open. There is a lot of space between the buildings, so it never feels claustrophobic. Another nice thing is the streets are very clean. No litter, no chewing gum stuck everywhere and no dog crap on the pavements. If only the residents of Birmingham could act like this.

The bay area is obviously where all the money is. There is a crazy casino built to look like a boat is sitting on three towers. Next to that there is an absolutely giant shopping mall, half of which is still under construction. They were prepping for a Christian Dior show when I was walking round. The other side of the bay seems to be where the young and rich go out to pose in the evening. Lots of very expensive cars and people trying hard to be noticed. I’m surprised I wasn’t escorted away by the authorities. :)

On the second day of the course we had a couple of delays, so I ended up running over by an hour. No big surprise there. :)

I was going to go to the Night Safari on the second evening, but I foolishly turned on my laptop when I got back to the hotel and the next thing I knew it was 22:00, so I went to bed.

This morning it was a 06:00 start to get to the airport. I waited for a few minutes for a taxi and started to break a sweat standing still. Even at silly o’clock in the morning it was boiling.

The journey from Singapore to Sydney was pretty standard seven hour flight, so nothing major to report, but a few little incidents will be added to a general travel rant (about passengers) I am in the process of writing. :)

Cheers

Tim…

Exadata, to index or not to index, that is the question

We will take a look at in this blog post, by testing several different approaches and comparing the time and the statistics for each scenario.

The tests have been performed on a quarter rack ExaData database machine (2 db nodes – with 16 cores each and 3 storage servers). The database is setup for a data warehouse implementation and has been patched with bundle patch 5 at the time of testing.

The tests were executed on a table with 403M rows distributed over 14 range partitions – 7 non-compressed and 7 partitions compressed with HCC query option.  Each test spans over two partitions covering 57.5M rows.  Please note the dimension tables contain 4000 or less rows.  The data is production data and are event based data, meaning data is generated when a certain events occur.

TABLE_NAME  PARTITION_NAME COMPRESS COMPRESS_FOR LAST_ANALYZED  SAMPLE_SIZE   NUM_ROWS
EVENT_PART  TEST_20100901  DISABLED              27-SEP-10         28793000   28793000
EVENT_PART  TEST_20100902  DISABLED              27-SEP-10         28793000   28793000
EVENT_PART  TEST_20100903  DISABLED              27-SEP-10         28793000   28793000
EVENT_PART  TEST_20100904  DISABLED              27-SEP-10         28793000   28793000
EVENT_PART  TEST_20100905  DISABLED              27-SEP-10         28793000   28793000
EVENT_PART  TEST_20100906  DISABLED              27-SEP-10         28793000   28793000
EVENT_PART  TEST_20100907  DISABLED              27-SEP-10         28793000   28793000
EVENT_PART  TEST_20100908  ENABLED  QUERY HIGH   27-SEP-10         28793000   28793000
EVENT_PART  TEST_20100909  ENABLED  QUERY HIGH   27-SEP-10         28793000   28793000
EVENT_PART  TEST_20100910  ENABLED  QUERY HIGH   27-SEP-10         28793000   28793000
EVENT_PART  TEST_20100911  ENABLED  QUERY HIGH   27-SEP-10         28793000   28793000
EVENT_PART  TEST_20100912  ENABLED  QUERY HIGH   27-SEP-10         28793000   28793000
EVENT_PART  TEST_20100913  ENABLED  QUERY HIGH   27-SEP-10         28793000   28793000
EVENT_PART  TEST_20100914  ENABLED  QUERY HIGH   27-SEP-10         28793000   28793000
 

Each test-case/SQL has been executed 5 times under different scenario:

(1)    Without any bitmap or regular indexes on non-compressed partitions
           Storage FTS on event_part and dimensions
(2)    Without any bitmap or regular indexes on HCC partitions
            Storage FTS on event_part and dimensions
(3)    With primary key  constraint on dimension tables only
          Storage FTS on event_part with primary key look up on dimensions
(4)    With bitmap and primary key indexes on non-compressed partitions
            Bitmap index lookup on event_part and primary key lookup on dimensions
(5)    With bitmap and primary key  indexes on HCC partitions
           Bitmap index lookup on event_part and primary key lookup on dimensions 

The test cases used are from a warehouse environment and I have modified the column and table names. For the bitmap test-cases I had to hint the queries to ensure the bitmap indexes was actually used.

The output from the test cases is over 20K lines, so I have summed up the elapsed time and a few statistics in tables below to provide a better overview. 

select /*+ MONITOR  basic */
            st.s_name,  pt.p_name,  cct.pc_name,  ep.c_level, count(ep.c_id)
  from event_part ep,  t_test tt, s_test st, p_test pt, cc_test cct
   where tt.t_id between 20100901 and 20100902
        and ep.t_id = tt.t_id
        and ep.t_id between 20100901 and 20100902
        and ep.s_id = st.s_id
        and ep.p_id = pt.p_id
        and ep.cc_id = cct.c_id
    group by st.s_name, pt.p_name, cct.pc_name, ep.c_level
    order by st.s_name, pt.p_name, cct.pc_name, ep.c_level;
 

Table figure for basic breakdown – Test case 1

Stats / Tests

1

2

3

4

5

Elapsed time sec

8.87

12.00

09.22

185.05

149.55

cell physical IO bytes saved by storage index

0

0

0

0

0

cell physical IO bytes eligible for predicate offload

5,209,325,568

0

5,209,325,568

0

0

cell physical IO interconnect bytes returned by smart scan

2,562,203,600

0

2,562,201,584

0

0

cell flash cache read hits

9

26

9

9,290

2,063

CC Total Rows for Decompression

 

57,586,000

 

 

57,586,000

 This is a basic query, which is used for high level summaries and serves as a good base line to compare with, for the other test-cases.  There is no use of a where clause in the test case, so we will not benefit from any storage indexes in this case.  The first 3 tests are without any indexes on the fact table and are performing much better than test 4 and 5 and we should of course not expect the CBO to follow this path anyway.   It is evident for test 1 and 3 that the performance gained is supported by the storage server offloading and the smart scans.  The above CC stats for test 2, tell us that the db node performs the decompression, so this test will have to burn extra CPU cycles compared to test 1 and 3.  There is more to be mentioned for test 2, but I’ll try to cover that in the conclusion.

 select /*+ MONITOR lc breakdown */
           st.s_name, pt.p_name,  cct.pc_name,  ep.c_level,  count(ep.c_id)
 from event_part ep, t_test tt, s_test st, p_test pt, cc_test cct
 where tt.t_id between 20100903 and 20100904
      and ep.t_id = tt.t_id
      and ep.t_id between 20100903 and 20100904
      and ep.s_id = st.s_id and ep.p_id = pt.p_id
      and ep.cc_id = cct.c_id and ep.c_id = 7
 group by st.s_name, pt.p_name, cct.pc_name, ep.c_level
 order by st.s_name, pt.p_name, cct.pc_name, ep.c_level;
 

Table figure for LC breakdown - Test case 2

Stats / Tests

1

2

3

4

5

Elapsed time sec

2.05

19.17

1.84

30.33

36.58

cell physical IO bytes saved by storage index

4,186,636,288

0

4,186,636,288

0

0

cell physical IO bytes eligible for predicate offload

5,209,292,800

0

5,209,292,800

0

0

cell physical IO interconnect bytes returned by smart scan

317,496,848

0

317,497,280

0

0

cell flash cache read hits

18

59

36

1,043

219

CC Total Rows for Decompression

0

57,782,554

0

0

7,842,364

Similar finding as we saw from the 1st test case; however, in this test-case we are performing the breakdown for a certain ID and therefore the performance of test 1 and 3, improved further from the IO saved by the Storage Index.   For this test case, I ran test 1 and 3 on the save partitions and it is worth noticing, that second time around the savings from the Storage Index improved; so the storage indexes are further maintained/improved as we select data from the tables and partitions.

select /*+ MONITOR lp breakdown */
           st.s_name,  pt.p_name, cct.pc_name, ep.c_level,  count(ep.c_id)
 from event_part ep,  t_test tt,  s_test st,  p_test pt,  cc_test cct
 where tt.t_id between 20100905 and 20100906
       and ep.t_id = tt.t_id
      and ep.t_id between 20100905 and 20100906
      and ep.s_id = st.s_id  and ep.p_id = pt.p_id
      and ep.cc_id = cct.c_id and ep.p_id = 4611686019802841877
 group by st.s_name, pt.p_name, cct.pc_name, ep.c_level
 order by st.s_name, pt.p_name, cct.pc_name, ep.c_level;
 

Table figure for lp breakdown - Test case 3

Stats / Tests

1

2

3

4

5

Elapsed time sec

 2.99

 6.01

 2.72

 49.22

 39.29

cell physical IO bytes saved by storage index

 2,623,143,936

 

0

 

2,623,799,296

 

0

 

0

cell physical IO bytes eligible for predicate offload

 

5,209,325,568

 

0

 

5,209,325,568

 

0

 

0

cell physical IO interconnect bytes returned by smart scan

 

674,439,456

 

0

 

 

674,436,288

 

0

 

0

cell flash cache read hits

64

44

10

2,113

635

CC Total Rows for Decompression

 

0

 

57,979,108

 

0

 

0

 

15,582,048

 Similar findings as we saw from the 2nd test case; this test is just performed on a different ID, which has a higher distinct count than the first ID we tested in test case 2; and as a result of that and on how the data is sorted during insert we are seeing less IO saved by the storage index.

 select /*+ MONITOR spcl breakdown */
           st.s_name, pt.p_name,  cct.pc_name,  ep.c_level, count(ep.c_id)
  from event_part ep, t_test tt,   s_test st, p_test pt,  cc_test cct
 where tt.t_id between 20100906 and 20100907
      and ep.t_id = tt.t_id
      and ep.t_id between 20100906 and 20100907
      and ep.s_id = st.s_id and ep.p_id = pt.p_id
      and ep.cc_id = cct.c_id and ep.s_id = 1
      and ep.cc_id =7 and ep.p_id = 4611686019802841877
  group by st.s_name, pt.p_name, cct.pc_name, ep.c_level
  order by st.s_name, pt.p_name, cct.pc_name, ep.c_level;
 

Table figure for spcl breakdown – Test case 4

Stats / Tests

1

2

3

4

5

Elapsed time sec

1.67

13.69

01.14

12.77

7.90

cell physical IO bytes saved by storage index

 

4,531,191,808

 

0

 

4,532,174,848

 

0

 

0

cell physical IO bytes eligible for predicate offload

 

5,209,325,568

 

0

 

5,209,325,568

 

0

 

0

cell physical IO interconnect bytes returned by smart scan

 

237,932,736

 

0

 

237,933,312

 

0

 

0

cell flash cache read hits

73

52

10

594

183

CC Total Rows for Decompression

 

0

 

57,782,554

 

0

 

0

 

5,614,752

This test case is performed with a where clause on multiple ID’s.  Again test 1 and 3 are taking advantage of the Exadata features and are performing well.   Test 4 and 5 are still not close to test 1 or 3, but have definitely become a bit more competitive.  Comparing the two HCC tests (2 and 5) test 5 seems to do better as it only has to burn CPU cycles for 10% of the results set of test 2.   A valid question to ask here would be why we are not seeing any benefits from either Storage offloading or indexing on test 2, but again I’ll defer that discussion to the conclusion.

select /*+ MONITOR  ttl */
           st.s_name, cct.pc_name, ep.c_level, count(ep.c_id) row_count,
           round(min((ep.ceg - ep.cbg) / 60),2) min_g_min,
           round(avg((ep.ceg - ep.cbg) / 60.0),2)  avg_g_min,
          round(max((ep.ceg - ep.cbg) / 60),2) max_g_min
  from event_part ep,  t_test tt,   s_test st,  cc_test cct
 where  tt.t_id between 20100901 and 20100902
      and ep.t_id = tt.t_id
      and ep.t_id between 20100901 and 20100902
      and ep.s_id = st.s_id
      and ep.character_class_id = cct.class_id
  group by st.shard_name, cct.public_class_name, ep.character_level
  order by  st.shard_name, cct.public_class_name, ep.character_level;
 

Table figure for ttl breakdown - Test case 5

Stats / Tests

1

2

3

4

5

Elapsed time sec

12.82

15.50

11.67

254.26

304.92

cell physical IO bytes saved by storage index

 

0

 

0

 

0

 

0

 

0

cell physical IO bytes eligible for predicate offload

 

5,209,325,568

 

0

 

5,209,325,568

 

0

 

0

cell physical IO interconnect bytes returned by smart scan

 

2,328,566,432

 

0

 

2,328,567,440

 

0

 

0

cell flash cache read hits

9

15

9

132,467

2,341

CC Total Rows for Decompression

 

0

 

57,586,000

 

0

 

0

 

61,643,318

Very similar findings as we saw from the 1st test case; the only difference is this query looks examine the time to something.

select /*+ MONITOR ttlsc */
           st.s_name, cct.pc_name, ep.c_level,  count(ep.c_id) row_count,
           round(min((ep.ceg - ep.cbg) / 60),2) min_g_min,
           round(avg((ep.ceg - ep.cbg) / 60.0),2)  avg_g_min,
           round(max((ep.ceg - ep.cbg) / 60),2) max_g_min
 from event_part ep, t_test tt, shard_test st, cc_test cct
where tt.t_id between 20100903 and 20100904
      and ep.t_id = tt.t_id
      and ep.t_id between 20100903 and 20100904
      and ep.s_id = st.s_id
      and ep.cc_id = cct.c_id
      and ep.s_id = 2
      and ep.cc_id =6
    group by st.s_name, cct.pc_name, ep.c_level
    order by st.s_name, cct.pc_name, ep.c_level;
 

Table figure for ttlsc breakdown - Test case 6

Stats / Tests

1

2

3

4

5

Elapsed time sec

 1.16

4.57

1.01

12.71

 03.87

cell physical IO bytes saved by storage index

 

4,697,096,192

 

0

 

4,698,832,896

 

0

 

0

cell physical IO bytes eligible for predicate offload

 

5,209,292,800

 

0

 

5,209,292,800

 

0

 

0

cell physical IO interconnect bytes returned by smart scan

 

55,906,960

 

0

 

55,906,384

 

0

 

0

cell flash cache read hits

 9

31

10

3891

 107

CC Total Rows for Decompression

 0

 57,749,795

 0

 0

1,998,299

 Very similar findings as we saw for the 4th test case.

 Conclusion

Most warehouse like queries I have performed in our Exadata environment is doing well without indexes on fact tables.  So it is no surprise to me to hear more and more people are dropping most of their indexes and take advantage of the Exadata features.   If you like to keep the primary key indexes on your dimension tables to ensure the hassle of resolving the duplicate key issues, that seems to be a valid option as well.

In my environment I’m still to find a case where the bitmap index search could compete with the no index approach; and let just say we found such a case, when it would still have to show significant improvements before  I would choose that path;  Consider the benefits of not having to maintain the bitmap indexes after each load.   There are also several restrictions with bitmap indexes that would be nice not to have to worry about.

Now, I mentioned that I would get back to the test 2 results, which were based on Storage FTS on partitions compressed with the HCC query option.   In the past I have performed queries on HCC tables and have seen IO savings from the Storage indexes.  

Initially i suspected the test2 results observed above to be a bug or alternatively be related to my HCC compressed partitions are only 29MB a piece versa 2.4GB uncompressed.  Oracle support/development has confirmed it to be related to the data size, as we can see from the stat "cell physical IO bytes eligible for predicate offload", which doesn't get bumped up after query.  The reason for that is after partition pruning,  the table is too small for predicate push to kick in and since predicate push doesn't kick in, the Storage Indexes won't kick in either.

Please be aware i don't know the Storage index internals, but I look forward to learn.