Problem running query.

Hello

I have the below slow running query.

Please suggest / give your input on the reduction of the time for this request

ENV: Oracle 10.2.0.4.0


SELECT *.
OF GMS_NOTE g
WHERE g.SEQ_ID =
(SELECT MAX (B.SEQ_ID)
OF GMS_NOTE gn
WHERE the gn. HIST_ID = g.HIST_ID)
AND SUPERIOR (SRC_ID) =: SYS_B_0
AND SUPERIOR (SAL_CODE) =: SYS_B_1
AND TRANS_DATE > = TO_DATE (: SYS_B_2, SYS_B_3);




PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------------------------------------------------
Hash value of plan: 4245552679

---------------------------------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
---------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | 1. 402 | 57739 (1) | 00:11:33 |
|* 1 | FILTER |
|* 2 | TABLE ACCESS FULL | GMS_NOTE | 1. 402 | 57736 (1) | 00:11:33 |
| 3. GLOBAL TRI | 1. 10.
| 4. FIRST LINE | 3. 30. 3 (0) | 00:00:01 |
|* 5 | INDEX RANGE SCAN (MIN/MAX) | GMS_NOTE_PK | 3. 30. 3 (0) | 00:00:01 |
---------------------------------------------------------------------------------------------------

Information of predicates (identified by the operation identity card):
---------------------------------------------------

1 - filter("O".") SEQ_ID "IS (SELECT MAX ('B'.". SEQ_ID") OF
"GMS_NOTE" 'B' WHERE 'B '. "HIST_ID"=:B1))
2 filter (UPPER ("SRC_ID") =: SYS_B_0 AND UPPER ("SAL_CODE") =: SYS_B_1)
AND 'TRANS_DATE' > = TO_DATE (: SYS_B_2,: SYS_B_3))
5 - access("B".") HIST_ID "(=:B1)"

21 selected lines.



Index / row count information for the GMS_NOTE (not partitioned table):

His stats are up to date.

Select count (*) in the GMS_NOTE;


COUNT (*)
----------
4858242



CREATE A UNIQUE GMS_NOTE_PK ON GMS_NOTE INDEX
(HIST_ID, SEQ_ID);


CREATE INDEX IDX1_BIDFEEDORDER ON GMS_NOTE
(HIST_ID, UPPER ("SRC_ID"), UPPER ("SAL_CODE"), TRANS_DATE);


ALTER TABLE GMS_NOTE ADD)
CONSTRAINT GMS_NOTE_PK
KEY ELEMENTARY SCHOOL
(HIST_ID, SEQ_ID)
WITH THE HELP OF INDEX GMS_NOTE_PK
ENABLE VALIDATE);

Thanks in advance.

user13517642 wrote:
Thanks Nikolay.

I created an index on the trans_date column, and it is originally a range of indexes on the table instead of a table scan full scan.

I'm not Nikolai, but you're welcome. ;)

Now turn this trans_date the composite index index, I suggested, for an even better improvement.

Tags: Database

Similar Questions

  • "Error running query: the real member does not exist in the application.

    Hi all

    I have a HFM EN users need to run, but somehow they started getting this error "error running query: real member does not exist in the application". I traced their levels of access to mine, and I am able to run the same report without any problem but the user still getting the same error. what may be the possible cause. Please help me so that I can ensure the debugging.

    Thank you

    Zitouni

    I was able to solve this problem by checking the user of security principals class was trying to run the report for. The user did not have acesss on the class of the said security and change all, solve the problem.

    Thanks, Sattu

  • Cannot run query because of RepositoryException

    Hello
    I'm new to this product.
    I am customizing the application of CRS. I want to create a point in ProductCatalog descriptor and must insert some properties. Here is my custom .xml

    <? XML version = "1.0" encoding = "UTF-8"? >
    < gsa-model >
    < name point-descriptor = "check_inv" >
    < table name = "My_DCS_SKU" type = "primary" id-column-name = "sku_id" >
    < property name = data type "inventory_status" = "string".
    column-name = display-name-resource "INVENTORY_STATUS" = "inventory_status" default = "InStock" / >
    < property name = data type "sku_id" = "string".
    column-name = display-name-resource "sku_id" = "sku_id" / >
    < /table >
    < / descriptor point >
    < / gsa-model >

    With this XML, I am able to see my newly added and point-descriptor properties in dyn/admin(in ProductCatalog). Even if I am able to check the values of these properties in dyn/admin.

    But in jsp when I get the inventory_status, I get an exception:
    Cannot run query because of the RepositoryException: atg.repository.RepositoryException: no property named 'sku40145' could be found in the descriptor of the item "check_inv".


    I added the following code in jsp.



    < name dsp:droplet = "/ atg/dynamo/drop/RQLQueryForEach" >
    < name dsp:param = "queryRQL" value = "sku_id = sku40145" / >

    < name dsp:param = "repository".
    value = "/ atg/commerce/catalog/ProductCatalog" / >

    < name dsp:param = "itemDescriptor" value = "check_inv" / >

    < name dsp:oparam = "output" >

    < p > < dsp:valueof param = "element.inventory_status" / >
    < / dsp:oparam >
    < / dsp:droplet >

    Please suggest me how to get rid of this problem?
    I use ATG10.1.1


    Thank you
    Phanie

    Published by: 995229 on March 21, 2013 02:21

    try to use a parameter for the value of your sku_id-

    and use the param below-

  • Problem running windows 10 to date for windows 7 Home premium 64-bit reference error code 08C 1800103 - 089002

    Problem running windows 10 to date for windows 7 Home premium 64-bit reference error code 08C 1800103 - 089002

    Could not update windows 7 Home premium service pack 1 for windows 10.

    I tried windows update. all updates are installed except win 10 update that comes up with unexpected error

    Please be aware, even if you do not get the Windows 10 app, you can always download Windows 10 as one. ISO file, create a bootable copy and update your system.

    See the instructions: How to download official Windows 10 ISO files

    Task of pre-required

    When you make significant changes to your computer for example updated operating system, you must always back up. See the links to resources on the backup by clicking the link for each version of Windows you are using: Windows XP, Windows Vista, Windows 7, Windows 8/8.1

  • Characters not visible (caused by hitting the bar space or TAB in PL/SQL developer tool) causing slow running query? and database with low performance?

    Hi all

    I need your help to get this issue resolved its urgent and I'm not able to get to the conclusion. Here is my scenario, I'm getting slow query runs because of some non-visible characters that are copied with the application of the PL/SQL developer tool. Please find below attached screenshot: Oracle_Issue

    Oracle_Isssue.png

    Note: This non-visible characters are caused when we write the query then us hit the SPACEBAR or press TAB PL/SQL developer tool

    I use the developer tool PL/SQL to write or test the query. Now I take this request copy paste in my application of the company (who takes this query connects to Oracle or any source of data base, catch data and produce PDF reports for customers).

    Now, my client is the Oracle user when I write and you run this query by the PL/SQL Developer, it works fine, but when I paste in my Inbox feature request (reporting system) and run it, it runs slower and jams to the customer database. Now after a little research I found that when I copy the query directly from PL/SQL developer at my request, he copy some characters not visible (introduced when we press SPACE or TAB in PL/SQL developer tool when writing query) with the request, then I copy this query again to my box of the application Notepad and delete these non-visible characters. Now, after removing the non-visible characters again once I copy backup question in my application and run the query, it works normally. Please find below attached screenshot: Oracle_Issue 2

    Oracle_Isssue_2.png

    So I think that the cause of slow performance is due to some INVISIBLE CHARACTERS present in the query.

    My application uses SQL server 2008-2012 at the backend to store data from different sources.

    Character set used: SQL_Latin1_General_CP1_CI_AS


    To write and test queries: PL/SQL developer tool

    My Client use Oracle 11 g

    Character set used: Normal character: NLS_CHARACTER: AL16UTF16

    National Characeter: NLS_NCHAR_CHARACTER: WE8WIN1521

    I just wanted to know the blocking process to the top of the database and the characters not visible how affecting slow running query of query database.

    Please let me know if I'm missing something or you need more information on this issue.

    Thanks in advance,

    HP

    Simple answer. No.

    Spaces and line breaks do not change the execution plan created. Does not plan to run slower or faster.

  • pre-requete and key-run-query

    Hi all

    one who fires first

    KEY-RUN-QUERY FIRES BEFORE PRE-REQUETE or vice versa?

    Thank you

    newbi_egy wrote:

    What do you mean with "obvious developer.

    1. I hear of course developer KEY-EXEQRY integrated call/write EXECUTE_QUERY trigger to run the query.

    2. This is in all versions, same behavior except the shortcut key to run the query in 6i F8 in 11 g Ctrl + F11

    3. it's Ok, it should be that way. This is correct behavior.

    You can test this way

    1 al ' KEY-EXEQRY

    message('KEY-EXEQRY');

    message('KEY-EXEQRY');

    EXECUTE_QUERY;

    2. in the previous QUERY

    message('PRE-QUERY');

    message('PRE-QUERY');

    3. press F8 or Ctrl + F11 to run the query based on you form version

    Result:

    First Messenger KEY-EXEQRY

    Second QUERY before displaying the messages

  • Having major problems running newly installed Phtoshop CS5

    Having major problems running newly installed Phtoshop CS5 on a newer, much more powerful computer that will benefit better large files published on CS5. When I try to run it, I get the message "Adobe Application Manager required to start your trial is missing or damaged. Please download a new copy of AAM... "I made this withoiut effect. I uninstalled my purchased version and installed the "download version" of Adobe's Web site. NO luck. I get the same error message. AM I supposed to buy in Adobe CC and chuck my purchased version CS % or is there a work around for this problem?

    Have you tried to download it from:

    Download the CS5 products

    The error message is that this installation is corrupted.

    Concerning

    Stéphane

  • When you click on the Cancel button, avoid running query

    Hello

    I'm going to the jsff a page to another at the click of a button

    In the second page I go back to the 1st page when the Cancel button is clicked
    But when clicked on this button cancel my request get rerun and takes a long time to come back on the 1st page
    This is a read only vo interview... How can I avoid running query on a button click Cancel

    Thank you

    Real question is: "why is your query run when you press the Cancel button?
    If your application is already running on the first page, this should not happen unless you:
    -to perform an operation on the Cancel button that runs the query
    -changed "Refresh" of your iterator property
    -perform rollback

    Dario

  • How to remove a discoverer report that has a status of running query

    Hello

    How to remove a discoverer report that has a status of running query

    Thank you

    Hi 925907,

    I think you would work with your DBA to kill the session associated with the workbook running.

    A query like this will provide your DBA with all the necessary information, it must:

    Select
    vs.*
    Of
    v$ session vs
    where
    vs. Program like 'dis51ws@% ';

    After the session was killed, it is a deletion of standard workbook (select file > open workbooks, and then right click on the name of the workbook, and then select delete).

    Patrick

  • How export (unload) result of the query without running query on sql developer

    Hello

    I want to know how export (unload) result of the query without running query on sql developer.

    I know this way.
    1. execution of query
    2. click on "Download" on the results tab
    http://i.stack.imgur.com/CQ4Qb.jpg


    Is he available unload a query result before the race?

    No, but you can do this ask the developer SQL change however, for other users can vote and add weight to the possible future implementation.

    Kind regards
    K.

  • Payroll Run query does not appear on the payroll LOV

    Hi all

    Am on 12.1.3
    DB - 11 GR 1 material

    Wen, trying to run on PAYROLL:
    FACE below error:
    Payroll Run query does not appear on the payroll LOV


    Thank you

    Please post the exact name of the simultaneous program you want to submit as well as all the parameters.

    I understand that you get an error when you try to select the LOV to pass parameters, right?

    If the program has not yet been presented, then it is an expected behavior not to find any file of log/output.

    Please see if these MOS Docs Help.

    Simultaneous request for payroll, payroll name Lov for payroll run Erros: APP-FND-1436: the list of values can not find all the values for you to choose [333524.1 ID]
    Payroll run parameter list of values (LOV) in the process "Retry Payroll Run" does not display any values [1368390.1 ID]

    Thank you
    Hussein

  • Error running query of queries

    Hello

    I am in the process of updating my site in CF5 to CF9 and I get a "query of query error" on the following code each time I have add the first point to my shopping cart. If I add a second element, the error disappears. Here are two pieces of keys to the code where I pull the item from the database information and then use the query requests to merge the query with the amount of shopping cart.

    <!-get-> Product Details

    < CFQUERY NAME='GetDetails'

    DATASOURCE = ' #request.ds # '

    Username = ' #request.dsuser # '

    PASSWORD = ' #request.dspass # ' >

    SELECT
    ItemNo,

    Agenda,

    Grades,

    Price,

    ImageSmall

    DE Products
    ItemNo IN (#QuotedValueList(GetCart.ItemNo) #)
    < / CFQUERY >

    <!-add the column "OrderQty"->

    < CFQUERY NAME="GetList" DBTYPE="query">

    SELECT
    GetDetails.ItemNo YOU ItemNo,

    GetDetails.Item point, AS

    GetDetails.Grades AS Grades,

    AS price, GetDetails.Price

    GetDetails.ImageSmall AS ImageSmall,

    GetCart.Quantity AS OrderQty

    DE GetDetails, GetCart
    GetDetails.ItemNo = GetCart.ItemNo
    < / CFQUERY >

    This is the error I get. The line number refers to the Q of Q above.

    Error running query of queries.

    Comparison = runtime exception.
    Comparison of Type incompatible Exception: on the left side and right side of the comparison operator "=" have incompatible types.
    Type of expression left side = "VARCHAR".
    Expression type side right hand = "DATE".

    I tried a lot of things affect a 'string' type to the right, but nothing seems to work.

    I would be very happy any help that I can get as I've spent countless hours trying to figure this.

    Thank you
    Steve

    Looks like the GetCart query is generated with functions to query coldfusion as opposed to a database query.  It also seems that the QueryNew function has the names of the fields, but not the types of data.  This means some trys to ColdFusion for the type of basic data on the first rows of data.

    Or it could be something else.

  • SQL +-PROBLEM OF QUERY IN MULTI TABLE

    HAI ALL,

    ANY SUGGESTION PLEASE?

    SUP: SQL +-PROBLEM OF QUERY IN MULTI TABLE


    SQL + QUERY DATA:
    -----------
    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,

    HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,

    PATIENTS_MASTER1 DLC_POLYMORPHS_NORMAL_VALUE, HAEMATOLOGY1,

    DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM AND PATIENT_NUM = DLC_PATIENT_NUM AND PATIENT_NUM

    = & PATIENT_NUM;
    -----------
    RESULT:

    & PATIENT_NUM = 1
    no selected line
    ---------
    & PATIENT_NUM = 2
    no selected line
    ------------
    & PATIENT_NUM = 3
    PATIENT_NUM 3

    PATIENT_NAME KKKK

    HMTLY_TEST_NAME HEMATOLOGY

    HMTLY_RBC_VALUE 4
    4.6 - 6.0 HMTLY_RBC_NORMAL

    DLC_TEST_NAME LEUKOCYTE COUNT PREMIUM

    DLC_POLYMORPHS_VALUE 60

    DLC_POLYMORPHS_NORMAL_VALUE 40-65

    -------------
    -------------

    REAL WILL BE:

    & PATIENT_NUM = 1

    PATIENT_NUM 1

    PATIENT_NAME BBBB

    HMTLY_TEST_NAME HEMATOLOGY

    HMTLY_RBC_VALUE 5
    4.6 - 6.0 HMTLY_RBC_NORMAL

    -----------

    & PATIENT_NUM = 2

    PATIENT_NUM 2

    PATIENT_NAME GEORGE

    DLC_TEST_NAME LEUKOCYTE COUNT PREMIUM

    DLC_POLYMORPHS_VALUE 42

    DLC_POLYMORPHS_NORMAL_VALUE 40-65
    ---------------
    & PATIENT_NUM = 3
    PATIENT_NUM 3

    PATIENT_NAME KKKK

    HMTLY_TEST_NAME HEMATOLOGY

    HMTLY_RBC_VALUE 4
    4.6 - 6.0 HMTLY_RBC_NORMAL

    DLC_TEST_NAME LEUKOCYTE COUNT PREMIUM

    DLC_POLYMORPHS_VALUE 60

    DLC_POLYMORPHS_NORMAL_VALUE 40-65
    ----------------------------

    4 TABLES OF LABORATORY CLINIC FOR DATA ENTRY AND GET REPORT ONLY FOR THE TESTS CARRIED OUT FOR PARTICULAR

    PATIENT.

    TABLE1:PATIENTS_MASTER1
    COLUMNS: PATIENT_NUM, PATIENT_NAME,

    VALUES:
    PATIENT_NUM
    1
    2
    3
    4
    PATIENT_NAME
    BENAMER
    GIROT
    KKKK
    PPPP
    ---------------
    TABLE2:TESTS_MASTER1
    COLUMNS: TEST_NUM, TEST_NAME

    VALUES:
    TEST_NUM
    1
    2
    TEST_NAME
    HEMATOLOGY
    DIFFERENTIAL LEUKOCYTE COUNT
    -------------

    TABLE3:HAEMATOLOGY1
    COLUMNS:
    HMTLY_NUM, HMTLY_PATIENT_NUM, HMTLY_TEST_NAME, HMTLY_RBC_VALUE, HMTLY_RBC_NORMAL_VALUE

    VALUES:
    HMTLY_NUM
    1
    2
    HMTLY_PATIENT_NUM
    1
    3
    MTLY_TEST_NAME
    HEMATOLOGY
    HEMATOLOGY
    HMTLY_RBC_VALUE
    5
    4
    HMTLY_RBC_NORMAL_VALUE
    4.6 - 6.0
    4.6 - 6.0
    ------------

    TABLE4:DIFFERENTIAL_LEUCOCYTE_COUNT1
    COLUMNS: DLC_NUM, DLC_PATIENT_NUM, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE, DLC_POLYMORPHS_

    NORMAL_VALUE,

    VALUES:
    DLC_NUM
    1
    2
    DLC_PATIENT_NUM
    2
    3
    DLC_TEST_NAME
    DIFFERENTIAL LEUKOCYTE COUNT
    DIFFERENTIAL LEUKOCYTE COUNT
    DLC_POLYMORPHS_VALUE
    42
    60
    DLC_POLYMORPHS_NORMAL_VALUE
    40-65
    40-65
    -----------------


    Thank you
    RCS
    E-mail:[email protected]
    --------

    I think you want an OUTER JOIN

    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
     HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
     DLC_POLYMORPHS_NORMAL_VALUE
    FROM PATIENTS_MASTER1, HAEMATOLOGY1,  DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM (+)
    AND PATIENT_NUM = DLC_PATIENT_NUM (+)
    AND PATIENT_NUM = &PATIENT_NUM;
    

    Published by: shoblock on November 5, 2008 12:17
    the outer join brands became stupid emoticons or something. try hard

  • Running query automatically by activating a form already open...

    Hello
    I have developed two forms... formed called formB (using the built-in function open_form passing certain parameters...).
    I want to run query automatically on a block of retail of formed when formB leaves (.. .then formA remains the only open form).
    I wrote a code of the trigger WHEN-WINDOW-ACTIVATED on formed... and it works...!
    but the user has to click on any element of this form...
    Is there another way...?

    Note: I use Dev2000 v6i with patch 12 applied...
    Thank you very much
    SIM

    sgalaxy wrote:

    I wrote a code of the trigger WHEN-WINDOW-ACTIVATED on formed... and it works...!
    but the user has to click on any element of this form...
    Is there another way...?

    Try using a GO_ITEM in your method instead of the user manually clicking on one, that might work.

    Tony

  • problem running the session of remote debugging for specific oracle sql developer

    I have a problem running the session of remote debugging of sql server specific oracle developer.
    I get the following error:
    Connection to the database mmgrep - INNA.
    PL/SQL execution: ALTER SESSION SET PLSQL_DEBUG = TRUE
    Running PL/SQL: CALL the DBMS_DEBUG_JDWP. CONNECT_TCP ('inna.followap.com', '4029')
    ORA-30683: failure connecting to debugger
    ORA-12535: TNS:operation expired
    ORA-06512: at "SYS." DBMS_DEBUG_JDWP', line 68
    ORA-06512: at line 1
    Process is complete.


    I understand that Oracle is unable to connect to my PC.
    I have 2 different oracle servers to work with the sql developer. With one I can run debugger, with another - the errow above.
    I need to change to be able to start debugging with second oracle server.

    In tools | Preferences | ebugger, you can specify a range of ports for the debugger to use so you can limit it to those that are open on the firewall.

    And just to check, is the ip address that is displayed in the CONNECT_TCP call the right one for your PC?

Maybe you are looking for

  • I get a pop up when I open the browser how can I prevent the it arise?

    When I open Firefox another tab is open. It says abduction, you won't see this message has still some photos down there an option, click "No thanks" or yes I will (do something) I do not have the window open so I don't have the details, but it's some

  • Portege M400 keeps freezing

    I recently bought a Portege M400 and it completely freezes and requires a hard reboot at least once per day - any ideas on how to solve this problem?

  • 192.168.1.1 is removed from the list of DNS servers

    I have a Linksys E3000 and I see the gateway (192.168.1.1) in my DNS server address. 1. why this figure here in the DNS? 2. how to remove from my DNS servers or stop the router insert it into my list of DNS servers?

  • audio CD gets hunting

    When you try to burn the cd new in wmp it says that it must be replaced by new cd?

  • Impossible to ping anyconnect Client IP de ASA

    Hello world I can't connect to cisco anyconenct fine no problem. When connected I ping the SAA in interface and other subnets that are behind the ASA inside the interface from the PC connected through the VPN. My only problem is that of ASA, I cannot