Query Slowing

Hello,
I have a query that has begun to slow overtime and would like to see if there is anything that can be done as far as cleaner code that could speed things back up. This query populates an html crgrid. This is a MySQL DB. TIA
QUERY:
<cfquery name="getRecordcount" datasource="#dsn#">
select count(editbcastreq.bcast_id) as editcount
from bcastreq
left join editbcastreq
on bcastreq.bcast_id = editbcastreq.bcast_id
where bcastreq.bcast_id = #url.cfgridkey#
group by bcastreq.bcast_id
</cfquery>
<cfset editcounts = '#getRecordcount.editcount#'>
<cfif #editcounts# is 0>
<cfquery name="getLastedit" datasource="#dsn#">
select *
from bcastreq
inner join affiliate
on bcastreq.affiliate_id = affiliate.affiliate_id
inner join affiliatetype
on affiliatetype.affiliatetype_id = affiliate.affiliatetype_id
where bcastreq.bcast_id = #url.cfgridkey#
</cfquery>
<cfelseif #editcounts# gte 1>
<cfquery name="getLastedit" datasource="#dsn#">
select *
from editbcastreq
inner join affiliate
on editbcastreq.affiliate_id = affiliate.affiliate_id
inner join affiliatetype
on affiliatetype.affiliatetype_id = affiliate.affiliatetype_id
where editbcastreq.bcast_id = #url.cfgridkey#
order by edit_id desc
</cfquery>
</cfif>
CFGRID:
<cfoutput>
<cfform>
<table border="1" width="50%">
<tr>
<td>
Filter By: <cfselect id="filtercolumn" name="filtercolumn" bind="cfc:alumforms.broadcast.cfc.Users.getUserColumns()"
display="ColumnName" value="ColumnName" bindOnLoad="true" />
Filter Text: <cfinput type="text" id="filter" name="filter" >
<cfinput type="button" name="filterbutton" value="Filter" id="filterbutton" onclick="ColdFusion.Grid.refresh('usersgrid',false)">
</td>
</tr>
<tr>
<td id="gridtd" style="padding-top:10px;">
<div style="min-height:200px;">
<cfgrid name="usersgrid" pagesize="20" format="html" width="625" height="450"
bind="cfc:alumforms.broadcast.cfc.Users.getUsers({cfgridpage},{cfgridpagesize},{cfgridsort column},{cfgridsortdirection},{filtercolumn},{filter})" href="editreq.cfm" hrefkey="bcast_id" gridlines="yes" striperows="yes"  >
<cfgridcolumn name="bcast_id" header="Broadcast ID" display="no"  >
<cfgridcolumn name="affiliatetype_id" header="Affiliate Type ID" display="no">
<cfgridcolumn name="affiliate_id" header="Affiliate ID" display="no">
<cfgridcolumn name="affiliatename" header="Affiliate Name" width="150">
<cfgridcolumn name="subject" header="Subject" width="350">
<cfgridcolumn name="editcount" header="No. Edits" width="50" >
<cfgridcolumn name="reqtimestamp" header="Submit Date" width="75" >
</cfgrid>
</div>           
</td>
</tr>
<tr>
</tr>
</table>
</cfform>
</cfoutput>
<cfset AjaxOnLoad("getGrid")>

Your first query does not need a group by clause.  In fact, I'm not even sure you need the first query at all.  With that left join, you are simply selecting the number of records in the bcastreq table that match the url.gridkey.  Depending on your intent, either changing the left join to an inner join, or simply selecting from one table will get you started.

Similar Messages

  • Sql query slowness due to rank and columns with null values:

        
    Sql query slowness due to rank and columns with null values:
    I have the following table in database with around 10 millions records:
    Declaration:
    create table PropertyOwners (
    [Key] int not null primary key,
    PropertyKey int not null,    
    BoughtDate DateTime,    
    OwnerKey int null,    
    GroupKey int null   
    go
    [Key] is primary key and combination of PropertyKey, BoughtDate, OwnerKey and GroupKey is unique.
    With the following index:
    CREATE NONCLUSTERED INDEX [IX_PropertyOwners] ON [dbo].[PropertyOwners]    
    [PropertyKey] ASC,   
    [BoughtDate] DESC,   
    [OwnerKey] DESC,   
    [GroupKey] DESC   
    go
    Description of the case:
    For single BoughtDate one property can belong to multiple owners or single group, for single record there can either be OwnerKey or GroupKey but not both so one of them will be null for each record. I am trying to retrieve the data from the table using
    following query for the OwnerKey. If there are same property rows for owners and group at the same time than the rows having OwnerKey with be preferred, that is why I am using "OwnerKey desc" in Rank function.
    declare @ownerKey int = 40000   
    select PropertyKey, BoughtDate, OwnerKey, GroupKey   
    from (    
    select PropertyKey, BoughtDate, OwnerKey, GroupKey,       
    RANK() over (partition by PropertyKey order by BoughtDate desc, OwnerKey desc, GroupKey desc) as [Rank]   
    from PropertyOwners   
    ) as result   
    where result.[Rank]=1 and result.[OwnerKey]=@ownerKey
    It is taking 2-3 seconds to get the records which is too slow, similar time it is taking as I try to get the records using the GroupKey. But when I tried to get the records for the PropertyKey with the same query, it is executing in 10 milliseconds.
    May be the slowness is due to as OwnerKey/GroupKey in the table  can be null and sql server in unable to index it. I have also tried to use the Indexed view to pre ranked them but I can't use it in my query as Rank function is not supported in indexed
    view.
    Please note this table is updated once a day and using Sql Server 2008 R2. Any help will be greatly appreciated.

    create table #result (PropertyKey int not null, BoughtDate datetime, OwnerKey int null, GroupKey int null, [Rank] int not null)Create index idx ON #result(OwnerKey ,rnk)
    insert into #result(PropertyKey, BoughtDate, OwnerKey, GroupKey, [Rank])
    select PropertyKey, BoughtDate, OwnerKey, GroupKey,
    RANK() over (partition by PropertyKey order by BoughtDate desc, OwnerKey desc, GroupKey desc) as [Rank]
    from PropertyOwners
    go
    declare @ownerKey int = 1
    select PropertyKey, BoughtDate, OwnerKey, GroupKey
    from #result as result
    where result.[Rank]=1
    and result.[OwnerKey]=@ownerKey
    go
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Sql query slow in new redhat enviornment

    We just migrated to a new dev environment in Linux REDHAT5, and now the query is very slow, and I used the TOAD to run the query, it took like 700 msecond to finish, however from any server connection, the sql query takes hours to finish.
    I checked toad monitor, it said need to increase db_buffer_cache and shared pool too small.
    Also three red alert from toad is:
    1. Library Cache get hit ratio: Dynamic or unsharable sql
    2. Chained fetch ratio: PCT free too low for a table
    3. parse to execute ratio: HIgh parse to execute ratio.
    App team said it ran real quick in the old AIX system, however I ran it in old system, and monitored in the toad, it gave me all same 5 red alerts in old system, and it did provide query results a lot quicker though.
    Here is the parameters in the old system (11gr1 on AIX):
    SQL> show parameter target
    NAME TYPE VALUE
    -------------------------------- archive_lag_target integer 0
    db_flashback_retention_target integer 1440
    fast_start_io_target integer 0
    fast_start_mttr_target integer 0
    memory_max_target big integer 0
    memory_target big integer 0
    pga_aggregate_target big integer 278928K
    sga_target big integer 0
    SQL> show parameter shared
    NAME TYPE VALUE
    -------------------------------- hi_shared_memory_address integer 0
    max_shared_servers integer
    shared_memory_address integer 0
    shared_pool_reserved_size big integer 31876710
    shared_pool_size big integer 608M
    shared_server_sessions integer
    shared_servers integer 0
    SQL> show parameter db_buffer
    SQL> show parameter buffer
    NAME TYPE VALUE
    -------------------------------- buffer_pool_keep string
    buffer_pool_recycle string
    db_block_buffers integer 0
    log_buffer integer 2048000
    use_indirect_data_buffers boolean FALSE
    SQL>
    In new 11gr2 Linux REDHAT parameter:
    NAME TYPE VALUE
    ----------- archive_lag_target integer 0
    db_flashback_retention_target integer 1440
    fast_start_io_target integer 0
    fast_start_mttr_target integer 0
    memory_max_target big integer 2512M
    memory_target big integer 2512M
    parallel_servers_target integer 192
    pga_aggregate_target big integer 0
    sga_target big integer 1648M
    SQL> show parameter shared
    NAME TYPE VALUE
    ----------- hi_shared_memory_address integer 0
    max_shared_servers integer
    shared_memory_address integer 0
    shared_pool_reserved_size big integer 28M
    shared_pool_size big integer 0
    shared_server_sessions integer
    shared_servers integer 1
    SQL> show parameter buffer
    NAME TYPE VALUE
    ----------- buffer_pool_keep string
    buffer_pool_recycle string
    db_block_buffers integer 0
    log_buffer integer 18857984
    use_indirect_data_buffers boolean FALSE
    SQL>
    Please help. Thanks in advance.

    846422 wrote:
    why need ddl? we have a sql query slow.The DDL shows the physical structure of the table and physical storage characteristics. All relevant in performance tuning.
    As for the SQL query being slow. It is not.
    You have not provided any evidence that it is slow. And no, comparing performance with a totally different system is not a valid baseline for comparison. (most cars have 4 wheels, a gearbox and a steering wheel - but that does not mean you can compare different cars like a VW Beetle with a VW Porsche)
    What is slow? What are the biggest wait states for the SQL? What does the execution plan say?
    You have not defined a problem - you identified a symptom called "+query is slow+". You need to diagnose the condition by determining exactly what the SQL qeury is doing in the database. (and please, do not use TOAD and similar tools in an attempt to do this - do it properly instead)

  • Query slow messages in logs

    Hi,
       We have a FAST ESP SP3 set up in windows 2010 server. Recently I have observed that below logs are getting logged in the error logs frequently.
     [2014-08-14 10:46:28] 
     WARNING 
     fdispatch 
     sdsdd
     15700 
     systemmsg 
     engine sdsdd:15751 query slow by 6.842s + 1.114s  
     [2014-08-14 10:46:26] 
     WARNING 
     fdispatch 
     sdsdsd
     15700 
     systemmsg 
     engine sdsdd:15745 query slow by 5.759s + 0.107s  
     [2014-08-14 10:40:50] 
     WARNING 
     fdispatch 
     sdsdd
     15700 
     systemmsg 
     engine sdddss:15741 query slow by 9.774s + 0.943s  
     [2014-08-14 10:21:54] 
    So what are the possible causes for this delay.
    How can it be rectified. Is this to do with indexer partitions are getting filled with loads of documents.
     WIth Regards,
     WARNING 
     fdispatch 
    sdsdds
     15700 
     systemmsg 
     engine sdsdds:15751 query slow by 42.360s + 18.154s  
    Santanu Mishra

    Santanu,
    Your snippet did not contain any error messages.
    Slow query can be caused by variety of factors but as you mentioned index partitions can be one of them. The query slow by messages can come from a partition that contains the most documents.
    Could you monitor resources like CPU usage (should not be pegged), swap usage (there should be none) and I/O when you get these messages.
    Also, querylogs may be helpful from these query slow timeframes . Querylogs contains some statistics that can help identify reason of slow queries. You can add more timings :http://qrserver:15100/control?debug.timings=1
    I`ve as well seen cases where slow queries are causedby  dynamic teaser generation. This can be prevented by setting an upper bound on it. This is set on the admin node, in $FASTSEARCH/etc/config_data/RTSearch/webcluster/fsearch.addon, and the setting
    to be appended at the bottom is:
    juniper.matcher.max_workset_duplicates 35
    After making this change, search-1 must be restarted on all nodes.

  • Query slow down when added a where clause

    I have a procedure that has performance issue, so I copy some of the query and run in the sql plus and try to spot which join cause the problem, but I get a result which I can figuer out why. I have a query which like below:
    Select Count(a.ID) From TableA a
    -- INNER JOIN other tables
    WHERE a.TypeID = 2;
    TableA has 140000 records, when the where clause is not added, the count return quite quick, but if I add the where clause, then the query slow down and seems never return so I have to kill my SQL Plus session. TableA has index on TypeID and TypeID is a number type. When TablA has 3000 records, the procedure return very quick, but it slow down and hang there when the TableA contains 140000 records. Any idea why this will slow down the query?
    Also, the TypeID is a foreign key to another table (TableAType), so the query above can written as :
    Select Count(a.ID) From TableA a
    -- INNER JOIN other tables
    INNER JOIN TableAType atype ON a.TypeID = atype.ID
    WHERE atype.Name = 'typename';
    TableAType table is a small table only contains less than 100 records, in this case, would the second query be more efficient to the first query?
    Any suggestions are welcome, thanks in advance...
    Message was edited by:
    user500168

    TableA now has 230000 records and 28000 of them has the TypeID 2.
    I haven't use the hint yet but thank you for your reply which let me to to run a query to check how many records in TableA has TypeID 2. When I doing this, it seems pretty fast. So I begin with the select count for TableA only and gradually add table to join and seems the query is pretty fast as long as TableA is the fist table to select from.
    Before in my query TableA is the second table to join from, there is another table (which is large as well but not as large as TableA) before TableA. So I think this is why it runs slow before. I am not at work yesterday so the query given in my post is based on my roughly memory and I forget to mention another table is joined before TableA, really sorry about that.
    I think I learn a lesson here, the largest table need to be in the begining of the select statement...
    Thank you very much everyone.

  • SQL query slow with call to function

    I have a SQL query that will return in less than a second or two with a function in-line selected in the "from" clause of the statement. As soon as I select that returned value in the SQL statement, the statement takes from anywhere from 2 to 5 minutes to return. Here is a simplified sample from the statement:
    This statement returns in a second or 2.
    select A.pk_id
    from stu_schedule A, stu_school B, stu_year C, school_year D,
    (select calc_ytd_class_abs2(Z.PK_ID,'U') ytd_unx
    from stu_schedule Z) II
    where B.pk_id = A.fk_stu_school
    and C.pk_id = B.fk_stu_year
    and D.pk_id = C.year
    and D.school_year = '2011';
    if I add this function call in, the statement runs extremely poor.
    select A.pk_id,
    II.ytd_unx
    from stu_schedule A, stu_school B, stu_year C, school_year D,
    (select calc_ytd_class_abs2(Z.PK_ID,'U') ytd_unx
    from stu_schedule Z) II
    where B.pk_id = A.fk_stu_school
    and C.pk_id = B.fk_stu_year
    and D.pk_id = C.year
    and D.school_year = '2011';
    Here is the function that is called:
    create or replace FUNCTION calc_ytd_class_abs2 (p_fk_stu_schedule in varchar2,
    p_legality in varchar2) return number IS
    l_days_absent number := 0;
    CURSOR get_class_abs IS
    select (select nvl(max(D.days_absent),'0')
    from cut_code D
    where D.pk_id = C.fk_cut_code
    and (D.legality = p_legality
    or p_legality = '%')) days_absent
    from stu_schedule_detail B, stu_class_attendance C
    where B.fk_stu_schedule = p_fk_stu_schedule
    and C.fk_stu_schedule_detail = B.pk_id;
    BEGIN
    FOR x in get_class_abs LOOP
    l_days_absent := l_days_absent + x.days_absent;
    END LOOP;
    return (l_days_absent);
    END calc_ytd_class_abs2;

    Query returns anywhere from 6000 to 32000 rows. For each of those rows a parameter is passed in to 4 different functions to get ytd totals. When I call the functions in the in-line view but do not select from them in the main SQL, the report (oh, this is Application Express 4.0 interactive reports, just an FYI) runs fast. The report comes back in a few seconds. But when I select from the in-line view to display those ytd totals, the report runs extremely slow. I know there are the articles about context switching and how mixing SQL with PL/SQL performs poorly. So I tried a pipeline table function where the function for the ytd totals populate the columns of the pipeline table and I select from the pipeline table in the SQL query in the interactive report. That seemed to perform a little worse from what I can tell.
    Thanks for any help you can offer.

  • Sql query slow due to case statement on Joins

    Hi
    The sql query runs very slow for 30 min when the below case statement is added on the joins. Could you please let me know how to tune it. if the case statement is not there then it runs only for 1 min.
    *( CASE*
    WHEN PO_DIST_GL_CODE_COMB.SEGMENT2 <> '1000'
    THEN  PO_DIST_GL_CODE_COMB.SEGMENT1 || PO_DIST_GL_CODE_COMB.SEGMENT2 || '_' || NVL(PO_DIST_GL_CODE_COMB.SEGMENT6,'000')
    WHEN DT_REQ_ALL.EMPMGMTCD IS NOT NULL AND
    PO_DIST_GL_CODE_COMB.SEGMENT2 = '1000'
    THEN DT_REQ_ALL.EMPMGMTCD
    END =DB2.DB2_FDW_MGMT_V.MH_CHILD  )
    SELECT  DISTINCT
      D.DB2_FDW_MGMT_V.RC_PARENT,
      DT_REQ_ALL.FULL_NAME,
      DT_REQ_ALL.EMP_COMPANY_CODE,
      DT_REQ_ALL.EMP_COST_CENTER,
      PO.PO_VENDORS.VENDOR_NAME,
      PO_PO_HEADERS_ALL2.SEGMENT1,
      PO_PO_HEADERS_ALL2.CREATION_DATE,
      PO_DIST_GL_CODE_COMB.SEGMENT1,
      PO_DIST_GL_CODE_COMB.SEGMENT2,
      PO_PO_HEADERS_ALL2.CURRENCY_CODE,
      PO_INV_DIST_ALL.INVOICE_NUM,
      PO_INV_DIST_ALL.INVOICE_DATE,
      (PO_INV_DIST_ALL.INVOICE_AMOUNT* PO_Rates_GL_DR.CONVERSION_RATE),
      (NVL(to_number(PO_DIST_ALL.AMOUNT_BILLED),0) * PO_Rates_GL_DR.CONVERSION_RATE),
      PO_LINES_LOC.LINE_NUM,
      GL.GL_SETS_OF_BOOKS.NAME,
      CASE
            WHEN TRUNC(PO_PO_HEADERS_ALL2.CREATION_DATE) > PO_INV_DIST_ALL.INVOICE_DATE
            THEN 1
            ELSE 0
        END ,
      PO.PO_REQUISITION_LINES_ALL.LINE_LOCATION_ID,
      TRUNC(PO_PO_HEADERS_ALL2.CREATION_DATE,'WW') + 8 WEEK_Ending
    FROM
      DB2.DB2_FDW_MGMT_V,
       PO.PO_VENDORS,
      PO.PO_HEADERS_ALL  PO_PO_HEADERS_ALL2,
      GL.GL_CODE_COMBINATIONS  PO_DIST_GL_CODE_COMB,
      AP.AP_INVOICES_ALL  PO_INV_DIST_ALL,
       PO.PO_DISTRIBUTIONS_ALL  PO_DIST_ALL,
      PO.PO_LINES_ALL  PO_LINES_LOC,
      GL.GL_SETS_OF_BOOKS,
      PO.PO_REQUISITION_LINES_ALL,
      PO.PO_LINE_LOCATIONS_ALL,
      AP.AP_INVOICE_DISTRIBUTIONS_ALL  PO_DIST_INV_DIST_ALL,
      APPS.HR_OPERATING_UNITS,
      PO.PO_REQ_DISTRIBUTIONS_ALL,
       SELECT DISTINCT
                            PO_RDA.DISTRIBUTION_ID,
                            PO_RLA.requisition_line_id,
                            PO_RHA.DESCRIPTION PO_Descr,
                            PO_RHA.NOTE_TO_AUTHORIZER PO_Justification,
                            Req_Emp.FULL_NAME,
                            GL_CC.SEGMENT1         Req_Company_Code,
                            GL_CC.SEGMENT2         Req_Cost_Center,
                            Req_Emp_CC.SEGMENT1    Emp_Company_Code,
                            Req_Emp_CC.SEGMENT2    Emp_Cost_Center,
                            (Case
                            When GL_CC.SEGMENT2 <> 8000
                            Then TRUNC(GL_CC.SEGMENT1) || TRUNC(GL_CC.SEGMENT2) || '_' || NVL(GL_CC.SEGMENT6,'000')
                            Else TRUNC(Req_Emp_CC.SEGMENT1) || TRUNC(Req_Emp_CC.SEGMENT2) || '_' || NVL(Req_Emp_CC.SEGMENT6,'000')
                            End) EmpMgmtCD
                FROM
                            PO.po_requisition_lines_all PO_rla,
                            PO.po_requisition_headers_all PO_rha,
                            PO.PO_REQ_DISTRIBUTIONS_ALL po_RDA,
                            GL.GL_CODE_COMBINATIONS gl_cc,
                            HR.PER_ALL_PEOPLE_F  Req_Emp,
                            HR.PER_ALL_ASSIGNMENTS_F Req_Emp_Assign,
                            HR.hr_all_organization_units Req_Emp_Org,
                            HR.pay_cost_allocation_keyflex Req_Emp_CC
                WHERE
                            PO_RDA.CODE_COMBINATION_ID = GL_CC.CODE_COMBINATION_ID and
                            PO_RLA.REQUISITION_LINE_ID = PO_RDA.REQUISITION_LINE_ID AND
                            PO_RLA.to_person_id = Req_Emp.PERSON_ID AND
                            PO_RLA.REQUISITION_HEADER_ID = PO_RHA.REQUISITION_HEADER_ID AND
                            (trunc(PO_rla.CREATION_DATE) between Req_Emp.effective_start_date and Req_Emp.effective_end_date OR
                            Req_Emp.effective_start_date IS NULL) AND
                            Req_Emp.PERSON_ID = Req_Emp_Assign.PERSON_ID AND
                            Req_Emp_Assign.organization_id = Req_Emp_Org.organization_id AND
                            (trunc(PO_rla.CREATION_DATE) between Req_Emp_Assign.effective_start_date and Req_Emp_Assign.effective_end_date OR
            Req_Emp_Assign.effective_start_date IS NULL) AND
            Req_Emp_Assign.primary_flag = 'Y' AND
            Req_Emp_Assign.assignment_type = 'E' AND
            Req_Emp_Org.cost_allocation_keyflex_id = Req_Emp_CC.cost_allocation_keyflex_id
      )  DT_REQ_ALL,
      SELECT
            FROM_CURRENCY,
            TO_CURRENCY,
            CONVERSION_DATE,
            CONVERSION_RATE
        FROM GL.GL_DAILY_RATES
        UNION
        SELECT Distinct
            'USD',
            'USD',
            CONVERSION_DATE,
            1
        FROM GL.GL_DAILY_RATES
      )  PO_Rates_GL_DR
    WHERE
      ( PO_DIST_GL_CODE_COMB.CODE_COMBINATION_ID=PO_DIST_ALL.CODE_COMBINATION_ID  )
      AND  ( PO_DIST_ALL.LINE_LOCATION_ID=PO.PO_LINE_LOCATIONS_ALL.LINE_LOCATION_ID  )
      AND  ( PO_PO_HEADERS_ALL2.VENDOR_ID=PO.PO_VENDORS.VENDOR_ID  )
      AND  ( PO_PO_HEADERS_ALL2.ORG_ID=APPS.HR_OPERATING_UNITS.ORGANIZATION_ID  )
      AND  ( GL.GL_SETS_OF_BOOKS.SET_OF_BOOKS_ID=APPS.HR_OPERATING_UNITS.SET_OF_BOOKS_ID  )
      AND  ( PO_PO_HEADERS_ALL2.CURRENCY_CODE=PO_Rates_GL_DR.FROM_CURRENCY  )
      AND  ( trunc(PO_PO_HEADERS_ALL2.CREATION_DATE)=PO_Rates_GL_DR.CONVERSION_DATE  )
      AND  ( PO_DIST_ALL.REQ_DISTRIBUTION_ID=PO.PO_REQ_DISTRIBUTIONS_ALL.DISTRIBUTION_ID(+)  )
      AND  ( PO.PO_REQ_DISTRIBUTIONS_ALL.REQUISITION_LINE_ID=PO.PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID(+)  )
      AND  ( PO_LINES_LOC.PO_HEADER_ID=PO_PO_HEADERS_ALL2.PO_HEADER_ID  )
      AND  ( PO.PO_LINE_LOCATIONS_ALL.PO_LINE_ID=PO_LINES_LOC.PO_LINE_ID  )
      AND  ( PO_DIST_ALL.REQ_DISTRIBUTION_ID=DT_REQ_ALL.DISTRIBUTION_ID(+)  )
      AND  ( PO_DIST_ALL.PO_DISTRIBUTION_ID=PO_DIST_INV_DIST_ALL.PO_DISTRIBUTION_ID(+)  )
      AND  ( PO_INV_DIST_ALL.INVOICE_ID(+)=PO_DIST_INV_DIST_ALL.INVOICE_ID  )
      AND  ( PO_INV_DIST_ALL.SOURCE(+) <> 'XML GATEWAY'   )
      AND 
       ( NVL(PO_PO_HEADERS_ALL2.CANCEL_FLAG,'N') <> 'Y'   )
       AND
       ( NVL(PO_PO_HEADERS_ALL2.CLOSED_CODE, 'OPEN') <> 'FINALLY CLOSED'  )
       AND
       ( NVL(PO_PO_HEADERS_ALL2.AUTHORIZATION_STATUS,'IN PROCESS') <> 'REJECTED'  )
       AND
       ( TRUNC(PO_PO_HEADERS_ALL2.CREATION_DATE)  BETWEEN TO_DATE('01-jan-2011') AND TO_DATE('04-jan-2011')  )
       AND
       PO_Rates_GL_DR.TO_CURRENCY  =  'USD'
         AND
       DB2.DB2_FDW_MGMT_V.RC_PARENT  In  ( 'Unavailable','Corp','Commercial'  )
       AND
      ( CASE
            WHEN PO_DIST_GL_CODE_COMB.SEGMENT2 <> '1000'
            THEN  PO_DIST_GL_CODE_COMB.SEGMENT1 || PO_DIST_GL_CODE_COMB.SEGMENT2 || '_' || NVL(PO_DIST_GL_CODE_COMB.SEGMENT6,'000')
            WHEN DT_REQ_ALL.EMPMGMTCD IS NOT NULL AND
                    PO_DIST_GL_CODE_COMB.SEGMENT2 = '1000'
            THEN DT_REQ_ALL.EMPMGMTCD     
        END =DB2.DB2_FDW_MGMT_V.MH_CHILD  )Explain plan. sorry can't get the explain plan from sql. this is from toad.
    Plan
    SELECT STATEMENT  ALL_ROWSCost: 53,932  Bytes: 2,607  Cardinality: 1                                                                                                                               
         79 HASH UNIQUE  Cost: 53,932  Bytes: 2,607  Cardinality: 1                                                                                                                          
              78 NESTED LOOPS OUTER  Cost: 53,931  Bytes: 2,607  Cardinality: 1                                                                                                                     
                   75 NESTED LOOPS OUTER  Cost: 53,928  Bytes: 2,560  Cardinality: 1                                                                                                                
                        72 NESTED LOOPS  Cost: 53,902  Bytes: 2,552  Cardinality: 1                                                                                                           
                             69 NESTED LOOPS OUTER  Cost: 53,900  Bytes: 2,533  Cardinality: 1                                                                                                      
                                  66 NESTED LOOPS OUTER  Cost: 53,898  Bytes: 2,521  Cardinality: 1                                                                                                 
                                       63 HASH JOIN OUTER  Cost: 53,896  Bytes: 2,509  Cardinality: 1                                                                                            
                                            40 TABLE ACCESS BY INDEX ROWID TABLE PO.PO_DISTRIBUTIONS_ALL Cost: 3  Bytes: 26  Cardinality: 1                                                                                       
                                                 39 NESTED LOOPS  Cost: 17,076  Bytes: 2,400  Cardinality: 1                                                                                  
                                                      37 NESTED LOOPS  Cost: 17,073  Bytes: 2,374  Cardinality: 1                                                                             
                                                           34 NESTED LOOPS  Cost: 17,070  Bytes: 2,362  Cardinality: 1                                                                        
                                                                31 NESTED LOOPS  Cost: 17,066  Bytes: 2,347  Cardinality: 1                                                                   
                                                                     29 NESTED LOOPS  Cost: 17,066  Bytes: 2,339  Cardinality: 1                                                              
                                                                          26 NESTED LOOPS  Cost: 17,065  Bytes: 2,312  Cardinality: 1                                                         
                                                                               23 NESTED LOOPS  Cost: 17,064  Bytes: 2,287  Cardinality: 1                                                    
                                                                                    20 NESTED LOOPS  Cost: 17,062  Bytes: 2,261  Cardinality: 1                                               
                                                                                         17 NESTED LOOPS  Cost: 17,056  Bytes: 6,678  Cardinality: 3                                          
                                                                                              15 HASH JOIN  Cost: 17,056  Bytes: 6,663  Cardinality: 3                                     
                                                                                                   13 MERGE JOIN CARTESIAN  Cost: 135  Bytes: 30,352  Cardinality: 14                                
                                                                                                        5 VIEW VIEW DB2.DB2_FDW_MGMT_V Cost: 4  Bytes: 2,128  Cardinality: 1                           
                                                                                                             4 SORT UNIQUE  Cost: 4  Cardinality: 1                      
                                                                                                                  3 UNION-ALL                 
                                                                                                                       1 REMOTE REMOTE SERIAL_FROM_REMOTE PRDFDW.WORLD          
                                                                                                                       2 FAST DUAL  Cost: 3  Cardinality: 1            
                                                                                                        12 BUFFER SORT  Cost: 135  Bytes: 560  Cardinality: 14                           
                                                                                                             11 VIEW DB2. Cost: 131  Bytes: 560  Cardinality: 14                      
                                                                                                                  10 SORT UNIQUE  Cost: 131  Bytes: 310  Cardinality: 14                 
                                                                                                                       9 UNION-ALL            
                                                                                                                            7 TABLE ACCESS BY INDEX ROWID TABLE GL.GL_DAILY_RATES Cost: 65  Bytes: 270  Cardinality: 9       
                                                                                                                                 6 INDEX SKIP SCAN INDEX (UNIQUE) GL.GL_DAILY_RATES_U1 Cost: 64  Cardinality: 1 
                                                                                                                            8 INDEX SKIP SCAN INDEX (UNIQUE) GL.GL_DAILY_RATES_U1 Cost: 64  Bytes: 4,368  Cardinality: 546       
                                                                                                   14 TABLE ACCESS FULL TABLE PO.PO_HEADERS_ALL Cost: 16,920  Bytes: 32,754  Cardinality: 618                                
                                                                                              16 INDEX UNIQUE SCAN INDEX (UNIQUE) HR.HR_ORGANIZATION_UNITS_PK Cost: 0  Bytes: 5  Cardinality: 1                                     
                                                                                         19 TABLE ACCESS BY INDEX ROWID TABLE HR.HR_ORGANIZATION_INFORMATION Cost: 2  Bytes: 35  Cardinality: 1                                          
                                                                                              18 INDEX RANGE SCAN INDEX HR.HR_ORGANIZATION_INFORMATIO_FK2 Cost: 1  Cardinality: 2                                     
                                                                                    22 TABLE ACCESS BY INDEX ROWID TABLE HR.HR_ORGANIZATION_INFORMATION Cost: 2  Bytes: 26  Cardinality: 1                                               
                                                                                         21 INDEX RANGE SCAN INDEX HR.HR_ORGANIZATION_INFORMATIO_FK2 Cost: 1  Cardinality: 1                                          
                                                                               25 TABLE ACCESS BY INDEX ROWID TABLE GL.GL_SETS_OF_BOOKS Cost: 1  Bytes: 25  Cardinality: 1                                                    
                                                                                    24 INDEX UNIQUE SCAN INDEX (UNIQUE) GL.GL_SETS_OF_BOOKS_U2 Cost: 0  Cardinality: 1                                               
                                                                          28 TABLE ACCESS BY INDEX ROWID TABLE PO.PO_VENDORS Cost: 1  Bytes: 27  Cardinality: 1                                                         
                                                                               27 INDEX UNIQUE SCAN INDEX (UNIQUE) PO.PO_VENDORS_U1 Cost: 0  Cardinality: 1                                                    
                                                                     30 INDEX UNIQUE SCAN INDEX (UNIQUE) HR.HR_ALL_ORGANIZATION_UNTS_TL_PK Cost: 0  Bytes: 8  Cardinality: 1                                                              
                                                                33 TABLE ACCESS BY INDEX ROWID TABLE PO.PO_LINES_ALL Cost: 4  Bytes: 60  Cardinality: 4                                                                   
                                                                     32 INDEX RANGE SCAN INDEX (UNIQUE) PO.PO_LINES_U2 Cost: 2  Cardinality: 4                                                              
                                                           36 TABLE ACCESS BY INDEX ROWID TABLE PO.PO_LINE_LOCATIONS_ALL Cost: 3  Bytes: 12  Cardinality: 1                                                                        
                                                                35 INDEX RANGE SCAN INDEX PO.PO_LINE_LOCATIONS_N1 Cost: 2  Cardinality: 1                                                                   
                                                      38 INDEX RANGE SCAN INDEX PO.PO_DISTRIBUTIONS_N1 Cost: 2  Cardinality: 1                                                                             
                                            62 VIEW DB2. Cost: 36,819  Bytes: 1,090  Cardinality: 10                                                                                       
                                                 61 HASH UNIQUE  Cost: 36,819  Bytes: 2,580  Cardinality: 10                                                                                  
                                                      60 NESTED LOOPS  Cost: 36,818  Bytes: 2,580  Cardinality: 10                                                                             
                                                           57 NESTED LOOPS  Cost: 36,798  Bytes: 2,390  Cardinality: 10                                                                        
                                                                54 NESTED LOOPS  Cost: 36,768  Bytes: 2,220  Cardinality: 10                                                                   
                                                                     51 NESTED LOOPS  Cost: 36,758  Bytes: 1,510  Cardinality: 10                                                              
                                                                          48 NESTED LOOPS  Cost: 36,747  Bytes: 1,050  Cardinality: 10                                                         
                                                                               45 HASH JOIN  Cost: 36,737  Bytes: 960  Cardinality: 10                                                    
                                                                                    43 HASH JOIN  Cost: 34,602  Bytes: 230,340  Cardinality: 3,490                                               
                                                                                         41 TABLE ACCESS FULL TABLE HR.PER_ALL_PEOPLE_F Cost: 1,284  Bytes: 1,848,420  Cardinality: 44,010                                          
                                                                                         42 TABLE ACCESS FULL TABLE PO.PO_REQUISITION_LINES_ALL Cost: 31,802  Bytes: 18,340,080  Cardinality: 764,170                                          
                                                                                    44 TABLE ACCESS FULL TABLE HR.PER_ALL_ASSIGNMENTS_F Cost: 2,134  Bytes: 822,540  Cardinality: 27,418                                               
                                                                               47 TABLE ACCESS BY INDEX ROWID TABLE HR.HR_ALL_ORGANIZATION_UNITS Cost: 1  Bytes: 9  Cardinality: 1                                                    
                                                                                    46 INDEX UNIQUE SCAN INDEX (UNIQUE) HR.HR_ORGANIZATION_UNITS_PK Cost: 0  Cardinality: 1                                               
                                                                          50 TABLE ACCESS BY INDEX ROWID TABLE HR.PAY_COST_ALLOCATION_KEYFLEX Cost: 1  Bytes: 46  Cardinality: 1                                                         
                                                                               49 INDEX UNIQUE SCAN INDEX (UNIQUE) HR.PAY_COST_ALLOCATION_KEYFLE_PK Cost: 0  Cardinality: 1                                                    
                                                                     53 TABLE ACCESS BY INDEX ROWID TABLE PO.PO_REQUISITION_HEADERS_ALL Cost: 1  Bytes: 71  Cardinality: 1                                                              
                                                                          52 INDEX UNIQUE SCAN INDEX (UNIQUE) PO.PO_REQUISITION_HEADERS_U1 Cost: 0  Cardinality: 1                                                         
                                                                56 TABLE ACCESS BY INDEX ROWID TABLE PO.PO_REQ_DISTRIBUTIONS_ALL Cost: 3  Bytes: 17  Cardinality: 1                                                                   
                                                                     55 INDEX RANGE SCAN INDEX PO.PO_REQ_DISTRIBUTIONS_N1 Cost: 2  Cardinality: 1                                                              
                                                           59 TABLE ACCESS BY INDEX ROWID TABLE GL.GL_CODE_COMBINATIONS Cost: 2  Bytes: 19  Cardinality: 1                                                                        
                                                                58 INDEX UNIQUE SCAN INDEX (UNIQUE) GL.GL_CODE_COMBINATIONS_U1 Cost: 1  Cardinality: 1                                                                   
                                       65 TABLE ACCESS BY INDEX ROWID TABLE PO.PO_REQ_DISTRIBUTIONS_ALL Cost: 2  Bytes: 12  Cardinality: 1                                                                                            
                                            64 INDEX UNIQUE SCAN INDEX (UNIQUE) PO.PO_REQ_DISTRIBUTIONS_U1 Cost: 1  Cardinality: 1                                                                                       
                                  68 TABLE ACCESS BY INDEX ROWID TABLE PO.PO_REQUISITION_LINES_ALL Cost: 2  Bytes: 12  Cardinality: 1                                                                                                 
                                       67 INDEX UNIQUE SCAN INDEX (UNIQUE) PO.PO_REQUISITION_LINES_U1 Cost: 1  Cardinality: 1                                                                                            
                             71 TABLE ACCESS BY INDEX ROWID TABLE GL.GL_CODE_COMBINATIONS Cost: 2  Bytes: 19  Cardinality: 1                                                                                                      
                                  70 INDEX UNIQUE SCAN INDEX (UNIQUE) GL.GL_CODE_COMBINATIONS_U1 Cost: 1  Cardinality: 1                                                                                                 
                        74 TABLE ACCESS BY INDEX ROWID TABLE AP.AP_INVOICE_DISTRIBUTIONS_ALL Cost: 26  Bytes: 16  Cardinality: 2                                                                                                           
                             73 INDEX RANGE SCAN INDEX AP.AP_INVOICE_DISTRIBUTIONS_N7 Cost: 2  Cardinality: 37                                                                                                      
                   77 TABLE ACCESS BY INDEX ROWID TABLE AP.AP_INVOICES_ALL Cost: 3  Bytes: 47  Cardinality: 1                                                                                                                
                        76 INDEX RANGE SCAN INDEX (UNIQUE) AP.AP_INVOICES_U1 Cost: 2  Cardinality: 1                                                                                                           Thanks

    Forming a new table "new_table" with 3 tables which particiapate in CASE statement logic.
    with  DT_REQ_ALL  as
       SELECT DISTINCT
                            PO_RDA.DISTRIBUTION_ID,
                            PO_RLA.requisition_line_id,
                            PO_RHA.DESCRIPTION PO_Descr,
                            PO_RHA.NOTE_TO_AUTHORIZER PO_Justification,
                            Req_Emp.FULL_NAME,
                            GL_CC.SEGMENT1         Req_Company_Code,
                            GL_CC.SEGMENT2         Req_Cost_Center,
                            Req_Emp_CC.SEGMENT1    Emp_Company_Code,
                            Req_Emp_CC.SEGMENT2    Emp_Cost_Center,
                            (Case
                            When GL_CC.SEGMENT2  8000
                            Then TRUNC(GL_CC.SEGMENT1) || TRUNC(GL_CC.SEGMENT2) || '_' || NVL(GL_CC.SEGMENT6,'000')
                            Else TRUNC(Req_Emp_CC.SEGMENT1) || TRUNC(Req_Emp_CC.SEGMENT2) || '_' || NVL(Req_Emp_CC.SEGMENT6,'000')
                            End) EmpMgmtCD
                FROM
                            PO.po_requisition_lines_all PO_rla,
                            PO.po_requisition_headers_all PO_rha,
                            PO.PO_REQ_DISTRIBUTIONS_ALL po_RDA,
                            GL.GL_CODE_COMBINATIONS gl_cc,
                            HR.PER_ALL_PEOPLE_F  Req_Emp,
                            HR.PER_ALL_ASSIGNMENTS_F Req_Emp_Assign,
                            HR.hr_all_organization_units Req_Emp_Org,
                            HR.pay_cost_allocation_keyflex Req_Emp_CC
                WHERE
                            PO_RDA.CODE_COMBINATION_ID = GL_CC.CODE_COMBINATION_ID and
                            PO_RLA.REQUISITION_LINE_ID = PO_RDA.REQUISITION_LINE_ID AND
                            PO_RLA.to_person_id = Req_Emp.PERSON_ID AND
                            PO_RLA.REQUISITION_HEADER_ID = PO_RHA.REQUISITION_HEADER_ID AND
                            (trunc(PO_rla.CREATION_DATE) between Req_Emp.effective_start_date and Req_Emp.effective_end_date OR
                            Req_Emp.effective_start_date IS NULL) AND
                            Req_Emp.PERSON_ID = Req_Emp_Assign.PERSON_ID AND
                            Req_Emp_Assign.organization_id = Req_Emp_Org.organization_id AND
                            (trunc(PO_rla.CREATION_DATE) between Req_Emp_Assign.effective_start_date and Req_Emp_Assign.effective_end_date OR
            Req_Emp_Assign.effective_start_date IS NULL) AND
            Req_Emp_Assign.primary_flag = 'Y' AND
            Req_Emp_Assign.assignment_type = 'E' AND
            Req_Emp_Org.cost_allocation_keyflex_id = Req_Emp_CC.cost_allocation_keyflex_id
    SELECT  DISTINCT
      D.DB2_FDW_MGMT_V.RC_PARENT,
      DT_REQ_ALL.FULL_NAME,
      DT_REQ_ALL.EMP_COMPANY_CODE,
      DT_REQ_ALL.EMP_COST_CENTER,
      PO.PO_VENDORS.VENDOR_NAME,
      PO_PO_HEADERS_ALL2.SEGMENT1,
      PO_PO_HEADERS_ALL2.CREATION_DATE,
      PO_DIST_GL_CODE_COMB.SEGMENT1,
      PO_DIST_GL_CODE_COMB.SEGMENT2,
      PO_PO_HEADERS_ALL2.CURRENCY_CODE,
      PO_INV_DIST_ALL.INVOICE_NUM,
      PO_INV_DIST_ALL.INVOICE_DATE,
      (PO_INV_DIST_ALL.INVOICE_AMOUNT* PO_Rates_GL_DR.CONVERSION_RATE),
      (NVL(to_number(PO_DIST_ALL.AMOUNT_BILLED),0) * PO_Rates_GL_DR.CONVERSION_RATE),
      PO_LINES_LOC.LINE_NUM,
      GL.GL_SETS_OF_BOOKS.NAME,
      CASE
            WHEN TRUNC(PO_PO_HEADERS_ALL2.CREATION_DATE) > PO_INV_DIST_ALL.INVOICE_DATE
            THEN 1
            ELSE 0
        END ,
      PO.PO_REQUISITION_LINES_ALL.LINE_LOCATION_ID,
      TRUNC(PO_PO_HEADERS_ALL2.CREATION_DATE,'WW') + 8 WEEK_Ending
    FROM
      ( SELECT * FROM
          DB2.DB2_FDW_MGMT_V,
          GL.GL_CODE_COMBINATIONS  PO_DIST_GL_CODE_COMB,
          DT_REQ_ALL
        WHERE
              DB2.DB2_FDW_MGMT_V.RC_PARENT  In  ( 'Unavailable','Corp','Commercial'  )
           AND
            CASE
               WHEN PO_DIST_GL_CODE_COMB.SEGMENT2  <>  '1000'
               THEN  PO_DIST_GL_CODE_COMB.SEGMENT1 || PO_DIST_GL_CODE_COMB.SEGMENT2 || '_' || NVL(PO_DIST_GL_CODE_COMB.SEGMENT6,'000')
               WHEN DT_REQ_ALL.EMPMGMTCD IS NOT NULL AND
                    PO_DIST_GL_CODE_COMB.SEGMENT2 = '1000'
               THEN DT_REQ_ALL.EMPMGMTCD     
            END =DB2.DB2_FDW_MGMT_V.MH_CHILD
       )   new_table,
       PO.PO_VENDORS,
      PO.PO_HEADERS_ALL  PO_PO_HEADERS_ALL2,
      AP.AP_INVOICES_ALL  PO_INV_DIST_ALL,
       PO.PO_DISTRIBUTIONS_ALL  PO_DIST_ALL,
      PO.PO_LINES_ALL  PO_LINES_LOC,
      GL.GL_SETS_OF_BOOKS,
      PO.PO_REQUISITION_LINES_ALL,
      PO.PO_LINE_LOCATIONS_ALL,
      AP.AP_INVOICE_DISTRIBUTIONS_ALL  PO_DIST_INV_DIST_ALL,
      APPS.HR_OPERATING_UNITS,
      PO.PO_REQ_DISTRIBUTIONS_ALL,
      SELECT
            FROM_CURRENCY,
            TO_CURRENCY,
            CONVERSION_DATE,
            CONVERSION_RATE
        FROM GL.GL_DAILY_RATES
        UNION
        SELECT Distinct
            'USD',
            'USD',
            CONVERSION_DATE,
            1
        FROM GL.GL_DAILY_RATES
      )  PO_Rates_GL_DR
    WHERE
      ( PO_DIST_GL_CODE_COMB.CODE_COMBINATION_ID=PO_DIST_ALL.CODE_COMBINATION_ID  )
      AND  ( PO_DIST_ALL.LINE_LOCATION_ID=PO.PO_LINE_LOCATIONS_ALL.LINE_LOCATION_ID  )
      AND  ( PO_PO_HEADERS_ALL2.VENDOR_ID=PO.PO_VENDORS.VENDOR_ID  )
      AND  ( PO_PO_HEADERS_ALL2.ORG_ID=APPS.HR_OPERATING_UNITS.ORGANIZATION_ID  )
      AND  ( GL.GL_SETS_OF_BOOKS.SET_OF_BOOKS_ID=APPS.HR_OPERATING_UNITS.SET_OF_BOOKS_ID  )
      AND  ( PO_PO_HEADERS_ALL2.CURRENCY_CODE=PO_Rates_GL_DR.FROM_CURRENCY  )
      AND  ( trunc(PO_PO_HEADERS_ALL2.CREATION_DATE)=PO_Rates_GL_DR.CONVERSION_DATE  )
      AND  ( PO_DIST_ALL.REQ_DISTRIBUTION_ID=PO.PO_REQ_DISTRIBUTIONS_ALL.DISTRIBUTION_ID(+)  )
      AND  ( PO.PO_REQ_DISTRIBUTIONS_ALL.REQUISITION_LINE_ID=PO.PO_REQUISITION_LINES_ALL.REQUISITION_LINE_ID(+)  )
      AND  ( PO_LINES_LOC.PO_HEADER_ID=PO_PO_HEADERS_ALL2.PO_HEADER_ID  )
      AND  ( PO.PO_LINE_LOCATIONS_ALL.PO_LINE_ID=PO_LINES_LOC.PO_LINE_ID  )
      AND  ( PO_DIST_ALL.REQ_DISTRIBUTION_ID=DT_REQ_ALL.DISTRIBUTION_ID(+)  )
      AND  ( PO_DIST_ALL.PO_DISTRIBUTION_ID=PO_DIST_INV_DIST_ALL.PO_DISTRIBUTION_ID(+)  )
      AND  ( PO_INV_DIST_ALL.INVOICE_ID(+)=PO_DIST_INV_DIST_ALL.INVOICE_ID  )
      AND  ( PO_INV_DIST_ALL.SOURCE(+)  'XML GATEWAY'   )
      AND 
       ( NVL(PO_PO_HEADERS_ALL2.CANCEL_FLAG,'N')  'Y'   )
       AND
       ( NVL(PO_PO_HEADERS_ALL2.CLOSED_CODE, 'OPEN')  'FINALLY CLOSED'  )
       AND
       ( NVL(PO_PO_HEADERS_ALL2.AUTHORIZATION_STATUS,'IN PROCESS')  'REJECTED'  )
       AND
       ( TRUNC(PO_PO_HEADERS_ALL2.CREATION_DATE)  BETWEEN TO_DATE('01-jan-2011') AND TO_DATE('04-jan-2011')  )
       AND
       PO_Rates_GL_DR.TO_CURRENCY  =  'USD'
      

  • Insert query slows in Timesten

    Hello DB Experts ,
    I am inserting bulk data with ttbulkcp command. my permsize is 20GB . Insert query gets slow . can anyone help me that how can i maximize throughput by ttbulkcp.
    Regards,

    Hi Chris thanks for your reply.
    I have uncommented that memlock parameter is working now. I will not use system DSN now onwards. thanks for that suggestion .
    1.    The definition of the table you are loading data into, including indexes.
    My Comments : Table defination.The table doesnot having any primary key and any indexes.
    create table TBLEDR
    (snstarttime number,
    snendtime number,
    radiuscallingstationid number,
    ipserveripaddress varchar2(2000) DEFAULT '0',
    bearer3gppimsi varchar2(2000) DEFAULT '0',
    ipsubscriberipaddress  varchar2(2000),
    httpuseragent  varchar2(2000) DEFAULT '0',
    bearer3gppimei  varchar2(256) DEFAULT '0',
    httphost varchar2(2000) DEFAULT '0',
    ipprotocol  varchar2(256) DEFAULT '0',
    voipduration varchar2(256) DEFAULT '0',
    traffictype varchar2(256) DEFAULT '0',
    httpcontenttype varchar2(2000) DEFAULT '0',
    transactiondownlinkbytes number DEFAULT '0',
    transactionuplinkbytes number DEFAULT '0',
    transactiondownlinkpackets number  DEFAULT '0',
    transactionuplinkpackets number DEFAULT '0',
    radiuscalledstationid  varchar2(2000) DEFAULT '0',
    httpreferer varchar2(4000) DEFAULT '0',
    httpurl varchar2(4000) DEFAULT '0',
    p2pprotocol  varchar2(4000)  DEFAULT '0'
    2.    Whether the indexes (if any) are in place while you are loading the data.
    My comments: No indexes are there.
    3.    The CPU type and speed.
    Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz .32 core .
    4.    The type of disk storage you are using for the filesystem containing the database.
    We are not using any external storage. we are using linux ext3 filesystem.
    5.   The location of the CSV file that you are loading - is it on the same filesystem as the database files?
    My comment - database files are resides on /opt partition. and yes the CSV files are also placed in same directories .those files are in /opt/Files.
    6.   The number of rows of data in the CSV file.
    My comment - in per CSV file there is around 50,000 Records.
    7.   Originally you said 'I am only getting 15000 to 17000 TPS'. How are you measuring this? Do you TPS (i.e. commutes per second) or 'rows inserted per second'? Note that by default ttBulkCp commits every 1024 rows so if you are measuring commits then the insert rate is 1024 x that.
    My comment- Now I have set timing on at bash prompt. lets say when i have run command ./ttbulkcp at that time i have note down the timing. now when the command complete , i am again note down the time. and then i am calculating the TPS. further in this, i have one file with ttbulkcp . I am having 50000 records in file. and out of these records around 38000 records gets sucsucced. and thus i am calculating TPS.

  • Does XML approach for passing parameters in the query make the query slow?

    Hi,
    I am using XML approach for passing parameters in a query. This is running very slow but when I pass comma separated values in parameter, it runs very fast.
    So it concludes that we should not use XML approach for passing parameters. Please confirm me that Am I right or wrong?
    I have also googled to clear my doubt but not get solution till now. please help me.
    Regards,
    Sachin

    914014 wrote:
    Hi,
    I am using XML approach for passing parameters in a query. This is running very slow but when I pass comma separated values in parameter, it runs very fast.
    So it concludes that we should not use XML approach for passing parameters. Please confirm me that Am I right or wrong?
    I have also googled to clear my doubt but not get solution till now. please help me.
    Regards,
    SachinShow us what you are doing, create a simple yet complete example we can run on our Oracle instances.
    Then we will know exactly what you mean, and can comment appropriately.
    Cheers,

  • Query slower in stored procedure(after upgrade to 16)

    Hi all,
    We are looking to upgrade our SQL Anywhere 9 database to 16. We thought version 16 is slower in update tables, but the reason of slowness are query's in stored procedures called from the trigger. One of the query's has a duration of 8 times the duration in version 9!! When I run the query in Interactive Sql(v16), they run fast like version 9. So the query runs slower in a stored procedure.
    I thought parameter sniffing, but it's not MS Sql Server. I've no idea why it was good in v9 and bad in v16. Have someone a idea?
    It's a query with subquery's in the where , a view in the from. In the view are unions. Looks not so special.
    thanks

    It may be more convenient for you to ask this question on the other forum: SAP SQL Anywhere Forum
    Preamble...
    It sometimes happens that (a) the same query will perform faster or slower in different versions because of different behaviors by the query optimizer. In most cases a minor change is necessary to restore good performance; in some rare cases, the changes are difficult.
    It also sometimes happens that (b) the same query will perform faster or slower under different operating conditions; e.g., client request (ISQL) versus inside a BEGIN block (stored procedure). Again, minor changes all that's required in most cases, sometimes otherwise.
    Details...
    In order to help, we will need more information. Two graphical plans with statistics for the same problematic query, both using V16, one captured in ISQL, and the other one captured inside the stored procedure, is the best way to pass on the information; ALL OTHER forms are inadequate, especially prose descriptions and edited snippets of code (that way lies frustration for all parties).
    There are a number of articles about graphical plans on this blog.

  • Query slow after upgrade

    Hi All,
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    We have upgraded to 11g, however, many queries in our DB is running slow. I have pasted the trace file one of the query which is part of the procedure. this query is a Cursor, and executed many times per the business logic.
    In 10g, this procedure was hardly taking any time to execute like 2 mins, on 11g it is taking more than 7 mins to execute. The culprit is the query for which i have given the trace file.
    1. Plan for the query is changed from 10g to 11g, something like in 10g it was using a filter and 11g it is using a nested semi- loop
    2. However, I can't find why this query is taking even though the plan is not bad.
    Edited by: user11969842 on Nov 7, 2011 1:42 PM
    Edited by: user11969842 on Nov 7, 2011 2:27 PM

    I had similar issues. for this you need to check the undocumented performance parameters.
    i had issue with a query in which earlier 10g CBO was using hash joins but 11g DBO was using nested loops.
    I referred following link.
    https://coskan.wordpress.com/2011/02/17/plan-stability-through-upgrade-why-is-my-plan-changed-new-optimizer-parameters/
    Also what I did was I set the session CBO compatibility to 10.2.0.4
    alter session set optimizer_features_enable='10.2.0.4';
    and query run perfectly fine.
    then i tried to change 10.2.0.4 to 10.2.0.5 and then to 11.1.0.6 and performance detoriated when i changed to 11.1.0.6.
    So now i had list between 10.2.0.5 and 11.1.0.6 as per method on above referenced link.
    I could pin point one optimizer which was in 11.1.0.6 and not in 10.2.0.5.
    alter session set "_optimizer_extend_jppd_view_types"=FALSE
    Thats it i changed it to FALSE and my Query was running perfect as it was running in 10g.
    Oracle generally sets new CBO parameters to TRUE hence this issue.
    Regards,
    Vinay Mistry
    DBA ATOS

  • Query slow due to dblink

    Hi All,
    We are experiencing slow performance for a query which is using dblink.
    Our Database version is 8i
    Our OS is Windows 2000
    the explain plan is as below.
    Explain plan:-
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=7494 Card=1 Bytes=38
    0)
    1 0 SORT (ORDER BY) (Cost=7494 Card=1 Bytes=380)
    2 1 SORT (GROUP BY) (Cost=7494 Card=1 Bytes=380)
    3 2 HASH JOIN (Cost=7489 Card=1 Bytes=380)
    4 3 MERGE JOIN (CARTESIAN) (Cost=9 Card=17 Bytes=1479)
    5 4 NESTED LOOPS (Cost=8 Card=1 Bytes=63)
    6 5 TABLE ACCESS (FULL) OF 'CATMAP' (Cost=1 Card=1 B
    ytes=14)
    7 5 TABLE ACCESS (BY GLOBAL INDEX ROWID) OF 'DOCPART
    EXT' (Cost=7 Card=1 Bytes=49)
    8 7 INDEX (RANGE SCAN) OF 'DOCPARTEXT_I10' (NON-UN
    IQUE) (Cost=3 Card=1)
    9 4 SORT (JOIN) (Cost=2 Card=17 Bytes=408)
    10 9 TABLE ACCESS (FULL) OF 'PARTGROUP' (Cost=1 Card=
    17 Bytes=408)
    11 3 REMOTE* (Cost=7311 Card=1161896 Bytes=340435528) PRICE
    11 SERIAL_FROM_REMOTE SELECT "PARTID","PARTGROUP","PARTDESCRIPTION
    ","IMAGEFILENAME" FROM "DIST"."
    Statistics
    18 recursive calls
    14 db block gets
    38130 consistent gets
    378 physical reads
    172 redo size
    65623 bytes sent via SQL*Net to client
    2983 bytes received via SQL*Net from client
    25 SQL*Net roundtrips to/from client
    3 sorts (memory)
    0 sorts (disk)
    360 rows processed
    The above query sometimes execute in 2 seconds and sometimes it takes almost 150 secs
    Please advice how to tune this query.
    Regards,
    ang

    Hi Anurag,
    I found below stuff in system wait events.
    EVENTS Total Waits
    SQL*Net message to client     112838591     0     0     0
    SQL*Net message to dblink     297216585     0     0     0
    SQL*Net more data to client     7965780     0     0     0
    SQL*Net more data to dblink     2207     0     0     0
    SQL*Net message from client     112838213     0     0     0
    SQL*Net more data from client     525083     0     0     0
    SQL*Net message from dblink     297216585     0     0     0
    SQL*Net more data from dblink     94103530     0     0     0
    SQL*Net break/reset to client     10115895     0     0     0
    SQL*Net break/reset to dblink     41218     0     0     0
    Above are the highest wait events in v$system_event.
    Regards,
    Ang

  • Query slows down after upgrade

    Hi,
    After upgrade from oracle 10 to oracle 11 a simple query is slowing down alot.
    Same amount of records, same table only the execution cost time is increased
    Can someone give me some feedback over this problem?
    Can I check some things to look into the problem?
    Thx in advance.
    Greetings
    query:
    Select nvl(sum(a.BM_OPENSTAAND_DEBET- a.BM_OPENSTAAND_CREDIT),0)
    from bh.bh123gh a
    where
    a.F123_AR_NR>='4400000000' and
    a.F123_AR_NR<='4404000000' and
    a.F123_KL_LEV_AR_NR='0631001000' and
    a.SRT_REK=2 and
    a.F123_BKJR>=0000 and
    a.F123_BKJR<=2011 and
    a.F123_FIRMA=2
    explain plans
    oracle 11
    cost 1,792
    Bytes: 38
    Cardinality: 1
    oracle 10
    cost 1,594
    Bytes: 38
    Cardinality: 1

    >
    After upgrade from oracle 10 to oracle 11 a simple query is slowing down alot.
    Same amount of records, same table only the execution cost time is increased
    Can someone give me some feedback over this problem?
    Can I check some things to look into the problem?
    Thx in advance.
    >
    Is it just one query or all queries are behaving strangely? If it's just one query, do a trace and see where it's slowing down.
    In the meanwhile, you can also modify the optimizer_features_enable parameter at session level and check the explain plan.
    Alter session set optimizer_features_enable='10.2.0.5';
    Now test the query.
    By the way, if you are just worried about the COST factor, you can just ignore it. COST by itself has no real meaning. You will only have to look at the response time.
    Regards

  • Selecting same column twice makes query slow

    Hello,
    Has anybody any idea why following statement is slow when selecting the
    DATA_TYPE column twice?
    SELECT S.OWNER,
    S.SYNONYM_NAME,
    UCOL.COLUMN_NAME,
    UCOL.DATA_TYPE,
    UCOL.DATA_TYPE,
    UCOL.DATA_LENGTH,
    COLUMN_ID
    FROM ALL_SYNONYMS S,
    ALL_TAB_COLUMNS UCOL
    WHERE S.TABLE_OWNER = UCOL.OWNER
    AND S.TABLE_NAME = UCOL.TABLE_NAME
    and S.owner = 'REPORTING_TEST'
    and S.SYNONYM_NAME = 'OV_COMMERCIAL_ENTITY_JN'
    Replace the owner and table name with one of your own.
    If you take one of the DATA_TYPE's out the select is much faster.
    Why, I hear you ask, do you select the same column twice?
    Well, it's not me. It's BusinessObjects when it does a structure refresh it
    produces a statement similar to the one above except that one of the
    DATA_TYPE's is a SUBSTR + DECODE (however they in themselves
    have virtually no impact on the statement). I just find it weird that repeating
    a column twice can have such a dramatic impact on performance.
    I'm not a tuning expert and have looked at EXPLAIN PLAN outputs but can't
    make head nor tail of them.
    Thanks,
    Ruud

    Yes it's true that Oracle caches data but I did run both statements several times within the same session. Run statement 1, run statement 2, add 2nd column and run again, take column away and run again, etc. Always the results were the same. The query with duplicate columns ran in seconds, the one without in milliseconds.
    If it tells you anything, below both explain plans. The main difference that I noticed is the full table scan on USER$ for the first query. The second one (although a more elaborate execution plan) seems to use indexes more.
    Don't spend too much time on this. I've found a workaround where I create temporary tables for ALL_SYNONYMS and ALL_TAB_COLUMNS and re-direct the public synonyms to point at those. After I've done what I wanted to do with BusinessObjects, I restore the original public synonyms. Next thing I'll try is rebuilding my database from scratch and see if the problem is still there.
    Apologies if the listings come out in variable font (how do you paste fixed font?).
    === SQL1 ====================================================
    EXPLAIN PLAN FOR
    SELECT UCOL.COLUMN_NAME,
    UCOL.DATA_TYPE,
    UCOL.DATA_TYPE
    FROM ALL_SYNONYMS S,
    ALL_TAB_COLUMNS UCOL
    WHERE S.TABLE_OWNER = UCOL.OWNER
    AND S.TABLE_NAME = UCOL.TABLE_NAME
    AND S.owner = 'REPORTING_TEST'
    AND S.SYNONYM_NAME = 'OV_COMMERCIAL_ENTITY_JN'
    Explained.
    Elapsed: 00:00:00.04
    SQL> @E:\Oracle\Product\10.2.0\db_1\RDBMS\ADMIN\utlxpls.sql
    Plan hash value: 1692851197
    | Id | Operation | Name |
    | 0 | SELECT STATEMENT | |
    | 1 | NESTED LOOPS | |
    | 2 | NESTED LOOPS | |
    | 3 | NESTED LOOPS | |
    | 4 | TABLE ACCESS BY INDEX ROWID | USER$ |
    |* 5 | INDEX UNIQUE SCAN | I_USER1 |
    | 6 | VIEW | ALL_TAB_COLUMNS |
    |* 7 | FILTER | |
    | 8 | NESTED LOOPS OUTER | |
    | 9 | NESTED LOOPS OUTER | |
    | 10 | NESTED LOOPS OUTER | |
    | 11 | NESTED LOOPS OUTER | |
    | 12 | NESTED LOOPS | |
    | 13 | NESTED LOOPS | |
    | 14 | TABLE ACCESS FULL | USER$ |
    | 15 | TABLE ACCESS BY INDEX ROWID| OBJ$ |
    |* 16 | INDEX RANGE SCAN | I_OBJ2 |
    |* 17 | TABLE ACCESS CLUSTER | COL$ |
    |* 18 | INDEX UNIQUE SCAN | I_OBJ# |
    |* 19 | TABLE ACCESS CLUSTER | COLTYPE$ |
    |* 20 | INDEX RANGE SCAN | I_HH_OBJ#_INTCOL# |
    |* 21 | TABLE ACCESS BY INDEX ROWID | OBJ$ |
    |* 22 | INDEX RANGE SCAN | I_OBJ3 |
    | 23 | TABLE ACCESS CLUSTER | USER$ |
    |* 24 | INDEX UNIQUE SCAN | I_USER# |
    |* 25 | TABLE ACCESS CLUSTER | TAB$ |
    |* 26 | INDEX UNIQUE SCAN | I_OBJ# |
    | 27 | NESTED LOOPS | |
    | 28 | FIXED TABLE FULL | X$KZSRO |
    |* 29 | INDEX RANGE SCAN | I_OBJAUTH2 |
    |* 30 | FIXED TABLE FULL | X$KZSPR |
    |* 31 | TABLE ACCESS BY INDEX ROWID | OBJ$ |
    |* 32 | INDEX RANGE SCAN | I_OBJ2 |
    |* 33 | TABLE ACCESS BY INDEX ROWID | SYN$ |
    |* 34 | INDEX UNIQUE SCAN | I_SYN1 |
    Predicate Information (identified by operation id):
    5 - access("U"."NAME"='REPORTING_TEST')
    7 - filter(("O"."TYPE#"=3 OR "O"."TYPE#"=4 OR "O"."TYPE#"=2 AND NOT
    EXISTS (SELECT 0 FROM "SYS"."TAB$" "T" WHERE "T"."OBJ#"=:B1 AND
    (BITAND("T"."PROPERTY",512)=512 OR BITAND("T"."PROPERTY",8192)=8192)))
    AND ("O"."OWNER#"=USERENV('SCHEMAID') OR EXISTS (SELECT 0 FROM
    "SYS"."OBJAUTH$" "OBJAUTH$",SYS."X$KZSRO" "X$KZSRO" WHERE "OBJ#"=:B2
    AND "GRANTEE#"="KZSROROL") OR EXISTS (SELECT 0 FROM SYS."X$KZSPR"
    "X$KZSPR" WHERE "INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-45)
    OR (-"KZSPRPRV")=(-47) OR (-"KZSPRPRV")=(-48) OR (-"KZSPRPRV")=(-49) OR
    (-"KZSPRPRV")=(-50)))))
    16 - access("O"."OWNER#"="U"."USER#")
    17 - filter(DECODE("C"."PROPERTY",0,'NO',DECODE(BITAND("C"."PROPERTY",
    32),32,'YES','NO'))='NO')
    18 - access("O"."OBJ#"="C"."OBJ#")
    19 - filter("C"."INTCOL#"="AC"."INTCOL#"(+))
    20 - access("C"."OBJ#"="H"."OBJ#"(+) AND
    "C"."INTCOL#"="H"."INTCOL#"(+))
    21 - filter("OT"."TYPE#"(+)=13)
    22 - access("AC"."TOID"="OT"."OID$"(+))
    24 - access("OT"."OWNER#"="UT"."USER#"(+))
    25 - filter(BITAND("T"."PROPERTY",512)=512 OR
    BITAND("T"."PROPERTY",8192)=8192)
    26 - access("T"."OBJ#"=:B1)
    29 - access("GRANTEE#"="KZSROROL" AND "OBJ#"=:B1)
    30 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-45) OR
    (-"KZSPRPRV")=(-47) OR (-"KZSPRPRV")=(-48) OR (-"KZSPRPRV")=(-49) OR
    (-"KZSPRPRV")=(-50)))
    31 - filter("O"."TYPE#"=5)
    32 - access("O"."OWNER#"="U"."USER#" AND
    "O"."NAME"='OV_COMMERCIAL_ENTITY_JN')
    33 - filter("S"."NAME"="UCOL"."TABLE_NAME" AND
    "S"."OWNER"="UCOL"."OWNER")
    34 - access("O"."OBJ#"="S"."OBJ#")
    Note
    - rule based optimizer used (consider using cbo)
    === SQL2 ====================================================
    EXPLAIN PLAN FOR
    SELECT UCOL.COLUMN_NAME,
    UCOL.DATA_TYPE
    FROM ALL_SYNONYMS S,
    ALL_TAB_COLUMNS UCOL
    WHERE S.TABLE_OWNER = UCOL.OWNER
    AND S.TABLE_NAME = UCOL.TABLE_NAME
    AND S.owner = 'REPORTING_TEST'
    AND S.SYNONYM_NAME = 'OV_COMMERCIAL_ENTITY_JN'
    Explained.
    SQL>
    SQL> @E:\Oracle\Product\10.2.0\db_1\RDBMS\ADMIN\utlxpls.sql
    Plan hash value: 3285788911
    | Id | Operation | Name |
    | 0 | SELECT STATEMENT | |
    | 1 | TABLE ACCESS BY INDEX ROWID | OBJ$ |
    |* 2 | INDEX UNIQUE SCAN | I_OBJ1 |
    | 3 | TABLE ACCESS BY INDEX ROWID | OBJ$ |
    |* 4 | INDEX UNIQUE SCAN | I_OBJ1 |
    | 5 | TABLE ACCESS BY INDEX ROWID | OBJ$ |
    |* 6 | INDEX UNIQUE SCAN | I_OBJ1 |
    | 7 | TABLE ACCESS BY INDEX ROWID | OBJ$ |
    |* 8 | INDEX UNIQUE SCAN | I_OBJ1 |
    | 9 | TABLE ACCESS BY INDEX ROWID | OBJ$ |
    |* 10 | INDEX UNIQUE SCAN | I_OBJ1 |
    |* 11 | FILTER | |
    | 12 | NESTED LOOPS OUTER | |
    | 13 | NESTED LOOPS OUTER | |
    | 14 | NESTED LOOPS OUTER | |
    | 15 | NESTED LOOPS OUTER | |
    | 16 | NESTED LOOPS | |
    | 17 | NESTED LOOPS | |
    | 18 | NESTED LOOPS | |
    | 19 | NESTED LOOPS | |
    | 20 | NESTED LOOPS | |
    | 21 | TABLE ACCESS BY INDEX ROWID| USER$ |
    |* 22 | INDEX UNIQUE SCAN | I_USER1 |
    |* 23 | TABLE ACCESS BY INDEX ROWID| OBJ$ |
    |* 24 | INDEX RANGE SCAN | I_OBJ2 |
    | 25 | TABLE ACCESS BY INDEX ROWID | SYN$ |
    |* 26 | INDEX UNIQUE SCAN | I_SYN1 |
    | 27 | TABLE ACCESS BY INDEX ROWID | USER$ |
    |* 28 | INDEX UNIQUE SCAN | I_USER1 |
    | 29 | TABLE ACCESS BY INDEX ROWID | OBJ$ |
    |* 30 | INDEX RANGE SCAN | I_OBJ2 |
    |* 31 | TABLE ACCESS CLUSTER | COL$ |
    |* 32 | INDEX UNIQUE SCAN | I_OBJ# |
    |* 33 | TABLE ACCESS CLUSTER | COLTYPE$ |
    |* 34 | INDEX RANGE SCAN | I_HH_OBJ#_INTCOL# |
    |* 35 | TABLE ACCESS BY INDEX ROWID | OBJ$ |
    |* 36 | INDEX RANGE SCAN | I_OBJ3 |
    | 37 | TABLE ACCESS CLUSTER | USER$ |
    |* 38 | INDEX UNIQUE SCAN | I_USER# |
    |* 39 | TABLE ACCESS CLUSTER | TAB$ |
    |* 40 | INDEX UNIQUE SCAN | I_OBJ# |
    | 41 | NESTED LOOPS | |
    | 42 | FIXED TABLE FULL | X$KZSRO |
    |* 43 | INDEX RANGE SCAN | I_OBJAUTH2 |
    |* 44 | FIXED TABLE FULL | X$KZSPR |
    Predicate Information (identified by operation id):
    2 - access("O"."OBJ#"=:B1)
    4 - access("O"."OBJ#"=:B1)
    6 - access("O"."OBJ#"=:B1)
    8 - access("O"."OBJ#"=:B1)
    10 - access("O"."OBJ#"=:B1)
    11 - filter(("O"."TYPE#"=3 OR "O"."TYPE#"=4 OR "O"."TYPE#"=2 AND NOT
    EXISTS (SELECT 0 FROM "SYS"."TAB$" "T" WHERE "T"."OBJ#"=:B1 AND
    (BITAND("T"."PROPERTY",512)=512 OR BITAND("T"."PROPERTY",8192)=8192)))
    AND ("O"."OWNER#"=USERENV('SCHEMAID') OR EXISTS (SELECT 0 FROM
    "SYS"."OBJAUTH$" "OBJAUTH$",SYS."X$KZSRO" "X$KZSRO" WHERE "OBJ#"=:B2
    AND "GRANTEE#"="KZSROROL") OR EXISTS (SELECT 0 FROM SYS."X$KZSPR"
    "X$KZSPR" WHERE "INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-45)
    OR (-"KZSPRPRV")=(-47) OR (-"KZSPRPRV")=(-48) OR (-"KZSPRPRV")=(-49) OR
    (-"KZSPRPRV")=(-50)))))
    22 - access("U"."NAME"='REPORTING_TEST')
    23 - filter("O"."TYPE#"=5)
    24 - access("O"."OWNER#"="U"."USER#" AND
    "O"."NAME"='OV_COMMERCIAL_ENTITY_JN')
    26 - access("O"."OBJ#"="S"."OBJ#")
    28 - access("S"."OWNER"="U"."NAME")
    30 - access("O"."OWNER#"="U"."USER#" AND "S"."NAME"="O"."NAME")
    31 - filter(DECODE("C"."PROPERTY",0,'NO',DECODE(BITAND("C"."PROPERTY",
    32),32,'YES','NO'))='NO')
    32 - access("O"."OBJ#"="C"."OBJ#")
    33 - filter("C"."INTCOL#"="AC"."INTCOL#"(+))
    34 - access("C"."OBJ#"="H"."OBJ#"(+) AND
    "C"."INTCOL#"="H"."INTCOL#"(+))
    35 - filter("OT"."TYPE#"(+)=13)
    36 - access("AC"."TOID"="OT"."OID$"(+))
    38 - access("OT"."OWNER#"="UT"."USER#"(+))
    39 - filter(BITAND("T"."PROPERTY",512)=512 OR
    BITAND("T"."PROPERTY",8192)=8192)
    40 - access("T"."OBJ#"=:B1)
    43 - access("GRANTEE#"="KZSROROL" AND "OBJ#"=:B1)
    44 - filter("INST_ID"=USERENV('INSTANCE') AND ((-"KZSPRPRV")=(-45) OR
    (-"KZSPRPRV")=(-47) OR (-"KZSPRPRV")=(-48) OR (-"KZSPRPRV")=(-49) OR
    (-"KZSPRPRV")=(-50)))
    Note
    - rule based optimizer used (consider using cbo)

  • Query slower due to sorting('order by')

    I have a query which when sorted is about 5 times slower.
    The 'order by' is on 3 different fields from 3 different tables, there are indexes present for all 3 columns. The number of records returned is about 5000.
    Any Ideas !!

    Sinantopuz was on to something -- but we could be talking about memory versus disk. Is SORT_AREA_SIZE too small? Or maybe you are using PGA_AGGREGATE_TARGET?
    If WORKAREA_SIZE_POLICY = AUTO, then reference PGA_AGGREGRATE_TARGET (show parameters pga_aggregate_target in SQL*Plus).
    Otherwise, review the SORT_AREA_SIZE.
    The SET AUTOTRACE will show disk sorts versus memory sorts. Disk sorts should be avoided by increasing your sort area (SORT_AREA_SIZE, PGA_AGGREGATE_TARGET, maybe even HASH_AREA_SIZE).
    Good luck.

Maybe you are looking for

  • Audio out from HDMI port?

    I have connected my TV and Booklet via a standard HDMI cable.  This same HDMI cable works fine with my DVD player.   When I use it with my booklet, only video seems to be sent to the TV via the HDMI cable.  Is the HDMI out port supporting only video,

  • Dead iMac scree

    Hi, I have the 2009 model iMac and while replacing my dvd drive I either didn't attach some cables back correct or something shorted out. Now my iMac's screen doesn't power on but the computer runs. Is there a way to use an external screen to use for

  • Mapping 2-3 receivers based on type.

    Hi experts My source message is as below: <?xml version="1.0" encoding="utf-8" ?> <ns:testdata xmlns:ns="http://mytest.com/dotcom/test"> <row> <Type>D</Type> <ACCT>111001</ACCT> <AMT>1000</AMt> </row> <row> <Type>D</Type> <ACCT>111001</ACCT> <AMT>550

  • Adobe Acrobat Reader X 10.x MUI ohne Sprachabfrage

    Hallo, Ich versuche den Acrobat Reader in einer Firmenumgebung zu installieren. Nach der Installation startet der Reader mit einer Sprachabfrage in der das Programm laufen soll. Wie kann ich das verhindern? Kann ich die Standardeinstellung (z.B. deut

  • How to turn of group message on iPhone 5 ios 6

    Hi, I would like to turn off group message on iPhone 5, 6.1.4. If I send a message to the sender of the group message, won't reply aver unify else involve in the conversation. Thanks.