Why is the Star Transformation using two indexes for the same dimension?
Hi,
Recently, I have made an investigation about the Star Transformation feature. I have found a strange test case, which plays an important role in my strategy for our overall DWH architecture. Here it is:
The Strategy:
I would like to have the classical Star Transformation approach (single column Bitmap Indexes for each dimension foreign key column in the fact table), together with additional Bitmap Join Indexes for some of the dimension attributes, which would benefit from the materialization of the join (bitmap merge operation will be skipped/optimized).
The query:
select dp.brand, ds. region_name, dc.region_name
, count(*), sum(f.extended_price)
from fact_line_item f
, dim_part dp
, dim_supplier ds
, dim_customer dc
where dp.mfgr = 10 -- dimension selectivity = 1/10 --> acttual/fact selectivity = 6/10
and f.part_dk = dp.dk
and ds.region_name = 'REGION #1' -- dimension selectivity = 1/9
and f.supplier_dk = ds.dk
and dc.region_name = 'REGION #1' -- dimension selectivity = 1/11
and f.customer_dk = dc.dk
group by dp.brand, ds. region_name, dc.region_name
The actual plan:
| Id | Operation | Name | Starts | E-Rows | Cost (%CPU)| A-Rows | A-Time | Buffers | Reads |
| 0 | SELECT STATEMENT | | 1 | | 3247 (100)| 1 |00:01:42.05 | 264K| 220K|
| 1 | HASH GROUP BY | | 1 | 2 | 3247 (1)| 1 |00:01:42.05 | 264K| 220K|
|* 2 | HASH JOIN | | 1 | 33242 | 3037 (1)| 217K|00:01:29.67 | 264K| 220K|
|* 3 | TABLE ACCESS FULL | DIM_SUPPLIER | 1 | 1112 | 102 (0)| 1112 |00:00:00.01 | 316 | 4 |
|* 4 | HASH JOIN | | 1 | 33245 | 2934 (1)| 217K|00:01:29.10 | 264K| 220K|
|* 5 | TABLE ACCESS FULL | DIM_CUSTOMER | 1 | 910 | 102 (0)| 910 |00:00:00.08 | 316 | 8 |
|* 6 | HASH JOIN | | 1 | 33248 | 2831 (1)| 217K|00:01:28.57 | 264K| 220K|
|* 7 | TABLE ACCESS FULL | DIM_PART | 1 | 10 | 3 (0)| 10 |00:00:00.01 | 6 | 0 |
| 8 | PARTITION RANGE ALL | | 1 | 36211 | 2827 (1)| 217K|00:01:28.01 | 264K| 220K|
| 9 | TABLE ACCESS BY LOCAL INDEX ROWID| FACT_LINE_ITEM | 6 | 36211 | 2827 (1)| 217K|00:01:33.85 | 264K| 220K|
| 10 | BITMAP CONVERSION TO ROWIDS | | 6 | | | 217K|00:00:07.09 | 46980 | 3292 |
| 11 | BITMAP AND | | 6 | | | 69 |00:00:08.33 | 46980 | 3292 |
| 12 | BITMAP MERGE | | 6 | | | 193 |00:00:02.09 | 2408 | 1795 |
| 13 | BITMAP KEY ITERATION | | 6 | | | 4330 |00:00:04.66 | 2408 | 1795 |
| 14 | BUFFER SORT | | 6 | | | 60 |00:00:00.01 | 6 | 0 |
|* 15 | TABLE ACCESS FULL | DIM_PART | 1 | 10 | 3 (0)| 10 |00:00:00.01 | 6 | 0 |
|* 16 | BITMAP INDEX RANGE SCAN | FACT_LI__P_PART_DIM_KEY_BIX | 60 | | | 4330 |00:00:02.11 | 2402 | 1795 |
|* 17 | BITMAP INDEX SINGLE VALUE | FACT_LI__P_PART_MFGR_BJX | 6 | | | 1747 |00:00:06.65 | 890 | 888 |
| 18 | BITMAP MERGE | | 6 | | | 169 |00:00:02.78 | 16695 | 237 |
| 19 | BITMAP KEY ITERATION | | 6 | | | 5460 |00:00:01.56 | 16695 | 237 |
| 20 | BUFFER SORT | | 6 | | | 5460 |00:00:00.02 | 316 | 0 |
|* 21 | TABLE ACCESS FULL | DIM_CUSTOMER | 1 | 910 | 102 (0)| 910 |00:00:00.01 | 316 | 0 |
|* 22 | BITMAP INDEX RANGE SCAN | FACT_LI__P_CUST_DIM_KEY_BIX | 5460 | | | 5460 |00:00:02.07 | 16379 | 237 |
| 23 | BITMAP MERGE | | 6 | | | 170 |00:00:03.65 | 26987 | 372 |
| 24 | BITMAP KEY ITERATION | | 6 | | | 6672 |00:00:02.23 | 26987 | 372 |
| 25 | BUFFER SORT | | 6 | | | 6672 |00:00:00.01 | 316 | 0 |
|* 26 | TABLE ACCESS FULL | DIM_SUPPLIER | 1 | 1112 | 102 (0)| 1112 |00:00:00.01 | 316 | 0 |
|* 27 | BITMAP INDEX RANGE SCAN | FACT_LI__S_SUPP_DIM_KEY_BIX | 6672 | | | 6672 |00:00:02.74 | 26671 | 372 |
The Question:
Why is the Star Transformation using both indexes FACT_LI__P_PART_DIM_KEY_BIX and FACT_LI__P_PART_MFGR_BJX for the same dimension criteria (dp.mfgr = 10)?? The introduction of the additional Bitmap Join Index actually make Oracle to do the work twice !!!
Anybody, any idea ?!?
Dom, here it is the plan with the predicates:
| Id | Operation | Name | Starts | E-Rows | Cost (%CPU)| A-Rows | A-Time | Buffers | Reads |
| 0 | SELECT STATEMENT | | 1 | | 3638 (100)| 1 |00:06:41.17 | 445K| 236K|
| 1 | HASH GROUP BY | | 1 | 2 | 3638 (1)| 1 |00:06:41.17 | 445K| 236K|
|* 2 | HASH JOIN | | 1 | 33242 | 3429 (1)| 217K|00:08:18.02 | 445K| 236K|
|* 3 | TABLE ACCESS FULL | DIM_SUPPLIER | 1 | 1112 | 102 (0)| 1112 |00:00:00.03 | 319 | 313 |
|* 4 | HASH JOIN | | 1 | 33245 | 3326 (1)| 217K|00:08:17.47 | 445K| 236K|
|* 5 | TABLE ACCESS FULL | DIM_CUSTOMER | 1 | 910 | 102 (0)| 910 |00:00:00.01 | 319 | 313 |
|* 6 | HASH JOIN | | 1 | 33248 | 3223 (1)| 217K|00:08:16.63 | 445K| 236K|
|* 7 | TABLE ACCESS FULL | DIM_PART | 1 | 10 | 3 (0)| 10 |00:00:00.01 | 6 | 0 |
| 8 | PARTITION RANGE ALL | | 1 | 36211 | 3219 (1)| 217K|00:08:16.30 | 445K| 236K|
| 9 | TABLE ACCESS BY LOCAL INDEX ROWID| FACT_LINE_ITEM | 6 | 36211 | 3219 (1)| 217K|00:08:40.89 | 445K| 236K|
| 10 | BITMAP CONVERSION TO ROWIDS | | 6 | | | 217K|00:00:32.00 | 46919 | 19331 |
| 11 | BITMAP AND | | 6 | | | 69 |00:00:34.50 | 46919 | 19331 |
| 12 | BITMAP MERGE | | 6 | | | 193 |00:00:00.58 | 2353 | 1 |
| 13 | BITMAP KEY ITERATION | | 6 | | | 4330 |00:00:00.10 | 2353 | 1 |
| 14 | BUFFER SORT | | 6 | | | 60 |00:00:00.01 | 6 | 0 |
|* 15 | TABLE ACCESS FULL | DIM_PART | 1 | 10 | 3 (0)| 10 |00:00:00.01 | 6 | 0 |
|* 16 | BITMAP INDEX RANGE SCAN | FACT_LI__P_PART_DIM_KEY_BIX | 60 | | | 4330 |00:00:00.07 | 2347 | 1 |
|* 17 | BITMAP INDEX SINGLE VALUE | FACT_LI__P_PART_MFGR_BJX | 6 | | | 1747 |00:01:23.64 | 882 | 565 |
| 18 | BITMAP MERGE | | 6 | | | 169 |00:00:09.14 | 16697 | 7628 |
| 19 | BITMAP KEY ITERATION | | 6 | | | 5460 |00:00:02.19 | 16697 | 7628 |
| 20 | BUFFER SORT | | 6 | | | 5460 |00:00:00.01 | 316 | 0 |
|* 21 | TABLE ACCESS FULL | DIM_CUSTOMER | 1 | 910 | 102 (0)| 910 |00:00:00.01 | 316 | 0 |
|* 22 | BITMAP INDEX RANGE SCAN | FACT_LI__P_CUST_DIM_KEY_BIX | 5460 | | | 5460 |00:00:08.78 | 16381 | 7628 |
| 23 | BITMAP MERGE | | 6 | | | 170 |00:00:21.46 | 26987 | 11137 |
| 24 | BITMAP KEY ITERATION | | 6 | | | 6672 |00:00:10.29 | 26987 | 11137 |
| 25 | BUFFER SORT | | 6 | | | 6672 |00:00:00.01 | 316 | 0 |
|* 26 | TABLE ACCESS FULL | DIM_SUPPLIER | 1 | 1112 | 102 (0)| 1112 |00:00:00.01 | 316 | 0 |
|* 27 | BITMAP INDEX RANGE SCAN | FACT_LI__S_SUPP_DIM_KEY_BIX | 6672 | | | 6672 |00:00:20.94 | 26671 | 11137 |
Predicate Information (identified by operation id):
2 - access("F"."SUPPLIER_DK"="DS"."DK")
3 - filter("DS"."REGION_NAME"='REGION #1')
4 - access("F"."CUSTOMER_DK"="DC"."DK")
5 - filter("DC"."REGION_NAME"='REGION #1')
6 - access("F"."PART_DK"="DP"."DK")
7 - filter("DP"."MFGR"=10)
15 - filter("DP"."MFGR"=10)
16 - access("F"."PART_DK"="DP"."DK")
17 - access("F"."SYS_NC00017$"=10)
21 - filter("DC"."REGION_NAME"='REGION #1')
22 - access("F"."CUSTOMER_DK"="DC"."DK")
26 - filter("DS"."REGION_NAME"='REGION #1')
27 - access("F"."SUPPLIER_DK"="DS"."DK")
Note
- star transformation used for this statement
Similar Messages
-
Why can I no longer use an image for my signature on forms? The only option I have now is "use a certificate". It was never like this until today.
Hi,
I had never heard of someone using the iPhone Number as the ID in the iMessages account in the Mac version.
i.e without adding an Apple ID
iMessages does allow iPhone numbers and mine lists mine.
I would try this.
Sign Out of the iMessages account and Quit Messages
On the iPhone in Settings > Messages remove the Apple ID
Set the iPhone to Airplane mode for a few minutes (to break with the Server)
On starting the phone up again check the iPhone Number is ticked for iMessages.
If it is add the Apple ID
On the Mac restart Messages
Add the Apple ID
At this point you should get a pop up or two saying the iPhone is using the Number and Apple ID.
Accept these and they get added to the Receive At list and Send From drop down.
9:41 pm Monday; October 28, 2013
iMac 2.5Ghz 5i 2011 (Mavericks 10.9)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad -
Why is this query not using my index ?
hey
i have the following situation
(i'm sorry but i can't add the acctual script or output)
create table x as
select level high_card ,
mod(level,1000) medium_card ,
mod(level,10) low_card ,
'***' padding
from dual
connect by level < 100001;
create index x_med_low_ix on x(low_card,medium_card);
create index x_high_ix on x(high_card);
exec dbms_stats.gather_table_stats(user,'x',cascade=>true,method_opt=>'for all indexed columns size auto');
i'm running the following query
select *
from x
where low_card = 70
and medium_card = 70
and high_card = 70;
i'm expecting a range scan on the x_high_ix index. the optimizer expects only one row. the stats on the high_card columns shows that (num_rows * density = 1).
when i run the query the optimizer uses the x_med_low_ix and does 14 cr.
when i force the use of x_high_ix the cr goes down to 4.
i don't want to declare x_high_ix as unique.
so, why isn't he using my index ?It's using that index for me:
SQL> create table x as
2 select level high_card ,
3 mod(level,1000) medium_card ,
4 mod(level,10) low_card ,
5 '***' padding
6 from dual
7 connect by level < 100001;
Table created.
SQL>
SQL> create index x_med_low_ix on x(low_card,medium_card);
Index created.
SQL>
SQL> create index x_high_ix on x(high_card);
Index created.
SQL>
SQL> exec dbms_stats.gather_table_stats(user,'x',cascade=>true,method_opt=>'for all indexed columns
size auto');
PL/SQL procedure successfully completed.
SQL> ed
Wrote file afiedt.buf
1 select *
2 from x
3 where low_card = 70
4 and medium_card = 70
5* and high_card = 70
SQL>
SQL> /
no rows selected
Execution Plan
Plan hash value: 775193209
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 15 | 2 (0)| 00:00:01 |
|* 1 | TABLE ACCESS BY INDEX ROWID| X | 1 | 15 | 2 (0)| 00:00:01 |
|* 2 | INDEX RANGE SCAN | X_HIGH_IX | 1 | | 1 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter("LOW_CARD"=70 AND "MEDIUM_CARD"=70)
2 - access("HIGH_CARD"=70)
Statistics
0 recursive calls
0 db block gets
3 consistent gets
0 physical reads
0 redo size
454 bytes sent via SQL*Net to client
370 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed
SQL> set autot off
SQL> select * from v$version;
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Productionwhat is your version?
By the way, when i force optimizer to use index X_MED_LOW_IX, it does 2 CR for me. -
Use two indicators for the same variable in two different VIs
hello, I want to use two indicators for the same variable in two different VIs running at the same time
should I use global variables?? I want to avoid because I have lot of variables and it would takes too much memory,I tried with this code but the value of the second indicator is not updated
I tried to use the queue and it works but the problem is as i said previously that i have many variables shoud I use a queue for each one??
what should I do?
thank you in advance
cordialy
Attachments:
projet.zip 13 KBCrisSTine01 wrote:
hello, I want to use two indicators for the same variable in two different VIs running at the same time
I'm a huge fan of User Events to send updates to GUIs from who knows where.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
I have two iphones ...why shows the same pictures
i have two iphones ...why shows the same pictures
Are you referring to the Camera Roll, or the Photostream, what?
-
Why does the same RGB color appear lighter in one ai file and darker in another?
Why does the same RGB color appear lighter in one ai file and darker in another?? I want to use the more vibrant color, but when I try to reproduce the same RGB color code in another Adobe Illustrator (ai) file, it shows up darker. I printed the two files out, and you can see the difference in the print too. I exported the color orginally as an eps file from an ArcGIS map.
Any insight is greatly appreciated!
AnneYou illustrator files may have different color profiles attached.
Set to show your color profile in the bottom left of each document by using the flyout menu >> show >> document color profile
Then you can use edit >> assign profile to get them the same
Yours are quite far off for RGB (which are usually close to each other for many profile due to wide gamut). I question as Jacob did if one of your documents are in CMYK mode. Look in parenthesis after the document name at top of window.
Check if view > proof setup is the same (do not use the uncoated profile as in my screenshot, that was only there cause of my testing)
Make sure view >> proofs colors is checked or unchecked for both.
To get them to print the same, check these settings are the same
Sorry for all the screenshots, but hopefully one day we will see Adobe's complex color management united all in one window. -
Total space used by indexes for specific schema
Hi all.
Running Oracle 9.2.0.4.
Is there a way I can see how much index space is used for a specific schema? I query index_stats and it returns 0 rows but my stats were updated this morning.
Any input is apreciated.
ThanksHi,
Index space and index stats are two different things.
What you are interested to know?
1) How much space is used by index for a particular schema
select sum(bytes)/1024/1024 from dba_segments
where (owner, segment_name) in
(select owner, index_name from dba_indexes where
owner = '<schema you are interested in>')2) Is the stats gathered on index
select index_name, last_analyzed, num_rows from dba_indexes where
owner = <'schema you are interested in >'Regards
Anurag -
Why, with the same number of photos on my iPad and supposedly in iCloud, do I still have over 25 GB of space on my iPad but now need to buy even more storage space in iCloud? My iPad is 64 GB and I am now paying for 20 GB of iCloud storage with 864 MB left!
As I said:
Even if the Photos are less than 20GB, There's other stuff on the iPhone that is likely getting backed up to iCloud and using space. Basically your Phone has more space to spare than iCloud.
You can check in Settings->iCloud->Storage->Manage Storage to see what is using up the space in iCloud.
Anyway, turning off Photo stream will remove all photos from iCloud, it will not remove them from the iPad if they were taken with it, or copied to it.
Again I suggest you check in:Settings->iCloud->Storage->Manage Storage to see what else is using your iCloud space. -
Compare two members from the same dimension in HFR
Hi,
Is it possibe to compare two members from the same dimension in HFR? The requirement is to compare Year and Week members from the same dimension. The Week date will be selected from POV. The corresponding Year date should be displayed in the report. Week dates are in the format W2008-03-07 and Year dates are in YTD2008-03-07.
The dates are same except the preceding character.I am unable to compare these two. In my understanding there's no substring or replace functions in HFR.
Kindly help. Thanks in advance.
Regards,
UmaHi,
How is your database structured? it may be possible to use the 'RelativeMember' function if it will always be the same number of steps between the 'W' member and the 'YTD' member, e.g. if your hierarchy is something like:
Time
.Weeks
..W2008-03-07
..W2008-03-10 etc.. for 52 weeks
.YTD
..YTD2008-03-07
..YTD2008-03-10 etc.. for 52 weeks
In your report select 'Current Point of View for Time' in one row/column and in the other use:
RelativeMember set up as follows:
Member: Current Point of View for Time
Offset: 52
Hierarchy: Time
RelativeMemberList: Lev0, Time
UseFirstDescendant: leave unselected
Hope this helps
StuartGame
www.analitica.co.uk -
Why is the same wirelles connection too slow for an iphone4 when it is quite fast to an iphone5?
You really have a question for iPhone support here, so I suggest that you post in the appropriate support area:
Using iPhone
The experts over there will likely suggest that you use the Apple Troubleshooting Guide for iOS devices, so you might want to work your way through that before you post in the iPhone support area.
http://support.apple.com/kb/TS1398 -
Use Secoandary Index for VBFA for fast execution .
HI all,
How can i use secoandary index for VBFA table to improve my select statement performance
in ALV report.below statement executing very slow.
SELECT
vbelv
POSNV
vbtyp_v
vbeln
POSNN
vbtyp_n
FROM VBFA
INTO TABLE IT_TY_SD_FLOW_do
FOR ALL ENTRIES IN IT_INV
WHERE VBELN = IT_INV-VBELN
AND POSNV = IT_INV-POSNR
AND VBTYP_N = 'M'
AND VBTYP_V = 'J'.Your query will never be optimized if you do not check first whether your internal table used in the where clause has at least one row.
If the table is empty you end up with a full table scan and this cannot be your objective.
Have fun. -
Why is the same photo repeated when I import photos from I-Photo to I-Movie?
Why is the same photo repeated when I import photos from I-Photo into I-Movie (2011)?
Select them in iPhoto and export (file menu ==> export) and use one of the options to set the file name of exproted photos
LN -
How to assign the two values for constant (same key)
How to assign the two values for constant (same key)
CONSTANTS: c_pstkey TYPE bschl VALUE '09',
c_splgl TYPE umskz VALUE 'I',
c_buzei TYPE buzei VALUE '001'.
using BSCH1 again i have two asign vaue
can you just let me know
Edited by: sravya_se38 on Nov 23, 2010 12:14 AMYou can create a structure for that constant .
You can define in this way
CONSTANTS : BEGIN OF c_pstkey,
01 TYPE bschl VALUE '01',
02 TYPE bschl VALUE '02',
END OF c_pstkey.
and can access using...
c_pstkey-01, c_pstkey-02 ........ -
Why does the same song apear as $0.99 and $1.29?
Why does the same song appear more than once and costs either $0.99 or $1.29?
Sometimes the exact same song will have two different prices when it appears on two different albums.
For one of many examples, "Concrete Angel" is 99 cents when it's on "Greatest Hits":
http://itunes.apple.com/us/album/greatest-hits/id256344266
But it is $1.29 when it is on the album "Hits and More":
http://itunes.apple.com/us/album/hits-and-more/id492676107
The reason is not obvious, but feel free to buy the cheaper one. -
Can I use two computers for my itunes with out losing music
Is it possible to use two computers for itunes? I have one at work I use and one at home that I'd like to use. I want to be able to update my ipod on both w/o losing any music...is this possible?
Yes it is, read more at these links:
Using iPod with Multiple computers
Managing Your Songs Manually
Maybe you are looking for
-
Creating multiple Spry menu bars in one site
I've been creating a website and I am required to use multiple templates to manage all the different sections of the site. To make it much less of a hassle, once I created one template, I simply saved that template as another template so I would not
-
My Mac is a 21.5-inch Late 2009 with a 1 TB Seagate HD that must be replaced, according to Apple support Panama, but they denied me that right because the serial is not part of the replacement program: any suggestions to get a plausible solution to t
-
Installing snow leopard by target disk firewire
i am re installing snow leopard by target disk fire wire. the installer hangs after the first reboot. it leaves a folder called install data with loads of.pkg files. trying an external dvd drive but that's even slower. any ideas? thanks Dave
-
Managed System Configuration - PI7.1 system solman_setup
HI all, In trying to execute the step "Managed System Configuration" for a PI7.1 system in Solution Manager SOLMAN_SETUP, in the first step to "maintain the connection", its failing immediately with: Error when opening an RFC connection Establish con
-
Calling BAPI from VBA - type mismatch error
Hi, I am trying to retrieve data from SAP R/3 material documents to Access VBA. In the example below, the connections works fine, but when I assign the value to the parameters, fx: MatDocItems.exports("MATERIAL_RA") = "000000000001032197", I get an e