If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > indexes and organize by dimensions

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-08-07, 12:03
Wim Wim is offline
Registered User
 
Join Date: Nov 2004
Posts: 1,279
indexes and organize by dimensions

Hi,

I have used the ORGANIZE BY DIMENSIONS option for the first time in our data warehouse.
Code:
CREATE TABLE myTable (
   ID_COMPANY      INTEGER  NOT NULL,
   YEAR_FISCAL     SMALLINT NOT NULL,
   ID_CO_ACTIVITY  SMALLINT  NOT NULL,
   .....
   constraint pkMYtABLE primary key (ID_COMPANY, YEAR_FISCAL, ID_CO_ACTIVITY)
) ORGANIZE BY DIMENSIONS (YEAR_FISCAL)
;
I noticed that inserting records was slower (8 minutes now vs. 5 min before). I hope the performance gain will follow.

I wonder what we must do with the existing indexes on that table.

CREATE INDEX index1 ON myTable (YEAR_FISCAL);
Can it be omitted totally?

CREATE INDEX index2 ON myTable (ID_COMPANY, YEAR_FISCAL);
What should this become ?
CREATE INDEX index2 ON myTable (ID_COMPANY); ?

I have found some information about MDC tables (Multi-Dimensional Clustering). I assume that, though my table is single dimensional, the same rules apply.

Are there any good sources of information about ORGANIZE BY DIMENSIONS?

This is new territory for me, any help is welcome.
__________________
With kind regards . . . . . SQL Server 2000/2005/2008/2008 R2 Earned beers: 16
Wim
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth
Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages
Reply With Quote
  #2 (permalink)  
Old 03-08-07, 12:29
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
YEAR_FISCAL only-index will be obsolete now..

The second one may still be useful ... It could depend on cardinality, your actual query, filter factors etc. From another perspective, this is not useful as you have these two columns as the leading columns in the PK index.

HTH

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 03-12-07, 05:44
Wim Wim is offline
Registered User
 
Join Date: Nov 2004
Posts: 1,279
Sathyaram,

Thank you for your reply.

Have you any experience about the performance gain? It's in a table at the end of our data warehouse creation chain, so only users will notice any performance gains.
__________________
With kind regards . . . . . SQL Server 2000/2005/2008/2008 R2 Earned beers: 16
Wim
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth
Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On