Simple select query is taking a lot of time

hi gems...
my table has 7267563 rows...and i am doing a simple select * from table;
but it is taking a lot of time nearly 25minutes but not completed...
when i did select count(1) from table then it gave the result instantly also select * from table where rownum < 10 is also fine...even when i am selecting all the records using rownum i.e. select * from table where rownum < 7267563 is also giving result instantly...
but the entire table is not getting result i.e. select * from table...also there is no lock in the table(though i know that select is nothing to do with lock)..
what may be the issue..please suggest...thanks in advance...
Edited by: user12780416 on Dec 12, 2011 11:08 PM

Hi;
Please see below thread
query takes too long ...
help in solving long run query
HOW TO: Post a SQL statement tuning request - template posting
Hope it helps
Regard
Helios

Similar Messages

  • Can we optimize the query  :  It is taking a lot of time

    the following query is taking a lot of time ...
    Can anyone suggest to make it run faster ???
    table B has 12 million records
    table a has 10000 records
    CREATE TABLE less_time
         PARALLEL
         NOLOGGING
         AS
         SELECT a.user_id,a.mp_id, COUNT(product_id) product _count
         FROM table a,table b
         WHERE TRUNC(a.call_time) < TRUNC(SYSDATE) - 1
         AND a.history_id = b.call_id
         AND b.product_type = 1
         AND b..product_status= 50
         AND user_id IS NOT NULL
         GROUP BY user_id,mp_id;

    analyze index indx_mtx compute statistics
    thanks for explaining David ...
    Actually I somewhat bettered it
    i made a consolidated index on table b
    like create index indx_ty on table b (call_id,mp_id,user_id,b.product_type,product_status)
    now the explain plan shows that the query is much much faster also i did one trick in the query
    SELECT a.user_id,a.mp_id, COUNT(product_id) product _count
    i changed to SELECT a.user_id,a.mp_id, COUNT(1) product _count
    to enable it to do FFS
    thanks anyways ....

  • Select query is taking lot of time to fetch data.....

    Select query is taking lot of time to fetch data.
        SELECT algnum atanum  abdatu abzeit abname abenum bmatnr bmaktx bqdatu bqzeit bvlenr bnlenr bvltyp bvlber b~vlpla
               bnltyp bnlber bnlpla bvsola b~vorga INTO TABLE it_final FROM ltak AS a
                       INNER JOIN ltap AS b ON  btanum EQ atanum AND algnum EQ blgnum
                       WHERE a~lgnum = p_whno
                       AND a~tanum IN s_tono
                       AND a~bdatu IN s_tocd
                       AND a~bzeit IN s_bzeit
                       AND a~bname IN s_uname
                       AND a~betyp = 'P'
                       AND b~matnr IN s_mno
                       AND b~vorga <> 'ST'.
    Moderator message: Please Read before Posting in the Performance and Tuning Forum
    Edited by: Thomas Zloch on Mar 27, 2011 12:05 PM

    Hi Shiva,
    I am using two more select queries with the same manner ....
    here are the other two select query :
    ***************1************************
    SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelpt LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelptrprctr
        WHERE rldnr  = c_telstra_projects
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          and rzzlstar in r_lstar             
          AND rpmax  = c_max_period.
    and the second one is
    *************************2************************
      SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelnt LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelntrprctr
        WHERE rldnr  = c_telstra_networks
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          and rzzlstar in r_lstar                              
          AND rpmax  = c_max_period.
    for both the above table program is taking very less time .... although both the table used in above queries have similar amount of data. And i can not remove the APPENDING CORRESPONDING. because i have to append the data after fetching from the tables.  if i will not use it will delete all the data fetched earlier.
    Thanks on advanced......
    Sourabh

  • A simple select query taking forever

    Hi All
    I am not able to execute a simple select query, I traced my session and here is TKPROF of that Trace.
    Solaris 8 , Oracle 10.2.0.4.0
    TKPROF: Release 10.2.0.4.0 -
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Trace file: 502_ora_28260.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    select OBJECT_ID , ORACLE_USERNAME , SESSION_ID
    from
      v$locked_object
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.03      32.86          0          0          6           0
    total        3      0.03      32.86          0          0          6           0
    Misses in library cache during parse: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS
    Rows     Row Source Operation
          0  MERGE JOIN  (cr=0 pr=0 pw=0 time=60 us)
          0   SORT JOIN (cr=0 pr=0 pw=0 time=58 us)
          0    MERGE JOIN  (cr=0 pr=0 pw=0 time=42 us)
          1     SORT JOIN (cr=0 pr=0 pw=0 time=2443 us)
       1105      FIXED TABLE FULL X$KSUSE (cr=0 pr=0 pw=0 time=1204 us)
          0     SORT JOIN (cr=0 pr=0 pw=0 time=41 us)
       1001      FIXED TABLE FULL X$KTCXB (cr=0 pr=0 pw=0 time=16132 us)
          0   SORT JOIN (cr=0 pr=0 pw=0 time=0 us)
          0    FIXED TABLE FULL X$KTADM (cr=0 pr=0 pw=0 time=0 us)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       1        0.00          0.00
      buffer busy waits                              34        0.97         32.83
      SQL*Net break/reset to client                   1        0.00          0.00
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.03      32.86          0          0          6           0
    total        3      0.03      32.86          0          0          6           0
    Misses in library cache during parse: 1
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       2        0.00          0.00
      SQL*Net message from client                     1       19.00         19.00
      buffer busy waits                              34        0.97         32.83
      SQL*Net break/reset to client                   1        0.00          0.00
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      0      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        0      0.00       0.00          0          0          0           0
    Misses in library cache during parse: 0
        1  user  SQL statements in session.
        0  internal SQL statements in session.
        1  SQL statements in session.
    Trace file: 502_ora_28260.trc
    Trace file compatibility: 10.01.00
    Sort options: default
           0  session in tracefile.
           1  user  SQL statements in trace file.
           0  internal SQL statements in trace file.
           1  SQL statements in trace file.
           1  unique SQL statements in trace file.
          64  lines in trace file.
          32  elapsed seconds in trace file. There is nothing fishy in alert logs... Please guide
    Thanks

    There it is TOP
    $ RUMPSHAKER>top
    load averages:  6.63,  7.45,  7.88;                    up 33+12:02:33           
    3631 processes: 3616 sleeping, 5 zombie, 1 stopped, 9 on cpu
    CPU states: 58.6% idle, 18.2% user, 23.2% kernel,  0.0% iowait,  0.0% swap
    Memory: 192G phys mem, 92G free mem, 96G swap, 96G free swap
       PID USERNAME LWP PRI NICE  SIZE   RES STATE    TIME    CPU COMMAND
    13752 ora0005    1  19    0 4243M 4219M sleep    5:21 62.78% oracle
    17758 ora0005    1  25    0 1174M 1156M cpu      1:05 37.12% oracle
    17923 root       1  57    0   18M   14M sleep  689:07 13.59% ecap_monitor
    20777 root      12  58    0   14M   13M sleep  864:33 11.55% OracleAgent
    18884 ora0004    1   1    0  830M  813M sleep    0:01  9.54% oracle
    12070 ora0004   61  58    0  320M  315M sleep   28.5H  8.29% emagent
    20347 root      16  59    0   33M   25M sleep   26.0H  6.34% caiUxsA2
    17949 ist0005    1  53    0 7984K 4984K cpu      0:00  3.93% top
         1 root       1  59    0 2912K 1288K sleep   32.2H  3.75% init
    15035 ora0001    1  46    0   32M   22M sleep  166:43  2.98% tnslsnr
      5748 ora0004   11  54    0  516M  496M sleep  389:37  2.78% oracle
    20567 ora0004    1  55    0   27M   22M sleep    0:00  2.69% sqlplus
      6730 ora0001    1  33    0  632M  616M sleep    0:06  2.67% oracle
    20557 ora0004    1  56    0   27M   23M sleep    0:00  2.53% sqlplus
      5355 ora0005    1  59    0 1154M 1137M sleep    0:04  2.46% oracleand VMSTAT 2 5
    $ RUMPSHAKER> vmstat 2 5
    kthr      memory            page            disk          faults      cpu
    r b w   swap  free  re  mf pi po fr de sr s0 s1 s2 sd   in   sy   cs us sy id
    6 8 0 143125576 74272080 4628 24012 488 150 149 0 0 4 4 -2 0 25037 192698 65249 38 26 36
    1 3 0 162803992 95246464 1989 6989 0 4 4 0 0 6 6 0  0 9170 57822 26434 8 13 79
    1 7 0 162801352 95240296 3043 15633 4 9737 9682 0 0 0 0 0 0 11277 73516 38200 16 16 68
    3 10 0 162801560 95227920 3326 12729 16 16862 16774 0 0 1 1 0 0 11377 86054 44758 16 17 68
    1 10 0 162784520 95186488 9638 48359 24 11682 11626 0 0 13 13 0 0 13484 149366 44205 23 29 47

  • Select Command taking a lot of time to execute

    Dear Experts,
    My below SELECT command taking a lot of time to execute.
          SELECT wid
                       matl_desc
                       INTO TABLE open_wid FROM zwb_table
                       WHERE ( weight2 = 0 OR weight2 IS NULL ).
    Table : zwb_table contains around 7 Lacs records. That's why taking a lot of time . I have also Indexed the table zwb_table with field WID & WEIGHT2 . (zwb_table contains only WID as Primary Key Field)
    Structure of Internal Table : open_wid ->
                                             wid LIKE zwb_table-wid,
                                             matl_desc LIKE zwb_table-matl_desc,
    Please suggest me how to Improve the Performance of the above Select command.
    Thanks in Advance
    JACK

    Hi Jack,
    you are having morethan 7lack records in z table. it is not good practice fetching all the records into internal table and restricting with where clause in loop statement.
    I hope you already created secondary index combination of primary key.
    check you select query fetching records based on index you have created in ST05.
    Refer below link for your program is using index that you have created.
    Re: Indexing
    Regards,
    Peranandam
    Edited by: peranandam chinnathambi on Apr 7, 2009 8:38 AM

  • Concurrent request is taking a lots of time to run

    Hi,
    I have one query regarding ICM.
    one of the concurrent request is taking a lots of time to run. How can I solve the issue.
    Is there any steps to diagnose this issue?
    Please reply.
    Regards,
    Manish

    Hi,
    How we can find that particular request are taking long time?See your other thread.
    Concurrent request taking long time
    Concurrent request taking long time
    what is "gather statistrics schema" concurent program and what it does?See (Note: 419728.1 - How To Gather Statistics On Oracle Applications 11.5.10(and above) - Concurrent Process,Temp Tables, Manually).
    Regards,
    Hussein

  • Startup taking a LOT of Time

    Hi All,
    We have our application on Weblogic Server 8.1 SP5 and its taking a lot of time while starting up.
    What I found that these lines are the ones which are taking up majority of the time.
    Kindly Suggest how we can improve on this.
    ####<Jun 15, 2009 4:14:59 PM GMT+05:30> <Info> <Deployer> <sunbom4> <cgServer> <main> <<WLS Kernel>> <> <BEA-149060> <Module uddi of application uddi successfully transitioned from unprepared to prepared on server cgServer.>
    This line took more than 2 min.
    ####<Jun 15, 2009 4:16:50 PM GMT+05:30> <Info> <Deployer> <sunbom4> <cgServer> <main> <<WLS Kernel>> <> <BEA-149060> <Module MLAppCoreWL610.jar of application IntellectMM successfully transitioned from unprepared to prepared on server cgServer.>
    ####<Jun 15, 2009 4:18:23 PM GMT+05:30> <Info> <Deployer> <sunbom4> <cgServer> <main> <<WLS Kernel>> <> <BEA-149060> <Module OpenFXWrapperEJB.jar of application IntellectMM successfully transitioned from unprepared to prepared on server cgServer.>
    The above 2 lines are taking 1.5min each.

    I suggest that you take some thread dumps 10-15 secs apart during the time it's slow. The log timing alone won't tell you where the threads are spending time.

  • Mac taking a lot more time

    My Mac is taking a lot more time to load photos from iPhone and iPad than was taking before.What can be the reason of it ?
    Thanks

    DO NOT INSTALL MACKEEPER or any other so called 'cleaning ' application.  Please read the following user tip:
    https://discussions.apple.com/docs/DOC-3036
    Look for reasons in this user tip for your issues of slow operation:
    https://discussions.apple.com/docs/DOC-3521
    Ciao.

  • My Ideapad N581 is taking a lot of time to start up ....Can experts help?

    My laptop is taking a lot of time to start up.It just shows the Lenovo screen and stops there.What could be the problem?
    Thanksin advance.

    hi mamuninayak,
    The system might be experiencing a boot or a POST issue.
    - Remove all USB devices.
    - Remove the AC adapter and battery then held down the power button for 15 sec.
               Reconnect just the AC and try.
    -See if BIOS can be reset.
             Start hiting F2 when while powering the system on.
                     If succesfull in booting into BIOS. Hit F9 the F10
    Try Removing the Harddrive and turn the system on, See if there will be any changes.
    Hope this helps
    Cheers!
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • My iPad is taking a lot of time to factory reset..What should I do?

    Hello,
                  I am currently factory resetting my iPad , but i forgot to do it using my pc , so I did it without using iTunes , I did it using the option in the iPad's settings but it is taking a lot of time , so far it has been 2 hours ... What should I do if it takes more than 5 hours or so?
                                                                                         Thanks in advance,

    hi mamuninayak,
    The system might be experiencing a boot or a POST issue.
    - Remove all USB devices.
    - Remove the AC adapter and battery then held down the power button for 15 sec.
               Reconnect just the AC and try.
    -See if BIOS can be reset.
             Start hiting F2 when while powering the system on.
                     If succesfull in booting into BIOS. Hit F9 the F10
    Try Removing the Harddrive and turn the system on, See if there will be any changes.
    Hope this helps
    Cheers!
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • Background task taking a lot of time to execute

    Hi,
    There is a background task in my workflow which is taking a lot of time to execute.
    I have tested it in dialog mode.. and it works fine.. takes just 2 mins.
    Only when the task is executed from background.. it takes about 10 mins.
    Is this a config problem? How do I check if it is so?

    you could try activating a trace (sql) and see what the differences are,.
    you could check if maybe user parameters are influencing this. Or ask your basis team if there are a lot of differences between syystem users and dialog users in terms of resource allocation.
    Did you find anything different whilst debugging it?
    Kind regards, Rob Dielemans

  • Hello i have a problem that i was making update IOS7 for my i phone 5 it's taking a lot of time about 4 hours till now, i can't use my phone know, it's appere logo i tunes only, can't do eny thing else like shutdown

    Hello i have a problem that i was making update IOS7 for my i phone 5 it's taking a lot of time about 4 hours till now, i can't use my phone know, it's appere logo i tunes only, can't do eny thing else like shutdown

    Hey Andrew keriakous,
    Thanks for the question. It sounds like your iPhone may be in recovery-mode. To resolve this issue, see the following:
    If you can't update or restore your iOS device
    http://support.apple.com/kb/HT1808
    Thanks,
    Matt M.

  • My ipod was disabled and i tried to restore it, now i am downloading an apple software update which is taking a **** lot of time and ipod is still disabled.. will it be ok after the download ends? help please..!!

    my ipod was disabled and i tried to restore it, now i am downloading an apple software update which is taking a **** lot of time and ipod is still disabled.. will it be ok after the download ends? help please..!!

    We need to know more about your system, please download EtreCheck and run the report and please post it on your next reply. Then we can see how your system is configured, what apps are on it and look for anything obvious. We will look forward to seeing your report.

  • Input help on 0Fiscper taking a lot of time

    Hi all
    1. Whenever i open the input help for the 0fiscper from the Variable selection screen it takes a lot of time (huge amt of time)
    2. Whereas there are only 24 values present for it.
    3. But when I open the input help through the ´select filter value´ it opens pretty fast.
    4. This problem is with only 0fiscper which is BI Content InfoObject & happens only on particular ODS 0FIGL_O02 which is again a SAP std Object .
    5. This problem has started just in the last few days , wasnt there earlier.
    Thanks
    Ramesh

    Hi!
    Did you find any solutions because I'm facing on the same problem. When I launch it in RSRT, there is no problem but whern I try it in the Java partal, it runs and doesn't work.
    Thanks in avdvance.
    Ronan

  • Expdp is taking a lot of time

    hi,
    I have a small schema in a database housing lots of users.
    The expdp is taking a lot of time for this schema eventhough the old exp takes 1/10 th time.
    When i switched on the trace i see its stuck at below on <SID>dw0115741.trc trace file
    KUPW: 03:40:41.551: 1: DBMS_LOB.TRIM returned
    KUPW: 03:40:41.551: 1: DBMS_METADATA.FETCH_XML_CLOB called
    its stuck at
    Starting "USER"."USER_JOB": USER/******** dumpfile=USER.dp logfile=USER.log job_name=USER_job parallel=4 exclude=grant,index,trigger,constraint,statistics,index_statistics trace=1FF0300 directory=EXPDP_BKP
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    I have replaces the actual username with USER
    sga_target 2147483648
    sga_max_size 2634022912
    streams_pool_size 0
    Does any one has any suggestion?
    I tried the metalink as well but didnt find anything useful
    Thanks
    Shipra

    Pl post details of OS and database versions
    Pl see is MOS Doc 453895.1 (Checklist for Slow Performance of Export Data Pump (expdp) and Import DataPump (impdp)) - "Defects 10/11" - can help
    HTH
    Srini

Maybe you are looking for

  • Dead video in firefox 37

    a friend's browser got upgraded to v. 37 yesterday, since then youtube videos do not work. we just see a blank screen, no video, no audio. any ideas on how to fix it?

  • Run time error occured

    when i  am trying to login to web appliaction designer i got the Run-time Error"91" "object Variable or with block Variable not set. please help me out to solve this. Regards Deepak

  • Can't get rid of NCH toolbar - went to add-ons, but nothing to uninstall NCH bar

    NCH toolbar installed covertly with some NCH software. I subsequently deleted software, but toolbar remained and is not visible in my install/uninstall. Re-installed FireFox, but NCH toolbar remained. I want it GONE! Followed FireFox troubleshooting

  • Excel for Mac2008 won't run

    I have a MacBook Pro running OSX 10.6.8, connected to a network through Time Machine, and have been using Excel 2008 for Mac for several years. Recently, after saving an Excel file to Time Machine I could not subsequently run Excel. It would start an

  • Adobe Reader ón my iPad

    How do i get Adobe Reader startet ón my iPad [subject title changed by host]