Select * query is slow on one particular table

Hi ,
I am using forms and reports of AppServer 10g,one particular form accesing one table ...The select * from statement on that table is slow.Any amendmends to be taken care of at the tablespace level??
Help needed urgent...
Regards,
Ashlee

Hi,
This is a general type of question. please be specific. Golden Thumb rule is that don't use '*", instead use the column names. Analyze the table and take a execution plan and check for index usage .
Please give the problem statement also so that we can help you.

Similar Messages

  • Issue in data replication for one particular table

    Hi,
    We have implemented streams in out test environment and testing the business functionalities. We have an issue in data replication for only one custom table all other tables data replications are proper no issue. When we do 100 rows update data replication is not happening for that particular table.
    Issue to simulate
    Update one row -- Replication successful.
    100 rows update -- After 3-4 hrs nothing happened.
    Please let me know did any of you have come across similar issue.
    Thanks,
    Anand

    Extreme slowness on apply site are usually due to lock, library cache locks or too big segments in streams technical tables left after a failure during heavy insert. these tables are scanned with full table scan and scanning hundreds of time empty millions of empty blocks result in a very big loss of performance, but not in the extend your are describing. In your case it sound more like a form of lock.
    We need more info on this table : Lob segments? tablespace in ASSM?
    If the table is partitioned and do you have a job that perform drop partitions? most interesting is what are the system waits nd above all the apply server sessions waits. given the time frame, I would more looks after a lock or an library cache lock due to a drop partitions or concurrent updates. When you are performing the update, you may query 'DBA_DDL_LOCKS', 'DBA_KGLLOCK' and 'DBA_LOCK_INTERNAL' to check that you are not taken in a library cache lock.

  • Select query performance improvement - Index on EDIDC table

    Hi Experts,
    I have a scenario where in I have to select data from the table EDIDC. The select query being used is given below.
      SELECT  docnum
              direct
              mestyp
              mescod
              rcvprn
              sndprn
              upddat
              updtim
      INTO CORRESPONDING FIELDS OF TABLE t_edidc
      FROM edidc
      FOR ALL ENTRIES IN t_error_idoc
      WHERE
      upddat GE gv_date1 AND
      upddat LE gv_date2 AND
      updtim GE p_time AND
      status EQ t_error_idoc-status.
    As the volume of the data is very high, our client requested to put up some index or use an existing one to improve the performance of the data selection query.
    Question:
    4.    How do we identify the index to be used.
    5.    On which fields should the indexing be done to improve the performance (if available indexes donu2019t cater to our case).
    6.    What will be the impact on the table performance if we create a new index.
    Regards ,
    Raghav

    Question:
    1.    How do we identify the index to be used.
    Generally the index is automatically selected by SAP (DB Optimizer )  ( You can still mention the index name in your select query by changing the syntax)
      For your select Query the second Index will be called automatically by the Optimizer, ( Because  the select query has u2018Updatu2019 , u2018uptimu2019 in the sequence before the u2018statusu2019 ) .
    2.    On which fields should the indexing be done to improve the performance (if available indexes donu2019t cater to our case).
    (Create a new Index with MANDT and the 4 fields which are in the where clause in sequence  )
    3.    What will be the impact on the table performance if we create a new index.
    ( Since the index which will be newly created is only the 4th index for the table, there shouldnu2019t be any side affects)
    After creation of index , Check the change in performance of the current program and also some other programs which are having the select queries on EDIDC ( Various types of where clauses preferably ) to verify that the newly created index is not having the negative impact on the performance. Additionally, if possible , check if you can avoid  into corresponding fields .
    Regards ,
    Seth

  • Sinlge select query in diff schemas for same table(Indentical Structure)

    Scenario :
    Table XYZ is created in Schema A
    After an year, the old data from the previous year would be moved to different schema. However in the other schema the same table name would be used.
    For eg
    Schema A contains table XYZ with data of 2012 yr
    Schema B contains table XYZ with data of 2011 yr
    Table XYZ in both the schemas have identical structure.
    So can we fire a single select query to read the data from both the tables in effective way.
    Eg select * from XYZ where date range between 15-Oct-2011 to 15-Mar-2012.
    However the data resides in 2 different schema altogether.
    Creating an view is an option.
    But my problem, there is ORM layer(either Hibernate or Eclipse Top Link) between the application and the database.
    So the queries would be formed by the ORM layer and are not hand generated.
    So i cannot use view.
    So is there any option that would allow me to use single query on different schema's ?

    Hi,
    970773 wrote:
    Scenario :
    Table XYZ is created in Schema A
    After an year, the old data from the previous year would be moved to different schema. However in the other schema the same table name would be used.
    For eg
    Schema A contains table XYZ with data of 2012 yr
    Schema B contains table XYZ with data of 2011 yr
    Table XYZ in both the schemas have identical structure.
    So can we fire a single select query to read the data from both the tables in effective way.That depends on what you mean by "effective".
    Eg select * from XYZ where date range between 15-Oct-2011 to 15-Mar-2012.
    However the data resides in 2 different schema altogether.You can do a UNION, so the data from the two years appears together. The number of actual tables may make the query slower, but it won;t change the results.
    Given that you have 2 tables, the fact that they are in different schemas doesn't matter. Just make sure the user running the query has SELECT privileges on both of them.
    Creating an view is an option.Is it? You seem to say it is not, below.
    But my problem, there is ORM layer(either Hibernate or Eclipse Top Link) between the application and the database.
    So the queries would be formed by the ORM layer and are not hand generated.
    So i cannot use view.So creating a view is not an option. Or is it?
    So is there any option that would allow me to use single query on different schema's ?Anything that you can do with a view, you can do with sub-queries. A view is merely a convenience; it just saves a sub-query, so you don't have to re-code it every time you use it. Assuming you have privilges to query the base tables, you can always avoid using a view by repeating the query that defines the view in your own query. It will not be any slower

  • SELECT query very slow, need suggestion.

    Dear all,
    Below stmt was coded in my report program.
    It was taking around 14 seconds in development system. The days in s_datum was just 1 or 2 days max.
    But when the same was transferred to test system, it is taking almost 10 minutes, though it we gave just 1 day.
      SELECT * FROM likp INTO TABLE i_likp                  
            WHERE erdat IN s_datum AND wadat_ist > '00000000' 
              AND lfart <> 'EL'                               
              AND vstel not in s_vstel.
    Some of you might suggest to make SELECT query with only s_datum, but i tried it in dev system, it was taking almost 22 secs with only s_datum.  I thought it could be more worse in test system so, did not move that idea.
    Can some one please suggest me why it is happening so.

    Hi,
    The difference, as I suppose you know, happens because LIKP probably has much more records in production than in the development system.
    You must think what is selective in your WHERE clause:
    - erdat in s_datum is selective if you are are only using one day
    - wadat_ist GE '00000000' is not selective (all deliveries with goods issue fulfill that condition)
    - lfart NE 'EL' probably is not selective
    - vsten not in s_vstel probably is not selective
    So in the end only erdat is selective. There is no index in LIKP by ERDAT, so if you really want to make it faster you would need an index by ERDAT.
    Still, if you are only making one SELECT (not inside a loop) I wouldn't expect that to take more than 10 minutes.
    I would measure the program with SE30 to make sure it is really the SELECT that is taking so much time (post here the results), and if it really is the select post here the explain plan.
    By the way, if you need to know all goods issues for the last day I would use change pointers instead.
    Hope this helps,
    Rui Dantas

  • Query performance slow in one instance in RAC

    Hi
    We have 3 node RAC. When we test onw query it slow by 40% in one instance and always physical reads are hapenning in that instance.
    Below are the details. All the parameters are same. Users compains some times the query is slow.
    Thanks in Advance.
    From Instance 1 - 9 Sec
    =============================================================
    Statistics
              0  recursive calls
              1  db block gets
          67209  consistent gets
              0  physical reads
              0  redo size
          23465  bytes sent via SQL*Net to client
          10356  bytes received via SQL*Net from client
             28  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             13  rows processed
    From Instance 2 - 13 Sec
    =============================================================
    Statistics
              0  recursive calls
              1  db block gets
          67215  consistent gets
          67193  physical reads    <<------------------------ Only in one instance
              0  redo size
          23465  bytes sent via SQL*Net to client
          10356  bytes received via SQL*Net from client
             28  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             13  rows processed
    From Instance 3 - 9 Sec
    =============================================================
    Statistics
              0  recursive calls
              1  db block gets
          67209  consistent gets
              0  physical reads
              0  redo size
          23465  bytes sent via SQL*Net to client
          10356  bytes received via SQL*Net from client
             28  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             13  rows processed

    You can also check global cache statistics. Run this before and after your query :
    select name, value from v$mystat s, v$statname n where s.statistic#=n.statistic# and name like '%blocks received';

  • Query not executing for one particular value

    Hi
    I have query on multi provider. and this multi provider is combination of Info objects only but not any ODS or cubes. I have one key figure in this multi provider.while executing the query i need to give input for variabl which has 7 different values. Query is executing fine for 6 values but not for one particular value.
    query executed in listcube transaction and it is executed fine here for the same selection. then what might be the reason?
    Please advise as soon as possible.
    Thanks

    Hi Kiran,
    are you maintaining any filters in the query? or is there any logic in the exit for this variable.
    regards.

  • Sinlge select query in different schemas for same table(Indentical Structu)

    Scenario :
    Table XYZ is created in Schema A
    After an year, the old data from the previous year would be moved to different schema. However in the other schema the same table name would be used.
    For eg
    Schema A contains table XYZ with data of 2012 yr
    Schema B contains table XYZ with data of 2011 yr
    Table XYZ in both the schemas have identical structure.
    So can we fire a single select query to read the data from both the tables in effective way.
    Eg select * from XYZ where date range between 15-Oct-2011 to 15-Mar-2012.
    However the data resides in 2 different schema altogether.

    Thanks for the reply
    Creating an view is an option.
    But my problem, there is ORM layer(either Hibernate or Eclipse Top Link) between the application and the database.
    So the queries would be formed by the ORM layer and are not hand generated.
    So i cannot use view.
    So is there any option that would allow me to use single query on different schema's ?

  • Dynamic Select query is failing with error "Invalid Table Name"

    OPEN rc FOR 'SELECT count(*) from :s' USING tab_name;
    fetch rc into rec_count;
    CLOSE rc;
    my requirement is to build dynamic select query to retrieve the total count of rows in each table ( variable tab_name contains the table_name )
    But I am getting stuck by this errror, not sure if there is any alternative !
    ORA-00903: invalid table name
    ORA-06512: at line 43

    OPEN rc FOR 'SELECT count(*) from '||tab_name;
    fetch rc into rec_count;
    CLOSE rc;
    -- This will work
    1. Create a sql statement.
    2. Open ref cursor for that statement.

  • Simple SELECT query to generate  INSERT for a table

    Hi,
    I am looking for a SELECT query which generates INSERT statements for a table.Please guide.
    Thanks
    PG.

    Like this?
    SQL> SELECT * from kons;
         COL1      COL2
            1         1
            2         2
    SQL> SELECT 'INSERT INTO kons VALUES('||col1||','||col2||');' statement FROM kons;
    STATEMENT
    INSERT INTO kons VALUES(1,1);
    INSERT INTO kons VALUES(2,2);
    SQL> If you have character and / or date columns you will have to change my example,
    but you might get the idea from it.
    You can spool the result to a file.
    Regards,
    Guido
    Edit: ';' added to end of statement...

  • Select query for sales order for particular customer oder text and storage

    Hi All,
    I am trying to retriev customer order text and customer storage bin from the following select query, but it's giving huge number of records, I want to restrict the number of records.
    Select customer order text, customer storage bin
                       Select STXH–TDOBJECT, STXH–TDID
                       Where  TDOBJECT = VBBP
                              TDID = Y001
                              TDID = Y007
    Please let me know how to restirct the number of records.
    Thanks,
    Ranjan

    Try using the FM 'READ_TEXT'.
    NAME will be the order number concatenated with the item number.
    And you have the ID and OBJECT.  You may also need to use the LANGUAGE.
    Message was edited by:
            Matt Nagel

  • Nested Tables select query soooooo slow

    I know that varrays are supposed to be used for small arrays. But, we are comparing nested tables to varrays and two table joins. Nested table query is unimaginably ,unacceptably slow.
    Is there anybody else out there who experienced the same thing. Are there ways to speed up the select queries.(besides indexes)

    If you try to use nested sql statement. Please be sure to setup the index to some specific tables inside oracle
    Doing this will speed up your performance about 5 ~ 9 times original.
    [email protected]

  • Query running slow in one node

    Hi All,
    We are running 4-node Oracle 10g RAC (linux 64-bit). The query is running fast in one node, but the same query is running very slow in the other node. And sometimes, we see pin S wait on X wait event in top 5 events.
    Has anyone faced this kind of situation before ?
    Thanks,
    Kumar

    Hi,
    Execute your query on node where query is running very slow. Get SID and execute query above to see what is event of waiting.
    exec dbms_application_info.set_client_info('@sw2')
    -- file sw2.sql
    col event  format     a25  heading "Wait Event" trunc
    col state  format     a15  heading "Wait State" trunc
    col siw    format   99999  heading "Waited So|Far (ms)"
    col wt     format 9999999  heading "Time Waited|(ms)"
    select event,
           state,
           seconds_in_wait siw,
           wait_time wt
    from   v$session_wait
    where  sid = &sid
    order by event;
    exec dbms_application_info.set_client_info('@sw1');
    -- file  sw1.sql
    set linesize 30000
    set pagesize 200
    col sid      format    9999  heading "SID"
    col username format     a10  heading "USERNAME"
    col osuser   format     a20  heading "OSUSER"
    col event    format     a25  heading "Wait Event" trunc
    col state    format     a15  heading "Wait State" trunc
    col siw      format   99999  heading "Waited So|Far (ms)"
    col wt       format 9999999  heading "Time Waited|(ms)"
    col sw1      format 9999999  heading "File"
    col sw2      format 9999999  heading "Block"
    col Objeto   format a50
    select sw.event,
           sw.p1,
           sw.p2,
           sw.p3,
           sw.state,
           s.sid,
           S.osuser,
           s.username,
           nvl(s.program, s.module),
           sw.seconds_in_wait siw,
           sw.wait_time wt
      from gv$session_wait sw,
           gv$session s
    WHERE sw.sid = s.sid
       and sw.EVENT NOT LIKE 'SQL%'
       and username is not NULL
       and s.inst_id = sw.inst_id
       and sw.event not like 'PX%'
    order by 1, 6, 7;Regards,
    Levi Pereira

  • Delete query is slow in one schema.

    Hi All,
    I have two schemas in a database PRDPUB and TOOLSERVER . In both the schemas i have a table BP_USER_PROFILE containg same amount of data , indexes and constrains. I am using one delete query to delete 26000 records from both the table , but in PRDPUB schema it is hanging but in TOOLSERVER schema it is running fine.When i tried to delete 100 records using the same query in PRDPUB schema it is taking 44 second nad 13 milisecond in TOOLSERVER.
    when i generated the exution plan it is very much same .But when i see the trace file i see in PRDPUB schema it is accessing the disk and doing parsing and execution 2 times , while in TOOLSERVER schema it is deleting in memory and parsing and executing once.
    For your reference i am attching the expalin plan and trace file output. Please help me out to resolve the issue.
    explain plan for delete from bp_user_profile where id_user in (select id_user from (SELECT * FROM bp_user_profile WHERE
    id_home_category=5005 AND DT_USER_LAST_UPDATED <'01-DEC-09' AND ID_USER_STATUS_ACTIVE ='DELETED_BY_ADMIN'
    OR ID_USER_STATUS_ACTIVE ='DELETED_BY_USER') where rownum<=100);
    PLAN_TABLE_OUTPUT in PRDPUB schema
    Plan hash value: 288284804
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | DELETE STATEMENT | | 100 | 7600 | 1906 (1)| 00:00:23 |
    | 1 | DELETE | BP_USER_PROFILE | | | | |
    | 2 | NESTED LOOPS | | 100 | 7600 | 1906 (1)| 00:00:23 |
    | 3 | VIEW | VW_NSO_1 | 100 | 1300 | 1885 (1)| 00:00:23 |
    | 4 | SORT UNIQUE | | 100 | 2100 | | |
    |* 5 | COUNT STOPKEY | | | | | |
    |* 6 | TABLE ACCESS BY INDEX ROWID | BP_USER_PROFILE | 86428 | 1772K| 1885 (1)| 00:00:23 |
    | 7 | BITMAP CONVERSION TO ROWIDS | | | | | |
    | 8 | BITMAP OR | | | | | |
    | 9 | BITMAP CONVERSION FROM ROWIDS | | | | | |
    |* 10 | INDEX RANGE SCAN | BP_USER_PROFILE_ID_USER_STATUS | | | 12 (0)| 00:00:01 |
    | 11 | BITMAP AND | | | | | |
    | 12 | BITMAP CONVERSION FROM ROWIDS| | | | | |
    |* 13 | INDEX RANGE SCAN | BP_USER_PROFILE_ID_USER_STATUS | | | 2 (0)| 00:00:01 |
    | 14 | BITMAP CONVERSION FROM ROWIDS| | | | | |
    |* 15 | INDEX RANGE SCAN | BP_USR_PROF_IDCATG | | | 79 (2)| 00:00:01 |
    |* 16 | INDEX UNIQUE SCAN | BP_USR_PROF_PK_ID_USER | 1 | 63 | 1 (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
    5 - filter(ROWNUM<=100)
    6 - filter("ID_USER_STATUS_ACTIVE"='DELETED_BY_USER' OR "ID_USER_STATUS_ACTIVE"='DELETED_BY_ADMIN' AND
    "ID_HOME_CATEGORY"=5005 AND "DT_USER_LAST_UPDATED"<'01-DEC-09')
    10 - access("ID_USER_STATUS_ACTIVE"='DELETED_BY_USER')
    13 - access("ID_USER_STATUS_ACTIVE"='DELETED_BY_ADMIN')
    15 - access("ID_HOME_CATEGORY"=5005)
    PLAN_TABLE_OUTPUT
    16 - access("ID_USER"="$nso_col_1")
    PLAN_TABLE_OUTPUT
    Plan hash value: 288284804
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | DELETE STATEMENT | | 102 | 7752 | 2892 (2)| 00:00:35 |
    | 1 | DELETE | BP_USER_PROFILE | | | | |
    | 2 | NESTED LOOPS | | 102 | 7752 | 2892 (2)| 00:00:35 |
    | 3 | VIEW | VW_NSO_1 | 100 | 1300 | 2871 (1)| 00:00:35 |
    | 4 | SORT UNIQUE | | 100 | 2100 | | |
    |* 5 | COUNT STOPKEY | | | | | |
    |* 6 | TABLE ACCESS BY INDEX ROWID | BP_USER_PROFILE | 170K| 3500K| 2871 (1)| 00:00:35 |
    | 7 | BITMAP CONVERSION TO ROWIDS | | | | | |
    | 8 | BITMAP OR | | | | | |
    | 9 | BITMAP CONVERSION FROM ROWIDS | | | | | |
    |* 10 | INDEX RANGE SCAN | BP_USER_PROFILE_ID_USER_STATUS | | | 22 (0)| 00:00:01 |
    | 11 | BITMAP AND | | | | | |
    | 12 | BITMAP CONVERSION FROM ROWIDS| | | | | |
    |* 13 | INDEX RANGE SCAN | BP_USER_PROFILE_ID_USER_STATUS | | | 22 (0)| 00:00:01 |
    | 14 | BITMAP CONVERSION FROM ROWIDS| | | | | |
    |* 15 | INDEX RANGE SCAN | BP_USR_PROF_IDCATG | | | 78 (2)| 00:00:01 |
    |* 16 | INDEX UNIQUE SCAN | BP_USR_PROF_PK_ID_USER | 1 | 63 | 1 (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
    5 - filter(ROWNUM<=100)
    6 - filter("ID_USER_STATUS_ACTIVE"='DELETED_BY_USER' OR "ID_USER_STATUS_ACTIVE"='DELETED_BY_ADMIN' AND
    "ID_HOME_CATEGORY"=5005 AND "DT_USER_LAST_UPDATED"<'01-DEC-09')
    10 - access("ID_USER_STATUS_ACTIVE"='DELETED_BY_USER')
    13 - access("ID_USER_STATUS_ACTIVE"='DELETED_BY_ADMIN')
    15 - access("ID_HOME_CATEGORY"=5005)
    PLAN_TABLE_OUTPUT
    16 - access("ID_USER"="$nso_col_1")
    34 rows selected.
    =====================================
    trace file out put:
    delete from prdpub.bp_user_profile where id_user in (select id_user from (SELECT * FROM prdpub.bp_user_profile WHERE
    id_home_category=:"SYS_B_0" AND DT_USER_LAST_UPDATED <:"SYS_B_1" AND ID_USER_STATUS_ACTIVE =:"SYS_B_2"
    OR ID_USER_STATUS_ACTIVE =:"SYS_B_3") where rownum<=:"SYS_B_4")
    call count cpu elapsed disk query current rows
    Parse 2 0.00 0.00 0 0 0 0
    Execute 2 0.61 0.61 1027 1574 8292 200
    Fetch 0 0.00 0.00 0 0 0 0
    total 4 0.61 0.61 1027 1574 8292 200
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: SYS
    Rows Row Source Operation
    0 DELETE BP_USER_PROFILE (cr=1542994 pr=527 pw=0 time=43954914 us)
    100 NESTED LOOPS (cr=794 pr=13 pw=0 time=125348 us)
    100 VIEW VW_NSO_1 (cr=558 pr=0 pw=0 time=95818 us)
    100 SORT UNIQUE (cr=558 pr=0 pw=0 time=95618 us)
    100 COUNT STOPKEY (cr=558 pr=0 pw=0 time=94328 us)
    100 TABLE ACCESS BY INDEX ROWID BP_USER_PROFILE (cr=558 pr=0 pw=0 time=94325 us)
    103 BITMAP CONVERSION TO ROWIDS (cr=481 pr=0 pw=0 time=93891 us)
    1 BITMAP OR (cr=481 pr=0 pw=0 time=93879 us)
    1 BITMAP CONVERSION FROM ROWIDS (cr=88 pr=0 pw=0 time=11643 us)
    22224 INDEX RANGE SCAN BP_USER_PROFILE_ID_USER_STATUS (cr=88 pr=0 pw=0 time=77 us)(object id 89712)
    1 BITMAP AND (cr=393 pr=0 pw=0 time=80750 us)
    1 BITMAP CONVERSION FROM ROWIDS (cr=10 pr=0 pw=0 time=1150 us)
    1911 INDEX RANGE SCAN BP_USER_PROFILE_ID_USER_STATUS (cr=10 pr=0 pw=0 time=21 us)(object id 89712)
    3 BITMAP CONVERSION FROM ROWIDS (cr=383 pr=0 pw=0 time=105831 us)
    181506 INDEX RANGE SCAN BP_USR_PROF_IDCATG (cr=383 pr=0 pw=0 time=26 us)(object id 88278)
    100 INDEX UNIQUE SCAN BP_USR_PROF_PK_ID_USER (cr=236 pr=13 pw=0 time=8945 us)(object id 88279)
    delete from toolserver.bp_user_profile where id_user in (select id_user from (SELECT * FROM toolserver.bp_user_profile WHERE
    id_home_category=:"SYS_B_0" AND DT_USER_LAST_UPDATED <:"SYS_B_1" AND ID_USER_STATUS_ACTIVE =:"SYS_B_2"
    OR ID_USER_STATUS_ACTIVE =:"SYS_B_3") where rownum<=:"SYS_B_4")
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.13 0.12 0 741 3144 100
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.13 0.12 0 741 3144 100
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: SYS
    Rows Row Source Operation
    0 DELETE BP_USER_PROFILE (cr=741 pr=0 pw=0 time=123855 us)
    100 NESTED LOOPS (cr=741 pr=0 pw=0 time=95704 us)
    100 VIEW VW_NSO_1 (cr=528 pr=0 pw=0 time=94093 us)
    100 SORT UNIQUE (cr=528 pr=0 pw=0 time=94091 us)
    100 COUNT STOPKEY (cr=528 pr=0 pw=0 time=93729 us)
    100 TABLE ACCESS BY INDEX ROWID BP_USER_PROFILE (cr=528 pr=0 pw=0 time=93724 us)
    102 BITMAP CONVERSION TO ROWIDS (cr=490 pr=0 pw=0 time=93380 us)
    1 BITMAP OR (cr=490 pr=0 pw=0 time=93369 us)
    1 BITMAP CONVERSION FROM ROWIDS (cr=93 pr=0 pw=0 time=11663 us)
    22722 INDEX RANGE SCAN BP_USER_PROFILE_ID_USER_STATUS (cr=93 pr=0 pw=0 time=78 us)(object id 87755)
    1 BITMAP AND (cr=397 pr=0 pw=0 time=80340 us)
    1 BITMAP CONVERSION FROM ROWIDS (cr=11 pr=0 pw=0 time=1118 us)
    1911 INDEX RANGE SCAN BP_USER_PROFILE_ID_USER_STATUS (cr=11 pr=0 pw=0 time=15 us)(object id 87755)
    3 BITMAP CONVERSION FROM ROWIDS (cr=386 pr=0 pw=0 time=104382 us)
    181849 INDEX RANGE SCAN BP_USR_PROF_IDCATG (cr=386 pr=0 pw=0 time=24 us)(object id 87758)
    100 INDEX UNIQUE SCAN BP_USR_PROF_PK_ID_USER (cr=213 pr=0 pw=0 time=1194 us)(object id 87754)
    Edited by: user12956550 on Apr 8, 2010 11:03 AM

    Hi,
    is your delete correct?
    delete from toolserver.bp_user_profile where id_user in (select id_user from (SELECT * FROM toolserver.bp_user_profile WHERE
    id_home_category=:"SYS_B_0" AND DT_USER_LAST_UPDATED <:"SYS_B_1" AND ID_USER_STATUS_ACTIVE =:"SYS_B_2"
    OR ID_USER_STATUS_ACTIVE =:"SYS_B_3") where rownum<=:"SYS_B_4")There is a suspected OR in the where clause, I expect you have to check both statusses with the date and home category, so I think your query should be (add parenthesisses around the two statusses):
    delete from toolserver.bp_user_profile where id_user in (select id_user from (SELECT * FROM toolserver.bp_user_profile WHERE
    id_home_category=:"SYS_B_0" AND DT_USER_LAST_UPDATED <:"SYS_B_1"
    AND
    ( -- added
    ID_USER_STATUS_ACTIVE =:"SYS_B_2"
    OR ID_USER_STATUS_ACTIVE =:"SYS_B_3"
    ) -- added
    ) where rownum<=:"SYS_B_4")Further is the content the same, if these are different, you could also have differences in execution time.
    Herald ten Dam
    Superconsult.nl

  • How to use dynamic select query which queries from 3 different table.

    Hi All,
    I am new to Toplink, i would like to use a named query to select some of the columns from 3 different tables with dynamic where clause.
    I have used the following lines. Please tell me how to get code for the dynamic where clause.
    First try :
    Vector objPersons = (Vector)session.executeQuery("findPersonByGlobalID",Person.class,vQueryArguments);
    The above method is not returning the vector or collection.
    Second Try:
    ReadAllQuery query = new ReadAllQuery(Person.class);
    query.useCollectionClass(LinkedList.class);
    LinkedList person = (LinkedList) session.executeQuery(query);
    The second try is returning the collection but, this fetches all the record from the table.
    1. How to query for range of records?
    2. How to query from multiple tables for some range. How to use dynamic range values ?
    Please reply with your answers or some pointers would help.
    Thanks and Regards,
    Vijay.B

    Hi,
    Did you try using a SQLCall ? It might be able to satisfy you requirements .. :-
    Employee employee = (Employee) session.executeSelectingCall(
        new SQLCall("SELECT * FROM EMPLOYEE WHERE EMP_ID = 44")
    );You can get more information here :-
    http://www.oracle.com/technology/products/ias/toplink/doc/1013/MAIN/_html/qrybas004.htm
    Regards,
    Sandeep

Maybe you are looking for

  • How do I print a web page and make it look "right"?

    When I try to print a web page, the printout (and preview) does not match the on-screen web page look. Does anyone know why that is? For example, the fonts change to Times New Roman, links appear underlined, the format changes, and some images disapp

  • JTree custom icon help

    Hi, i am trying to get custom icon for specific nodes of a tree. In my customTreeCellrenderer that extends the default predecessor, i have this function. The problem is that, the icons are not set to the node i want but the node after that node. Anyo

  • My songs only exist on my iPod now...

    I used iTunes between a Windows laptop and my 15 GB iPod. Last week I dropped my laptop, sent it to Dell, and they told me that it arrived DOA. So I just bought a brand new Windows laptop and installed iTunes. When I connect my iPod iTunes states tha

  • Time Balance, rate and dynamic Calc

    Hi all, I am calculating a Rate which equal to Sales / Quantity. I put my indicator Rate as a dynamic calc but I don't know how to recalculate it at quarter level Example, What currently occurs whith time balance flow so completly false:      JAN    

  • Run a process when leaving a page

    Hello, Is it possible to run a process when users leave a page? Let me explain: On a page, I have an Automatic Row Processing (DML) and a PL/SQL process. These two process are run when users click on the "Apply change" button. Is it possible to run t