Is it proper to use indexed views as the source of your cubes
I understand that you're supposed to use views as the source of your SSAS cube because it provides a layer of abstraction and allows you to make schema changes without adversely effecting the cube. I also know that when you have users accessing the warehouse
you should use indexed views. However I just ran across this little gem:
"With schema binding, if the base object is bound to another object, you will not be able to modify the base object unless you drop or alter the object to remove the schema binding."
That seems to run contrary to the goal of abstraction, that is, if I'm reading that correctly. What am I missing?
You should use schema bound / indexed views very little. They have high overhead associated with them.
In order to change a base table referenced by a schema bound view, you must drop the view, make the change to the table and recreate the view (and any indexes). Depending on the change to the base table this may or may not have any affect on the view.
This is by design.
Similar Messages
-
Using a View as the DataSource for a Matrix
Does anyone know if it is possible to use a view as the datasource for a matrix? For example, I have created a view named 'VW1' with 4 columns (1 being ItemCode). Here is the code that tries to set this view as the datasource for a matrix:
tableName = "VW1";
dbDataSource = sboForm.DataSources.DBDataSources.Add(tableName);
// Add the bind columns
column = columns.Add(COL_VALUE_UID, SAPbouiCOM.BoFormItemTypes.it_EDIT);
column.DataBind.SetBound(true, tableName, "ItemCode");
This last line of this code hangs but if I put a try around it, the GetLastError does not return anything. Is it because views cannot be used as datasources or is there something else I am missing?Hi David,
You can use a view as a matrix datasource if you use UserDataSources instead of DBDataSources.
UserDataSource DSSubJobID = form.DataSources.UserDataSources.Add("SubJobID", SAPbouiCOM.BoDataType.dt_LONG_NUMBER, 12);
Col = GridMain.Columns.Item(ColSubJobID);
Col.DataBind.SetBound(true, "", DSSubJobID.UID);
You then need to manually set the value of the UserDataSource e.g:
Reader = Command.ExecuteReader(CommandBehavior.SequentialAccess);
GridMain.Clear();
int RowNo = 1;
while (Reader.Read())
DSSubJobID.Value = SubJobID.ToString();
//set other user datasources here
//add a row the matrix
GridMain.AddRow(1, -1);
Regards, Lita -
I use aperture 3 since a long time. Using slit viewer, noe the bigger image become bigger then the given space and shifted to the right, so that I can't see the complete picture anymore. And I also don't see the last few picture in the strip below. How can I splve this problem?
This lloks like your preferences file might have become corrupted.
you probably have a problem with corrupted user preferences.
Remove the Preferences: Remove the Aperture's user preferences from the User Library as described here:
Aperture 3: Troubleshooting Basics http://support.apple.com/kb/HT3805
Note:Your User Library is hidden by default in 10.7.x or later - to open it in a Finder window use the "Go" menu from the Finder's main menu bar.
Quit Aperture, if it is running. Log off and on again.
Open the user library by using the Finder's "Go > Go to Folder" menu and hold down the options-key, until "Library" appears in the drop down menu. Select it.
In the widow that will open, scroll down to "Preferences"
From the "Preferences" folder remove "com.apple.Aperture.plist".
Then try to launch Aperture again.
But deleting the "Preferences" file will cause Aperture to forget the preferences settings. Be prepared to have to reset all options you set using the Aperture Preferences panel.
Regards
Léonie -
Using lab view to control an Arduino led cube
Has anyone used lab view to control an Arduino led cube? It seems to me that you could make a pretty awesome project out of the two.
Hi there, I haven't done it my self but, you may find a tread at the LabVIEW Interface for Arduino Group including links to download the LabVIEW Interface for Arduino Toolkit . I think this will make the task easier. Good luck!
Alejandro | Academic Program Engineer | National Instruments -
Hi All,
I have a cube in which i'm using the TIME DIM that i created in the warehouse. But now i wanted a new measure in the cube which is Average over time and when i wanted to created the new measure i got a message that no time dim was defined, so i created a
new time dimension in the SSAS using wizard. But when i tried to process the new time dimension i'm getting the follwoing error message
"Errors in the high-level relational engine. The data source view does not contain a definition for "SSASTIMEDIM" the table or view. The Source property may not have been set."
Can anyone please tell me why i cannot create a new measure average over the time using my time dimension? Also what am i doing wrong with the SSASTIMEDIM, that i'm getting the error.
ThanksHi PMunshi,
According to your description, you get the above error when processing the time dimension. Right?
In this scenario, since you have updated the DSV, it should have no problem on the table existence. One possibility is that table has been specified for tracking in the notifications for proactive caching, but isn't available any more for some
reason. Please change the setting in Proactive Caching into "MOLAP".
Reference:
How To Implement Proactive Caching in SQL Server Analysis Services SSAS
If you have any question, please feel free to ask.
Best Regards,
Simon Hou
TechNet Community Support -
Errors making a bootable clone? Message said "To use this disk as a source, restart your computer using recovery system and open DU again". Need help making a bootable clone of a MacPro/Lion to a new external hard drive? Thanks.
Use CarbonCopyCloner or Super Duper.
-
Can't tab into file list when using column view in the open/save dialogue boxes
Hi,
When in Open/Save Dialog Boxes I can't use tab to select the file/folder list in Column View. Tab will only cycle through Save As, Tags, Search, and the Sidebar. In all the other views (Icon, List, Cover) I can tab into the file list. Is this a bug?
I know that enabling Full Keyboard Access will make this work, but I'd rather not do that since it increases the number of buttons you must tab through to get to the file list.
I'm using the latest version of Yosemite on a 2014 Macbook Air. Thanks.Hi,
Did you found the solution to this? I'm also trying to do something like you , but I got stuck up in a very primitive stage than you. I'm not getting how I can make that File Download window to appear. Can you help me please.
Thanks. -
How to use a DisplayObject as the source of a flow:img/
I have a text flow that I am loading from an external file that has this snippet of xml in it:
<flow:p>
<flow:img styleName="chart" id="fig1" height="250"/>
</flow:p>
What I need to do is put a Flex chart in place of that image. I tried the following before passing my TextFlow into the thing that displays it.
var flow:TextFlow = TextConverter.importToFlow("sample.xml", TextConverter.TEXT_LAYOUT_FORMAT);
var figs:Array = flow.getElementsByStyleName("chart");
for (var i:int = 0; i < figs.length; i++) {
if (figs[i] is InlineGraphicElement) {
var id:String = FlowElement(figs[i]).id;
var figure:DisplayObject = getFigure(id);// <-- this returns an instance of my chart
InlineGraphicElement(figs[i]).source = figure;
The result is that nothing happens, I don't see my chart, just an empty space. My understanding was that you can set a DisplayObject as the source of the InlineGraphicElement as described at http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/frames.html?http://help .adobe.com/en_US/FlashPlatform/reference/actionscript/3/index.html&http://help.adobe.com/e n_US/FlashPlatform/reference/actionscript/3/all-classes.html&filter_flex=4&filter_flashpla yer=10&filter_air=1.5
The difference is that I am not creating my flow programatically but I wouldn't expect that to make a difference. I am using Flex 3.4 though. Could that be the difference?It didn't seem to have any effect. Though, maybe I put it in the wrong spot. See below:
var figs:Array = flow.getElementsByStyleName("chart");
for (var i:int = 0; i < figs.length; i++) {
if (figs[i] is InlineGraphicElement) {
var id:String = FlowElement(figs[i]).id;
var figure:DisplayObject = getFigure("fig1");
InlineGraphicElement(figs[i]).source = figure;
flow.tlf_internal::appendOneElementForUpdate(figs[i]); -
How to maintain data in tables using maintenace view of the tables in ECC6
Hi,
I have two table SBUSPART (Business partner) and STRAVELAG (Travel agency).
SBUSPART is foreign key table while STRAVELAGE is a reference table. The relationships is :
SBUSPART-MANDANT = STRAVELAGE-CLIENT
SBUSPART-BUSPARTNUM = STRAVELAGE-AGENCYNUM
now, I create a maintenance view ZVI_HT_PARTNER in which SBUSPART is primary table and STRAVELAGE is secondary table. I have also created maintenace interfaces by generating maintenance modules in function group zht_fg. Authorization group is SUNI and maintenance type is one-step, the number maintenace screen is 100.
Now I want to maintain the data in tables SBUSPART and STRAVELAGE together in the maintenace view. If i want to enter a new partner dirctly I have to enter it in table SBUSPART first, only then could I enter the corresponding data in STRAVELAGE.
in older version I easyly do this by the way: in maintenace screen of zvi_ht_partner ( in se11) I choose: system/ services/table maintenace/Enhance.Tab.maintain.
but in ECC6 when I choose: system/ services/table maintenace, there is no Enhance.Tab.maintain instead there are two options Extended table maintenace and View cluster maintenace.
So in this case I don't know how to tackle this problem, Please help me if you have a solution.
Thanks,Hi,
I suppose 'Extended table maintenace ' would be same as 'Enhance.Tab.maintain'.
Regards,
Himanshu -
How to fixed some view on the top of your windows for WD?
as title as said.i have a windows(named <b>winA</b>),which included three views(named <b>viewA,viewB,viewC</b>)) in it(windows'viewset (row,column)=(1,3)), for some reasons,the high of winA is often exceed out of the protal displayed hight in IE when <b>viewA,viewB,viewC</b> are visual.So i wanna to fixed the <b>viewA</b> to the top of the winA ,no matter what the protal displayed high exceed or not. this is to say,for anytime <b>viewA</b> can be seen from u IE,no need to drag scroll bar from the bottom to the top.
maybe u suggest to put viewB and ViewC into seperately ScrollContainer control of WD.
but i don't wanna to got two scroll bars appeared in IE,and i still wanna to hold <b>viewB </b>and<b> viewC</b>.
any adivce is welcome.hi,
you can do it in the following way:
1...use the T-Viewset(the left side is not wasted. Adjust the width)
2...Assign the "Height" & "width" properties of your root containers(of the three views) to be around 60 or 70% (depends on how much space is avaliable on portal screen)
3...If your viewA is something like a banner(without any funcitonal UI elements in it), then why dont you put it up as a Portal-Banner. That way you can get rid of viewA..n hav only viewB
Regards,
Hanoz -
CBO calculates un acceptable cost while using index.
Hi,
I was wondering to see the execution plan for both the case using index/without index.
We are using oracle 10G(10.2.0.3.0) with RAC in production at O/S:- sun solaris 10.
Java based application is running in this database. One of the sql query is taking long time to fetch the records. I analyzed the sql plan and noticed the FTS. I created indexes to the column(s) which is refering in where clauses. I noticed a strage behavior. Execution plan shows that the CBO is using right path but its not acceptable as application is time outs while return the rows.
first execution plan with/without index (not using the index).
PLAN_TABLE_OUTPUT
Plan hash value: 419342726
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 196 | 3332 | 67845 (3)| 00:13:35 |
|* 1 | TABLE ACCESS FULL | CWDBENUMDESCRIPTIONS | 1 | 35 | 3 (0)| 00:00:01 |
| 2 | SORT GROUP BY | | 196 | 3332 | 67845 (3)| 00:13:35 |
|* 3 | TABLE ACCESS FULL| CWORDERINSTANCE | 51466 | 854K| 67837 (3)| 00:13:35 |
Predicate Information (identified by operation id):
1 - filter("ERR"."CODE"=:B1)
3 - filter("OI"."ERROR_CODE" IS NOT NULL AND "OI"."DIVISION"='OR9' AND
"OI"."ACTIVE"=TO_NUMBER(:1) AND "OI"."ORDER_STATE"<>'O_NR_NS' AND
"OI"."ORDER_STATE"<>'C_C_QR' AND "OI"."ORDER_STATE"<>'O_NR_NS_D')
SQl query was modified to force the index to use /*+ index(oi oi_div) */ the execution is as below:-
PLAN_TABLE_OUTPUT
Plan hash value: 1157277132
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 196 | 3332 | 394K (1)| 01:18:52 |
|* 1 | TABLE ACCESS FULL | CWDBENUMDESCRIPTIONS | 1 | 35 | 3 (0)| 00:00:01 |
| 2 | SORT GROUP BY | | 196 | 3332 | 394K (1)| 01:18:52 |
|* 3 | TABLE ACCESS BY INDEX ROWID| CWORDERINSTANCE | 51466 | 854K| 394K (1)| 01:18:52 |
|* 4 | INDEX RANGE SCAN | OI_DIV | 3025K| | 14226 (1)| 00:02:51 |
Predicate Information (identified by operation id):
1 - filter("ERR"."CODE"=:B1)
3 - filter("OI"."ERROR_CODE" IS NOT NULL AND "OI"."ACTIVE"=TO_NUMBER(:1) AND
"OI"."ORDER_STATE"<>'O_NR_NS' AND "OI"."ORDER_STATE"<>'C_C_QR' AND
"OI"."ORDER_STATE"<>'O_NR_NS_D')
My questions are here:-
1). why FTS is less costly comparing index scan where there are 15000000 rows in the table.
2). while forcing index to use cost increase drastically (the statistics is latest one analyzed on 6th of feb 2009)
3). what should i suppose to change to get the performance benefit.
Thanks,
Pradeepuser587112 wrote:
select null, oi.division, oi.METADATATYPE, oi.ERROR_CODE,
( select err.DESCRIPTION
FROM CWDBENUMDESCRIPTIONS err
WHERE oi.ERROR_CODE = err.CODE
count(*)
from CWORDERINSTANCE oi
where
oi.ERROR_CODE is not null
and oi.division in ('BK9')
and oi.order_state not in ('O_NR_NS_D', 'C_C_QR', 'O_NR_NS')
and oi.metadatatype = :1
and oi.duedate>=:2
and oi.active = :3
group by oi.division, oi.metadatatype, oi.error_code
order by oi.division, oi.metadatatype, oi.error_code
In this query, if we use as it is how its being displayed, it runs like a rocket, but if we change division in ('OR9') instead of 'BK9' it does not use index and leads to time out the application.
Number of records division
1964690 ---------------- why this field is null ?
3090666 OR9
3468 BA9
1242 EL9
2702 IN9
258 EU9
196198 DT9
1268 PA9
8 BK9
2332 BH9
1405009 TP9
According to the stats in your original execution plan, it looks like you have a histogram on this column, and the index you want to use is on just the division column.
Oracle estimate for 'OR9' is 3M rowids from the index, resulting in 50,000+ rows from the table - that's a lot of work - it's not surprising that the optimizer chose a tablescan for 'OR9' - but chose to use the index for 'BK9' which has only 8 rows.
How often do you want to run this query ? And how accurate does the answer have to be ?
If you want this query to run faster even when it's processing a huge number of rows, one option would be to create a materialized view over the data that could supply the result set much more efficiently (possibly getting your front-end code to call a materialized view refresh before running the query).
The only other altenative is probably to create an index that covers all the columns in the query so that you don't have to visit the table - and if you order them correctly you won't have to do a sort group by. I think this index should do the trick: (division, metadatatype, error_code,active, duedate,orderstate). You could also compress this index on at least the first column, but possibly on far more columns, to minimise the size,
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
"The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge."
Stephen Hawking
To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format. -
I am running a query against the table that has few million records using a column in where clause.The column has got low cardinality values (only 19 ) unique values of the millions of rows. i created a bit map index on the column. For what so ever reason the query does not use the index at all and the cost is way high in the Explain plan. I used hints to use index to improve the query which on the other hand increased the cost instead of reducing it. It looks like full table scans are lot better than indexed scans. Any suggestions on what could be done. It is a report and it needs to be tuned to reduced the execution time.
-- BalaIf the 19 distinct values are roughly equally likely, so any query is going to retrieve roughly 5% of the rows from the table, the CBO is likely to prefer a full-table scan because it is generally going to be quicker than doing single-block reads to get that volume of data back. If, on the other hand, the data is skewed so some values are more common that others, gathering histograms on the column and using literals rather than bind variables should allow the CBO to use an index where appropriate (i.e. to retrieve the less common results)
Presumably, you're not presenting 5% of a few million rows to users. You're probably aggregating those results somehow. In that case, you may be able to create a materialized view that does the aggregation and is refreshed after each load (ideally it would be fast-refreshable, but that depends on logistics).
Note as well that I'm assuming that you have some sort of data warehouse type system since you've created a bitmap index and bitmap indexes are generally incompatible with OLTP systems.
Justin -
Stored Procedures VS Indexed Views - Performance?
Hey folks,
In the past, one of the factors I'd consider when choosing to use a Stored Procedure over a View was the fact that the Stored Procedure would get optimized by storing the query execution path (I'm a developer so I understand this at a higher level than a
DBA would). But I've recently become aware of the fact that you can now Index your Views. This has now raised new questions for me as to when I'd get better performance out of the Indexed View versus the Stored Procedure?
Take for example the following:
SELECT colA, colB, sum(colC), sum(colD), colE
FROM myTable
WHERE colFDate < '9/30/2011'
GROUP BY colA, colB, colE
The date will be different every time it's run, so if this were a view, I wouldn't include the WHERE in the view and instead have that as part of my select against the View. If it were a stored procedure, the date would be a parameter.
If this were an Indexed View, should I expect to get better performance out of it then a stored procedure that's had an opportunity to cache the execution path? Or would the proc be faster? Or would
the difference be negligible? I know we could say "just try both out" but there are too many factors that could falsely bias the results, so I'd like to hear more of the theory behind it and what the expected outcomes are instead.
Thanks!Very cool. Thanks Dan. One question though. You said "
If you are using SQL Server Enterprise Edition, you do not need to select from the view directly. " I'm not sure what you mean here. Where would I selecting from if not from the view?
Thanks again!
What I mean is that if your query is semantically similar to the same query encapsulated in the view, the optimizer may be able to use the view index even though you specify the table in the query. For example, each of the queries below will scan
the view index in Enterprise (or Developer) edition instead of the underlying table:
CREATE VIEW dbo.vw_myTable
WITH SCHEMABINDING
AS
SELECT colFDate, colA, colB, SUM(colC) AS colC, SUM(colD) AS colD, colE, COUNT_BIG(*) AS countbig
FROM dbo.myTable
GROUP BY colA, colB, colE, colFDate
GO
CREATE UNIQUE CLUSTERED INDEX cdx_vw_myTable ON
dbo.vw_myTable(colA, colB, colE, colFDate);
GO
SELECT colA, colB, SUM(colC), SUM(colD), colE
FROM dbo.myTable
WHERE colFDate < '20110903'
GROUP BY colA, colB, colE;
GO
SELECT colA, colB, SUM(colC), SUM(colD), colE
FROM dbo.vw_myTable
WHERE colFDate < '20110903'
GROUP BY colA, colB, colE;
GO
SELECT colA, colB, SUM(colC), SUM(colD), colE
FROM dbo.vw_myTable WITH (NOEXPAND)
WHERE colFDate < '20110903'
GROUP BY colA, colB, colE;
GO
Dan Guzman, SQL Server MVP, http://www.dbdelta.com -
How to rearrange the structure of a table by using a view?
At wits end: I need to reorganize the structure of a table into a new structure - either as a view or actually moving the data from the old structure to the new structure (using a view).
The old structure is:
TESTNAME, SCHOOL_ID, PTILE1, PTILE2, PTILE3 ... PTILE99
Test1,0001,18,19,20...
Test1,0002,23,24,28...
Test1,0003,20,21,26...
Test2,0001,48,52,55...
Test2,0002,50,54,54...
Test2,0003,60,62,64
The new structure is:
SCHOOL_ID,PTILE,TESTNAME1,TESTNAME2...
1,0001,Score1,Score2...
1,0002,Score1,Score2...
1,0003,Score1,Score2...
2,0001,Score1,Score2...
2,0002,Score1,Score2...
2,0003,Score1,Score2...
99,0001,Score1,Score2...
99,0002,Score1,Score2...
99,0003,Score1,Score2...
What this data shows are the percentiles for test scores for different tests for each school who took the tests.
It seems like creating a view to arrange the data through a bunch of selects and unions would work, but I can't figure out how.Tricky.
When confronted with a problem like this I try to write out an algorthm in pseudocode to work out what I want to do. If you have more than 2 or 3 tables to merge I'd consider going with a new structure; otherwise the view approach might be a good idea. Remember that if you go with a new structure you can insert once and update the other values later, something like
foreach school insert row
update testname1
update testname2
Good luck. -
Query DB2 tables from oracle using normal view
This is with regard to querying db2 tables using oracle views. The view is created using dblink. The querying is not an one time activity.querying will be done once in a day. Can i use normal view (will it work ) or should i use materialised view. will i be able to view the added records in db2 table using normal view?
thanks,
vinodhVinodh2 wrote:
This is with regard to querying db2 tables using oracle views. The view is created using dblink. The querying is not an one time activity.querying will be done once in a day. Can i use normal view (will it work ) or should i use materialised view. will i be able to view the added records in db2 table using normal view?How can the SQL select statement via a dblink not work for a view, but the same SQL select statement work for a materialised view?
Do you think the database link or remote database care whether the select SQL that hits it, comes from a PL/SQL procedure, a view, a materialised view, a job or whatever else? It has no idea what/who is behind that select SQL - and nor does it care.
As for the benefits of a view vs. a materialised view - that depends on the requirements for needing to use that foreign database's data in the local database.
Maybe you are looking for
-
What is the best way to manage my dvd's with the Apple TV
Hi, I might be in the wrong category/subforum, but I dont really know where to post my question exactly. A few months ago I bought my first MBP after owning several ipods, iphones and ipads, an Apple TV and an Airport Extreme. My wife and I have seve
-
Acrobat 9.3.4 doesn't enforce Date Formating
After we upgraded to Acrobat 9.3.4 from a previous version of 9.3 acrobat doesn't enforce date formating..before in a Text field formated as Date mm/dd/yyyy it would autocompelete if we typed in 9/21 to 9/21/2010.. now it doesn't, we can type any ran
-
Windows won't install and can't get back to mac os
I printed boot camp instructions. I partitioned the disk with no problem, inserted windows 7 and it came up a black screen with blinking cursor. I cannot get out of it and if I restart, it says to insert bootable disk. I cannot get mac os to come
-
Java Kernel and the "Unlimited Strength Java Crypto Extension Policy Files"
Is Java Kernel able to download and install on-demand the "Unlimited Strength Java(TM) Cryptography Extension Policy Files"? Currently, I have to instruct the users of my applications to download those policy files from Sun's website and follow the i
-
Set/change dynamic header configuration from ABAP Proxies
This question is with reference to Async ABAP Proxies. Is it possible to set or change dynamic configuration header of an outbound (client) proxy, from within an inbound (server) proxy ? If it is, how do I do it? Can someone please advise? Thanks, Ba