Count (*)  for select stmt take more time than  execute a that sql stmt

HI
count (*) for select stmt take more time than execute a that sql stmt
executing particular select stmt take 2.47 mins but select stmt is using the /*+parallel*/ (sql optimer) in that sql  command for faster execute .
but if i tried to find out total number of rows in that query it takes more time ..
almost 2.30 hrs still running to find count(col)
please help me to get count of row faster.
thanks in advance...

797525 wrote:
HI
count (*) for select stmt take more time than execute a that sql stmt
executing particular select stmt take 2.47 mins but select stmt is using the /*+parallel*/ (sql optimer) in that sql  command for faster execute .
but if i tried to find out total number of rows in that query it takes more time ..
almost 2.30 hrs still running to find count(col)
please help me to get count of row faster.
thanks in advance...That may be because your client is displaying only the first few records when you are running the "SELECT *". But when you run "COUNT(*)", the whole records has to be counted.
As already mentined please read teh FAQ to post tuning questions.

Similar Messages

  • When i put my Mac for sleep it takes more time than normal ( 20 secs). Sometimes, coming back from sleep the system is not responding (freeze).

    When i put my Mac for sleep it takes more time than normal (>20 secs). Sometimes, coming back from sleep the system is not responding (freeze).

    Perform SMC and NVRAM resets:
    http://support.apple.com/en-us/HT201295
    http://support.apple.com/en-us/HT204063
    The try a safe boot:
    http://support.apple.com/en-us/HT201262
    Any change?
    Ciao.

  • Threaded program takes more time than executing serially!

    Hello All
    Ive converted my program into a threaded application so as to improve speed. However i found that after converting the execution time is more than it was when the program was non threaded. Im not having any synchronised methods. Any idea what could be the reason ?
    Thanx in advance.

    Putting aside fstreams amusing comment, I suspect your
    theads are never yielding (they are sitting in a tight
    loop, thus taking all available procesor power). Try
    adding Thread.sleep(0) at som point in the loop.No. If you just want to encourage one thread to give another thread a turn, use yield, not sleep.
    Note, though, that this may not help your situation. As was pointed out, on a single CPU machine, the only way a multithreaded program will run faster (by which I mean total wall-clock time start to finish) than its single-threaded equivalent is if the 1-thread version spends a lot of time waiting for IO when it could be doing something else. (If it's waiting for IO, but that IO is needed for the big number crunching, then putting the crunching in another thread won't make things any faster.)
    On the other hand, if by "faster" you're referring to a more responsive GUI, then, yes, in general you might expect better GUI response be putting non-GUI stuff in a different thread, but there's no guarantee. Depending on what the other thread does, how much work your GUI has to do, how your VM's scheduler works, how you've split up the work, etc., it may not be any better.
    I know that's not very specific, but neither was your question.

  • Select Query Takes more time

    Hi All,
    I have cloned KSB1 tcode to custom one as required by business.
    Below query takes more time than excepted.
    Here V_DB_TABLE = COVP.
    Values in Where clause are as follows
    OBNJR in ( KSBB010000001224  BT  KSBB012157221571)
    GJAHR in blank
    VERSN in '000'
    WRTTP in '04' and '11'
    all others are blank
    VT_VAR_COND = ( CPUDT BETWEEN '20091201' and '20091208' )
    SELECT (VT_FIELDS) INTO CORRESPONDING FIELDS OF GS_COVP_EXT      
                        FROM (V_DB_TABLE)                             
                        WHERE LEDNR = '00'                            
                        AND   OBJNR IN LR_OBJNR                       
                        AND   GJAHR IN GR_GJAHR                       
                        AND   VERSN IN GR_VERSN                       
                        AND   WRTTP IN GR_WRTTP                       
                        AND   KSTAR IN LR_KSTAR                       
                        AND   PERIO IN GR_PERIO                       
                        AND   BUDAT IN GR_BUDAT                       
                        AND   PAROB IN GR_PAROB                       
                        AND   (VT_VAR_COND).    
    Checked in table for this condition it has only 92 entries.
    But when i execute program takes long time as 3 Hrs.
    Could any one help me on this

    >1.Dont use SELECT/ENDSELECT instead use INTO TABLE addition .
    > 2.Avoid using corresponding addition.create a type and reference it.
    > If the select is going for dump beacause of storage limitations ,then use Cursors.
    you got three large NOs .... all three recommendations are wrong!
    The SE16 test is going in the right direction ... but what was filled. Nobody knows!!!!
    Select options:
    Did you ever try to trace the SE16?  The generic statement has for every field an in-condition!
    Without the information what was actually filled, nobody can say something there
    are at least 2**n  combinations possible!
    Use ST05 for SE16 and check actual statement plus explain!

  • What is the reason for query take more time to execute

    Hi,
    What is the reason for the query take more time inside procedure.
    but if i execute that query alone then it excute within a minutes.
    query includes update and insert.

    I have a insert and update query when I execute
    without Procedure then that query execute faster but
    If I execute inside procedure then It takes 2 hours
    to execute.Put you watch 2 hours back and the problem will disappear.
    do you understand what I want to say?I understood what you wanted to say and I understood you didn't understood what I said.
    What does the procedure, what does the query, how can you say the query does the same as the procedure that takes longer. You didn't say anything useful to have an idea of what you're talking about.
    Everyone knows what means that something is slower than something else, but it means nothing if you don't say what you're talking about.
    To begin with something take a look at this
    When your query takes too long ...
    especially the part regarding the trace.
    Bye Alessandro

  • Delete DML statment takes more time than Update or Insert.

    i want to know whether a delete statement takes more time than an update or insert DML command. Please help in solving the doubt.
    Regards.

    i do not get good answers sometimes, so, i ask again.I think Alex answer to your post was quite complete. If you missed some information, continue the same post, instead of opening a new thread with the same subject and content.
    You should be satistied with the answers you get, I also answered your question about global indexes, and I do think my answer was very complete. You may ask more if you want, but stop multiposting please. It is quite annoying.
    Ok, have a nice day

  • Why import of change request in production takes more time than quality?

    Hello All,
                 why import of change request in production takes more time than import into quality?

    Hi jahangeer,
    I believe it takes same time to import a request in both quality and production as they will be in sync.
    Even then if it takes more time in production that may depend on the change request.
    Thanks
    Pavan

  • Calc takes more time than previous

    Hi All,
    I have a problem with the calc as this calc take more time to execute please help!!!
    I have included calc cache high in the .cfg file.
    FIX (&As, &Af, &C,&RM, @RELATIVE("Pr",0), @RELATIVE("MS",0), @RELATIVE("Pt",0), @RELATIVE("Rn",0),@RELATIVE("Ll",0))
    CLEARDATA "RI";
    /* 22 Comment */
    FIX("100")
    "RI" = @ROUND ((("RDL")/("SBE"->"RDL"->"TMS"->"TP"->"TR"->"AF"->"Boom")),8);
    ENDFIX
    FIX("200")
    "RI" = @ROUND ((("RDL")/("ODE"->"RDL"->"TMS"->"T_P"->"TR"->"AF"->"Boom")),8);
    ENDFIX
    Appriciate your help.
    Regards,
    Mink.

    Mink,
    If the calculation script ,which you are using is the same which performed better before and data being processes is same ( i mean data might not have exceptionally grown more).Then, there must be other reasons like server side OS , processor or memory issues.Consult sys admin .Atleast you ll be sure that there is nothing wrong with systems.
    To fine tune the calc , i think , you can minimise fix statements . But,thats not the current issue though
    Sandeep Reddy Enti
    HCC
    http://analytiks.blogspot.com

  • Automatic DOP take more time to execute query

    We upgraded database to oracle 11gR2. While testing Automatic DOP feature with our existing query it takes more time than with parallel.
    Note: No constrains or Index created on table to gain performance while loading data (5000records / sec)
    Os : Sun Solaris 64bit
    CPU = 8
    RAM = 7456M
    Default parameter settings:
    parallel_degree_policy               string      MANUAL
    parallel_degree_limit                string      CPU
    parallel_threads_per_cpu             integer     2
    arallel_degree_limit                 string      CPU
    cpu_count                            integer     8
    parallel_threads_per_cpu             integer     2
    resource_manager_cpu_allocation      integer     8
    Query:
    SELECT COUNT(*)
    from (
    SELECT
    /*+ FIRST_ROWS(50), PARALLEL */
    Query gets executed in 22minutes : execution plan
      COUNT(*)
          9600
    Elapsed: 00:22:10.71
    Execution Plan
    Plan hash value: 3765539975
    | Id  | Operation           | Name             | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT    |                  |     1 |    21 |  2164K  (1)| 07:12:52 |       |   |
    |   1 |  SORT AGGREGATE     |                  |     1 |    21 |            |          |       |   |
    |   2 |   PARTITION RANGE OR|                  | 89030 |  1825K|  2164K  (1)| 07:12:52 |KEY(OR)|KEY(OR)|
    |*  3 |    TABLE ACCESS FULL| SUBSCRIBER_EVENT | 89030 |  1825K|  2164K  (1)| 07:12:52 |KEY(OR)|KEY(OR)|Automatic DOP Query: parameters set
    alter session set PARALLEL_DEGREE_POLICY = limited;
    alter session force parallel query ;Query:
    SELECT COUNT(*)
    from (
    SELECT /*+ FIRST_ROWS(50), PARALLEL*/
    This query takes more than 2hrs to execute
    COUNT(*)
          9600
    Elapsed: 02:07:48.81
    Execution Plan
    Plan hash value: 127536830
    | Id  | Operation              | Name             | Rows  | Bytes | Cost (%CPU)| Time     | Pstart|Pstop |    TQ   |IN-OUT| PQ Distrib |
    |   0 | SELECT STATEMENT       |                  |     1 |    21 |   150K  (1)| 00:30:01 |       |      |         |      |            |
    |   1 |  SORT AGGREGATE        |                  |     1 |    21 |            |          |       |      |         |      |            |
    |   2 |   PX COORDINATOR       |                  |       |       |            |          |       |      |         |      |            |
    |   3 |    PX SEND QC (RANDOM) | :TQ10000         |     1 |    21 |            |          |       |      |  Q1,00  | P->S | QC (RAND)  |
    |   4 |     SORT AGGREGATE     |                  |     1 |    21 |            |          |       |      |  Q1,00  | PCWP |            |
    |   5 |      PX BLOCK ITERATOR |                  | 89030 |  1825K|   150K  (1)| 00:30:01 |KEY(OR)|KEY(OR)|  Q1,00 | PCWC |            |
    |*  6 |       TABLE ACCESS FULL| SUBSCRIBER_EVENT | 89030 |  1825K|   150K  (1)| 00:30:01 |KEY(OR)|KEY(OR)|  Q1,00 | PCWP |            |
    Note
    - automatic DOP: Computed Degree of Parallelism is 16 because of degree limitcan some one help us to find out where we did wrong or any pointer will really helpful to resolve an issue.
    Edited by: Sachin B on May 11, 2010 4:05 AM

    Generated AWR report for ADOP
    Foreground Wait Events                       DB/Inst: HDB/hdb  Snaps: 158-161
    -> s  - second, ms - millisecond -    1000th of a second
    -> Only events with Total Wait Time (s) >= .001 are shown
    -> ordered by wait time desc, waits desc (idle events last)
    -> %Timeouts: value of 0 indicates value was < .5%.  Value of null is truly 0
                                                                 Avg
                                            %Time Total Wait    wait    Waits   % DB
    Event                             Waits -outs   Time (s)    (ms)     /txn   time
    direct path read                522,173     0    125,051     239    628.4   99.3
    db file sequential read             663     0        156     235      0.8     .1
    log file sync                       165     0        117     712      0.2     .1
    Disk file operations I/O            267     0         63     236      0.3     .1
    db file scattered read              251     0         36     145      0.3     .0
    control file sequential re          217     0         32     149      0.3     .0
    library cache load lock               2     0         10    4797      0.0     .0
    cursor: pin S wait on X               3     0          9    3149      0.0     .0
    read by other session                 5     0          2     429      0.0     .0
    kfk: async disk IO              613,170     0          2       0    737.9     .0
    sort segment request                  1   100          1    1007      0.0     .0
    os thread startup                    16     0          1      43      0.0     .0
    direct path write temp                1     0          1     527      0.0     .0
    latch free                           51     0          0       2      0.1     .0
    kksfbc child completion               1   100          0      59      0.0     .0
    latch: cache buffers chain           19     0          0       2      0.0     .0
    latch: shared pool                   36     0          0       1      0.0     .0
    PX Deq: Slave Session Stat           21     0          0       1      0.0     .0
    library cache: mutex X               45     0          0       1      0.1     .0
    CSS initialization                    2     0          0       6      0.0     .0
    enq: KO - fast object chec            1     0          0      11      0.0     .0
    buffer busy waits                     3     0          0       1      0.0     .0
    cursor: pin S                         9     0          0       0      0.0     .0
    CSS operation: action                 2     0          0       1      0.0     .0
    direct path write                     1     0          0       2      0.0     .0
    jobq slave wait                  17,554   100      8,942     509     21.1
    PX Deq: Execute Reply             4,060    95      7,870    1938      4.9
    SQL*Net message from clien           96     0      5,756   59962      0.1
    PX Deq: Execution Msg               618    56        712    1152      0.7
    KSV master wait                      11     0          0       2      0.0
    PX Deq: Join ACK                     16     0          0       1      0.0
    PX Deq: Parse Reply                  14     0          0       1      0.0
    Background Wait Events                       DB/Inst: HDB/hdb  Snaps: 158-161
    -> ordered by wait time desc, waits desc (idle events last)
    -> Only events with Total Wait Time (s) >= .001 are shown
    -> %Timeouts: value of 0 indicates value was < .5%.  Value of null is truly 0
                                                                 Avg
                                            %Time Total Wait    wait    Waits   % bg
    Event                             Waits -outs   Time (s)    (ms)     /txn   time
    control file sequential re        6,249     0      2,375     380      7.5   55.6
    control file parallel writ        2,003     0        744     371      2.4   17.4
    db file parallel write            1,604     0        503     313      1.9   11.8
    log file parallel write             861     0        320     371      1.0    7.5
    db file sequential read             363     0        151     415      0.4    3.5
    db file scattered read              152     0         64     421      0.2    1.5
    Disk file operations I/O            276     0         21      77      0.3     .5
    os thread startup                   316     0         15      48      0.4     .4
    ADR block file read                  24     0         11     450      0.0     .3
    rdbms ipc reply                      17    12          7     403      0.0     .2
    Data file init write                  6     0          6    1016      0.0     .1
    direct path write                    21     0          6     287      0.0     .1
    log file sync                         7     0          6     796      0.0     .1
    ADR block file write                 10     0          4     414      0.0     .1
    enq: JS - queue lock                  1     0          3    2535      0.0     .1
    ASM file metadata operatio        1,801     0          2       1      2.2     .0
    db file parallel read                30     0          1      40      0.0     .0
    kfk: async disk IO                  955     0          1       1      1.1     .0
    db file single write                  1     0          0     415      0.0     .0
    reliable message                     10     0          0      23      0.0     .0
    latch: shared pool                   75     0          0       2      0.1     .0
    latch: call allocation               26     0          0       2      0.0     .0
    CSS initialization                    7     0          0       6      0.0     .0
    asynch descriptor resize            352   100          0       0      0.4     .0
    undo segment extension                2   100          0       5      0.0     .0
    CSS operation: action                 9     0          0       1      0.0     .0
    CSS operation: query                 42     0          0       0      0.1     .0
    latch: parallel query allo            4     0          0       0      0.0     .0
    rdbms ipc message                37,948    97    104,599    2756     45.7
    DIAG idle wait                   16,762   100     16,927    1010     20.2
    ASM background timer              1,724     0      8,467    4912      2.1
    shared server idle wait             282   100      8,465   30019      0.3
    pmon timer                        3,123    90      8,465    2711      3.8
    wait for unread message on        8,381   100      8,465    1010     10.1
    dispatcher timer                    141   100      8,463   60019      0.2
    Streams AQ: qmn coordinato          604    50      8,462   14010      0.7
    Streams AQ: qmn slave idle          304     0      8,462   27836      0.4
    smon timer                           35    71      8,382  239496      0.0
    Space Manager: slave idle         1,621    99      8,083    4986      2.0
    PX Idle Wait                      2,392    99      4,739    1981      2.9
    class slave wait                     46     0        623   13546      0.1
    KSV master wait                       2     0          0      27      0.0
    SQL*Net message from clien            7     0          0       1      0.0
    Wait Event Histogram                         DB/Inst: HDB/hdb  Snaps: 158-161
    -> Units for Total Waits column: K is 1000, M is 1000000, G is 1000000000
    -> % of Waits: value of .0 indicates value was <.05%; value of null is truly 0
    -> % of Waits: column heading of <=1s is truly <1024ms, >1s is truly >=1024ms
    -> Ordered by Event (idle events last)
                                                        % of Waits
                               Total
    Event                      Waits  <1ms  <2ms  <4ms  <8ms <16ms <32ms  <=1s   >1s
    ADR block file read           24                                     100.0
    ADR block file write          10                                     100.0
    ADR file lock                 12 100.0
    ASM file metadata operatio  1812  99.0    .3    .4                      .2    .1
    CSS initialization             9                   100.0
    CSS operation: action         11  90.9   9.1
    CSS operation: query          54 100.0
    Data file init write           6        16.7  16.7                    16.7  50.0
    Disk file operations I/O     533  88.7   2.6    .6               1.5    .2   6.4
    PX Deq: Signal ACK EXT         4 100.0
    PX Deq: Signal ACK RSG         2 100.0
    PX Deq: Slave Session Stat    21  42.9  28.6  28.6
    SQL*Net break/reset to cli     6 100.0
    SQL*Net message to client    102 100.0
    SQL*Net more data to clien     4 100.0
    asynch descriptor resize     527 100.0
    buffer busy waits              4  75.0        25.0
    control file parallel writ  2003   9.3    .5          .0    .1        90.0
    control file sequential re  6466  10.6    .0    .0    .0    .1    .2  89.0
    cursor: pin S                  9 100.0
    cursor: pin S wait on X        3                          33.3  33.3        33.3
    db file parallel read         30                           6.7  30.0  63.3
    db file parallel write      1604   7.4    .1                .6  16.5  75.5
    db file scattered read       403   3.7    .2   2.5  13.6  14.9   3.5  61.5
    db file sequential read     1017  12.3    .8   2.3   7.3   6.6   2.0  68.8
    db file single write           1                                     100.0
    direct path read           522.2   2.2   2.1    .1    .0   1.8  17.9  75.9
    direct path write             22         4.5                     4.5  90.9
    direct path write temp         1                                     100.0
    enq: JS - queue lock           1                                           100.0
    enq: KO - fast object chec     1                         100.0
    enq: PS - contention           1 100.0
    kfk: async disk IO         614.1 100.0                                  .0
    kksfbc child completion        1                                     100.0
    latch free                    58  46.6  27.6  15.5  10.3
    latch: cache buffers chain    19  36.8  10.5  52.6
    latch: call allocation        26  76.9  11.5         7.7         3.8
    latch: parallel query allo     4 100.0
    latch: shared pool           111  44.1  28.8  27.0
    library cache load lock        2                                           100.0
    library cache: mutex X        45  84.4   8.9   4.4   2.2
    log file parallel write      861  10.0          .1    .1              89.5    .2
    log file sync                172   6.4                                90.1   3.5
    os thread startup            332                                     100.0
    rdbms ipc reply               18  72.2                                11.1  16.7
    read by other session          5                                     100.0
    reliable message              11  81.8   9.1                           9.1
    sort segment request           1                                     100.0
    undo segment extension         2  50.0                    50.0
    ASM background timer        1724    .8    .6    .1                      .6  97.9
    DIAG idle wait             16.8K                                     100.0
    KSV master wait               13   7.7  23.1  61.5                     7.7
    PX Deq: Execute Reply       4060    .4          .0    .0          .1   3.4  96.0
    PX Deq: Execution Msg        617  34.7   1.5   2.4   1.5   1.5    .2    .8  57.5
    PX Deq: Join ACK              16  93.8                     6.3
    PX Deq: Parse Reply           14  71.4   7.1  14.3   7.1
    PX Idle Wait                2384    .0                                  .6  99.3
    SQL*Net message from clien   103  82.5         1.0   1.9               1.0  13.6
    Space Manager: slave idle   1621                                        .2  99.8
    Streams AQ: qmn coordinato   604  50.0                                      50.0
    Wait Event Histogram                         DB/Inst: HDB/hdb  Snaps: 158-161
    -> Units for Total Waits column: K is 1000, M is 1000000, G is 1000000000
    -> % of Waits: value of .0 indicates value was <.05%; value of null is truly 0
    -> % of Waits: column heading of <=1s is truly <1024ms, >1s is truly >=1024ms
    -> Ordered by Event (idle events last)Edited by: Sachin B on May 11, 2010 4:52 AM

  • Zfs destroy command takes more time than usual

    Hi,
    When I run the destroy command it takes more than usual.
    I have exported the lun form this zfs volume ealier.
    Later I have removed the lun view and deleted the lun.After that when I run the below command it takes more time (more than 5mins and still running)
    #zfs destroy storage/lu

    Is there a way to quickly destroy the filesystem.
    It looks it removing the allocated files.
                  capacity     operations    bandwidth
    pool        alloc   free   read  write   read  write
    storage0     107G   116T  3.32K  2.52K  3.48M  37.7M
    storage0     107G   116T    840    551  1.80M  6.01M
    storage0     106G   116T    273      0   586K      0
    storage0     106G   116T  1.19K      0  2.61M      0
    storage0     106G   116T  1.47K      0  3.20M  

  • Save for web - system take more time

    Hi, We used adobe photo shop cloud one of our blog for optimized images. We use "save for web" option in photoshop. But its will take more time. What is the reason. How to solve this issue.

    A lot more information about your hardware and software is needed.
    BOILERPLATE TEXT:
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CC", but something like CC2014.v.2.2) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    a screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Query take more time to execute

    Hi
    I am using in sql select statement two non exist statements it is taken more time to execute the query ,non exist is any impact query performance
    thank's

    [email protected] wrote:
    I am using in sql select statement two non exist statements it is taken more time to execute the query ,non exist is any impact query performanceI have a query that is using even more time to execute. Do I win?

  • SYS_REFCURSOR takes more time than direct query execution

    I have a stored proc which has 4 inputs and 10 output and all outputs are sys_refcursor type.
    Among 10 ouputs, 1 cursor returns 4k+ records and all other cursors has 3 or 4 records and average 5 columns in each cursors. For this, it takes 8 sec to complete the execution. If we directly query, it gives output in .025 sec.
    I verified code located the issue with cursor which returns 4k+ only.
    The cursor opening from a temporary table (which has 4k+ records ) without any filter. The query which inserted into temporary is direct inserts only and i found nothing to modify there.
    Can anyone suggest, how we can bring the results in less than 3 sec? This is really a challenge since the code needs to go live next week.
    Any help appreciated.
    Thanks
    Renjish

    I've just repeated the test in SQL*Plus on my test database.
    Both the ref cursor and direct SQL took 4.75 seconds.
    However, that time is not the time to execute the SQL statement, but the time it took SQL*Plus in my command window to print out the 3999 rows of results.
    SQL> create or replace PROCEDURE TEST_PROC (O_OUTPUT OUT SYS_REFCURSOR) is
      2  BEGIN
      3    OPEN  O_OUTPUT FOR
      4      select 11 plan_num, 22  loc_num, 'aaa' loc_nm from dual connect by level < 4000;
      5  end;
      6  /
    Procedure created.
    SQL> set timing on
    SQL> set linesize 1000
    SQL> set serverout on
    SQL> var o_output refcursor;
    SQL> exec test_proc(:o_output);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.04
    SQL> print o_output;
      PLAN_NUM    LOC_NUM LOC
            11         22 aaa
            11         22 aaa
            11         22 aaa
            11         22 aaa
            11         22 aaa
    3999 rows selected.
    Elapsed: 00:00:04.75
    SQL> select 11 plan_num, 22  loc_num, 'aaa' loc_nm from dual connect by level < 4000;
      PLAN_NUM    LOC_NUM LOC
            11         22 aaa
            11         22 aaa
            11         22 aaa
            11         22 aaa
            11         22 aaa
            11         22 aaa
    3999 rows selected.
    Elapsed: 00:00:04.75
    That's the result I expect to see, both taking the same amount of time to do the same thing.
    Please demonstrate how you are running it and getting different results.

  • Oracle SQL Select query takes long time than expected.

    Hi,
    I am facing a problem in SQL select query statement. There is a long time taken in select query from the Database.
    The query is as follows.
    select /*+rule */ f1.id,f1.fdn,p1.attr_name,p1.attr_value from fdnmappingtable f1,parametertable p1 where p1.id = f1.id and ((f1.object_type ='ne_sub_type.780' )) and ( (f1.id in(select id from fdnmappingtable where fdn like '0=#1#/14=#S0058-3#/17=#S0058-3#/18=#1#/780=#5#%')))order by f1.id asc
    This query is taking more than 4 seconds to get the results in a system where the DB is running for more than 1 month.
    The same query is taking very few milliseconds (50-100ms) in a system where the DB is freshly installed and the data in the tables are same in both the systems.
    Kindly advice what is going wrong??
    Regards,
    Purushotham

    SQL> @/alcatel/omc1/data/query.sql
    2 ;
    9 rows selected.
    Execution Plan
    Plan hash value: 3745571015
    | Id | Operation | Name |
    | 0 | SELECT STATEMENT | |
    | 1 | SORT ORDER BY | |
    | 2 | NESTED LOOPS | |
    | 3 | NESTED LOOPS | |
    | 4 | TABLE ACCESS FULL | PARAMETERTABLE |
    |* 5 | TABLE ACCESS BY INDEX ROWID| FDNMAPPINGTABLE |
    |* 6 | INDEX UNIQUE SCAN | PRIMARY_KY_FDNMAPPINGTABLE |
    |* 7 | TABLE ACCESS BY INDEX ROWID | FDNMAPPINGTABLE |
    |* 8 | INDEX UNIQUE SCAN | PRIMARY_KY_FDNMAPPINGTABLE |
    Predicate Information (identified by operation id):
    5 - filter("F1"."OBJECT_TYPE"='ne_sub_type.780')
    6 - access("P1"."ID"="F1"."ID")
    7 - filter("FDN" LIKE '0=#1#/14=#S0058-3#/17=#S0058-3#/18=#1#/780=#5#
    8 - access("F1"."ID"="ID")
    Note
    - rule based optimizer used (consider using cbo)
    Statistics
    0 recursive calls
    0 db block gets
    0 consistent gets
    0 physical reads
    0 redo size
    0 bytes sent via SQL*Net to client
    0 bytes received via SQL*Net from client
    0 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    9 rows processed
    SQL>

  • Why HTML report takes more time than the PDF one?

    Hi,
    I have created report in Reports 6i. When I run the report on the web with FORMAT = PDF it runs very fast and shows all the pages in 2 minutes. But when I run with
    FORMAT = HTML it shows the first page in 2 minutes, after that it takes lot of time to show the remaining pages. If the total pages are more than 40, the browser just freezes
    Can somebody give me the reason?
    Is there any way to rectify this?
    Thanks alot.
    Ram.

    Hi Senthil,
    Iam running with the below parameters.
    Format : HTML
    Destination : Screen.
    My default browser is IE. When I try to run using Netscape it showed only 1 page out of 34 pages.
    When I run Format as PDF it is faster but font size is small when it opens up. Offcourse user can zoom it.
    If I increase the report width from 11 to 14 the font size becomes very small when it open up in browser.
    Is there any way that I can set up zoom when I run as PDF?
    Thanks for your help.
    Ram.

Maybe you are looking for