How Does BI Build The Physical SQL

How does BI build physical queries? Below I have two queries.
Query1 – This is what BI builds. I tried to run it but after 14 minutes of no results, I kill the job.
Query2 – This is just the extraction of the base query from Query1. This runs in 2:08 minutes.
For whatever reason, BI is taking the base query and making it an inline view to create Query1. The wrapper query around this view is slow. Very weird.
There are only 409 rows returned.
Why does BI build these physical queries with the code WITH SAWITH0 ... ? It seems to be very inefficient.
Is there a way to force BI to not use this inefficient method?
Query1
WITH SAWITH0 AS
(select max(T321619.PRJ_EST_SALES) as c1,
max(T321619.PRJ_EST_TONS) as c2,
max(T321619.PRJ_EST_MARGIN_PCT) as c3,
T316339.NAME as c4,
T321619.REGION as c5,
substr(T324598.X_TERRITORY,
instr(T324598.X_TERRITORY, '.', 1, 4) + 1,
instr(T324598.X_TERRITORY, '.', 1, 5) -
instr(T324598.X_TERRITORY, '.', 1, 4) - 1) as c6,
T342203.PER_NAME_MONTH as c7,
T321619.PROJ_DESC as c8,
T316552.FULL_NAME as c9,
min(T342064.PER_NAME_MONTH) as c10,
T321619.BUILD_PART_ORD_IND as c11,
T321619.STATUS as c12
from obia.W_DAY_D T342064 /* Dim_W_DAY_D_SOCPM_Order_Create_Date */,
obia.W_DAY_D T342203 /* Dim_W_DAY_D_SOCPM_Proj_Creat_Date */,
obia.WC_VW_PROJECT_INFO_F T342484 /* Dim_WC_VW_PROJECT_INFO_F_SOCPM */,
obia.W_EMPLOYEE_D T316552 /* Dim_W_EMPLOYEE_D_Sales_Sales_Order_Resp_Custom */,
obia.W_CUSTOMER_LOC_USE_D T324598 /* Dim_W_CUSTOMER_LOC_USE_D_Sales_Customer_Bill_To_Loc_Use_Custom */,
obia.W_PARTY_D T316339 /* Dim_W_PARTY_D_Sales_Sales_Order_Customer_Custom */,
obia.WC_ORDER_VWO T321619 /* Fact_WC_ORDER_VW_SalesOrderCustom */
where (T316339.ROW_WID = T321619.CUSTOMER_WID and
T316552.ROW_WID = T321619.X_SALESREP_WID and
T321619.BILL_TO_SITE_USE_WID = T324598.ROW_WID and
T321619.ORDER_DATE_WID = T342064.ROW_WID and
T321619.DIVISION_INCL_BSC = 'VP' and
T321619.PROJ_DESC = T342484.PROJ_DESC and
T342203.ROW_WID = T342484.MIN_ORDER_CREATION_DATE_WID and
T342203.PER_NAME_MONTH = '2013 / 04')
group by T316339.NAME,
T316552.FULL_NAME,
T321619.REGION,
T321619.PROJ_DESC,
T321619.STATUS,
T321619.BUILD_PART_ORD_IND,
T342203.PER_NAME_MONTH,
substr(T324598.X_TERRITORY,
instr(T324598.X_TERRITORY, '.', 1, 4) + 1,
instr(T324598.X_TERRITORY, '.', 1, 5) -
instr(T324598.X_TERRITORY, '.', 1, 4) - 1)),
SAWITH1 AS
(select max(D1.c1) over(partition by D1.c8, D1.c4, D1.c9, D1.c6, D1.c7) as c1,
max(D1.c2) over(partition by D1.c8, D1.c4, D1.c9, D1.c6, D1.c7) as c2,
max(D1.c3) over(partition by D1.c8, D1.c4, D1.c9, D1.c6, D1.c7) as c3,
D1.c4 as c4,
D1.c5 as c5,
D1.c6 as c6,
D1.c7 as c7,
D1.c8 as c8,
D1.c9 as c9,
D1.c10 as c10,
D1.c11 as c11,
D1.c12 as c12
from SAWITH0 D1)
select distinct 0 as c1,
D1.c4 as c2,
D1.c5 as c3,
D1.c6 as c4,
D1.c11 as c5,
D1.c7 as c6,
D1.c8 as c7,
D1.c9 as c8,
D1.c12 as c9,
D1.c3 as c10,
D1.c1 as c11,
D1.c2 as c12
from SAWITH1 D1
where (D1.c7 = D1.c10 and (D1.c1 >= 500 or D1.c1 <= -500))
order by c2, c3, c4, c5, c6, c7, c8, c9
Query2
select max(T321619.PRJ_EST_SALES) as c1,
max(T321619.PRJ_EST_TONS) as c2,
max(T321619.PRJ_EST_MARGIN_PCT) as c3,
T316339.NAME as c4,
T321619.REGION as c5,
substr(T324598.X_TERRITORY,
instr(T324598.X_TERRITORY, '.', 1, 4) + 1,
instr(T324598.X_TERRITORY, '.', 1, 5) -
instr(T324598.X_TERRITORY, '.', 1, 4) - 1) as c6,
T342203.PER_NAME_MONTH as c7,
T321619.PROJ_DESC as c8,
T316552.FULL_NAME as c9,
min(T342064.PER_NAME_MONTH) as c10,
T321619.BUILD_PART_ORD_IND as c11,
T321619.STATUS as c12
from obia.W_DAY_D T342064 /* Dim_W_DAY_D_SOCPM_Order_Create_Date */,
obia.W_DAY_D T342203 /* Dim_W_DAY_D_SOCPM_Proj_Creat_Date */,
obia.WC_VW_PROJECT_INFO_F T342484 /* Dim_WC_VW_PROJECT_INFO_F_SOCPM */,
obia.W_EMPLOYEE_D T316552 /* Dim_W_EMPLOYEE_D_Sales_Sales_Order_Resp_Custom */,
obia.W_CUSTOMER_LOC_USE_D T324598 /* Dim_W_CUSTOMER_LOC_USE_D_Sales_Customer_Bill_To_Loc_Use_Custom */,
obia.W_PARTY_D T316339 /* Dim_W_PARTY_D_Sales_Sales_Order_Customer_Custom */,
obia.WC_ORDER_VWO T321619 /* Fact_WC_ORDER_VW_SalesOrderCustom */
where (T316339.ROW_WID = T321619.CUSTOMER_WID and
T316552.ROW_WID = T321619.X_SALESREP_WID and
T321619.BILL_TO_SITE_USE_WID = T324598.ROW_WID and
T321619.ORDER_DATE_WID = T342064.ROW_WID and
T321619.DIVISION_INCL_BSC = 'VP' and
T321619.PROJ_DESC = T342484.PROJ_DESC and
T342203.ROW_WID = T342484.MIN_ORDER_CREATION_DATE_WID and
T342203.PER_NAME_MONTH = '2013 / 04')
group by T316339.NAME,
T316552.FULL_NAME,
T321619.REGION,
T321619.PROJ_DESC,
T321619.STATUS,
T321619.BUILD_PART_ORD_IND,
T342203.PER_NAME_MONTH,
substr(T324598.X_TERRITORY,
instr(T324598.X_TERRITORY, '.', 1, 4) + 1,
instr(T324598.X_TERRITORY, '.', 1, 5) -
instr(T324598.X_TERRITORY, '.', 1, 4) - 1)
;

When you have aggregation rules applied on the front end, OBIEE forms the additional query where you are concerned about.
Try to push the logic as much as possible to RPD side and also try to use FILTER function instead of CASE WHEN.

Similar Messages

  • Interactive Report - How does it build the where claue when filtering data?

    I am curious how APEX builds the where clause when users add filters or does APEX simply filter the data?
    The reason I am asking, is for performance reasons, we have used inner selects to retrieve columns vs. using outer joins. However, I am just curious if we will suffer doing so when users add filters on these columns.
    Below are some details about our report:
    We have a report where we are joining many tables (25 tables) together. Initially, we created the report with outer joins and noticed that the cost of the explain plan was 2600 and the performance was marginal. We then started to remove the outer joins and replacing with inner selects and the cost and performance of the report improved. Currently, we have replaced 13 of the outer joins with inner selects and the cost is down to 650 and the performance is better.
    Below are examples:
    -- Using Outer Joins
    Select q.quote_id, q.quote_name, l.location_name, sr.sales_rep_name
    from quote q, location l, sales_rep sr
    where q.location_id = l.loation_id
    and q.sales_rep_id = sr.sales_rep_id
    -- Using Inner Selects
    Select q.quote_id, q.quote_name,
    (select location_name from location where location_id = q.location_id) location_name,
    (select sales_rep_name from sales_rep where sales_rep_id = q.sales_rep_id) sales_rep_name
    from quote q
    Just curious,
    Thanks,
    Brian

    Hi -
    If you switch on debug in Apex developer toolbar you can see the effect of user built filters on the sql that is actually executed for report.
    Good luck.

  • MappedByteBuffer - How does it handle the physical memory?

    Hello!
    I have some question regarding the java.nio.MappedByteBuffer class. I am wondering how does it exactly handle the physical memory.
    As first, I guess when I map a file into the the memory it does not mean that the whole file is being read into the physical memory. Am I right?
    My second question is, if I map more files into the memory, is there a real danger that I will get an out-of-memory exception? Is available any official resource about the memory management of this class?
    And my third question is, what is more efficient way at all, to use the MappedByteBuffer class or to use a FileChannel?
    I am looking forward to your replies!

    Tomi1226 wrote:
    I have some question regarding the java.nio.MappedByteBuffer class. I am wondering how does it exactly handle the physical memory.Java maps the file into virtual memory, the OS determines how to translate virtual memory into physical memory. Java has no control over how the OS does this, nor should it need to.
    As first, I guess when I map a file into the the memory it does not mean that the whole file is being read into the physical memory. Am I right?True, map != read or what would be the point.
    My second question is, if I map more files into the memory, is there a real danger that I will get an out-of-memory exception? An out of memory ERROR occurs when you run out of heap space. If you create enough file maps you are likely to run out of file handles or some other resourfe before you run out of heap.
    Exception != Error.
    Is available any official resource about the memory management of this class?Which class?
    And my third question is, what is more efficient way at all, to use the MappedByteBuffer class or to use a FileChannel?It depends on what you are doing.

  • Command-TAB - How does this build the application list???

    I have a need to enumerate the applications that have "windows", "icons", whether if they are minimized to the dock or not. I need basically the list of applications that Command-TAB brings you. How do you do this programmatically?
    Everything I tried gave me everything, or just the applications that are NOT minimized. Drives me nuts. Tried CGWindowListCopyWindowInfo, NSArray *runningApps = [workspace launchedApplications], but I can't get to the filtering of the list I need - whatever Cmd-TAB brings you.
    Help?

    Hello,
    I cannot reproduce what you say using launchedApplication.
    NSArray *launchedApps = [[NSWorkspace sharedWorkspace] launchedApplications];
    for (NSDictionary *app in launchedApps)
    printf("%s is launched
    ",[[app valueForKey:@"NSApplicationName"]UTF8String]);
    This gives me all launched apps that I can see in the comd-tab shortcut. If I use runningApplications then I get much more results (any app running even in background).
    I minimized all windows of two apps: Preview and MacSoup as one is Cocoa and the other is not (well I think Preview is Cocoa): they where listed as well
    {quote}
    Finder is launched
    Terminal is launched
    WebKit is launched
    Xcode is launched
    Property List Editor is launched
    Mail is launched
    Trousseau d’accès is launched
    Aperçu is launched
    MacSOUP is launched
    iTunes is launched
    ResKnife is launched
    MacVim is launched
    TextMate is launched
    Préférences Système is launched
    Interface Builder is launched
    AppList is launched
    {quote}
    That is the exact list I can see using comd-tab at the moment ..

  • How does this happen: The picture of recent apps you get when double clicking the home button showed in Settings-Wifi that I had been connected to a network I have not been near for two months. Its not a recent "image" of Settings-Wifi. Can anyone explain

    How does this happen: The picture of recent apps you get when double clicking the home button showed in Settings-Wifi that I had been connected to a network I have not been near for two months. Its not a recent "image" of Settings-Wifi. Can anyone explain?

    Greetings,
    I've never seen this issue, and I handle many iPads, of all versions. WiFi issues are generally local to the WiFi router - they are not all of the same quality, range, immunity to interference, etc. You have distance, building construction, and the biggie - interference.
    At home, I use Apple routers, and have no issues with any of my WiFi enabled devices, computers, mobile devices, etc - even the lowly PeeCees. I have locations where I have Juniper Networks, as well as Aruba, and a few Netgears - all of them work as they should.
    The cheaper routers, Linksys, D-Link, Seimens home units, and many other no name devices have caused issues of various kinds, and even connectivity.
    I have no idea what Starbucks uses, but I always have a good connection, and I go there nearly every morning and get some work done, as well as play.
    You could try changing channels, 2.4 to 5 Gigs, changing locations of the router. I have had to do all of these at one time or another over the many years that I have been a Network Engineer.
    Good Luck - Cheers,
    M.

  • How does one change the font size for folders and/or file lists in the Bookmarks Library?

    How does one change the font size for folders and/or file lists in the '''Bookmarks''' Library?
    Since the upgrade to version 9.0.1 of Firefox, the Bookmarks feature changes are confusing me. They seem to be confusing themselves as well. The list of bookmarks has changed. The font size is so small that my aging eyes cannot read it without fogging the screen with my breath. Some folders are out of alphabetical order (where I know they were previously good), and some are missing altogether (folders to which I frequently add references).
    As for missing or deranged files or folders, was there something that I should have done or now need to do to recover those after the upgrade (or before)?
    With regard to font size,
    1. there is no “Edit Bookmarks” or like option to edit the list in this version
    2. the “zoom” option in the “view” list of functions is greyed out when in “Show All Bookmarks” window
    3. expanding the browser window has no effect on font size
    4. “Preferences” settings for font size has no effect in that window either, including advanced settings
    5. “Help” offers none that I can find.
    Can any of you Help?!?

    Maybe this extension helps:
    *Theme Font & Size Changer: https://addons.mozilla.org/firefox/addon/theme-font-size-changer/

  • In InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to

    This may be a basic question... but in InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to determine what word count we can fit in, and c) how to do it in a table? Thanks!

    Set your ruler increments to pixels Preferences>Units & Increments. You can fill the text box with placeholder text Type>Fill with Placeholder text and get a word count from the Info panel with Show Options turned on from the flyout.
    From the Transform panel you can set a text box's width and height

  • In Photo 1.0, how does one access the map showing where all photos were taken, as could be done previously in iPhoto?

    In Photo 1.0, how does one access the map showing where all photos were taken, as could be done previously in iPhoto?

    Hi JohnDory,
    The information side-bar from iPhoto has been removed in Photos App, and so it's been converted into a pop-up window showing both the exposure, aperture and so technical photo parameters, as well as the comments, faces and LOCATION for that photo.
    This small floating window is shown whenever you click the button in the app title bar, right clicking a specific photo or pressing ⌘i
    If you open the albums view (clicking in the name of the album list, NOT an album name, you can see in your left sidebar - which can be shown or hidden) and press ⌘i without selecting a specific photo the Info pop-up will show the map for your whole library (as well as the total amount of photos, videos, GB used, etc)
    So, I'm afraid the "Locations" view (which I really loved) from iPhoto has been ripped off... and we can only get "some sort of locations view" by this method.
    As for locations... there is no option for manual geotagging (so, setting location to a specific photography which doesn't have it yet)... that really ****** me off 
    Regards,
    braincasualties.

  • I have downloaded a music file through a downloader . But the file is not found in the captured in music player . How can I locate the physical location and move the file . I cannot do via itunes also .

    I have downloaded a music file through a downloader . But the file is not found in the captured in music player . How can I locate the physical location and move the file . I cannot do via itunes also .

    Exactly what do you mean by a 'downloader'?
    Thanks
    Pete

  • How does apex detect the MIMETYPE of an upload?

    Hello,
    I need to import a bunch of files from the OS filesystem to my own table (blob).
    For implementing the download of these files I need to know the mimetype.
    Now, the files are stored in my table, but I have no clue how to detect the mimetype of
    my files (blob).
    How does Apex detect the mimetype of an uploaded file?
    Thanks,
    Michael
    Edited by: MJaro on 21.09.2010 15:52, Reason: little typo

    Michael,
    Mimetype detection is done during upload, if you don't have a mimetype column in your table where APEX can store it, this information is lost.
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

  • How does oracle suggest the archive log

    Hi All,
    My question is about user managed backup and recovery.
    For User managed hot database refreshes.
    We  create a new controlfile and do cancel based recovery.
    How does oracle suggest the next archive to apply when we do "recover database using backup controlfile until cancel;"
    I mean we created a new control file ..rt.
    where is the information about the archivelogs stored.
    Thanks,
    Silver

    In the controlfile.
    The "using backup controlfile" means using a backed up controlfile, and you want to fool Oracle into thinking a point in time recovery will happen so don't use what would be the controlfiles current scn time to automatically say the recovery is complete.  If you have created a new controlfile, all it can know about is where the logs should be and compare to what log sequences the datafile headers have.  So it uses the init.ora parameters and what the data file headers have in them to figure it out. http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:3151992035532#36651366990046
    If you backup controlfile to trace you can see log files that have the incarnation history.  See "Recovering Through a RESETLOGS with a Created Control File"  in Performing User-Managed Recovery: Advanced Scenarios

  • How does iPhoto organises the photos?

    Dear fellow Mac users,
    how are you! Tonight, my parents had a lot of fun taking photos of them using Photo Booth... awww. those love birds haha.. and i made a music slideshows for them. (too bad i dont know how to burn it into a VCD for them to watch on TV). I dont have a DVD RW.
    My question is
    1. How does Iphoto organises the photos? It seems like there are many dublicate copy of the same photo.... i am kind of confused. (There is .. Original Folder and Modified Folder) and worried that it will eat up my disk space
    2. Is it possible for me to burn a slide show VCD?
    Thank you soooo much!
    moses

    StanB:
    As PhillyPhan warned, you don't need to use the Finder to locate an image file for use outside iPhoto. You can either drag the thumbnail to the desktop to get a copy of it or use the File->Export->File Export menu route to export the file to the desktop. The second option allows you to resize it if desired. So there's no need to go rummaging around in the iPhoto Library folder to find a file.
    Do you Twango?

  • How does one get the Satellite to work in Google Maps ?

    How does one get the Satellite to work in google maps ?

    I am experiencing exactly the same issue - iMac, 10.6.8.  Thanks for reporting it - I thought I was going nuts.  What happens from here?  Does Apple watch these postings?  Do we just hope that they find the bug themselves?  Is there a vehicle for reporting bugs directly to Apple?
    Thanks in advance.

  • How does one increase the y-axis (amplitude) of the audio tracks?

    How does one increase the y-axis (amplitude) of the audio tracks? My patient appears to have flatlined. I don't want to increase the gain, just the way the waveform looks on my monitor.

    DrDtMM
    The "Expert view" is a part of the new interface of Premiere Elements 11. In your version 10, you have the Timeline and the Sceneline view choices.
    For now, I will assume that you are in the Timeline view where you utilize video and audio tracks and not a Filmstrip with scene slots.
    I suspect that you may be after the following. Let us see.
    To the right of where it shows the name "Audio 1" is a microphone icon. That represents the "Audio Display Style". There are two Audio Display Styles and you can select one or the other by toggling that microphone icon.
    a. In one instance, you will see the wave form plus a horizontal orange line which is typically the Volume Rubberband for Volume adjust. This Display Style has a light green background.
    and
    b. In the other case, you will see a dark horizontal line, no wave form. That dark line is on a light green background.
    I suspect you are at "b". Are you aware that "a" exists.
    If you want a really blown up version of "a" to look at, you could separate the audio from the video, double click the audio to open the Preview Windows, and then scale up the Preview Window.
    We will be watching for your follow up to see if we are getting in sync.
    Thanks.
    ATR

  • I have passed my iphone to my partner. How does she clear the phone and set up her own itunes account

    I have upgraded my iphone and have given it to my partner. How does she clear the phone and start from scratch with an itunes account. Thank you.

    ERASE / Clear All Data
    Go to Settings > General > Reset > Erase all content and settings
    Then Connect to iTunes on their computer.
    Syncing with iTunes
    From Here  >  http://www.apple.com/support/iphone/getstarted/

Maybe you are looking for

  • What is the 1/2" slit on the right front edge of the MacBook Pro?

    I recent bought a 15" Macbook Pro (2012 Model without the Retina Display). I love it, but I notice there is a little 1/2" slit on the right front edge of the laptop. Looking on the Tec Specs Page that lists all the ports and connections it is not lis

  • RRI Reports - Tables

    Hi all, I have a list of queries and Web templates. I want to know if there are any RRI Reports built on these queries. Is there any table from which I can fetch this information?? For e.g. I have one XYZ query. i need to find if there any RRI report

  • Inconsisten with the protected source The system cannot find the path specified (0x80070003)

    Hi, we are getting an error with the DPM server, the disk is on the same server, other disk have no issues The replica of Volume H:\ on backup.domain.eu is inconsistent with the protected data source. All protection activities for data source will fa

  • Restful Web Services - First Party Authentication with custom authentication schemes

    Hi I've successfully enabled security using first party authentication on our Restful web services however these only work with the built in Apex accounts and not other authentication schemes. Ideally I'd like to authenticate against LDAP, however wh

  • Adobe Web Services: KernelResourceBundle problem

    Env. WebAs 6.40 Java SP13 I have installed the Adobe Document Services. Then I have updated to SP13, all with no problems. But the Services do not start correctly, because of the error below. Since the License Trust Manager is not started, I do not g