Apex slow report but not in dev?

Hello world

as the title says I have a problem with the speed of my reports (I.R.).
The scenario is this: I report with a filter at the front which is not rendered until at least one of 6 possible values is defined. The statement underlying the report is large enough (about 8 tables with millions of rows, but each of them is indexed nicely) so a filter is necessary. The preparation of the declaration, that everything worked perfectly, since each of the given values is a single point of entry in the data model and access roads resulting for the optimizer were always "unique index scan" or "range of index scans.
Now the problem is that I don't have many of the 6 values the user will now use. That's why I had to make every filter criteria in the statement as follows:

WHERE (customer_id =: P1_CUSTOMER_ID or: P1_CUSTOMER_ID IS NULL)
AND (= client_name: P1_CUSTOMER_NAME or: P1_CUSTOMER_NAME IS NULL)
and so on...

My problem is that when the value is giving the execution plan result is obviously horrible. But given that the report is not rendered unless there is at least a set of values, this isn't the problem right?

Unfortunately, Apex doesn't seem to work that way, as it always uses the execution plan that has no values listed. As revealed a SQL Trace.
Unfortunately, I can work only with limited hints (first_rows and others), since forcing him an index does not work.

Any of you guys have an idea, how can I solve this problem?

Published by: docdir on January 29, 2010 06:15

Docdir wrote:
Hey everybody,

Thanks for your interest. As I already mentioned the query itself is not the issue because it works very well in sqlplus and produces a brilliant execution plan when a value is provided. Here it is:
...
and (buis_type.id =: P10_BUISNESS_TYPE or: P10_BUISNESS_TYPE is NULL)
and (buis.id =: P10_BUISNESS_ID or: P10_BUISNESS_ID is NULL)
and (as buis_lo.title: P10_TITLE or: P10_TITLE is NULL)
and (as buis_lo.versiontitle: P10_VERSION_TITLE or: P10_VERSION_TITLE is NULL)
and (as buis_lo.displaytitle: P10_DISPLAY_title or: P10_DISPLAY_title is NULL)
and (buis_lo.locale_id =: P10_LOCALE_ID or: P10_LOCALE_ID is NULL)
and (CUSTOMER.id =: P10_CUSTOMER_ID or: P10_CUSTOMER_ID is NULL)
and (customer.name to the client as: P10_CUSTOMER_NAME or: P10_CUSTOMER_NAME is NULL)
and (lic. CONTENTCATEGORY_ID =: P10_CONTENTCATEGORY_ID OR: P10_CONTENTCATEGORY_ID is NULL)

I seriously doubt that you will get the execution plan in SQL Plus. If you add values then this is a diferent request. You must use liaison even variables in sqlplus to compare the execution plan. How have you seen the execution plan in sql * more?

The problem is not to do much with APEX. For the first part, it's just a pure sql problem.
However. You could create DIFFERENT reports with different behind sql queries or regions. According to the chosen input values, you can decide what region/query will be executed.

Example not tested

/* region one:  INPUT = customername */
...
and (buis_type.id =  :P10_BUISNESS_TYPE OR :P10_BUISNESS_TYPE is NULL)
and (buis.id = :P10_BUISNESS_ID OR  :P10_BUISNESS_ID is NULL)
and (buis_lo.title like :P10_TITLE OR :P10_TITLE is NULL)
and (buis_lo.versiontitle like :P10_VERSION_TITLE OR :P10_VERSION_TITLE is NULL)
and (buis_lo.displaytitle like :P10_DISPLAY_title OR :P10_DISPLAY_title is NULL)
and (buis_lo.locale_id = :P10_LOCALE_ID OR :P10_LOCALE_ID is NULL)
and (CUSTOMER.id = :P10_CUSTOMER_ID OR :P10_CUSTOMER_ID is NULL)
and CUSTOMER.name like :P10_CUSTOMER_NAME
and (lic.CONTENTCATEGORY_ID = :P10_CONTENTCATEGORY_ID OR :P10_CONTENTCATEGORY_ID is NULL) 

/* region two: INPUT = Business ID choosen */
...
and (buis_type.id =  :P10_BUISNESS_TYPE OR :P10_BUISNESS_TYPE is NULL)
and buis.id = :P10_BUISNESS_ID
and (buis_lo.title like :P10_TITLE OR :P10_TITLE is NULL)
and (buis_lo.versiontitle like :P10_VERSION_TITLE OR :P10_VERSION_TITLE is NULL)
and (buis_lo.displaytitle like :P10_DISPLAY_title OR :P10_DISPLAY_title is NULL)
and (buis_lo.locale_id = :P10_LOCALE_ID OR :P10_LOCALE_ID is NULL)
and (CUSTOMER.id = :P10_CUSTOMER_ID OR :P10_CUSTOMER_ID is NULL)
and (CUSTOMER.name like :P10_CUSTOMER_NAME OR :P10_CUSTOMER_NAME is NULL)
and (lic.CONTENTCATEGORY_ID = :P10_CONTENTCATEGORY_ID OR :P10_CONTENTCATEGORY_ID is NULL) 

You can also use different hint in the select statement to force the optimizer to choose a special map, you prefer. But that shouldn't be necessary.

This is only of a poor workaround, but it might be useful.

BTW: decode is able to compare NULL values. But point you might not equal to NULL.

Published by: Sven w. February 1, 2010 16:44

Tags: Database

Similar Questions

  • CPU 50% + when the computer is basically idle__Computer very slow today, but not yesterday

    Today, my computer is very slow and jerky. In the Task Manager, CPU is always at 50% or more when none of the tasks are running. I don't know why this just happened out of nowhere, but I don't know what to do.

    I noticed things:

    In the Task Manager, showing processes from all users, are the two things that use CPU: idle process of the system (under the name of user, SYSTEM) and ((sous le nom d'utilisateur, SYSTÈME) system (as the description says NT kernel & system).)

    Both use upward around 48-50 CPU when running nothing, while the System Idle Process CPU decreases dramatically every time I click on something.

    If anyone can help understand me why Vista is upward today, I would be very happy!

    Wow, I have fixed the problem before you posted right! What a coincidence! I was disappointed that it took me hours of tree to find out how to solve this problem, it turns out that all I had to do was restart my computer. After restarting, "Sysem" was 3% of CPU. Now everything is running back to normal. I'll still try and discover what it is and why it can swell into a giant monster of CPU consumption.

    Thanks for your help!

  • ADDM report is not produced by SQL DEV if connected 4.0 user is not SYSDBA privilege

    Hello-

    SQLDEV 4.0 (early adapter), I logged in as a user with SYSDBA privileges. But ADVICE given and run DBMS_ADDM granted and "select any dictionary" granted, etc..

    Then I go in the menu view-> DBA--> Performance-> automatic database diagnostic monitor

    Select report ADDM in the choices available.

    Off the menu 3 options: summary, results and report ADDM, I can see the first two, but I get a grey screen for report ADDM.

    ^^^^^^^^^^^^^^^^^^^^^

    If I do exactly the same thing but connection as SYSDBA, ADDM report can be produced and can be seen. So, the question is the lack of subsidies and privileges.

    ^^^^^^^^^^^^^^^^^^^^^^

    The goal we are pursuing in our shop is to give developers to work with reports of the ADDM by connect non-SYSDBA user.

    ^^^^^^^^^^^^^^^^^^^^^^^^

    Please tell us what privilege must be granted to get this working for a non-SYSDBA connection

    The same user can successfully run $ORACLE_HOME/rdbms/admin/addmrpt.sql and produce files with ADDM full report. But not able to get the ADDM of SQL DEV 4.0

    Thank you

    VR

    Hi RV,.

    The security model for the DBMS_ADVISOR package means that a database user can only generate reports for ADDM tasks created by this user. To create a task SQLDev ADDM, invoke the action "Performance / automatic database Diagnostic monitor-> run ADDM. Once this is done, you should be able to generate and view report 'ADDM' for the new task.

    In order to accomplish the above, you should probably add the following privileges to your user name: -.

    Executer run on dbms_workload_repository, Advisor, select any dictionary and select_catalog_role

    I hope this helps.

    Best regards

    Phil Richens.

    SQLDev development team.

  • In cascade LOVs (APEX 4.1) problem, using in the report does not define values

    Hello

    I use APEX 4.1.0.00.32 and I have a simple report as

    SQL :*

    SELECT * in the region
    Region WHERE the like '% "| P3_REGION | » %'
    and country like "%" | P3_COUNTRY | » %'
    and the city like '% "| P3_CITY | » %'

    Elements:*.

    P3_REGION:
    Select a separate region as d, r of the region of the region

    Display the Null value: YES
    Value null, display value: - Select -
    Return value of NULL: + 0 +.

    P3_COUNTRY:
    Select distinct country as d, r of the region of the country where region =: P3_REGION

    Display the Null value: YES
    Value null, display value: - Select -
    Return value of NULL: + 0 +.
    Cascading LOV Parent article (s): P3_REGION

    P3_CITY:
    + select distinct city, city as the region r, whose country =: P3_COUNTRY

    Display the Null value: YES
    Value null, display value: - Select -
    Return value of NULL: + 0 +.
    Cascading LOV Parent article (s): P3_COUNTRY


    The LOVs work very well and the correct values are displayed if cascade through them

    So, I want to the last step to filter the report with the values that were selected in the lovs. And that I does not.
    I tried to add a button with the SUBMISSION of the page. After choosing values in all the LOVs and by clicking on the button SUBMIT page supports, alle LOVs are disabled (with value - select-) and the report shows all lines.
    I tried to change the "redirecting to Page 3" button and setting the values P3_REGION, P3_COUNTRY, P3_CITY P3_REGION., P3_COUNTRY. & P3_CITY. but without success.
    I tried to use the 'Page Action time value' parameter to 'Validate' or 'redirect and set' for all the element LOVs or only the last element LOV, but then the cascade of the LOVs is not working properly and the report does not change.

    I am confused as I Don t know what I can do so far. I think this should be a condition easy limit/filter the report with the values in the LOVs.
    In addition, it should be possible to choose only the LOV region and then limit the report with this region (not select country and city)

    Thanks in advance!

    I had a problem similar to a previous version, fixed when I updated element Source value or Expression (the section of the Source) to himself.

    I mean:
    for the P3_REGION, defined as & P3_REGION element.
    for the P3_COUNTRY, defined as & P3_COUNTRY element.
    for the P3_CITY, defined as & P3_CITY element.

    It will be useful.

  • whenever I touched icon it will not start and sent the report but heard nothing back

    Since yesterday, when I click on the firefox icon that it does not start, it shows the screen of crash reporter and said that he will attempt to restart, but when I type restarts, it crashes again. When I hit exit firefox sends report but ive heard nothing back. not sure if I need to download the new copy or wait for the response.

    You can check if you can start Firefox in Safe Mode by holding down the shift/Options key.

    Try to start Firefox with the subject: blank page by creating a copy of the current Office Firefox shortcut and add a space and -url "about: Virgin" in the target field.

  • I use trusteer for Bank report but it will not support the beta version firefox o 9, suggestions?

    I use trusteer for banking report, but it will not support the beta version of firefox 9, suggestions

    Trusteer informed me that a new version of their report software that is compatible with Firefox 9 is available at http://download.trusteer.com/Gcur4Wtnu/RapportSetup.exe

  • Windows family safety reports the pc business but not the web activity

    Windows 7 home premiun. Installed Windows family safety.  PC activity but not the web activity reports.  www.youtube.com but still stuck playing on the PC.

    I have two desktop and they have three accounts.  My title of administrator and two children as standard users.

    Hi rlsegura,

    We need to check the version and compilation of parental control that you are currently using on the computer where the user account from the child. In addition, please provide us with a screenshot of the "Reporting PC activity" but not the web activity. Follow the steps in this article to get a screenshot. You can download the photo/s in the private message that I have provided. It would also help if you can provide the exact scenario when you mentioned 'blocked but still playing on the PC.

    Thank you
    Gerard G.

  • Cluster based popup works in Dev but not as Exe

    Hi all

    I use an old tool TS Popup box to allow the user to enter data in a multicolumn listbox: https://lavag.org/topic/10282-cr-type-sensitive-popup/

    Consist of an invisible cluster containing different types of control which monitors for events click on multicolumn listbox.

    Work in the environment of dev but no exe.  Click in the cell works, but not when you click.

    How something like this work in dev and no exe?

    Déjà vu?

    If you look at the thread of LAVA that you linked, ask you the same question it and I answered it say that there are screws that must be explicitly included in the EXE file. I guess if you search the forums OR thread mentioned there that you will find more details.

  • Download wireless, but not slow upload on desktop PC with built-in 802.11n Wireless LAN Card Ralink

    Download but not upload slow Wi - Fi on desktop PC with built-in 802.11n Wireless LAN Card Ralink.

    I use a desktop computer HP Elite with Windows 7.

    Hello

    ·         If it works much earlier?

    ·         Did you make any changes before the show?

    Method 1: Follow the instructions in the link and check if this can help to determine the coefficient of slow internet:

    http://Windows.Microsoft.com/en-us/Windows7/why-is-my-Internet-connection-so-slow

    Method 2: I suggest that you update the wireless network card driver and check if that helps:

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly

    Visit the link below which deals with the same issue and check if that helps.

    http://h30434.www3.HP.com/T5/TouchSmart-PC/RALink-802-11n-wireless-LAN-card/TD-p/32290

    You can also contact the manufacturer for assistance:

    http://h30434.www3.HP.com/

  • Printerwill not print elements in Quebec printing copy elements. Will display the wireless test report, but I use USB connection

    (HP 4580) does not print what items.  It will be printed "(scan and copy) and wireless test report, but I we USB connection to"

    My Compaq Presario CQ 60-41OUS Notebook PC.  Just reinstalled the printer pogram/driver.  He hhas worked OK for 2 years.

    Al to * address email is removed from the privacy *

    And the answer to your message of 15 does not solve the problem?

  • ORA-20987: APEX - interactive report region does not exist in the application

    ORA-20987: APEX - interactive report region does not exist in the application

    I'm trying to get the query of an international registration (interactive report) on a specific page in my application.

    The code I am using is thesi:

    create or replace function get_report_query (nPage_id number)

    return varchar2

    as

    l_report apex_ir.t_report;

    l_query varchar2 (32767).

    l_list varchar2 (32767).

    number of nRegion_id;

    number of nIR_id;

    OWA.vc_arr nm;

    VL owa.vc_arr;

    BEGIN

    SELECT region_id

    IN nRegion_id

    Of apex_application_page_regions

    WHERE application_name = "E-BRIL.

    AND page_id = nPage_id

    AND source_type = "interactive report";

    nIR_id: =.

    apex_ir.get_last_viewed_report_id (p_page_id = > nPage_id,)

    p_region_id = > nRegion_id);

    NM (1): = "DUMMY_JUST_TO_SET_UP_OWA_UTIL";

    VL (1): = 'WHATEVER ';

    OWA.init_cgi_env (nm.count, nm, vl);

    l_report: = APEX_IR. () GET_REPORT

    p_page_id = > nPage_id,

    p_region_id = > nRegion_id,

    p_report_id = > 0);

    l_query: = l_report.sql_query;

    because me in 1.l_report.binds.count

    loop

    l_list: = l_list | i||'. '|| l_report. Binds (i) .name | » ='|| l_report. Binds (i) .value;

    end loop;

    Return l_query;

    end;

    /

    I want to get the query of the IR on my page 3. And I run;

    get_report_query (3)

    That's what I get:

    ORA-20987: APEX - interactive report region does not exist in application, page 3 and 1278226325207011749 region. -Contact your administrator of the application.

    ORA-06512: at "APEX_040200.WWV_FLOW_ERROR", line 630

    ORA-06512: at "APEX_040200.WWV_FLOW_ERROR", line 911

    ORA-06512: at "APEX_040200.WWV_FLOW_WORKSHEET_UTIL", line 33

    ORA-06512: at "APEX_040200.WWV_FLOW_WORKSHEET_UTIL", line 55

    ORA-06512: at "EBR_OWNER. GET_REPORT_QUERY', line 19

    The regio_id seems ok, because when I ask this region_id of apex_application_page_regions, id 1278226325207011749 is returned.

    Page 3 is also correct.

    I tried to follow Denes Kubicek his blog (Denes Kubicek ApEx BLOG: interactive report query is).

    What I'm doing wrong here?

    We use the Apex 4.2.

    Thanks in advance.

    Reg,

    Chris

    1717220 wrote:

    Please update your forum profile with a recognizable username instead of "1717220": Video tutorial how to change username available

    ORA-20987: APEX - interactive report region does not exist in the application

    I'm trying to get the query of an international registration (interactive report) on a specific page in my application.

    The code I am using is thesi:

    create or replace function get_report_query(nPage_id IN number)
    return varchar2
    as
    l_report  apex_ir.t_report;
    l_query  varchar2(32767);
    l_list  varchar2(32767);
    nRegion_id number;
    nIR_id number;
    nm  owa.vc_arr;
    vl  owa.vc_arr;
    BEGIN 
    
        SELECT region_id
        INTO nRegion_id
        FROM apex_application_page_regions
        WHERE application_name = 'E-BRIL'
          AND page_id = nPage_id
          AND source_type = 'Interactive Report';
    
        nIR_id :=
          apex_ir.get_last_viewed_report_id (p_page_id        => nPage_id,
                                            p_region_id      => nRegion_id);
    
        nm(1) := 'DUMMY_JUST_TO_SET_UP_OWA_UTIL';
        vl(1) := 'WHATEVER';
        owa.init_cgi_env( nm.count, nm, vl );
    
        l_report := APEX_IR.GET_REPORT (
                        p_page_id  => nPage_id,
                        p_region_id => nRegion_id,
                        p_report_id => 0); 
    
        l_query := l_report.sql_query;
        for i in 1..l_report.binds.count
        loop
            l_list := l_list||i||'. '||l_report.binds(i).name||'='||l_report.binds(i).value;
        end loop;
    
    return l_query;
    end;
    

    I want to get the query of the IR on my page 3. And I run;

    get_report_query (3)

    That's what I get:

    ORA-20987: APEX - interactive report region does not exist in application, page 3 and 1278226325207011749 region. -Contact your administrator of the application.

    ORA-06512: at "APEX_040200.WWV_FLOW_ERROR", line 630

    ORA-06512: at "APEX_040200.WWV_FLOW_ERROR", line 911

    ORA-06512: at "APEX_040200.WWV_FLOW_WORKSHEET_UTIL", line 33

    ORA-06512: at "APEX_040200.WWV_FLOW_WORKSHEET_UTIL", line 55

    ORA-06512: at "EBR_OWNER. GET_REPORT_QUERY', line 19

    The regio_id seems ok, because when I ask this region_id of apex_application_page_regions, id 1278226325207011749 is returned.

    Page 3 is also correct.

    I tried to follow Denes Kubicek his blog (Denes Kubicek ApEx BLOG: interactive report query is).

    What I'm doing wrong here?

    We use the Apex 4.2.

    The '0' in line 31 should be "nIR_id".

    What is the purpose of the lines 24-26?

  • Hello... just asked this, but not sure it sent... new laptop, no cd/dvd player, need to install my design cs6... standard have code # and product series, but the only download link, I found was a bit slow (14 days and count - up - when it expired,)

    Hello... just asked this, but not sure it sent... new laptop, no cd/dvd player, need to install my design cs6... standard have code # and product series, but the only download link, I found was a bit slow (14 days and count - up - when it expired, haha)... hoping someone can help, please and thank you

    You can try with below steps if you want:

    Folder Temp light 1).

    (2) close all running Applications.

    (3) close webistes all opened browser.

    (4)disable the firewall temporarily.

    (5) open only Adobe Web site as it is safe and secure site free of all kind of threats.

    (6) then try to download CS 6 Design Standard and check.

    Note: Though the firewall is disabled. do not open applications, files or even other Web sites.

    Or if you think it is still very slow and would not turn off the firewall , you can try with 3' rd party like download managers: IInternet Download Manager , which is more efficient than the browser built in downloader.

  • Column classic report - export - not visable (APEX 4.1)

    I have a problem with export to excel classic report file.

    I can't do a single column to export, only that one does not work, all the other columns in the report are exported.

    In the column definition value include in exports is set to Yes.

    SQL query is defined as pl/slq body return the sql query.

    It's report

    http://www.deviantpics.com/images/2013/08/14/report.jpg

    It comes to excell

    http://www.deviantpics.com/images/2013/08/14/Excel.jpg

    No, there is no condition on the column, I have reproduced report on the same page with the same set upward and it works on this report.

    I was not able to understand why it does not work on trees report so I recreated all the columns in this report and now it works.

    In addition, there is problem when I get to this site, I can not export the values. I see values in the report, but when I export them in they are not excel file.

    I solved that with refresing region and submit all items that I use in this query, then all values are excellent file.

  • The data are stored in the DB for the Jdeveloper test, but not in the dev environment

    The data are stored in the DB for the Jdeveloper test, but not in the dev environment

    Hi all,

    IM new with OFA and Im working with Jdeveloper, I create a form to store information using a VO and EO and add information to the current line using the attribute set of function, I noticed that when I lunch the update in the jdevelopher data is OK in the comic book, but when I install the development in the DEV environment the data stored using java code does not the table, only data that are related by the object as text fields and others.

    This is the code that I use for SAP data, it works in jd, but not in the dev environment

    {} public void saveData (String responsabilidadID)
    int respId = Integer.parseInt (responsabilidadID);
    OAViewObject vo = (OAViewObject) getQuiebresComercialesVO1 ();

    vo.getCurrentRow () .setAttribute ("ResponsabilidadId", respId);

    getTransaction () .commit ();
    }

    Any there who encounter this type of problem, something I can check?

    Thank you all.

    Just check if you bounced the server after you deploy the code. Objects Java would not reflect the changes, unless the instance is bounced.

  • I can see my Seagate backup more player in the utility disk and report system, but not in the Finder. Can someone please?

    I have a Mac Book Pro (mid-2012) which ran OS 10.9 Mavericks, which I upgraded to El Captain a few days ago. My Seagate external backup more BK 1 TB hard drive was working fine (reading, writing, all things were very good) with the Mavericks. After upgrade, he once showed in the Finder and after a reboot, it stopped in the Finder. I can see utility disk and the system of report but cannot do much from here, as you can see at the bottom of screen captures.

    Backup external drive more BK is formatted in NTFS and I NTFS for Mac OS X driver/application on Mac. When I plug the same backup external drive more BK in a Windows machine it works as well as *. I understand what happened with her. This external drive is complete with tons of very important and useful data. Can someone please help with this?

    After the upgrade to El Capitan, have you installed the version 14 of Paragon? To what level, you would need and this for download, see this .

Maybe you are looking for

  • Web (pop-up) pages open without the toolbars

    Article: http://kb.mozillazine.org/Prevent_websites_from_disabling_new_window_featurestold to open "" subject: config "' and change all entries""dom.disable_window" "true to prevent"Windows to open without toolbars. As you can see in the clips, the o

  • Bookmark and history do not work

    My bookmarks and history ceased to operate. I followed all the instructions in the help nothing helps. I've uninstalled and reinstalled Firefox without result. In some cases, the instructions to fix this problem do not work because the buttons they s

  • Development of sites Web + programming: optimization of Xcode

    I am currently building my own Web site. So far, I have .html, .cssand .js files. I would like to know what you advice like how to be super effective using Xcode. As the autocompletion for all these file extensions And now, I opened a .html and .css

  • eStudio 281 digital copier, printer, Fax, Scanner

    Hello We have a Toshiba eStudio 281, which is connected to a Microsoft Windows network. I want to ensure that only certain users can print in color on it so that other users can print only in black and white. I can't find this information in the manu

  • Can't access by Satellite C50 - A - 1 6 Boot Menu

    Hello I have a C50 Satellite - A - 1 6 originally shipped with Windows 8.1. I had turned off successfully UEFI and start safe to install Windows 7 in boot legacy mode. However, I now upgrade to 8.1 Windows again, but I can't access the boot menu or B