Query takes long time for first time

I have a table with 100 million records and another tables with many rows.
When I ran a query - it's takes about 1 minute to complete, but when I ran it again it takes less than 1 second to complete.
Why it is happening?
Thanks,
Tz.

Welcome to the forum.
When you post a question always provide your 4 digit Oracle version. Different versions have different functionality and this can affect your results and the advice you need.
For performance tuning questions see the FAQ (upper right corner of page) for the information needed for tuning requests.
>
When I ran a query
>
How did you run it? Did you use sql*plus, sqldeveloper, some other tool?
What command did you enter?
Using sql*plus you can get an execution plan for the query by
SQL> set serveroutput on
SQL> set autotrace traceonly
SQL> select * from emp;
Execution Plan
Plan hash value: 3956160932
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT  |      |    14 |   546 |     3   (0)| 00:00:01 |
|   1 |  TABLE ACCESS FULL| EMP  |    14 |   546 |     3   (0)| 00:00:01 |
SQL>

Similar Messages

  • ADF application taking more time for first time and less from second time

    Hi Experts,
    We are using ADF 11.1.1.2.
    Our application contains 5 jsp pages, 10 - 12 taskflows, and 50 jsff pages.
    For the first time in the day if we use the application it is taking more than 60 sec on some actions.
    And from the next time onwords it is taking 5 to 6 sec.
    Same thing is happening daily.
    Can any one tell me why this application is taking more time for first time and less time from second time.
    Regards
    Gayaz

    Hi,
    If you don't restart you WLS every day, then you should read about Tuning Application Module Pools and Connection Pools
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcampool.htm#sm0301
    And pay attention to the parameter: Maximum Available Size, Minimum Available Size
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcampool.htm#sm0314
    And adjust them to suit your needs.

  • Application takes lot of time for first time..

    Hai guys,
              we made an application on a 3rd party software for use on a tool which connects to SAP with RFC.
    the applicaiton updates ORACLE databse after getting relevant information from SAP.
    Now,for information on SAP side we have RFC.
    for updates on oracle we write SQL.
    the unique problem is..this applicaiton  takes lot of time when used the first time..
    once the first use is over it takes much lesser time for any subsequent use(by any user)..
    I DOUBT THE SQLS(ESP UPDATE) TAKE MUCH TIME THE FIRST TIME.

    I DOUBT THE SQLS(ESP UPDATE) TAKE MUCH TIME THE FIRST TIME.
    Why don't you trace the call and be sure?  Don't guess.
    once the first use is over it takes much lesser time for any subsequent use(by any user)..
    Because the statement is in the cursor cache - clear the cache each time and the statement will run long every time.  Again, trace the call and determine the issue - most likely you need an index or have an improperly coded SELECT statement.

  • Interface is taking lots of time for first time execution

    Hello all,
    I have one inbound interface in which i am updating T-code CO01 ,CO15 , MIGO and MB1A respectively
    depending upon the condition in the incoming file.
    When ever i run this interface for the first time it takes lots of time for execution, but when i run the same interface again with the same file it is taking half time of the first time execution.
    I am not able to understand why it is taking lots of time for first execution and after that execution time is redued very much with the same file
    Kindly help
    Thanks
    Sachin Yadav

    thank you santhosh for your reply..
    as this program is in Production system it it taking 3 to 4 hour to execute.
    Previously it was OK but from last 2 to 3 moths it is taking more time.
    when i debug the code it is working fine. I din't find any point at which it is taking more time.
    I am not aware about buffers and SAP memory. can you plz help
    Do you have any idea why this is happening.
    Or how can i rectify the problem?
    Thanks
    Sachin

  • Long time to open workbook for first time

    Hi,
    I have a workbook with three queries . Performance of workbook is good when it was created for first time. It has additional 22 sheets with formulas and other sheets with values based on query sheets.
    The problem starts after I close the existing session and open in another session when it takes 15 to 20 minutes to come up.But after that the book is slow even for single click button action.
    Version of analysis 1.4.6
    Win 7(64 bit)
    Ms office 2010(32 bit)
    Refresh on opening is disabled.
    Few thing which I did:
    >> I opened up task manager and did analyze wait chain, I found that excel.exe is waiting for splwow64.exe process.
    >> I enabled logging at "debugging information" in support setting for workbook and checked things out in log file.
    Found that
    There was warning "AddSerializer failed (Command processors not initialized)
    Looking at log file for events when book took time to open, I found that time stamp gap between  following events"
    -verbose: Working mode as serialized in document:'Local'
    -verbose: Successfully deserialized system info from workbook  XML
    - verbose: ...its logs various properties of queries like query name,id etc"
    and its immediate previous event of cache formula string is 20 mins.
    >> in another session I opened a workbook with normal performance.Found above mentioned warning message and deserialization... information.
    the difference in this case is that there is not delay in events.
    Has anybody faced this issue? Any idea on deserialization of workbook xml in analysis.
    Any idea where is metadata saved in analysis. is it in form of some hidden script object just as in BEx 7.0
    Thanks
    Pramod.

    Hi Pramod,
    Since you have several sheets in this workbook, have you checked the number of custom styles?
    Please check the SAP note http://service.sap.com/sap/support/notes/1899658
    According to the note, too many styles slow down Analysis for Office.
    The note also contains a macro that you can run on your workbook to delete the custom styles if you want to check.
    Regards,
    Filipe

  • Why update query takes  long time ?

    Hello everyone;
    My update query takes long time.  In  emp  ( self testing) just  having 2 records.
    when i issue update query , it takes long time;
    SQL> select  *  from  emp;
      EID  ENAME     EQUAL     ESALARY     ECITY    EPERK       ECONTACT_NO
          2   rose              mca                  22000   calacutta                   9999999999
          1   sona             msc                  17280    pune                          9999999999
    Elapsed: 00:00:00.05
    SQL> update emp set esalary=12000 where eid='1';
    update emp set esalary=12000 where eid='1'
    * ERROR at line 1:
    ORA-01013: user requested cancel of current operation
    Elapsed: 00:01:11.72
    SQL> update emp set esalary=15000;
    update emp set esalary=15000
      * ERROR at line 1:
    ORA-01013: user requested cancel of current operation
    Elapsed: 00:02:22.27

    Hi  BCV;
    Thanks for your reply but it doesn't provide output,  please  see   this.
    SQL> update emp set esalary=15000;
    ........... Lock already occured.
    >> trying to trace  >>
    SQL> select HOLDING_SESSION from dba_blockers;
    HOLDING_SESSION
                144
    SQL> select sid , username, event from v$session where username='HR';
    SID USERNAME     EVENT
       144   HR    SQL*Net message from client
       151   HR    enq: TX - row lock contention
       159   HR    SQL*Net message from client
    >> It  does n 't  provide  clear output about  transaction lock >>
    SQL> SELECT username, v$lock.SID, TRUNC (id1 / POWER (2, 16)) rbs,
      2  BITAND (id1, TO_NUMBER ('ffff', 'xxxx')) + 0 slot, id2 seq, lmode,
      3  request
      4  FROM v$lock, v$session
      5  WHERE v$lock.TYPE = 'TX'
      6  AND v$lock.SID = v$session.SID
      7  AND v$session.username = USER;
      no rows selected
    SQL> select MACHINE from v$session where sid = :sid;
    SP2-0552: Bind variable "SID" not declared.

  • Performance issue in browsing SSAS cube using Excel for first time after cube refresh

    Hello Group Members,
    This is a continuation of my earlier blog question -
    https://social.msdn.microsoft.com/Forums/en-US/a1e424a2-f102-4165-a597-f464cf03ebb5/cache-and-performance-issue-in-browsing-ssas-cube-using-excel-for-first-time?forum=sqlanalysisservices
    As that thread is marked as answer, but my issue is not resolved, I am creating a new thread.
    I am facing a cache and performance issue for the first time when I try to open a SSAS cube connection using Excel (using Data tab  -> From Other Sources --> From Analysis Services) after daily cube refresh. In end users system (8 GB RAM but around
    4GB available RAM), for the first time, it takes 10 minutes to open the cube. From next run onwards, its open up quickly within 10 secs.
    We have daily ETL process running in high end servers. The configuration of dedicated SSAS cube server is 8 core, 64GB RAM. In total we have 4 cube DB - out of which for 3 is full cube refresh and 1 is incremental refresh. We have seen after daily cube
    refresh, it takes 10 odd minutes to open the cube in end users system. From next time onwards, it opens up really fast with 10 secs. After cube refresh, in server systems (32 GB RAM, around 4GB available RAM), it takes 2 odd minutes to open the cube.
    Is there, any way we could reduce the time taken for first attempt ?
    As mentioned in my previous thread, we have already implemented a cube wraming cache. But, there is no improvement.
    Currently, the cumulative size of the all 4 cube DB are more than 9 GB in Production and each cube DB having 4 individual cubes in average with highest cube DB size is 3.5 GB. Now, the question is how excel works with SSAS cube after
    daily cube refresh?
    Is it Excel creates a cache of the schema and data after each time cube is refreshed and in doing so it need to download the cube schema in Excel's memory? Now to download the the schema and data of each cube database from server to client, it will take
    a significant time based on the bandwidth of the network and connection.
    Is it anyway dependent to client system RAM ? Today the bigest cube DB size is 3.5 GB, tomorrow it will be 5-6 GB. Now, though client system RAM is 8 GB, the available or free RAM would be around 4 GB. So, what will happen then ?
    Best Regards, Arka Mitra.

    Could you run the following two DMV queries filling in the name of the cube you're connecting to. Then please post back the row count returned from each of them (by copying them into Excel and counting the rows).
    I want to see if this is an issue I've run across before with thousands of dimension attributes and MDSCHEMA_CUBES performance.
    select [HIERARCHY_UNIQUE_NAME]
    from $system.mdschema_hierarchies
    where CUBE_NAME = 'YourCubeName'
    select [LEVEL_UNIQUE_NAME]
    from $system.mdschema_levels
    where CUBE_NAME = 'YourCubeName'
    Also, what version of Analysis Services is it? If you connect Object Explorer in Management Studio to SSAS, what's the exact version number it says on the top server node?
    http://artisconsulting.com/Blogs/GregGalloway

  • My refurbished iPad 3 charged for first time it and charger got very hot is that normal

    just replaced my refurbished iPad 3 with another.  Tried to charge it for first time.  Noticed it got very hot and so did charger.  I don't recall my other iPad doing this  is this a defect in the ipad?

    Define "hot".
    If fully drained both the battery (that essentially fills up most of the body of the device) and the charger will get quite warm, though not unbearable. Time to charge will vary according to device: my iPad 4 takes about 6 hours if almost flat, but takes about 40 min if at 75%.
    Be sure to use ONLY its original charger OR chargers that are rated for iPads. They draw twice the current as phones and will cause phone chargers to get much warmer than usual.

  • HT1178 I'm setting up airport for first time. I'm getting error no DNS servers help

    I'm setting up airport for first time. Getting error no DNS servers. What is DNS server and how do I fix this?

    DNS server is that translation from a website address in words meaningful to us.. eg www.google.com to an actual number that computers can use. Without DNS the internet may work but you would have to know the ipv4 address of every site you want to visit.
    Whenever you don't know the meaning of a term just type wiki plus the term in google search.
    http://en.wikipedia.org/wiki/Domain_Name_System
    We cannot really help fix the problem without knowing a good deal more info.
    So
    What modem do you have.. make and model may be a help?
    Who is your ISP.. may be helpful??
    Is the modem also a router?
    How is the TC connected to the modem?
    How is the computer connected to the TC?
    A primary example of where you get this problem is a pure cable modem.. ie has no router in it.
    When you replace an existing computer or router that is plugged into it, with the TC, requires that you power cycle the modem. In some cases the off time is 5min.. for a lot of services, it needs to be off 20min.. and for some even longer.. maybe an hour or overnight.
    But it is not worth getting into specifics without knowing the rest of the system.

  • HT201250 i am using for first time the time machine and an external hard drive because I want to erase my macbook and start from zero files. do i keep my files in the portable hard disk when I connect it again with the macbook or the time machine will era

    i am using for first time the time machine and an external hard drive because I want to erase my macbook and start from zero files. Am i keeping my files in the portable hard disk when I will connect it again with the macbook or the time machine will erase all?
    I would like to know if after I erase all my data, empy hard drive inside the macbook, the time machine will erase all my files that I have saved in my "WD "My passport" external hard drive

    Welcome to Apple Support Communities
    Time Machine has to erase the external disk in order to make backups. Before setting Time Machine up, copy the files of your external disk to the hard disk of the Mac in order not to lose them, and then, set up Time Machine. The first backup will start automatically.
    If you want more information about Time Machine, read the Pondini's site > http://pondini.org

  • How do I sync my new ipad mini with my old ipad 2, without losing any apps or data in notes?  I need step by step instructions for first-time sync with ipad mini.  Thanks.

    How do I sync my new ipad mini with my old ipad 2, without losing any apps or data in notes?  I need step by step instructions for first-time sync with ipad mini.  Thanks.

    If you synced it many times, you have to have a backup. It's just a question of how old that backup is now. When did you last sync?
    First of all launch iTunes on your computer and go to Edit>Preferences>Devices. Do you see any backups for you iPad in that window? If so, how new is the newest backup? That will be the backup that you will want to use. But remember that if you use that backup and it is one month old, you can only restore from that date back in time. Anything that you did on the iPad in the past month will not be in that backup.
    Turn on the new iPad Minin and start activating OTA via WiFi. You will get to a certain point in the process where you will be given the choice to Set up as new, Restore from iCloud - or Restore from iTunes. You will want to select Restore from iTunes.
    That is the short and sweet version. There are step by step instructions in this article. This applies to the mini as well as the iPad 4 or the iPad 3 for that matter.
    http://www.everythingicafe.com/how-to-set-up-new-ipad/2012/03/16/

  • Using iPod shuffle 4th generation for first time and receiving the error : one of the USB devices attached to this computer has malfunctioned, and windows does not recognize it. For assistance in solving this problem, click this message

    Using iPod shuffle 4th generation for first time and receiving the error : one of the USB devices attached to this computer has malfunctioned, and windows does not recognize it. For assistance in solving this problem, click this message.
    Using win 7 and latest iTunes [10.6.3]. Have already gone through below links and did not find any solution.
    http://support.apple.com/kb/HT2292
    http://support.apple.com/kb/TS1369
    http://support.apple.com/kb/HT1923
    http://en.kioskea.net/forum/affich-17997-ipod-not-detected

    I was hoping it would be something like a USB device conflict, but now the shuffle is the only thing connected...
    This article was one of the ones you linked to above in your initial post
    http://support.apple.com/kb/TS1369
    Under Part 9. Verify that USB drivers are installed, did you try the steps in If only "Unknown Device" appears?  That appears to be your situation.
    Also, you said that the shuffle initially worked well enough to do a sync, then it had the same problem again.  If you can get it to work again initially, before doing anything else, try the following.  Select the shuffle in the iTunes sidebar, under DEVICES.  Over to the right, go to the Summary tab.  By default, the checkbox for Enable disk use should be unchecked.  If so, check it and Apply the change.  See if that makes any difference. 
    (If Enable disk use was already checked, try unchecking it and Apply the change.  Basically, set it the "other way" and see if there is any improvement.)
    NOTE:  When disk use is enabled, you have to eject the iPod in iTunes before disconnecting it physically.
    If the disk use change makes a difference, that may provide a clue about the actual cause.

  • HT1476 if i bought my ipod touch 32gb in germany where the voltage is 220v and i live in America where the voltage is 110, i will have to wait to get to my home to charge it for first time or I can charge it here and change the voltage of the battery in A

    if i bought my ipod touch 32gb in germany where the voltage is 220v and i live in America where the voltage is 110, i will have to wait to get to my home to charge it for first time or I can charge it here and change the voltage of the battery in America?
    please i need help, im worried that if I connect my ipod here, it will burn or sometihng bad.

    Just connect it to a computer's USB port.
    Most wall chargers are dual voltage (110- 220 volts) and only require a plug adopter. Check the wall charger to see if yours is.

  • Error when launch MaxDB studio for first time

    Dear, Experts
    I faced with one issue for launch MaxDB studio for first time.
    It reported:
    Connect user failed
    SAP DBTech JDBC: Cannot connect to jdbc:sapdb://.../.UMDB [Restart required].
    Creating default user management failed
    Could not create database ".UMDB": [C:\sapdb\clients\DatabaseStudio\pgm\dbmcli.exe] > ERR, -24832, ERR_SHMNOTAVAILABLE ...
    Could you please help me on this?
    Thank you in advance.
    Best Regards

    If not solved yet...
    What says appsrv.log ? Which user are you using to start the appserver ? Which user have you specified when sreating the database ?
    Nicolas.

  • Mac 10.9.5 trying to launch Illustrator CS6 for first time and prompts Java even though I have Java 8 installed.

    Mac 10.9.5 trying to launch Illustrator CS6 for first time and won't launch, prompts for Java 6 even though I have Java 8 installed!
    Apple says Java 6 is very insecure and not to use it.  I have the latest Java installed.  Why won't Illustrator launch?  What else can I do?

    tm,
    I believe you should be able to get round the issue by following this:
    http://oliverdowling.com.au/2014/03/28/java-se-8-on-mac-os-x/
    It is even more thoroughly described in this thread, see post #3 on by gator soup:
    https://forums.adobe.com/thread/1706469

Maybe you are looking for

  • ABAP Trial Version SP12:Error while setting up transport environment

    Hi Folks, I have successfully installed ABAP trial SP12 on my notebook(XP) and have been able to create some objects. Thanks to very effective blogs by Manfred Lutz . Now, I'm trying to set up the transport environment as per the blog but face the fo

  • Org.osmf.layout.LayoutTargetSprite missing from 0.9

    Hi I'm trying to get the OSMF player project to compile using the 0.9 stable tag. It requires ChromeLibrary, in which FadingSprite extends LayoutTargetSprite. This base clase does not exist in the org.osmf.layout package. Any suggestions for where I

  • Licensing for Guests OS

    Hello,  We are planning to move to Windows Server 2012 DataCanter Edition, and we are aware it suppports unlimited guests OS and it will provide us also free multiple Activation keys, what if we install Windows Server 2008 R2 edition and Windows Serv

  • Crop tool precision - can it snap to whole pixels?

    One thing that drives myself and every other designer I know crazy in Photoshop are tools that do not allow precisie snapping to the edges of whole pixels This is not such a problem with printed media and there are valid reasons to allow certain tool

  • Can't get firefox to start

    Clic on firefox icon - get wait symbol - after a few seconds it goes away & firefox never loads