REF partitioning is affecting on complex queries

Hi,
I am having 7 tables consider A,B,C,D,E,F,G. whereas A is master table and others are dependent on table A. columnA is referential key for all tables. Table A is having one DateRange column.
I have successfully created range partitioning with partitioning key is DateRange. and Refeernce partitioning on other tables with column referring to ColumnA with foreign key.
Also created local indexes on partitioned key DateRange.
Problem is that, while fetching complex queries for reports, it is taking more time as compared to non partitioning structure. Is ref partitioning affecting on complex queries, queries returning more rows ??? Please suggest me about it.
Thanks,
Avinash.

Did I miss anything ?Depends on what you've read about it sofar and why you decided to implement it.
http://www.oracle-base.com/articles/11g/partitioning-enhancements-11gr1.php#reference_partitioning
"The following conditions and restrictions apply to reference partitioning:
The child table must specify a referential integrity constraint defined on the table being created. This constraint must be in ENABLE VALIDATE NOT DEFERRABLE state (the default) and refer to a primary or unique key on the parent table.
The foreign key columns referenced in constraint must be NOT NULL.
The constraint cannot use the ON DELETE SET NULL clause.
The parent table referenced must be an existing partitioned table. All partitioning methods except interval partitioning are supported.
The foreign key cannot contain any virtual columns.
The referenced primary key or unique constraint on the parent table cannot contain any virtual columns.
Reference partitioning cannot be used for index-organized tables, external tables, or domain index storage tables.
A chain of reference partitioned tables can be created, but constraint used can't be self-referencing.
The ROW MOVEMENT setting for both tables must match.
Reference partitioning cannot be specified in a CREATE TABLE ... AS SELECT statement."

Similar Messages

  • OBIEE generates complex queries

    Hi,
    Currently we are experiencing performance issues, i.e. some queries are running for a very long time. I examined these queries and it struck me that it could be caused by the complexity of the generated queries. For example, a query accessing only one facttable accessed that facttable 5 times (the queries are concatenated through the WITH statement) ! I wonder, why is this necessary? Business Objects XI does not generate such complex queries, BO XI would access that facttable only one time.
    Basically my question is: which settings affect the queries generated by OBIEE? Isn't it possible to generate different, simpler queries?
    TIA,
    EriK

    Thanks guys. Bad design could be a reason.. but we're using Oracle's own product called BI-APPS and I expect that to be perfect...:-)
    Here is an example of a query that is imho way too complex:
    WITH
    SAWITH0 AS (select sum(T258218.LINE_AMT * T258218.GLOBAL1_EXCHANGE_RATE) as c1,
    T551303.PROJECT_NUMBER as c2,
    T258218.PURCH_ORDER_NUM as c3
    from
    W_PROJECT_D T551303 /* Dim_W_PROJECT_D_Project */ ,
    W_PURCH_COST_F T258218 /* Fact_W_PURCH_COST_F */
    where ( T258218.DELETE_FLG = 'N' and T258218.PROJECT_WID = T551303.ROW_WID and T551303.PROJECT_NUMBER = '101491' )
    group by T258218.PURCH_ORDER_NUM, T551303.PROJECT_NUMBER),
    SAWITH1 AS (select distinct SAWITH0.c2 as c1,
    SAWITH0.c3 as c2,
    SAWITH0.c1 as c3,
    SAWITH0.c1 as c4,
    SAWITH0.c1 as c5
    from
    SAWITH0),
    SAWITH2 AS (select distinct SAWITH1.c1 as c1,
    SAWITH1.c2 as c2,
    SAWITH1.c3 as c3
    from
    SAWITH1),
    SAWITH3 AS (select sum(T258218.LINE_AMT * T258218.GLOBAL1_EXCHANGE_RATE) as c1,
    T551303.PROJECT_NUMBER as c2,
    T258218.PURCH_ORDER_NUM as c3
    from
    W_PROJECT_D T551303 /* Dim_W_PROJECT_D_Project */ ,
    W_PURCH_COST_F T258218 /* Fact_W_PURCH_COST_F */
    where ( T258218.DELETE_FLG = 'N' and T258218.PROJECT_WID = T551303.ROW_WID and T551303.PROJECT_NUMBER = '101491' )
    group by T258218.PURCH_ORDER_NUM, T551303.PROJECT_NUMBER),
    SAWITH4 AS (select distinct SAWITH3.c2 as c1,
    SAWITH3.c3 as c2,
    SAWITH3.c1 as c3,
    SAWITH3.c1 as c4,
    SAWITH3.c1 as c5
    from
    SAWITH3),
    SAWITH5 AS (select sum(SAWITH4.c4) as c4,
    SAWITH4.c1 as c5
    from
    SAWITH4
    group by SAWITH4.c1),
    SAWITH6 AS (select sum(T258218.LINE_AMT * T258218.GLOBAL1_EXCHANGE_RATE) as c1,
    T551303.PROJECT_NUMBER as c2,
    T258218.PURCH_ORDER_NUM as c3
    from
    W_PROJECT_D T551303 /* Dim_W_PROJECT_D_Project */ ,
    W_PURCH_COST_F T258218 /* Fact_W_PURCH_COST_F */
    where ( T258218.DELETE_FLG = 'N' and T258218.PROJECT_WID = T551303.ROW_WID and T551303.PROJECT_NUMBER = '101491' )
    group by T258218.PURCH_ORDER_NUM, T551303.PROJECT_NUMBER),
    SAWITH7 AS (select distinct SAWITH6.c2 as c1,
    SAWITH6.c3 as c2,
    SAWITH6.c1 as c3,
    SAWITH6.c1 as c4,
    SAWITH6.c1 as c5
    from
    SAWITH6),
    SAWITH8 AS (select sum(SAWITH7.c5) as c3
    from
    SAWITH7)
    select SAWITH2.c1 as c1,
    SAWITH2.c2 as c2,
    SAWITH2.c3 as c3,
    SAWITH5.c4 as c4,
    SAWITH8.c3 as c5
    from
    SAWITH2,
    SAWITH5,
    SAWITH8
    where ( nvl(SAWITH2.c1 , 'q') = nvl(SAWITH5.c5 , 'q') and nvl(SAWITH2.c1 , 'z') = nvl(SAWITH5.c5 , 'z') )
    Basically the query is:
    select sum(T258218.LINE_AMT * T258218.GLOBAL1_EXCHANGE_RATE) as c1,
    T551303.PROJECT_NUMBER as c2,
    T258218.PURCH_ORDER_NUM as c3
    from
    W_PROJECT_D T551303 /* Dim_W_PROJECT_D_Project */ ,
    W_PURCH_COST_F T258218 /* Fact_W_PURCH_COST_F */
    where ( T258218.DELETE_FLG = 'N' and T258218.PROJECT_WID = T551303.ROW_WID and T551303.PROJECT_NUMBER = '101491' )
    group by T258218.PURCH_ORDER_NUM, T551303.PROJECT_NUMBER
    but this query is repeated multiple times. It looks like a self join - but why is OBIEE generating such a complex query? And can it be affected?
    Edited by: user10984315 on 18-Mar-2011 08:29
    Edited by: user10984315 on 18-Mar-2011 08:30

  • Complex Queries Developed in Desktop for Plus Users

    I develop complex queries in Discoverer desktop, with complex calculations and conditions and customized report formats. I understand that my "Plus" users can run them all. Is that correct?
    What about my "Viewer" users?

    Hi,
    The "Viewers" users can run any complex report, equally like "Plus". The reports would have to be shared with the Viewers users.
    Discoverer desktop is a client side development tool and Plus is the "Equivalent" web version. So complex calculations/conditions should not affect.
    Thanks.

  • Please some one can explain about some complex queries

    BW Guru's,
    please some one can explain about some complex queries which was created while working on Reporting.
    I need to create profit and loss query as per requirment on the FL-Gl cube.
    Answer would be appreciate in advance.
    Regards
    Krish

    HI Aryan,
    No need to create FM on your own. You can copy the FM from Function Group RSAX.
    The procedure to create FM extractor is as follows:
    1) Create an extract structure.
    2) Go to SE80. Select Function Group RSAX , right click and then copy.
    3) Give your own name to the function group to copy.
    4) Select one appropriate FM from the list of FMs provided. eg FM RSAX_BIW_GET_DATA_SIMPLE.
    5)Specify the name of new FM you want to create.
    6) Go to SE37 and open the FM you have created by copying from Function Group RSAX.
    7) no need to change the import tab.
    8) On tables tab, for paramerter name E_T_DATA under asociate name specify the name of extract structure you hav created.
    9) Under source code tab make the changes in the source code only to customise it to your requirement. eg: declare the database table you are using, make changes where datasource is in picture, etc.
    I have created a generic DataSource with the help of above procedure.. I hope you will find it helpful...
    Regards,
    Geetanjali

  • Differentiate between Simple, Medium and Complex Queries.

    Hi Gurus,
    I am a Tech. Architect on this new project. I would like to know how to differentiate between Simple, Medium and Complex Queries in BW because I need this info to work on the Estimates. Has this differentiation got anything to do with the Backend config also?
    Thanks in Advance.
    Chandu.

    Hi
    You need to understand the requirements and consider the following before you classify........
    1) Queries that are based on multiple key figures--which may result in cell definition.
    2) Queries with complex calculations.
    3) Queries that are based on Variable Exits
    Regards
    Srinivas Bandi

  • IMPLEMENTING PAGEWISE CONCEPT FOR COMPLEX QUERIES FOR WEB BASED TECHNOLOGIES

    Dear Friends
    how do i implement Page Wise concept for complex queries. Complex queries includes 'Group by', 'from selects'. Mere Rownum selection doesnt solve my problem. I have 3 buttons 'Previous', 'Next' and 'display of No. of records' . Kindly suggest me with a solution.

    The only widespread way is dynamically bild a SQL clause then parse and execute it using dynamic sql (package dbms_sql) or native dynamic sql (execute immediate clause).
    You can go through your already built cursor and display only those records you need (for example from 10th to 20th). I think there is no way to leave cursor open and reuse it another time. Every time You hit next, back or count button you need build new cursor (either selecting context columns to show some records or selecting count(*) to show number of records). You can generate this code with Oracle Designer, making webserver modules. Of course this will cost rather many $$$. Another tip - Designer makes this code for all situations and therefore it is somewhat difficult to understand it in the beginning. If you really need some example I can send something to you.

  • Documenting complex queries

    I'd like to start providing better documentation along with the database objects I produce. What's the best way to document what's going on in complex queries? I've started trying out different techniques of documenting source/target in a spreadsheet, but it seems to be lacking. I was wondering what others do? Any suggestions or references you could point me to? I could probably improve upon my inline comment practices, so any suggestions there are also welcome. Thanks

    I’ve encountered the problem before and got some good advice here: Re: Documentation help:  Procedural logic Vs Set logic
    Because SQL is an explicit language, and programmers being in the mental state that they are when programming, it’s difficult for us to deconstruct our perfectly explicit, self-documenting SQL statement into something that someone else will understand.
    The diagram linked in the above forum thread is an example where to explain what I’m doing, I’ve had to change the set-based logic of the SQL statement into a procedural loop type explanation. I hated doing this, but it was the best way I could think of to explain it to someone.
    More recently I’ve had to document a query that is fairly simple logically (to me anyway) but due to the number of tables and the fact that the audience doesn’t necessarily understand spatial queries, I found it easier to break it down using the following diagram:
    http://img.photobucket.com/albums/v115/whitehat/work%20related/query1.jpg
    tables probably won’t mean anything to you, but you can see how I’ve broken it down into business-logic “Retrieve criteria for exception checking”, “select providers”, “restrict providers” etc. the arrows represent the join criteria and the boxes split up the driving tables and the restriction tables.
    I’ve found this particular diagram very useful as part of the current project that I’m involved with. Even the System Testers are relying on this diagram to direct them in how everything fits together.
    Each situation is different however and you’ll just have to experiment with each bit of code as it comes along.
    Hope this helps!

  • Want complex queries

    Hi,
    Where can i find the SQL queries(unsolved) through which i can learn to write complex queries...
    As I am a novice programmer it would be better if the range varies from easy to complex ones.
    Thanks in advance.
    Mythili

    Actually for me a skill full SQL developer is one who can solve a complex problem with a simple SQL. Not the one who can write complex SQL ;)
    Some of the places from where i learn new and exiting stuff ever day are
    [Asktom.oracl.com |http://asktom.oracle.com/pls/asktom/f?p=100:1:146758316283624]
    [forums.oracle.com|http://forums.oracle.com/forums/main.jspa?categoryID=84]
    [Richard footes oracle blog|http://richardfoote.wordpress.com/]
    [Oracle Document is always there|http://tahiti.oracle.com/]
    These places are not going to make you a great SQL Developer in a day. You have to be there and keep learning constantly. Without your knowledge over a period of time your approach towards SQL will change. And change is good ;)

  • More complex queries ???

    hi all,
    Can you tell me anyone, where can I found more complex queries for oracle sql expert exam ?
    thx in advance

    Hi Christopher,
    have you checked out chapter 20 of the BPEL developers guide, at otn.oracle.com/bpel?
    It covers the dbadapter. Also we have many samples with the install, check out samples/tutorials/122.DBAdapter/PureSQLSelect.
    The most advanced solution, if you know TopLink well enough, is to use descriptor ammendment to express any complex sql using TopLink's proprietary expression API. Your ammendment class is written in java and must be on the appserver's classpath. You could check out the toplink otn forum for more info about that.
    Thanks
    Steve

  • Complex Queries.

    Hi Gang,
    I was in an interview last week and was asked to give an example of a complex queries I have worked with. I was really cought off guard and could not give a very intelligent answer other than mumbling. Can someone please help me out with real life examples? May be I will be asked the same in my next interview.
    Thanks,
    Kara.

    There are many features available in BEx querying, I would think that being able to discuss how / why you used some of them in the same query is what they are looking for, e.g. 
    - Creating RKFs with restrictions on several characteristics
    - Using variable offsetsto get KFs form different time periods
    - A case where using Constant Selection was needed.
    - Using some of the various totaling options.
    - Use of MultiProvider that includes Cube, ODS, and Master Data.
    Now if you haven't actually designed any quereis, this can be a challenge........

  • Complex queries in Open SQL

    Moved to performance forum by moderator
    Hi Experts,
    This is more of a discussion rather than a question. I would like to know the advantages of Open SQL. It prevents you from writing complex queries, the kind of queries that you can write in native sql.
    The biggest disadvantage I feel is that you have to fetch data into internal tables and loop. This takes a lot of processing time when you have a report having a lot of lines. A complex query using complex joins and subqueries will always perform better than having to loop and process data and simple things like generating sequence.
    The best thing about open sql is the way it handles select options.
    I would like to get your opinions and suggestions how to write complex queries in ABAP with some code snippets if possible.
    Warm Regards,
    Abdullah
    Edited by: Matt on Jan 21, 2009 6:54 PM

    > select - endselect will query the database repeatedly and wont be any different from using a loop on
    > internal table.
    that is a  very common misunderstanding, but not true, it uses the arry interface, but gives you the possibility to react on every line. But interaction with DB is in blocks.
    The biggest advantage of Open SQL is the implementation of the table buffer, every Open SQL Statement checks the buffers first.
    Other advantage, all statements changing table definitions are not allowed.
    And of course, as already said, it is a set of commands available on all DB platforms certified for SAP software, i.e. IBM, Oracle, Max DB and Microsoft.
    Complex queries, even with the available joins you can write very very complex queries ... sometimes too complex. I see not advantage for a competetion of writing the most complex statement
    Siegfried

  • Ref.Partitioning

    Hi Inderjyot Singh ( Kaamin and other friends)
    Thanks a lot to all of you , for your mails regarding the question I
    have posted. The discussion has been really helpful .
    Regarding your thought from your recent mail..,
    "What if you drag a UserVisible SO that belongs to application 'A1'
    into a reference partition with services for application 'A2'??"
    This also does not work out. I have tried all combinations of User
    visible and Environment visible objects to put them in the same
    reference partitioning ( or the way U suggested above. No way U can put
    both of them together).
    Now I am trying to do the same ref.partitioning by changing the User
    visibility (of one service object) to Environment visibility and trying
    to put things together in the same reference partition.( for
    experimental purposes)
    Both environment visible service objects option also does not seem to be
    easy ( for deploying purposes ), you have to compromise on some good
    design issues and the side effects are right now not predictable, Just
    to understand them, I am trying this option.
    Once I am done with it, I will share the results with U all.
    Let us meet in the next discussion.
    Thirumurthi
    Get Your Private, Free Email at http://www.hotmail.com

    Did I miss anything ?Depends on what you've read about it sofar and why you decided to implement it.
    http://www.oracle-base.com/articles/11g/partitioning-enhancements-11gr1.php#reference_partitioning
    "The following conditions and restrictions apply to reference partitioning:
    The child table must specify a referential integrity constraint defined on the table being created. This constraint must be in ENABLE VALIDATE NOT DEFERRABLE state (the default) and refer to a primary or unique key on the parent table.
    The foreign key columns referenced in constraint must be NOT NULL.
    The constraint cannot use the ON DELETE SET NULL clause.
    The parent table referenced must be an existing partitioned table. All partitioning methods except interval partitioning are supported.
    The foreign key cannot contain any virtual columns.
    The referenced primary key or unique constraint on the parent table cannot contain any virtual columns.
    Reference partitioning cannot be used for index-organized tables, external tables, or domain index storage tables.
    A chain of reference partitioned tables can be created, but constraint used can't be self-referencing.
    The ROW MOVEMENT setting for both tables must match.
    Reference partitioning cannot be specified in a CREATE TABLE ... AS SELECT statement."

  • Best Practices for Batch Updates, Inserts and Complex Queries

    The approach we have taken for our ALDSP Architecture is to model or DASi as Business Data Objects, each DS joining several (some times many) tables and lookups. This works ok when needing to access individual records for read and update, but when we need to update multiple tables and rows within the same commit, trying to do this with a logical single ds built on tables or other dASi, proves both cumbersome and slow. This is also the case for queries, when we have complex where clauses within a DS built upon two or more multi-table-joined logical DASi.
    We tried a DS built on SQL, but that does not allow dml operations. We may have to just use JDBC. Any thoughts on how best to leverage DAS in this respect.

    I tried doing this by creating a UO class and using it on a DS built on a sql statement. What we wanted to do here is first read the DS to get a list of ID values that met the conditions of the query and then call submit() and have the UO update all the necessary tables associated with those IDS.
    However, we found that U/O never get's called unless you actually update something, not just send submit() after a read. Dis I misunderstand the way this shoudl work?

  • Uninstalling: Will my present Mac partition be affected if I restore?

    Hi there.
    I have a 250 gb hd in my Macbook (affectively 231 gb), currently partitioned as a Windows and a Mac partition. I don't need the boot camp windows partition anymore, and therefore want it deleted. I'm not sure if this should be done in disk utility or the boot camp assisant, but I'm guessing it's the the latter. When I chose the Boot Camp-assistant and chose continue > Create or remove a Windows-partition > it tells me that my disk Macintosh HD will be partitioned as Mac OS X - so does this mean the gbs currently partitioned as the Windows HD will appear usable without - in theory - affecting my current Mac OS X hd, or will it delete all files on the two partitions and restore the disk at once.
    Hope it makes sense (I did do a quick search on the forum, with no result, although I admit I was too lazy to look through all the results)
    Cheers!

    You are right, boot camp assistant should be used to remove the boot camp partition (Windows) and combine both partitions into one OSx partition.
    This means that all information on your OSx HD will remain intact and that the whole drive will once again be ONE whole partition.
    Axel F.

  • Is it possible to resize a OSX partition without affecting a Bootcamp partition?

    I have a new SSD drive but its only 120GB. I want to clone the entire drivevbut I cannot do this since my original SSD was 128GB. My OSX partition is 60GB and my Bootcamp partition takes up the rest. I know you cannot resize the Bootcamp partition but could I resize the OSX partition down to 50GB without affecting Bootcamp from booting up? Resizing the OSX partition, I should be able to clone my old drive to the new drive.

    It doesn't matter how big a physical drive is. With a Mac partition, it also doesn't matter what the size of the source and target partitions are. The only thing that matters is if the amount of live data you're cloning will fit on the target drive.
    Your current partition is 60GB. I would imagine it's not filled to the last byte of space. So as an example, let's say there's 40GB of data on it.
    The target drive only needs to be a bit larger than that. Though preferably with a fair amount of free space so if you boot to it, the OS isn't running on a drive with virtually no operating room. So the target partition should be about 50GB.
    Unlike Windows, Mac partitions do not dynamically change size to match the source.

Maybe you are looking for