Query runs much slower the second time!

I am doing a simple SELECT on a fairly complex view:
select * from balances where day = date'2011-08-15';The results are correct, and they arrive in about 3 seconds. However, immediately repeating the exact same query takes about 3 minutes!
Using a different SELECT list and/or WHERE clause gives a quick result, but only once; repeating any past query triggers the big slowdown.
Doing ANALYZE TABLE on any of the tables involved in the view seems to reset things and the queries become fast again, but still only once for each specific query.
This view worked fine on 9i and has only started doing this since we moved to 11g.
Weird, eh?

Here's EXPLAIN PLAN, which is the same before the fast query, before the slow query, and after the slow query.
| Id  | Operation                         | Name                  | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT                  |                       |   184K|    11M|       |   364K  (1)| 01:12:52 |
|   1 |  HASH GROUP BY                    |                       |   184K|    11M|    13M|   364K  (1)| 01:12:52 |
|*  2 |   FILTER                          |                       |       |       |       |            |          |
|   3 |    NESTED LOOPS OUTER             |                       |   184K|    11M|       |   361K  (1)| 01:12:17 |
|   4 |     NESTED LOOPS                  |                       |  3071 | 82917 |       |    27   (0)| 00:00:01 |
|   5 |      TABLE ACCESS BY INDEX ROWID  | GL_DAYS               |     1 |    12 |       |     2   (0)| 00:00:01 |
|*  6 |       INDEX UNIQUE SCAN           | GL_DAYS_DAY           |     1 |       |       |     1   (0)| 00:00:01 |
|*  7 |      TABLE ACCESS FULL            | GL_ACCOUNTS           |  3071 | 46065 |       |    25   (0)| 00:00:01 |
|   8 |     VIEW                          |                       |    60 |  2340 |       |   118   (0)| 00:00:02 |
|*  9 |      FILTER                       |                       |       |       |       |            |          |
|* 10 |       TABLE ACCESS BY INDEX ROWID | GL_ENTRIES            |    60 |  1380 |       |    28   (0)| 00:00:01 |
|* 11 |        INDEX RANGE SCAN           | GL_ENTRIES_BY_ACCOUNT |    46 |       |       |     2   (0)| 00:00:01 |
|  12 |       NESTED LOOPS                |                       |     1 |    15 |       |     3   (0)| 00:00:01 |
|  13 |        TABLE ACCESS BY INDEX ROWID| GL_VOUCHERS           |     1 |     7 |       |     2   (0)| 00:00:01 |
|* 14 |         INDEX UNIQUE SCAN         | GL_VOUCHERS_PK        |     1 |       |       |     1   (0)| 00:00:01 |
|* 15 |        TABLE ACCESS BY INDEX ROWID| GL_PERIODS            |   104 |   832 |       |     1   (0)| 00:00:01 |
|* 16 |         INDEX UNIQUE SCAN         | GL_PERIODS_PK         |     1 |       |       |     0   (0)| 00:00:01 |
Predicate Information (identified by operation id):
   2 - filter(TO_DATE(' 2011-08-15 00:00:00', 'syyyy-mm-dd hh24:mi:ss')<CURRENT_DATE+730)
   6 - access("D"."DAY"=TO_DATE(' 2011-08-15 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
       filter("D"."DAY"<CURRENT_DATE+730)
   7 - filter("A"."HAS_SUB"=0)
   9 - filter("D"."FISCAL_YEAR"= (SELECT "P"."FISCAL_YEAR" FROM MFA4."GL_PERIODS" "P",MFA4."GL_VOUCHERS"
              "V" WHERE "V"."ID"=:B1 AND "P"."ID"="V"."PERIOD_ID" AND "P"."PERIOD_NO"<13))
  10 - filter("E"."ENTRY_DATE"<="D"."DAY")
  11 - access("E"."ACCOUNT_ID"="A"."ID")
  14 - access("V"."ID"=:B1)
  15 - filter("P"."PERIOD_NO"<13)
  16 - access("P"."ID"="V"."PERIOD_ID")As for the trace file, did you want the raw .trc file or the tkprof output?

Similar Messages

  • When I run the same query for the second time it's faster, I want to reset this behavior

    I am running a query in oracle 11g select A from B where C = ':D' B has millions of records.
    The first time i run it it takes about 30 seconds, the second time i run the query it takes about 1 second.
    Obviously it's caching something and i want it to stop that, each time i run the query i want it to take 30s - just like it was running for the first time.
    The reason I want to reset this is because for testing purposes I want to measure this query at the very first time.
    Please help.
    Thanks & Best Regards,
    Dark

    user9359353 wrote:
    I am running a query in oracle 11g select A from B where C = ':D' B has millions of records.
    The first time i run it it takes about 30 seconds, the second time i run the query it takes about 1 second.
    Obviously it's caching something and i want it to stop that, each time i run the query i want it to take 30s - just like it was running for the first time.
    The reason I want to reset this is because for testing purposes I want to measure this query at the very first time.
    Please help.
    Thanks & Best Regards,
    Dark
    No - you do NOT want to do that. Not if you want to get results that really represent how that query will work in reality.
    See these two AskTom blogs where he discusses the reasons for NOT doing this in detail.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:7413988573867
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:311990400346061304

  • My four year old iMac is running much slower than when it was new.  Any suggestions on cleaning out the cob webs?

    My four year old iMac is running much slower than when it was new.  Does anyone have any suggestions on what I can do to "clean it up" and get it running like it used to?

    What year, screen size, CPU speed and amount of RAM installed?
    To find out info about your system,
    Click on the Apple symbol in the upper left of the OS X main menu bar. A drop down menu appears.
    Click About this Mac. A smaller popup window appears. This gives you basic info like what version of OS X your iMac is running, the speed of your iMac's CPU and how much RAM is installed.
    Click on the button that says More Info. A larger window appears giving you a complete overview of your iMac's hardware specs.
    Highlight all of this info and copy/paste all of this into another reply to this post, editing out your iMac's serial number before actually posting the reply.
    This will tell us everything about your iMac so we may begin to help with your iMac issues.
    How full is your Mac's hard drive?
    Locate your iMac's hard drive icon on the OS X desktop. Click the icon once, then use the keyboard key combination Command-I. This will give you additonal info about your iMac's internal hard drive.  
    Post this info in your reply here, also.
    Here are some general tips to keep your Mac's hard drive trim and slim as possible
    You should never, EVER let a conputer hard drive get completely full, EVER!
    With Macs and OS X, you shouldn't let the hard drive get below 15 GBs or less of free data space.
    If it does, it's time for some hard drive housecleaning.
    Follow some of my tips for cleaning out, deleting and archiving data from your Mac's internal hard drive.
    Have you emptied your Mac's Trash icon in the Dock?
    If you use iPhoto, iPhoto has its own trash that needs to be emptied, also.
    If you store images in other locations other than iPhoto, then you will have to weed through these to determine what to archive and what to delete.
    If you use Apple Mail app, Apple Mail also has its own trash area that needs to be emptied, too!
    Delete any old or no longer needed emails and/or archive to disc, flash drives or external hard drive, older emails you want to save.
    Look through your other Mailboxes and other Mail categories to see If there is other mail you can archive and/or delete.
    STAY AWAY FROM DELETING ANY FILES FROM OS X SYSTEM FOLDER!
    Look through your Documents folder and delete any type of old useless type files like "Read Me" type files.
    Again, archive to disc, flash drives, ext. hard drives or delete any old documents you no longer use or immediately need.
    Look in your Applications folder, if you have applications you haven't used in a long time, if the app doesn't have a dedicated uninstaller, then you can simply drag it into the OS X Trash icon. IF the application has an uninstaller app, then use it to completely delete the app from your Mac.
    To find other large files, download an app called Omni Disk Sweeper.
    Download an app called OnyX for your version of OS X.
    When you install and launch it, let it do its initial automatic tests, then go to the cleaning and maintenance tabs and run the maintenance tabs that let OnyX clean out all web browser cache files, web browser histories, system cache files, delete old error log files.
    Typically, iTunes and iPhoto libraries are the biggest users of HD space.
    move these files/data off of your internal drive to the external hard drive and deleted off of the internal hard drive.
    If you have any other large folders of personal data or projects, these should be archived or moved, also, to the optical discs, flash drives or external hard drive and then either archived to disc and/or deleted off your internal hard drive.
    Good Luck!

  • Error 1172, an error running a VI in the second time call of the DLL

    Hello All,
    I am a beginner in labVIEW.
    I have to write a test program in labVIEW which uses a DLL created by other programmer.
    I called the DLL from my labVIEW to control DIOs, a serial port, communicate with a slave device, perfrom a flashing task.
    While testing the program, I found that the program is OK if I use it just once, however, if I want to run it coninuously using a Do-While Loop, it failed with
    Error 1172.
    As far as I could understand, it seems that the DLL creates a log file in C:\ while it was called for the first time, and the process does not stop taking control of this log file even after the DLL is closed.
    Then when the DLL is called for the second time, it looks for the same log file to write new info but as it was taken control by the previous process, there comes an error.
    Please find the attached files.
    Hope there would be somebody who is able to help me to point out my mistakes in my vi or suggest me a solution for it.
    Thanks and Best Regards
    Aung
    (As the system does not accept the DLL attachment, I changed the extension to .pdf for the DLL File)
    Solved!
    Go to Solution.
    Attachments:
    I Basic Flasher.vi ‏60 KB
    Failure.xls ‏86 KB

    -message deleted -
    Message Edited by Ray.R on 11-17-2009 08:01 PM

  • I have always heard that Macs are less likely to get infected with a virus.  My computer has been running much slower since I installed Maverick.  Just not sure what the problem might be.  Is there a way for me to run a diagnosis?

    I have always heard that Macs are less likely to get infected with a virus.  My computer has been running much slower since I installed Maverick.  Just not sure what the problem might be.  Is there a way for me to run a diagnosis?

    Some have found relief just by reinstalling, but it is more than likely incompatible third-party applications that slow it down.
    You will have to investigate to see what it is.
    Open Activity Monitor and see if anything is using a lot of CPU% or Memory. If they are, check to see if there is an update for them.
    Another place to look is the Console. See if anything is logging repeating messages with throttling and/or respawn in the All Messages list.
    Sometimes it is not that easy to root out the problems, but if you have anything that purported to clean, protect, optimize, maintain, or flush your system, then that is likely the cause.

  • Query taking longer to execute the second time.

    Hello,
    I have a query joing few tables and views and when i execute it the first them, it executes within a seconds, immediately if i execute it the second time it takes about 40 seconds to execute. I am using Oracle 11g [11.2.0.1.0].
    Please find the TKPROF output.
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.26       0.24          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch       23      0.81       0.82          0       5610          0         326
    total       25      1.07       1.07          0       5610          0         326
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 127
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.23       0.23          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch       23     41.01      41.00          0      38218          0         326
    total       25     41.24      41.24          0      38218          0         326
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 127 

    Hi Nicholay,
    VPD is not being used in our application. ArcSDE Multi-Versionsed View uses some functions in VW_ objects. In Oracle 10g I dont have this issue.
    Here is the output from V$SQL_SHARED_CURSOR.
    "SQL_ID"                      "ADDRESS"                     "CHILD_ADDRESS"               "CHILD_NUMBER"                "UNBOUND_CURSOR"              "SQL_TYPE_MISMATCH"           "OPTIMIZER_MISMATCH"          "OUTLINE_MISMATCH"            "STATS_ROW_MISMATCH"          "LITERAL_MISMATCH"            "FORCE_HARD_PARSE"            "EXPLAIN_PLAN_CURSOR"         "BUFFERED_DML_MISMATCH"       "PDML_ENV_MISMATCH"           "INST_DRTLD_MISMATCH"         "SLAVE_QC_MISMATCH"           "TYPECHECK_MISMATCH"          "AUTH_CHECK_MISMATCH"         "BIND_MISMATCH"               "DESCRIBE_MISMATCH"           "LANGUAGE_MISMATCH"           "TRANSLATION_MISMATCH"        "BIND_EQUIV_FAILURE"          "INSUFF_PRIVS"                "INSUFF_PRIVS_REM"            "REMOTE_TRANS_MISMATCH"       "LOGMINER_SESSION_MISMATCH"   "INCOMP_LTRL_MISMATCH"        "OVERLAP_TIME_MISMATCH"       "EDITION_MISMATCH"            "MV_QUERY_GEN_MISMATCH"       "USER_BIND_PEEK_MISMATCH"     "TYPCHK_DEP_MISMATCH"         "NO_TRIGGER_MISMATCH"         "FLASHBACK_CURSOR"            "ANYDATA_TRANSFORMATION"      "INCOMPLETE_CURSOR"           "TOP_LEVEL_RPI_CURSOR"        "DIFFERENT_LONG_LENGTH"       "LOGICAL_STANDBY_APPLY"       "DIFF_CALL_DURN"              "BIND_UACS_DIFF"              "PLSQL_CMP_SWITCHS_DIFF"      "CURSOR_PARTS_MISMATCH"       "STB_OBJECT_MISMATCH"         "CROSSEDITION_TRIGGER_MISMATCH""PQ_SLAVE_MISMATCH"           "TOP_LEVEL_DDL_MISMATCH"      "MULTI_PX_MISMATCH"           "BIND_PEEKED_PQ_MISMATCH"     "MV_REWRITE_MISMATCH"         "ROLL_INVALID_MISMATCH"       "OPTIMIZER_MODE_MISMATCH"     "PX_MISMATCH"                 "MV_STALEOBJ_MISMATCH"        "FLASHBACK_TABLE_MISMATCH"    "LITREP_COMP_MISMATCH"        "PLSQL_DEBUG"                 "LOAD_OPTIMIZER_STATS"        "ACL_MISMATCH"                "FLASHBACK_ARCHIVE_MISMATCH"  "LOCK_USER_SCHEMA_FAILED"     "REMOTE_MAPPING_MISMATCH"     "LOAD_RUNTIME_HEAP_FAILED"    "HASH_MATCH_FAILED"           "PURGED_CURSOR"               "BIND_LENGTH_UPGRADEABLE"    
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD49C88"            "1"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD3A7B8"            "0"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD46A40"            "2"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD3A7B8"            "0"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD49C88"            "1"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD46A40"            "2"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD3A7B8"            "0"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD49C88"            "1"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                          
    "7rtqvjtyp06k9"               "000007FFABD3A918"            "000007FFABD46A40"            "2"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           "N"                           Edited by: 955237 on 29 Aug, 2012 1:57 AM

  • Firefox runs much slower with the new download of version 3.6.8

    I downloaded Firefox 3.6.8 on Sat. 7/30. Now it seems to be running much slower and some websites take forever to download some pages. What can I do to get it running like it was before the download? I have windows 7 os
    == URL of affected sites ==
    http://

    Same here but im running windows xp pro

  • Parameterized queries running much slower than ones with hardcoded values

    Very often there is a huge performance difference when using parameters in a query, compared to running the same code after replacing the parameters with hardcoded values: the parameterized version of the code runs much slower!
    The case is not parameter sniffing as it is not a (compiled) stored proc, but code executed directly from the editor and the performance issue has been observed in different versions of SQL Server (2000 and 2005).
    How is this explained and how can the parameterized queries have similar performance with the hardcoded ones?
    Also, why does this happen in some cases and not always?
    Finally, the same is sometimes the case with stored procs: a very slow running proc speeds up tremendously when running its code directly, instead of calling the procedure --and even faster, according to the previous, when its parameters are replaced with
    hardcoded values 

    >>The case is not parameter sniffing as it is not a (compiled) stored proc, but code executed >>>directly
    from the editor ?>>>and the performance issue has been observed in different >>>versions of SQL Server (2000 and 2005).
    Something like below?
    --SQL Server creates 3 execution plan rather only one
    DBCC FREEPROCCACHE
    GO
    SELECT *
    FROM Sales.SalesOrderHeader
    WHERE SalesOrderID = 56000
    GO
    SELECT * FROM
    AdventureWorks.Sales.SalesOrderHeader WHERE
    SalesOrderID = 56001
    GO
    declare @i int
    set @i = 56004
    SELECT *
    FROM Sales.SalesOrderHeader
    WHERE SalesOrderID = @i
    GO
    select  stats.execution_count AS exec_count, 
    p.size_in_bytes as [size], 
    [sql].[text] as [plan_text]
    from sys.dm_exec_cached_plans p
    outer apply sys.dm_exec_sql_text (p.plan_handle) sql
    join sys.dm_exec_query_stats stats ON stats.plan_handle = p.plan_handle
    GO
    ----This time only (we get parameterization)
    DBCC FREEPROCCACHE
    GO
    EXEC sp_executesql N'SELECT  SUM(LineTotal) AS LineTotal
    FROM Sales.SalesOrderHeader H
    JOIN Sales.SalesOrderDetail D ON D.SalesOrderID = H.SalesOrderID
    WHERE H.SalesOrderID = @SalesOrderID', N'@SalesOrderID INT', 56000
    GO
    EXEC sp_executesql N'SELECT  SUM(LineTotal) AS LineTotal
    FROM Sales.SalesOrderHeader H
    JOIN Sales.SalesOrderDetail D ON D.SalesOrderID = H.SalesOrderID
    WHERE H.SalesOrderID = @SalesOrderID', N'@SalesOrderID INT', 56005
    GO
    select  stats.execution_count AS exec_count, 
    LEFT([sql].[text], 80) as [plan_text]
    from sys.dm_exec_cached_plans p
    outer apply sys.dm_exec_sql_text (p.plan_handle) sql
    join sys.dm_exec_query_stats stats ON stats.plan_handle = p.plan_handle
    GO
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • My iPhone 4S is dark, this is the second time.  The first time i was able to get it back on by plugging in into my PC.  However this time i have had it plugged in for an hour or so and nothing.  I have done the Start/sleep buttons

    My iPhone 4s is dark, this is the second time.  The first time I was able to get it back up and running by plugging it into my PC.  However this time it has been plugged in for an hour or more and nothing. There was still at least 70% charge left on it when it went dead.  I have pressed the sleep and start button separately and together.  It said that I did not have much space left this morning so I deleted Apps and photos but there was still space.  Just two days ago it was losing power even though it still 55% charge left so I plugged it in and it seemed to gain power.  Any suggestions on the problem?

    Sounds like faulty battery. Make Genius reservation and take to Apple for quick (minutes) free battery diagnostic testing. If you have Warranty or AppleCare the problem will be covered.

  • In CS6, JavaScript Running MUCH Slower than ActionScript

    Hi All,
    I am finding that in CS6, JS code runs MUCH slower than ActionScript code. I don't want to double-post here - Full details may be found where I posted them in the InDesign Scripting forum at  - CS6 JavaScript Running Much Slower than ActionScript, before I realized that this forum might be more appropriate.
    The basic gist of it is that I had a Flex/ActionScript Extension, which I obviously needed to start converting to JavaScript in advance of the next version not supporting ActionScript. I converted 20,000 lines of my business logic code from ActionScript to JavaScript (grrr...) - only to find that it now runs 5 times slower than it did in ActionScript.
    What has been the experience of others who have converted large Extensions from ActionScript to JavaScript?
    I would greatly appreciate any and all suggestions.
    TIA,
    mlavie

    Hi All,
    I am finding that in CS6, JS code runs MUCH slower than ActionScript code. I don't want to double-post here - Full details may be found where I posted them in the InDesign Scripting forum at  - CS6 JavaScript Running Much Slower than ActionScript, before I realized that this forum might be more appropriate.
    The basic gist of it is that I had a Flex/ActionScript Extension, which I obviously needed to start converting to JavaScript in advance of the next version not supporting ActionScript. I converted 20,000 lines of my business logic code from ActionScript to JavaScript (grrr...) - only to find that it now runs 5 times slower than it did in ActionScript.
    What has been the experience of others who have converted large Extensions from ActionScript to JavaScript?
    I would greatly appreciate any and all suggestions.
    TIA,
    mlavie

  • You block my hotmail account for the second time

     you don't have the right to block my hotmail account for the second time and for no reason.
    you have the worst customer service system ever, it's not respectable.
    I think my new E-mail will not be with you.

    Lots of Mikes in this thread!  
    MichaelRizk: I dont speak or write Arabic so hopefully you can understand an English response. 
    This is the TechNet Website Feedback forum, and here we know things about the TechNet Website and the TechNet Subscription.  Microsoft has a lot of products and a lot of separate teams that work on those products.  
    The link Mike provided for you is exactly where you need to go to get help, and where you have the best chance to get an explanation for whatever happened to your Hotmail account.  Here we don't know anything about Hotmail.
    Good luck!
    Thanks,
    Mike
    Unfortunately your post is off topic here, in the TechNet Site Feedback forum, because it is not Feedback about the TechNet Website or Subscription.  This is a standard response I’ve written up in advance to help many people (thousands, really.)
    who post their question in this forum in error, but please don’t ignore it.  The links I share below I’ve collected to help you get right where you need to go with your issue.
    For technical issues with Microsoft products that you would run into as an
    end user of those products, one great source of info and help is
    http://answers.microsoft.com, which has sections for Windows, Hotmail, Office, IE, and other products. Office related forums are also here:
    http://office.microsoft.com/en-us/support/contact-us-FX103894077.aspx
    For Technical issues with Microsoft products that you might have as an
    IT professional (like technical installation issues, or other IT issues), you should head to the TechNet Discussion forums at
    http://social.technet.microsoft.com/forums/en-us, and search for your product name.
    For issues with products you might have as a Developer (like how to talk to APIs, what version of software do what, or other developer issues), you should head to the MSDN discussion forums at
    http://social.msdn.microsoft.com/forums/en-us, and search for your product or issue.
    If you’re asking a question particularly about one of the Microsoft Dynamics products, a great place to start is here:
    http://community.dynamics.com/
    If you really think your issue is related to the subscription or the TechNet Website, and I screwed up, I apologize!  Please repost your question to the discussion forum and include much more detail about your problem, that could include screenshots
    of the issue (do not include subscription information or product keys in your screenshots!), and/or links to the problem you’re seeing. 
    If you really had no idea where to post this question but you still posted it here, you still shouldn’t have because we have a forum just for you!  It’s called the Where is the forum for…? forum and it’s here:
    http://social.msdn.microsoft.com/forums/en-us/whatforum/
    Moving to off topic. 
    Thanks, Mike
    MSDN and TechNet Subscriptions Support

  • C++ Call to DLL made in LabVIEW Fails the second time it is called

    I have an application where a C++ executive calls a LabVIEW DLL (a LabVIEW application built into a DLL).
    The executive calls and operates the DLL fine the first time (NT, the applications task manager shows LabVIEW runtime runs, then stops when the DLL is done. However, when the executive calls the DLL a second time, it hangs, and the runtime engine never shows up in the applications task manager as running.
    However, this only occurs when something like IMAQ, DAQ, or another custom DLL call is occurring. We tried it with a simple DLL that only uses a call to the sound VIs, and it seems to run fine, although as the program called is very short, and the task manager slow, we never see the runtime engin
    e in the task manager. We are going to put a popup dialog in to ensure that the DLL is being called reliably, but we believe it is.
    We are unable to answer why when we call something that uses IMAQ, that the DLL doesn't run right the second time. We are unsure of the reasons, but believe it to be related to thread creation and destruction in the executive.
    If anyone out there has any insight into this, we would be happy to see it.
    We will be putting in a formal request for support from NI, but wanted to poll the audience as well, as we know from first hand experience that LabVIEW users often times have more experience with this sort of thing than developers.
    Thanks a bunch

    > Thanks for the information Greg. There is no documentation on this
    > issue, except for the email that we got from NI Support. This is
    > quite a new realm for us and NI alike. We would like to know what
    > your experiences have been on this subject. If you have a bit of
    > information, perhaps we should suggest a topic. As I said, this is a
    > new frontier for LabVIEW, and there are a lot of things that NI
    > doesn't know, and I'm sure a few of the programmers out there have
    > figured out.
    >
    I often answer emails from home, but I work for NI on the LV development
    team. So anything I know about, NI knows about. The info I was
    describing about the DLL execution system is not well documented since
    we were hoping that it would work we
    ll with the way Windows Apps are
    typically written. I suspect that we will need to write a Tech Note
    to cover the nitty gritty. This sort of info gets lost in manuals,
    and it is subject to change as we learn how people are expecting to
    use it.
    Anyway, my post was to explain why your use of it didn't work.
    In general, we believe that LV DLLs are thread savvy, reentrant
    VIs can be called from multiple threads simultaneously, execution can
    continue in the background after the DLL call has returned, and the UI
    is live provided the calling app processes messages in that thread.
    If you have other issues or questions, just ask.
    Greg McKaskle

  • Palm Desktop 6.2.2 Datebook has lost 98% of future entries for the second time

    For the second time in a couple months when I opened the Datebook in Palm Desktop running on my PC (running XP) almost all the entries after May 18th are missing.  My last hot sync was June 10th - no errors were reported.  Each time I make an entry in any of the Palm Desktop apps I save.  I hot sync each evening when entries are made.  Only the Datebook seems to be affected.  I have a Palm Centro thru AT&T.
    Post relates to: Centro (AT&T)

    I solved the problem.  I no longer use the Palm Desktop.  I changed my hotsync conduit to Outlook, re-synced and everything transfered over without a hitch.  The missing Calendar entries were even transferred,  Life is now so much easier!

  • I play a lot of games.  I noticed my computer running much slower what can I do

    I play a lot of games.  I noticed my computer running much slower.  Is there something I can do to fix probkem

    Things You Can Do To Resolve Slow Downs
    If your computer seems to be running slower here are some things you can do:
    Start with visits to:     OS X Maintenance - MacAttorney;
                                      The X Lab: The X-FAQs;
                                      The Safe Mac » Mac Performance Guide;
                                      The Safe Mac » The myth of the dirty Mac;
                                      Mac maintenance Quick Assist.
    Boot into Safe Mode then repair your hard drive and permissions:
    Repair the Hard Drive and Permissions Pre-Lion
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    Repair the Hard Drive - Lion/Mountain Lion/Mavericks
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the Utilites Menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD disk icon and click on the arrow button below.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported, then click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
    Restart your computer normally and see if this has helped any. Next do some maintenance:
    For situations Disk Utility cannot handle the best third-party utility is Disk Warrior;  DW only fixes problems with the disk directory, but most disk problems are caused by directory corruption; Disk Warrior 4.x is now Intel Mac compatible.
    Note: Alsoft ships DW on a bootable DVD that will startup Macs running Snow Leopard or earlier. It cannot start Macs that came with Lion or later pre-installed, however, DW will work on those models.
    Suggestions for OS X Maintenance
    OS X performs certain maintenance functions that are scheduled to occur on a daily, weekly, or monthly period. The maintenance scripts run in the early AM only if the computer is turned on 24/7 (no sleep.) If this isn't the case, then an excellent solution is to download and install a shareware utility such as Macaroni, JAW PseudoAnacron, or Anacron that will automate the maintenance activity regardless of whether the computer is turned off or asleep.  Dependence upon third-party utilities to run the periodic maintenance scripts was significantly reduced since Tiger.  These utilities have limited or no functionality with Snow Leopard or later and should not be installed.
    OS X automatically defragments files less than 20 MBs in size, so unless you have a disk full of very large files there's little need for defragmenting the hard drive.
    Helpful Links Regarding Malware Protection
    An excellent link to read is Tom Reed's Mac Malware Guide.
    Also, visit The XLab FAQs and read Detecting and avoiding malware and spyware.
    See these Apple articles:
              Mac OS X Snow Leopard and malware detection
              OS X Lion- Protect your Mac from malware
              OS X Mountain Lion- Protect your Mac from malware
              About file quarantine in OS X
    If you require anti-virus protection I recommend using VirusBarrier Express 1.1.6 or Dr.Web Light both from the App Store. They're both free, and since they're from the App Store, they won't destabilize the system. (Thank you to Thomas Reed for these recommendations.)
    Troubleshooting Applications
    I recommend downloading a utility such as TinkerTool System, OnyX, Mavericks Cache Cleaner, or Cocktail that you can use for removing old log files and archives, clearing caches, etc. Corrupted cache, log, or temporary files can cause application or OS X crashes as well as kernel panics.
    If you have Snow Leopard or Leopard, then for similar repairs install the freeware utility Applejack.  If you cannot start up in OS X, you may be able to start in single-user mode from which you can run Applejack to do a whole set of repair and maintenance routines from the command line.  Note that AppleJack 1.5 is required for Leopard. AppleJack 1.6 is compatible with Snow Leopard. Applejack does not work with Lion and later.
    Basic Backup
    For some people Time Machine will be more than adequate. Time Machine is part of OS X. There are two components:
    1. A Time Machine preferences panel as part of System Preferences;
    2. A Time Machine application located in the Applications folder. It is
        used to manage backups and to restore backups. Time Machine
        requires a backup drive that is at least twice the capacity of the
        drive being backed up.
    Alternatively, get an external drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
      1. Carbon Copy Cloner
      2. Get Backup
      3. Deja Vu
      4. SuperDuper!
      5. Synk Pro
      6. Tri-Backup
    Visit The XLab FAQs and read the FAQ on backup and restore.  Also read How to Back Up and Restore Your Files. For help with using Time Machine visit Pondini's Time Machine FAQ for help with all things Time Machine.
    Referenced software can be found at MacUpdate.
    Additional Hints
    Be sure you have an adequate amount of RAM installed for the number of applications you run concurrently. Be sure you leave a minimum of 10% of the hard drive's capacity as free space.
    Add more RAM. If your computer has less than 2 GBs of RAM and you are using OS X Leopard or later, then you can do with more RAM. Snow Leopard and Lion work much better with 4 GBs of RAM than their system minimums. The more concurrent applications you tend to use the more RAM you should have.
    Always maintain at least 15 GBs or 10% of your hard drive's capacity as free space, whichever is greater. OS X is frequently accessing your hard drive, so providing adequate free space will keep things from slowing down.
    Check for applications that may be hogging the CPU:
    Pre-Mavericks
    Open Activity Monitor in the Utilities folder.  Select All Processes from the Processes dropdown menu.  Click twice on the CPU% column header to display in descending order.  If you find a process using a large amount of CPU time (>=70,) then select the process and click on the Quit icon in the toolbar.  Click on the Force Quit button to kill the process.  See if that helps.  Be sure to note the name of the runaway process so you can track down the cause of the problem.
    Mavericks and later
    Open Activity Monitor in the Utilities folder.  Select All Processes from the View menu.  Click on the CPU tab in the toolbar. Click twice on the CPU% column header to display in descending order.  If you find a process using a large amount of CPU time (>=70,) then select the process and click on the Quit icon in the toolbar.  Click on the Force Quit button to kill the process.  See if that helps.  Be sure to note the name of the runaway process so you can track down the cause of the problem.
    Often this problem occurs because of a corrupted cache or preferences file or an attempt to write to a corrupted log file.

  • 2009 MBP can't see internal hard drive - for the second time!

    Well, my 2009 13" MBP is at Applecare for the second time because it cannot recognize _any_ internal hard drive.
    The first repair came at 9 months (purchased new), now 16 months later I have the same issue.
    Swap in a known good drive, it can't see it, boot from DVD, and run Disk Utility, it can't see it either (optical drive shows up fine)
    My first repair only said they replaced the original hard drive, has anyone else had the issue of losing access to your internal hard drive?
    Ugh, I will be out of the 3 year Applecare next summer, and don't want to get stuck with another iBook G3, if you know what I mean.
    Thanks for any feedback!

    Hi
    I have the same issue, I have a Vodafone branded Huawei HG556a with an external drive connected. I have found that it isn't possible to connect via Finder and that SMB doesn't work either. The only way I could connect to it was via FTP using Cyberduck (or Filezilla), but no use as I can't add my media files from the drive to iTunes, so unfortunately disappointing. I'm still looking, but here's the document I was referred too from another forum.
    broadband.vodafone.ie/download/files/storage_mac.pdf
    Although not an answer to your question, hopefully this will give you an idea why you are getting the password and username errors when you know they are correct. In the end when I entered the FTP details into Cyberduck I was able to connect.
    I know this doesn't help solve the problem (as I'm still looking too), but at leas you know why (ish).
    Cheers
    Topes

Maybe you are looking for