Why is the query so slow?

Hello
I have a fast running query (3 seconds).
If I try to run it on the test environment, it takes about 2 minutes (!)
I see in both environments explain plan is the same and therefore are used. I also tried to rebuild indexes and tables that looked quite fragmented in test, but the result is always the same. If our test environment is slower and with lower performance? What else could I check? (Oracle worms is 8.1.7)
Thank you!

812809 wrote:
steps to follow:
1. If candidate columns has index or not

Sometimes and index can cause a query slow down rather than speed upward, especially if a person has created too many indexes on a table and the optimizer not to find one that is suitable for use.

2. go to explain the plan and search for the query is not to fall into the category of the full Table Scan

Full scan of the table isn't always a bad thing. They are sometimes faster than using the index. It depends on.

Tags: Database

Similar Questions

  • Why is the VI so slow? VI using drivers AFG 3011 and GST 2014

    I use the generator of signals AFG 3011 and oscillosope GST 2014 pilot live to generate a signal at different times of the frequency and then get the tensions for the plot of the magnitude and phase. I have attached the VI calculate and draw as well. The problem is just to calculate the frequency 3 points its time consuming and I get like 50-100 points. It takes like a couple minutes just to 3 points. Is there something wrong with Vi or I use the incorrectly?

    I said remove the duplicate to the horizontal/time base. It is not at all the same thing as the volts/div (vertical).

    I have no idea how or if you used a case statement. What I'm thinking is something like the code below. I have just showd the scan for a channel operation. You're already retune the frequency with LabVIEW function, you know.

    p.s. Just realized that in a previous post, you said that you were using the serial port. Crank upward the baud rate to as high as it can go and lower your expectations.

  • Query Insert slows in Timesten

    Hello DB Experts.

    I am inserting data block with the ttbulkcp command. My permsize is 20 GB. Insert the query becomes slow. can anyone help me that how can I maximize the flow by ttbulkcp.

    Kind regards

    Hi chris,

    We have created the java batch program sample and we have tested bulk insertion, we reached aroud 60000 GST. I want to thank you for your support.

  • Why the update did slow my MacBook pro down so

    Why the update did slow my MacBook pro down so much? What could be in the last update of El Capitan to slow my Mid 2010 GHz Intel Core 2 Duo Macbook Pro 2.66 down so much?   He has never run it slow before! Everything takes more time in all areas. Could I have made a mistake during the download and installation?  If so is it possible to force a re - install the latest update?

    I don't know if I can restore back after an update of this size. Everyone has similar problems or have thoughts on what could be wrong? I know it's far from being a State of the art Macbook Pro. But it was working fine before the update.

    Any thoughts would be really appreciated. I can't afford to buy anything newer right now.

    Thank you

    Ron Genovesi

    HMBGENO

    Things you can try to solve this problem:

    1 https://support.apple.com/kb/PH21875?viewlocale=en_US & local = en_US

    Start in safe mode and then restart.

    2. How to reset the NVRAM on your Mac - Apple Support

    Reset the NVRAM.

    If this does not help, download Etrecheck, a report and view the results here.

    http://etrecheck.com

  • Slow index by using the query. Fast with full table Scan.

    Salvation;

    (Thanks for the links)

    Here's my question correctly formatted.

    The query:
    SELECT count(1)
    from ehgeoconstru  ec 
    where ec.TYPE='BAR'  
    AND ( ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') )   
    and deathdate is null 
    and substr(ec.strgfd, 1, length('[CIMText')) <> '[CIMText'
    Works on 32 seconds!


    Same query, but with an extra where clause:
    SELECT count(1)
    from ehgeoconstru  ec 
    where ec.TYPE='BAR'  
    and  ( (ec.contextVersion = 'REALWORLD')     --- ADDED HERE
    AND ( ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') ) )  
    and deathdate is null 
    and substr(ec.strgfd, 1, length('[CIMText')) <> '[CIMText'
    This is 400 seconds.

    It should return data from a table, given the conditions.

    The database version is Oracle9i Release 9.2.0.7.0

    These are the parameters relevant for the optimizer:
    SQL> show parameter optimizer
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    optimizer_dynamic_sampling           integer     1
    optimizer_features_enable            string      9.2.0
    optimizer_index_caching              integer     99
    optimizer_index_cost_adj             integer     10
    optimizer_max_permutations           integer     2000
    optimizer_mode                       string      CHOOSE
    
    SQL> 
    Here is the output of the PLAN to EXPLAIN for the first quick query:
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    
    --------------------------------------------------------------------------------
    | Id  | Operation                     |  Name               | Rows  | Bytes | Cost  |
    --------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT     |                         |           |       |       |
    |   1 |  SORT AGGREGATE       |                         |           |       |       |
    |*  2 |   TABLE ACCESS FULL   | EHCONS            |       |       |       |
    --------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    
       2 - filter(SUBSTR("EC"."strgfd",1,8)<>'[CIMText' AND "EC"."DEATHDATE"
                  IS NULL AND "EC"."BIRTHDATE"<=TO_DATE('2009-10-06 11:52:12', 'yyyy
    -mm-dd
    
                  hh24:mi:ss') AND "EC"."TYPE"='BAR')
    
    Note: rule based optimization
    Here is the output of the EXPLAIN of PLAN for slow queries:
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
       |       |
    
    |   1 |  SORT AGGREGATE              |                             |       |
       |       |
    
    |*  2 |   TABLE ACCESS BY INDEX ROWID| ehgeoconstru      |       |
       |       |
    
    |*  3 |    INDEX RANGE SCAN          | ehgeoconstru_VSN  |       |
       |       |
    
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    2 - filter(SUBSTR("EC"."strgfd",1,8)<>'[CIMText' AND "EC"."DEATHDATE" IS
     NULL AND "EC"."TYPE"='BAR')
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
       3 - access("EC"."CONTEXTVERSION"='REALWORLD' AND "EC"."BIRTHDATE"<=TO_DATE('2
    009-10-06
    
                  11:52:12', 'yyyy-mm-dd hh24:mi:ss'))
           filter("EC"."BIRTHDATE"<=TO_DATE('2009-10-06 11:52:12', 'yyyy-mm-dd hh24:
    mi:ss'))
    
    
    Note: rule based optimization
    The TKPROF output for this slow statement is:
    TKPROF: Release 9.2.0.7.0 - Production on Tue Nov 17 14:46:32 2009
    
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    
    Trace file: gen_ora_3120.trc
    Sort options: prsela  exeela  fchela  
    ********************************************************************************
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing 
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    ********************************************************************************
    
    SELECT count(1)
    from ehgeoconstru  ec
    where ec.TYPE='BAR'
    and  ( (ec.contextVersion = 'REALWORLD')
    AND ( ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') ) )
    and deathdate is null
    and substr(ec.strgfd, 1, length('[CIMText')) <> '[CIMText'
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      0.00     538.12     162221    1355323          0           1
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        4      0.00     538.12     162221    1355323          0           1
    
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 153  
    
    Rows     Row Source Operation
    -------  ---------------------------------------------------
          1  SORT AGGREGATE 
      27747   TABLE ACCESS BY INDEX ROWID OBJ#(73959) 
    2134955    INDEX RANGE SCAN OBJ#(73962) (object id 73962)
    
    ********************************************************************************
    
    alter session set sql_trace=true
    
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.02          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        1      0.00       0.02          0          0          0           0
    
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    Optimizer goal: CHOOSE
    Parsing user id: 153  
    
    
    
    ********************************************************************************
    
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.00          0          0          0           0
    Execute      2      0.00       0.02          0          0          0           0
    Fetch        2      0.00     538.12     162221    1355323          0           1
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        5      0.00     538.15     162221    1355323          0           1
    
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    
    
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        0      0.00       0.00          0          0          0           0
    Execute      0      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        0      0.00       0.00          0          0          0           0
    
    Misses in library cache during parse: 0
    
        2  user  SQL statements in session.
        0  internal SQL statements in session.
        2  SQL statements in session.
    ********************************************************************************
    Trace file: gen_ora_3120.trc
    Trace file compatibility: 9.02.00
    Sort options: prsela  exeela  fchela  
           2  sessions in tracefile.
           2  user  SQL statements in trace file.
           0  internal SQL statements in trace file.
           2  SQL statements in trace file.
           2  unique SQL statements in trace file.
          94  lines in trace file.
    Published by: PauloSMO on November 17, 2009 04:21

    Published by: PauloSMO on November 17, 2009 07:07

    Published by: PauloSMO on November 17, 2009 07:38 - title changed to be more correct.

    Although your optimizer_mode is choosing, it seems that there are no statistics collected on ehgeoconstru. The absence of estimated costs and estimated row counts of each of the stages of the plan and the "Note: optimization based on rules" at the end of these two plans would tend to confirm this.

    Optimizer_mode choose means that if statistics are collected then it will use the CBO, but if no statistic is present in any of the tables in the query, the optimizer to rule will be used. The RBO tends to be happy in the best of the index case. I guess the index ehgeoconstru_VSN contextversion as the main column and also includes the date of birth.

    You can either gather statistics on the table (if all other tables have statistics) using dbms_stats.gather_table_stats, or suggest the query to use a full scan instead of index. Another solution would be to apply a function or an operation against the contextversion to prevent the use of the index. something like this:

    SELECT COUNT(*)
    FROM ehgeoconstru  ec
    WHERE ec.type='BAR' and
          ec.contextVersion||'' = 'REALWORLD'
          ec.birthDate <= TO_DATE('2009-10-06 11:52:12', 'YYYY-MM-DD HH24:MI:SS') and
          deathdate is null and
          SUBSTR(ec.strgfd, 1, LENGTH('[CIMText')) <> '[CIMText'
    

    or maybe UPPER (ec.contextVersion) so that would not change the rows returned.

    John

  • Why is Windows XP Professional slow to get on the desktop?

    Hello

    I have a Toshiba laptop with Windows XP and it takes a long time to start and join the office. When testing and restarting in safe mode with networking with the wireless connection, the computer is slow, but when I turn off the wireless connection, start in safe mode with networking is much faster.

    Thank you

    LD.

    Hello, LD,

    This question is considered, perhaps, if the PMKCache is loaded again when restarting. This was seen when you use Windows XP SP2 and Windows XP SP3. To work around this problem, you can disable the PMKCacheMode in the registry. To do this, follow the steps below:

    1. click on Start, run and type regedit.exe and then click OK

    2. navigate to the following registry key

    3 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\EAPOL\Parameters\General\Global

    4. Click to select the key \Global

    5. browse the list on the list at PMKCacheMode

    6 double-click on PMKCacheMode, change the value data: 0, close the registry editor

    7 restart your computer

    This key specifies whether a Windows XP wireless client will perform PMK caching. By default, PMKCacheMode is enabled (set to 1).

    Hope this helps

    Bobby

  • Query on the view runs slower than the direct request

    Hi all

    I created a simple display and when I run the view she takes more time and when I run the query it answer quickly.

    Here are the plans of the explain command

    Query:

    Execution plan

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

    Hash value of plan: 2867537711

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

    | ID | Operation | Name                       | Lines | Bytes | Cost (% CPU). Time |

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

    |   0 | SELECT STATEMENT |                            |     1.   153.  107   (1)| 00:00:02 |

    |   1.  COUNT                         |                            |       |       |            |          |

    |*  2 |   OUTER HASH JOIN |                            |     1.   153.   107 (1) | 00:00:02 |

    |   3.    NESTED LOOPS |                            |     1.   101 |     4 (0) | 00:00:01 |

    |   4.     TABLE ACCESS BY INDEX ROWID | TBLWEBINSPR |     1.    58.     2 (0) | 00:00:01 |

    |*  5 |      INDEX UNIQUE SCAN | IDX_SUBSRIBER_WEBINSPR |     1.       |     1 (0) | 00:00:01 |

    |*  6 |     TABLE ACCESS BY INDEX ROWID | TBLMACCOUNT |     1.    43.     2 (0) | 00:00:01 |

    |*  7 |      INDEX RANGE SCAN | IDX_USERNAME_ACCOUNT |     1.       |     1 (0) | 00:00:01 |

    |*  8 |    TABLE ACCESS FULL | TBLTNETWORKSERVICEINSTANCE | 12828.   651K |   103 (1) | 00:00:02 |

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


    Explain the Plan of view:

    Execution plan

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

    Hash value of plan: 3639776364

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

    | ID | Operation | Name                       | Lines | Bytes | Cost (% CPU). Time |

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

    |   0 | SELECT STATEMENT |                            | 12889.    61 M |   824 (1) | 00:00:10 |

    |*  1 |  VIEW                   | V5                         | 12889.    61 M |   824 (1) | 00:00:10 |

    |   2.   COUNTY |                            |       |       |            |          |

    |*  3 |    EXTERNAL RIGHT HASH JOIN |                            | 12889.  1925K |   824 (1) | 00:00:10 |

    |*  4 |     TABLE ACCESS FULL | TBLTNETWORKSERVICEINSTANCE | 12828.   651K |   103 (1) | 00:00:02 |

    |*  5 |     HASH JOIN |                            | 12889.  1271K |   721 (1) | 00:00:09 |

    |*  6 |      TABLE ACCESS FULL | TBLMACCOUNT | 12865.   540K |   583 (1) | 00:00:07 |

    |   7.      TABLE ACCESS FULL | TBLWEBINSPR | 17680.  1001K |   137 (1) | 00:00:02 |

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

    Query is:

    Select rownum as id, tw.subscriberidentity as user_identity, tw.password, tw.customertype, tw.expirydate, tw.status, nvl (decode (lower (tn.isportal), 'yes', 'yes', 'no', 'no'), 'yes') as passwordcheck,.

    fn_getEncryptionType (TM.encryptiontypeid) as encryptiontype, tw.servicetype, tn.maccount, tn.isroaming, tn.isportal, tn.iprange, lower (replace (fn_getmodemmac (tn.referenceaccountid),'-')) as modemmac,

    NVL(fn_getclientmac(TN.referenceaccountid),'A4-BA-DB-B7-FA-10') as clientmac, 'DEN Delhi address' as address, tn.networkkeyid, decode (lower (tn.isroaming), 'yes', null, 'no', "0:8 ='|") TN.iprange) as checkroaming,

    'ACC0000000' as cacno, ' [email protected] ' as cemailid, 'The account name' as cname, like cmobile's ' 7567077034', '66099965606' as coffice from (select distinct referenceaccountid, param2 Minventa, param4

    IsRoaming, param5 isportal, param6 iprange, NTWRKSRVINSTANCEID networkkeyid of tbltnetworkserviceinstance where systemgenerated = 'n') tn, tw, tblmaccount tm tblwebinspr where

    TN.referenceaccountid (+) = tm.accountid and tw.subscriberidentity = tm.username and tm.accounttypeid = 'ACT08' and tm.systemgenerated = ' don't

    Please suggest.

    Kind regards

    Ronak Masudi

    You do not have show us the request, the view definition or the predicate for the plans section; but speculation obvious that you have included the rownum inside the view definition - which makes a view no-that can be merged that must be instantiated before the predicate of the query can be applied.

    Concerning

    Jonathan Lewis

  • IMPDP | Possible using the query option

    HI PPL,

    I wanted to know if IMPDP is possible by using the query option, as I took full expdp dump of the mentioned table and want to import only select lines.

    Impdp arup/arup directory = demo_dir dumpfile = employees.dmp
    Query = employees:------"" where salary\ > 10000\ order of salary "tables used ="

    version: 10 gr 2
    platform: UNIX

    concerning

    Obviously, it will be slow if you are using the query option, because IMPDP must import only the data that meets the criteria; It of why we export only limited data (one or two tables as needed) and import them completely.

    Concerning
    Girish Sharma

  • Why my Apple TV so slow is download from iTunes when other sites such as HBOGo or Netflix or showtime begin playing immediately.  Apple needs to fix this!

    Why my Apple TV so slow is download from iTunes when other sites such as HBOGo or Netflix or showtime begin playing immediately.  Apple needs to fix this!

    These services adapt to the connection that iTunes is set the highest rate and quality it will load a front part of reading people.

    You need the problems

    What is your current connection via speedtest

    Make sure that DNS is set to automatic (network - general - settings)

    If during testing of wifi Ethernet

    Test on another network

  • Why doesn't my computer slow and down so often?

    Hello

    Why doesn't my computer slow and down so often?  I have quite a few red errors and yellow when I look where the Viewer, how can I get rid of them?  And also I have Norton installed on my PC Utillities, can this program to get rid of these errors?

    Take a look in the system and Application logs in the errors and warnings event viewer and post here the copies. Do not post on more than 48 hours ago.

    You can access event viewer by selecting Start, Control Panel, administrative tools, and Event Viewer. When searching for the meaning of the error, information about the event ID, Source and Description are important.

    A tip for posting copies of error reports! Run Event Viewer and double-click the error you want to copy. You will see a button resembling two pages. Click on the button and close Event Viewer. This places a copy of the report to your Clipboard. Paste it into the body of your message. Make sure that it is the first dough right out of the event viewer.

  • Why my computer running so slow and why online games lag and freeze.

    Why my computer run so slow and why do games lag and freeze so often-

    Windows Vista 64-bit on the HP Pavilion DV2 laptop IE9

    Product NX926UA #ABA number

    Start the HP Support Assistant software. Click troubleshooting, and then select each of the options available, except the performance. Delete all Temp files and temporary internet browser files will help you.

    Follow the instructions on this tutorial at home to define your default virtual memory paging size. It's certainly worth a performance improvement you will notice. Don't let not Windows controls the size of your virtual memory paging file.

    Fill your online games can be for various reasons. The most likely reason if you use wireless 802. 11 b or G is the connection. If you have a 802.11n wireless router and the wireless in your laptop card is capable of 802.11n bandwidth and then use it without a doubt.

  • How can I solve the problem of slow computer or what nested steps I need to take more things that I mention below to slow computer speed?

    Hello

    I know that for your computer to start faster, you can disable in msconfig certain applications or auto-start services

    I also know that to make your computer faster to do a virtual and half larger than the memory size, more you will need to start it and the value of the same size virtual memory, for example start value 3000 end value3000.

    I know also some malicious spyware can slow down your computer.

    In addition, you can add more memory to mke your computer more fast, your drive hard must be empty of 25%.

    In addition to these things I mentioned before nested thing wat do I check to solve the problem of slow computer?

    can you give me some?

    Thank you

    Johan

    The size of the virtual memory required will depend on the type of requests and is influenced by the installed physical memory. The 1.5 times value really applies to computers with a limited amount of ram and the use of virtual will decrease with an increase in physical (but remove never virtual memory altogether) while Shawn says investigate fitting over RAM.

    Setting the pagefile identical to max and min values will reduce fragmentation but was so moving to a less actively used by car.

    http://TechNet.Microsoft.com/en-us/magazine/ff382717.aspx

    The largest suites 'internet security' may have much more impact than the plain simple AV (that's why I use MSE).

    By far the biggest kick in performance should be move to the SSD, it reduces by half my boot time.

    If a desktop computer fits a discreet graphics card, she discharge the graphic CPU and restores memory used.

    As well as Msconfig, check the contents of the process in the Task Manager tab. Most will be perfectly legitimate, but you can identify the odd thief of uninstalled programs.

    NOT tempted by claims of speed countless programs available. Rarely, they make a significant difference and can do serious damage.

  • Window of the query editor with Microsoft SQL Server Management Studio DO NOT scroll

    In my view, that it is a question more of a Microsoft SQL Server Management Studio number... apologies if you think I might be in the wrong place of Windows...

    When you work in Microsoft SQL Server Management Studio, my cursor is common in my part of the query editor window. When I try using my scroll wheel it to review some SQL code, instead the scroll on my mouse wheel is controlling the pane objects in the Solution Explorer window and NOT the glass query editor.
    Some of our partners appear to be well with their ability to scroll using the mouse scroll wheel while others seem to be in the same boat I am, and nobody here seems to know why it is.
    I hope for some comments and I am hopeful for an answer. Thanks in advance.
    PSULionRP

    Hello

    The question you posted would be better suited to the TechNet community. Please visit the link below to find a community that will provide the support you want.

    http://social.technet.Microsoft.com/forums/Gu-in/sqldatawarehousing/threads

    Hope this information helps.

  • Tuning for sql join key table no consumer of the heavy use of the query processor

    Obligation comes to tunne prod of the query in

    high use of the query processor

    sql_id: fp79wb32h7a6t

    Module: AHC, P_PatientDQ()

    Cost: 7

    Elapsed time: hung

    Status: Hung, 35,253,460 day at 30 minute intervals

    -Create table

    create table ahc. PATIENTVISITS

    (

    ahcid NUMBER,

    visitId NUMBER,

    visitstatus NVARCHAR2 (100),

    visitdate DATE,

    visitintime DATE,

    visitouttime DATE

    )

    -Create/recreate the index

    create indexes ahc. F1_PATIENTVISIT_AHCID on ahc. PATIENTVISITS (AHCID, VISITID);

    create indexes ahc. VISITDATE_IDX on ahc. PATIENTVISITS (TRUNC (VISITDATE));

    First total number of table

    Select count (1) of

    Pvs AHC.patientvisits

    -Save County 1387485

    create table ahc. PATIENTDEPENDENTVISITS

    (

    ahcid NUMBER (19) not null,

    IDPack NUMBER (10) not null,

    visitId NUMBER (19) not null,

    dependentvisitid NUMBER (19) not null,

    isdiabetic NUMBER (2)

    )

    -Create/recreate the index

    create indexes ahc. K1_PATIENTDEPENDENT_AHCID on ahc. PATIENTDEPENDENTVISITS (AHCID);

    Total number of second table

    Select count (1) of

    AHC.patientdependentvisits POS

    -Save County 774599

    Original request:

    SELECT count (*)

    ACH. PVS PATIENTVISITS

    WHERE PVS. VISITID IN (SELECT POS. DEPENDENTVISITID

    ACH. PATIENTDEPENDENTVISITS POS

    WHERE POS. AHCID = 37

    AND POS. VISITID = 218

    AND POS. ISDIABETIC = 0)

    AND SUPERIOR (PVS. VISITSTATUS) = 'PENDING'

    AND PVS. AHCID = 37

    Count (1)

    -----------

    1

    PL/sql Developer explain plan for the original query

    Owner of description Objects_name cost cardin bytes cpucost cost of e/s

    SELECT STATEMENT, GOAL = ALL_ROWS7141636697
    AGGREGATION OF TRI141
    SEMI OF THE NESTED LOOPS7141636697
    TABLE ACCESS BY INDEX ROWIDAHCPATIENTVISITS4125332954
    INDEX RANGE SCANAHCF1_PATIENTVISIT_AHCID39231643
    TABLE ACCESS BY INDEX ROWIDAHCPATIENTDEPENDENTVISITS3116303753
    INDEX RANGE SCANAHCK1_PATIENTDEPENDENT_AHCID214180932

    After editing the query

    SELECT / * + FIRST_ROWS * / COUNT (1)

    ACH. PVS PATIENTVISITS

    JOIN THE AHC. PATIENTDEPENDENTVISITS POS ON PVS. VISITID = POS. DEPENDENTVISITID

    WHERE PVS. AHCID = POS. AHCID

    AND POS. AHCID = 37

    AND POS. VISITID = 218

    AND POS. ISDIABETIC = 0

    AND SUPERIOR (PVS. VISITSTATUS) = 'PENDING'

    Count (1)

    -----------

    1

    PL/sql Developer explain plan for change request

    Owner of description Objects_name cost cardin bytes cpucost cost of e/s

    SELECT STATEMENT, TARGET = TIP: FIRST_ROWS7141592577
    AGGREGATION OF TRI141
    NESTED LOOPS
    NESTED LOOPS7141592577
    TABLE ACCESS BY INDEX ROWIDAHCPATIENTDEPENDENTVISITS4116366464
    INDEX RANGE SCANAHCK1_PATIENTDEPENDENT_AHCID314243643
    INDEX RANGE SCANAHCF1_PATIENTVISIT_AHCID21152932
    TABLE ACCESS BY INDEX ROWIDAHCPATIENTVISITS3125226113

    here after I changed the query no display cost = 7 io wait = improvement also 7 can someone please help these

    How to adjust or rewrite lots of join not keys to multiple records on table table

    Thank you

    VSM

    you have not answered my question. Are you really calling it 35 million times in 30 minutes?

    If so, why?

  • package in the query according to VO function call

    Hello Experts,

    Can we define the variable binding for the query in VO before we vo.executequery ()?

    because the parameter is not a where clause, I don't get any idea how to set this variable to link dynamically.

    could you please advice?

    Select book_name,

    author_name,

    (Select (ABC.IS_VALID_ISBN (double:1))) as IS_VALID_ISBN

    of books.

    Kind regards

    Suman

    Suman,

    1. in the case of an external parameter, why do you need this inside this query? All the lines are going to have the same value, right?

    2. you can write the query as below:

    Select book_name,

    author_name,

    ABC.IS_VALID_ISBN(:1) as IS_VALID_ISBN

    of books.

    3. you can use the variable of the same link when it is in the whereclause. use setWhereClauseparam(0,)

    Let us know if you are facing a mistake

    See you soon

    AJ

Maybe you are looking for