Report with multiplying columns  and WITH clause

Hello
I saw sth strange in my report. I assume that it could happens very often.
I have report with few columns which two of them ar most complicated (many joins subqueries aggreagations on joined values etc.) These two columns (i.e C3,C4) should be multiplied (C3*C4).
When i do pure report without multiplying only columns C1,C2,C3,C4 everything is ok - duration about 15 sec. but... when I put next column on report which multiply these columns (in Answers C5=C3*C4)
I wait 3-4 minutes and my database hungs :(. After investigation I saw that in first case to databese goes pure "SELECT" statement it means:
"Select ... as C1, ... as C2, max(...) as C3, sum(xxx)... C4 from yyy,sss,ttt WHERE aaa"
but in second case BI uses WITH clause it means:
WITH SAWITH0 AS
( Select ... as C1, ... as C2, max(...) as C3, sum(xxx)... C4 from yyy,sss,ttt WHERE aaa )
SELECT SAWITH0.C1 as C1,
SAWITH0.C2 as C2,
     SAWITH0.C3 as C3,
     SAWITH0.C4 as C4,
     SAWITH0.C3*SAWITH0.C4 as C5 FROM SSS
and this statement is long runninq query and kills my database :(.
I checked that SQL like this:
Select ... as C1, ... as C2, max(...) as C3, sum(xxx)... C4, max(...)*sum(xxx)... As C5 from yyy,sss,ttt WHERE aaa" -
runs few times faster than that above
I know that I can do this multiply in business model layer but sometimes users can multiply(or other operations) on columns in reports without my knowledge and it kills my db :(. Where is bug? Why SQLs with WITH clause takes so much db time?
Thank you for each kind of help

WITH clause or Subquery Factoring allows the set of data to be reused multiple times within the SQL. Oracle will usually materialize the data into a temporary table (you will see it if you take an explain plan of the SQL).
I would be surprised if it was the actual WITH clause that was causing the performance issue, however you can test this by turning the WITH clause feature off. Go to the Physical model, right mouse click on your Database > Properties > Features Tab, scroll down to WITH_CLAUSE_SUPPORTED and switch it off.
I'd be interested to know if you do see actual improvement.
Good Luck.

Similar Messages

  • Dynamic gallery with 3 columns and 5 rows with paging

    guyz, i am new to spry and i need your help. i want to create
    a dynamic gallery with data source as xml. i want to create a
    gallery with 3 columns and 5 rows.Basically a wallpaper page where
    there would be 15 wallpapers in a page with a link of downloading
    wallpapers with resolution 800x600,1024x768 and 1280x1024.
    for example if there are 63 wallpapers for a section , then
    there would be 5 pages with 5th page having only 3 wallpapers.
    everytime a wallpaper is added to xml, it automatically adds
    it up in html...
    plz help....i really want to create this asap and i cant find
    any help...

    thanks a ton for your response.... Meanwhile i figured out
    the solution myself using photogallery tutorial where div fixes the
    width and the next repeated element get shifted to another
    line.....
    now i am struck with another problem.
    i need to give substring to a particular data on xml.
    for example i have the following xml
    <movies>
    <data>
    Important Note: These online forums are for user-to-user
    discussions of Adobe products, and are not an official customer
    support channel for Adobe. If you require direct assistance, or
    prefer to contact Adobe support staff directly, please contact
    Adobe support.
    </data>
    </movies>
    i want to display only first 50 characters of data tag.....
    whats the code/syntax to do so.....

  • I use "element 12" and want  like in the old PS version due Automating and Contact  II upload multiple filesand print them with any columns and rows on the same page . How does it work?

    I use "element 12" and want  like in the old PS version due Automating and Contact  II upload multiple filesand print them with any columns and rows on the same page . How does it work?

    Can you supply a link?

  • Suggestions for JSF table with sortale columns and Pagination

    Hi,
    My JSF application needs a table with sortable columns and also pagination.
    Thank you.

    Just add a bunch of commandlinks and/or commandbuttons at the right locations and invoke the appropriate logic in the backing bean.
    You can find some useful insights in this article: [http://balusc.blogspot.com/2006/06/using-datatables.html].

  • Hello, I have a "clé usb" with a imovie film in. I want to read it with my mac and with iMovie but it didn't work! Can you help me please

    hello, I have a "clé usb" with a imovie film in. I want to read it with my mac and with iMovie but it didn't work! Can you help me please

    Jeanne, you are going to have to give us some additional information: what kind of files are they, on what computer, using what application, were they made, how was the USB key formatted in the first place?
    Do the files not copy to your desktop?

  • If i bought iphone 5s from apple retail store on t mobile with free contract and with full price it will work with egypt's local carrier ????

    If i bought iphone 5s from apple retail store on t mobile with free contract and with full price it will work with egypt's local carrier ????

    Yes

  • My camera works with the photobooth and with skype but does not work with online applications such as "lolcam from facebook" or "faceonthehole" application. Please help

    My camera works with the photobooth and with skype but does not work with other applications like the "lolcam" from facebook or the " faceonthe hole" application. Can anyone help?

    There was a issue with school computers being used to spy on kids in their bedrooms, Mac's were involved.
    So Apple most likely tightened the API's to only select, trustworthy companies as not to abuse the web cam access priviledge.
    If you want to use a web cam with these other programs and services, you'll likely have to buy a third party USB one, so you can manually disconnect it.
    There isn't a way to physcially disconnect the built in web cam on Mac's without busting open the machine.

  • Is snow leopard compatible with microsoft office and with quicken 2007?

    Is snow leopard 10.6.3 compatible with Microsoft office and with quicken 2007.  I am about to upgrade to snow leopard and wanted to see if there are any problems with interfacing with non apple applications.  Any help is appreciated.

    Yes. Snow Leopard includes Rosetta, which will allow Office 2004 and Quicken 2007 to run. Office 2008 and 2011 are Intel native and will also run under SL.

  • ALV with dynamic columns and description labels in header titles

    Hi everybody,
    I have to implement an ALV whose columns are not defined until runtime. Is it possible to do that in some simple way? Is it necessary to use objects to define this kind of ALV's?
    And another one query, is it possible to add description labels to column headers so that when the user points with the cursor in them he/she gets a little explanation about the detail of the column (for example, description name of the product hierarchy when pointing to the column named with one of the existing hierarchies, i.e 010102102)
    Thanks in advance,

    for your first question check this
    Just check this sample from one of the SAP site
    ABAP Code Sample for Dynamic Table for ALV with Cell Coloring
    Applies To:
    ABAP / ALV Grid
    Article Summary
    ABAP Code Sample that uses dynamic programming techniques to build a dynamic internal table for display in an ALV Grid with Cell Coloring.
    Code Sample
    REPORT zcdf_dynamic_table.
    * Dynamic ALV Grid with Cell Coloring.
    * Build a field catalog dynamically and provide the ability to color
    * the cells.
    * To test, copy this code to any program name and create screen 100
    * as described in the comments. After the screen is displayed, hit
    * enter to exit the screen.
    * Tested in 4.6C and 6.20
    * Charles Folwell - [email protected] - Feb 2, 2005
    DATA:
    r_dyn_table TYPE REF TO data,
    r_wa_dyn_table TYPE REF TO data,
    r_dock_ctnr TYPE REF TO cl_gui_docking_container,
    r_alv_grid TYPE REF TO cl_gui_alv_grid,
    t_fieldcat1 TYPE lvc_t_fcat, "with cell color
    t_fieldcat2 TYPE lvc_t_fcat, "without cell color
    wa_fieldcat LIKE LINE OF t_fieldcat1,
    wa_cellcolors TYPE LINE OF lvc_t_scol,
    wa_is_layout TYPE lvc_s_layo.
    FIELD-SYMBOLS:
    <t_dyn_table> TYPE STANDARD TABLE,
    <wa_dyn_table> TYPE ANY,
    <t_cellcolors> TYPE lvc_t_scol,
    <w_field> TYPE ANY.
    START-OF-SELECTION.
    * Build field catalog based on your criteria.
    wa_fieldcat-fieldname = 'FIELD1'.
    wa_fieldcat-inttype = 'C'.
    wa_fieldcat-outputlen = '10'.
    wa_fieldcat-coltext = 'My Field 1'.
    wa_fieldcat-seltext = wa_fieldcat-coltext.
    APPEND wa_fieldcat TO t_fieldcat1.
    wa_fieldcat-fieldname = 'FIELD2'.
    wa_fieldcat-inttype = 'C'.
    wa_fieldcat-outputlen = '10'.
    wa_fieldcat-coltext = 'My Field 2'.
    wa_fieldcat-seltext = wa_fieldcat-coltext.
    APPEND wa_fieldcat TO t_fieldcat1.
    * Before adding cell color table, save fieldcatalog to pass
    * to ALV call. The ALV call needs a fieldcatalog without
    * the internal table for cell coloring.
    t_fieldcat2[] = t_fieldcat1[].
    * Add cell color table.
    * CALENDAR_TYPE is a structure in the dictionary with a
    * field called COLTAB of type LVC_T_SCOL. You can use
    * any structure and field that has the type LVC_T_SCOL.
    wa_fieldcat-fieldname = 'T_CELLCOLORS'.
    wa_fieldcat-ref_field = 'COLTAB'.
    wa_fieldcat-ref_table = 'CALENDAR_TYPE'.
    APPEND wa_fieldcat TO t_fieldcat1.
    * Create dynamic table including the internal table
    * for cell coloring.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = t_fieldcat1
    IMPORTING
    ep_table = r_dyn_table
    EXCEPTIONS
    generate_subpool_dir_full = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    * Get access to new table using field symbol.
    ASSIGN r_dyn_table->* TO <t_dyn_table>.
    * Create work area for new table.
    CREATE DATA r_wa_dyn_table LIKE LINE OF <t_dyn_table>.
    * Get access to new work area using field symbol.
    ASSIGN r_wa_dyn_table->* TO <wa_dyn_table>.
    * Get data into table from somewhere. Field names are
    * known at this point because field catalog is already
    * built. Read field names from the field catalog or use
    * COMPONENT <number> in a DO loop to access the fields. A
    * simpler hard coded approach is used here.
    ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'ABC'.
    ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'XYZ'.
    APPEND <wa_dyn_table> TO <t_dyn_table>.
    ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'TUV'.
    ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'DEF'.
    APPEND <wa_dyn_table> TO <t_dyn_table>.
    * Color cells based on your criteria. In this example, a test on
    * FIELD2 is used to decide on color.
    LOOP AT <t_dyn_table> INTO <wa_dyn_table>.
    ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    * Get access to internal table used to color cells.
    ASSIGN COMPONENT 'T_CELLCOLORS'
    OF STRUCTURE <wa_dyn_table> TO <t_cellcolors>.
    CLEAR wa_cellcolors.
    wa_cellcolors-fname = 'FIELD2'.
    IF <w_field> = 'DEF'.
    wa_cellcolors-color-col = '7'.
    ELSE.
    wa_cellcolors-color-col = '5'.
    ENDIF.
    APPEND wa_cellcolors TO <t_cellcolors>.
    MODIFY <t_dyn_table> FROM <wa_dyn_table>.
    ENDLOOP.
    * Display screen. Define screen 100 as empty, with next screen
    * set to 0 and flow logic of:
    * PROCESS BEFORE OUTPUT.
    * MODULE initialization.
    * PROCESS AFTER INPUT.
    CALL SCREEN 100.
    * MODULE initialization OUTPUT
    MODULE initialization OUTPUT.
    * Set up for ALV display.
    IF r_dock_ctnr IS INITIAL.
    CREATE OBJECT r_dock_ctnr
    EXPORTING
    side = cl_gui_docking_container=>dock_at_left
    ratio = '90'.
    CREATE OBJECT r_alv_grid
    EXPORTING i_parent = r_dock_ctnr.
    * Set ALV controls for cell coloring table.
    wa_is_layout-ctab_fname = 'T_CELLCOLORS'.
    * Display.
    CALL METHOD r_alv_grid->set_table_for_first_display
    EXPORTING
    is_layout = wa_is_layout
    CHANGING
    it_outtab = <t_dyn_table>
    it_fieldcatalog = t_fieldcat2.
    ELSE. "grid already prepared
    * Refresh display.
    CALL METHOD r_alv_grid->refresh_table_display
    EXPORTING
    i_soft_refresh = ' '
    EXCEPTIONS
    finished = 1
    OTHERS = 2.
    ENDIF.
    ENDMODULE. " initialization OUTPUT

  • Advanced datagrid with grouped columns and grouped rows

    hello every body, plz need your experience help. 'cause Im so new using FLEX
    I have an XML (like an XML data type) something like this
    <Table>
      <Rows>
        <cAgencia>F0002</cAgencia>
        <cAgNombre>SanBorja</cAgNombre>
        <cTVentanilla>V0002</cTVentanilla>
        <dTVNombre>Plataforma</dTVNombre>
        <TcksEnEspera>20</TcksEnEspera>
        <VentsEnAtencion>50</VentsEnAtencion>
      </Rows>
      <Rows>
         <cAgencia>F0003</cAgencia>
         <cAgNombre>Miraflores</cAgNombre>
         <cTVentanilla>V0002</cTVentanilla>
         <dTVNombre>Plataforma</dTVNombre>
         <TcksEnEspera>30</TcksEnEspera>
         <VentsEnAtencion>40</VentsEnAtencion>
       </Rows>
      <Rows>
         <cAgencia>F0002</cAgencia>
         <cAgNombre>SanBorja</cAgNombre>
         <cTVentanilla>V0003</cTVentanilla>
         <dTVNombre>Caja</dTVNombre>
         <TcksEnEspera>55</TcksEnEspera>
         <VentsEnAtencion>25</VentsEnAtencion>
       </Rows>
       ...... (continue)
    </Table>
    so, I need to make a table (I guess with advancedDataGrid) something like this
    as you can see,   I have to group them by columns and Rows.  I have found a "mx:groupedColumns" that maybe could help me , but I couldn't find something like "mx:groupedRows".
    The grid may be dynamic,   for example if I have another XML node like:
      <Rows>
         <cAgencia>F0004</cAgencia>
         <cAgNombre>SanMiguel</cAgNombre>
         <cTVentanilla>V0002</cTVentanilla>
         <dTVNombre>Plataforma</dTVNombre>
         <TcksEnEspera>15</TcksEnEspera>
         <VentsEnAtencion>52</VentsEnAtencion>
       </Rows>
    the grid may add a ROW and in the column of plataforma add the data: 15 and 52, so the grid may be something like this:
    as you can see, the grid may add rows and columns in depends of the count of XML data.
    plz help.
    thanks, regards  from Lima, Peru.
    JS

    any help ????????? I found OLAPDataGrid .....   I was thinking to send all the data into a bidimensional Array , then pass the data of my bidimensionalArray to  OLAPDataGrid ...  but I'n not sure if Flex is able to do it  .... 
    the really serious problem is the special ROW I must use ...
    regards
    JS

  • Data Grid - issues resizing width of columns and with data refresh and sort

    SQLDeveloper 1215 on Windows XP professional
    Database : various 9.2
    In the table data tab there are a few minor issues our developers have highlighted.
    1) There seems to be a minimum column width in the data display. This restricts flexibility in reviewing the data, esp. where the data length is less than the minimum column width.
    2) If a column is resized or the column order is changed and a refresh or a new filter is applied then the columns are restored to their original position and size making it frustrating to run more than one query via the GUI.
    3) There is no quick sort option by clicking on the column heading which would be useful.

    I am still seeing this minimum column width in SQL Developer production (v1467) and I haven't seen any other posts relating to this. I have seen this all of the grids that I have looked at, including all of the grid based sub-tabs for the Object tabs (ie Columns, Data, Indexes, Constraints, etc) and the SQL Worksheet results tab.
    It is very obvious with the Column Name and Data Type columns of the Table Columns tab - the Column Name column can be shrunk to truncate values but the Data Type column can only be shrunk to about the twice the width of the widest value.
    Can anyone in development provide any comments about why we have this minimum width and how the minimum width is actually calculated?

  • Spatial index on table with object-column (and inheritance)

    Hi!
    Is it possible to create a spatial index on a table with an object-column (and inheritance) like this:
    CREATE OR REPLACE TYPE feature_type AS OBJECT (
    shape MDSYS.SDO_GEOMETRY
    ) NOT FINAL;
    CREATE OR REPLACE TYPE building_type UNDER feature_type (
    name VARCHAR2(50)
    CREATE TABLE features ( no NUMBER PRIMARY KEY, feature feature_type);
    [...] user_sdo_geom_metadata [...]
    Then
    CREATE INDEX features_idx ON features(feature.shape) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    throws:
    ORA-01418: specified index does not exist
    Curious! :)
    If I define feature_type with "NOT FINAL" option but without subtypes, I get (create index):
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01460: unimplemented or unreasonable conversion requested
    So I think besides object tables also inheritance isn't supported whith oracle spatial!?
    Thanks,
    Michael
    ps:
    We use Oracle9i Enterprise Edition Release 9.0.1.4.0 / Linux.
    Solves Oracle9i 9.2 this problems?

    Hi
    You'll need to be on 9.2 to do this....
    Dom

  • Web Service to Query with 21 Columns and up to 1000 Rows

    Hi Experts,
    I have a web service to a query that returns a table of 21 Columns and up to 1000 Rows.
    I would like to display this data in an UI element such List view / Spreadsheet table.
    When I am doing so, I have the following issues:
    1. With the Spreadsheet table I can't set the header of the columns to the name of the column in the query.
    2. with both elements I would like to have a paging capability which I am not sure if is even possible.
    3. With both elements I am not able to set the width of each column as I need, and also not able to define the correct formating (date / string....)
    Is it possible to have what I am looking for with these elements? Or there are other UI elements for it?
    Thanks in advanced,
    DoronS

    Hi Charles,
    Actually, I am using Xcelsius as you said, and wanted to use it also as I mentioned since in the Web Intelligence I could not find the way to have a good filtering mechanism.
    Meaning, there is an option to add filters based on the fields that are in the query. But you can only choose one value per filter filed. If I want filter the data with more than one value it is impossible. Furthermore, there is no way to use free text filtering.
    Do you know in what BO Tool I will be able to provide such filtering capabilities?
    DoronS

  • Display only one row for distinct columns and with multiple rows their valu

    Hi,
    I have a table having some similar rows for some columns and multiple different rows for some other columns
    i.e
    o_mobile_no o_doc_date o_status d_mobile_no d_doc_date d_status
    9825000111 01-jan-06 'a' 980515464 01-feb-06 c
    9825000111 01-jan-06 'a' 991543154 02-feb-06 d
    9825000111 01-jan-06 'a' 154845545 10-mar-06 a
    What i want is to display only one row for above distinct row along with multiple non distinct colums
    ie
    o_mobile_no o_doc_date o_status d_mobile_no d_doc_date d_status
    9825000111 01-jan-06 'a' 980515464 01-feb-06 c
    991543154 02-feb-06 d
    154845545 10-mar-06 a
    regards,
    Kumar

    Re: SQL Help

  • Need help with af:column and skinning

    Hallo,
    ADF Faces and skinning is in general a great opportunity to get projects done - thx for this.
    - I use a af:table with af:column with sortable="true".
    - This works great, but the customer want's to have the icon for sorting to the left side of the label.
    - I have created my own skin for this and can change the sorting icon, but I cannot place it to the left side of the label:
    af|column::sort-ascend-icon {
    content:url(/skins/espa/sort_ab_h.gif);
    Has anyone done this? Is this possible?
    Thx, Willi

    Looking at the source gives a clear picture - it can't be done.
    Now I am switching over to less comples jsf components and additional implementations.
    Thx, Willi

Maybe you are looking for

  • Voice Memo will not export into iTunes

    I am currently using an iPhone 3GS and I have a 2008 MacBook running Lion with the latest version of iTunes 10.4.1. For some reason, I cannot get voice memos to import into iTunes. I don't know if length of memos has anything to do with this or not,

  • Fresh install of Yosemite, nearly unusable, constant spinning wheel

    Hello everyone, MacBook Pro 13'', mid 2012 750GB HD 8GB Ram 2.9GHz dual-core Intel i7 A little background... once a year I usually back up my entire Macbook Pro, wipe it clean and install a fresh version of the most recent OS. I did this about a mont

  • Cant access my photos and videos on N95

    After I installed the latest software update for N95 my cellphone started to act weird. First: everytime I try to access the "gallery" it freeze the cellphone so I cant see my photos and video. Thats VERY annoying and my battery metter can be fully c

  • Purchase order number addition to Delivery

    what is the process of adding the purchase order to a return delivery. Plz let me know. Thanks. Edited by: raghav nba on Nov 25, 2008 9:40 PM

  • Top posting in Mail

    Is there some way to inhibit top posting when composing a message in Mail (Leopard)? Top posting places your reply text above the quoted text, which means you have to scroll to the bottom and read up to follow a thread of the messages being quoted. T