SELECT query very slow, need suggestion.

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

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

Similar Messages

  • Query very slow!

    I have Oracle 9i and SUN OS 5.8
    I have a Java application that have a query to the Customer table. This table has 2.000.000 of records and I have to show its in pages (20 record each page)
    The user query for example the Customer that the Last Name begin with “O”. Then the application shows the first 20 records with this condition and order by Name.
    Then I have to create 2 querys
    1)
    SELECT id_customer,Name
    FROM Customers
    WHERE Name like 'O%'
    ORDER BY id_customer
    But when I proved this query in TOAD it take long to do it (the time consuming was 15 minutes)
    I have the index in the NAME field!!
    Besides, if the user want to go to the second page the query is executed again. (The java programmers said me that)
    What is your recommendation to optimize it????? I need to obtain the information in
    few seconds.
    2)
    SELECT count(*) FROM Customers WHERE NAME like 'O%'
    I have to do this query because I need to known How many pages (20 records) I need to show.
    Example with 5000 records I have to have 250 pages.
    But when I proved this query in TOAD it take long to do it (the time consuming was 30 seconds)
    What is your recommendation to optimize it????? I need to obtain the information in
    few seconds.
    Thanks in advance!

    This appears to be a dulpicate of a post in the Query very slow! forum.
    Claudio, since the same folks tend to read both forums, it is generally preferred that you post questions in only one forum. That way, multiple people don't spend time writing generally equivalent replies.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Variable selection is very slow in WAD

    Hi All,
    Variable selection is very slow, It  takes 2 min to 3 min to get the variable list.
    There are Lots of Data in the system and This query is from Multicube
    please help me out from this issue. It's Urgent !!
    Thanks,
    Greg

    Hi Greg,
    I have the same issue.
    It is very important to improve performance of the F4 function in the web.
    For one query in BEx, it takes about 2 seconds to open the F4 screen for 0CUSTOMER. In the web (WAD) it takes a lot more even with HTTP compression enabled!
    Anybody with a solution to improve performance of the variable selection screen?
    Thanks!

  • My MacBook Pro is very slow any suggestions?

    My MacBook Pro is very slow any suggestions?

    OS X 10.7/10.8
    http://support.apple.com/kb/PH3915
    Start up in Safe Mode.
    http://support.apple.com/kb/PH4373
    Repair Disk
    Steps 1 through 7
    http://support.apple.com/kb/PH5836?viewlocale=en_US
    Increase Disk Space
    http://support.apple.com/kb/PH10677?viewlocale=en_US

  • My Mac Book Pro is suddenly very slow.  Suggestions?

    My Mac Book Pro is suddenly very slow.  Suggestions?

    Hi p,
    Try any of the following which you have not yet done:
    Make sure you have at least 15% free space available on your HD.
    Check SMART status on HD.
    Repair Permissions.
    Repair Disk.
    SMC Reset.
    Safe Boot.
    Check Page outs in Activity Monitor.

  • Safari is very slow, needs a long time to open a website

    Hello there,
    I´m using the version Version 7.0.4 on my iMac. The download of websites is very slow. What can I do? Is there any possibilty to make the safari faster?
    Thank you very much for your help.

    Please answer as many of the following questions as you can. You may already have answered some of them. In that case, there's no need to repeat the answers.
    Have you restarted your router and your broadband device (if they're separate) since you first noticed the problem? If not, do that now and see whether there's any change.
    If your browser is Safari, then from the Safari menu bar, select
    Safari ▹ Preferences... ▹ Privacy ▹ Remove All Website Data
    and confirm. Any change?
    If you're running OS X 10.9 or later, select the Advanced tab in the Preferences window and uncheck the box marked
    Stop plug-ins to save power
    Any change?
    Quit and relaunch the browser. Any change?
    Log out and log back in. Any change?
    Enable Private Browsing in the Safari menu. Any change?
    Are any other web browsers installed, and are they the same? What about other Internet applications, such as iTunes and the App Store?
    If other browsers and Internet applications are also affected, follow these instructions and test. Any change?
    If Parental Controls is active for any user, please turn it off and test. Any change?
    If only Safari is affected, launch the Activity Monitor application and enter "web" (without the quotes) in the search box. If a process named "Safari Web Content" is shown in red or is using more than about 5% of a CPU, select it and force it to quit by clicking the X or Quit Process button in the toolbar of the window. There may be more than one such process. Any improvement?
    Again, if only Safari is involved, open the iCloud preference pane and uncheck the box marked Safari, if it's checked. Any change?
    Are there any other devices on the same network that can browse the Web, and are they affected?
    If you can test Safari on another network, is it the same there?
    If you connect to your router with Wi-Fi and you can also connect with Ethernet, do that and turn off Wi-Fi. Any difference?

  • SPATIAL QUERY VERY SLOW

    I CAN TO EXECUTE THIS QUERY BUT IT IS VERY SLOW, I HAVE 2 TABLE , ONE A WITH 250.000 SITE AND B WITH 250.000 POINTS, I WANT TO DETERMINING HOW MANY RISK INSIDE THE SITES.
    THANKS
    JGS
    SELECT B.ID, A.ID, A.GC, A.SUMA
    FROM DBG_RIESGOS_CUMULOS_SITE A, DBG_RIESGOS_CUMULOS B
    WHERE A.GC = 'PATRIMONIAL FENOMENOS SISMICOS' AND A.GC=B.GC
    AND SDO_RELATE(B.GEOMETRY, A.GEOMETRY, 'MASK=INSIDE') = 'TRUE';
    100 RECORS IN 220 '' SLOWWWWW

    I would do two things:
    1) Ensure Oracle is patched with the latest 10.2.0.4 patches
    This is the list I've been working with:
    Patch 7003151
    Patch 6989483
    Patch 7237687
    Patch 7276032
    Patch 7307918
    2) Write the query like this
    SELECT /*+ ORDERED*/ B.ID, A.ID, A.GC, A.SUMA
    FROM DBG_RIESGOS_CUMULOS B, DBG_RIESGOS_CUMULOS_SITE A
    WHERE B.GC = 'PATRIMONIAL FENOMENOS SISMICOS'
    AND A.GC=B.GC
    AND SDO_ANYINTERACT(A.GEOMETRY, B.GEOMETRY) = 'TRUE';

  • Oracle interview questions;; query very slow

    Hai
    Most of time in interview they ask..
    WHAT IS THE STEPS U DO WHEN UR QUERY IS RUNNNING VERY SLOW..?
    i used to say
    1) first i will check for whether table is properly indexed or not
    2) next properly normalized or not
    interviewers are not fully satisfied with these answers..
    So kindly tell me more suggestion
    S

    Also when checking the execution plan, get the actual plan using DBMS_XPLAN.DISPLAY_CURSOR, rather than the predicted one (EXPLAIN PLAN FOR). If you use a configurable IDE such as SQL Developer of PL/SQL Developer it is worth taking the time to set this up in the session browser so that you can easily capture it while it's running. You might also look at the estimated vs actual cardinalities. While you're at it you could check v$session_longops, v$session_wait and (if you have the Diagnostic and Tuning packs licenced) v$active_session_history and the various dba_hist% views.
    You might try the SQL Tuning Advisor (DBMS_SQLTUNE) which generates profiles for SQL statements (requires ADVISOR system privilege to run a tuning task, and CREATE ANY SQL PROFILE to apply a profile).
    In 11g look at SQL Monitor.
    Tracing is all very well if you can get access to the tracefile in a reasonable timeframe, though in many sites (including my current one) it's just too much trouble unless you're a DBA.
    Edited by: William Robertson on Apr 18, 2011 11:40 PM
    Sorry Rob, should probably have replied to oraclehema rather than you.

  • User Defined Type - Array bind Query very slow

    Hi.
    I have following Problem. I try to use Oracle Instant Client 11 and ODP.NET to pass Arrays in SELECT statements as Bind Parameters. I did it, but it runs very-very slow. Example:
    - Inittial Query:
    SELECT tbl1.field1, tbl1.field2, tbl2.field1, tbl2.field2 ... FROM tbl1
    LEFT JOIN tbl2 ON tbl1.field11=tbl2.field0
    LEFT JOIN tbl3 ON tbl2.field11=tbl3.field0 AND tbll1.field5=tbl3.field1
    ...and another LEFT JOINS
    WHERE
    tbl1.field0 IN ('id01', 'id02', 'id03'...)
    this query with 100 elements in "IN" on my database takes 3 seconds.
    - Query with Array bind:
    in Oracle I did UDT: create or replace type myschema.mytype as table of varchar2(1000)
    than, as described in Oracle Example I did few classes (Factory and implementing IOracleCustomType) and use it in Query,
    instead of IN ('id01', 'id02', 'id03'...) I have tbl1.field0 IN (select column_value from table(:prmTable)), and :prmTable is bound array.
    this query takes 190 seconds!!! Why? I works, but the HDD of Oracle server works very hard, and it takes too long.
    Oracle server we habe 10g.
    PS: I tried to use only 5 elements in array - the same result, it takes also 190 seconds...
    Please help!

    I recommend you generate an explain plan for each query and post them here. Based on what you have given the following MAY be happening:
    Your first query has as static IN list when it is submitted to the server. Therefore when Oracle generates the execution plan the CBO can accurately determine it based on a KNOWN set of input parameters. However the second query has a bind variable for this list of parameters and Oracle has no way of knowing at the time the execution plan is generated what that list contains. If it does not know what the list contains it cannot generate the most optimal execution plan. Therefore I would guess that it is probably doing some sort of full table scan (although these aren't always bad, remember that!).
    Again please post the execution plans for each.
    HTH!

  • 10g Form - first execute query - very slow

    I have the following issue:
    Enter an application
    open a form in enter query mode
    first time execute query is very slow (several minutes)
    every other time it's quick (couple seconds or less)
    I can leave the form, use other forms within the app, come back and query is still quick. It's only the first time after initially launching the app.
    Any ideas what might be causing this?

    We have the same application running in 6i client/server DB-9i in production. We are testing the upgraded application that is 10g forms on OAS DB-10g. We don't have the issue in the current production client/server app.

  • UNION making query very slow... solution?

    Hi Guys,
    I want to get the records of two tables in one view. Option available in oracle is UNION.
    I have used UNION between two select statement. There are above 15,000 records in one table and around 200 in the other one.
    But after using this UNION between the select statements my view have become very slow.
    Can i use a order by command in the following view, I have tried but it gives error. What is the alternate of a UNION.
    Please help. All of our reports depend on this view and its very slow.
    the script of the view is as follows:
    CREATE OR REPLACE VIEW "COMMON"."V_SEL_SYS_EMP" AS
    Select Employee.Emp_Employees.Employee_ID,
    trim(Employee.Emp_Employees.Emp_F_Name) ||' '|| trimemployee.Emp_Employees.Emp_L_Name) As
    Emp_Name, Employee.Emp_Employees.Branch_ID,
    Common.Com_Branches.Br_Name, COMMON.COM_BRANCHES.REGION_ID,
    COMMON.COM_REGIONS.REGION_NAME, COMMON.COM_BRANCHES.CHAPTER_ID,
    COMMON.COM_CHAPTERS.CHAPTER_NAME, Employee.Emp_Employees.Company_ID,
    Common.Com_Companies.Comp_Name, Employee.Emp_Employees.Department_ID,
    Common.Com_Departments.Dept_Name, Employee.Emp_Employees.Religion_ID,
    Common.Com_Religions.Religion_Name, Employee.Emp_Employees.Premises_ID,
    Common.Com_Premises.Premises_name, Employee.Emp_Employees.Categ_ID,
    Employee.Emp_Categories.Categ_Name, Employee.Emp_Employees.Desig_ID,
    Employee.Emp_Employees.Desig_Suffix, Employee.Emp_Designations.Designation,
    EMPLOYEE.EMP_EMPLOYEES.PAY_SCALE, EMPLOYEE.EMP_EMPLOYEES.BASIC_SAL,
    Employee.Emp_Employees.HEAD_OF_DEPT, Employee.Emp_Employees.Birth_Date,
    Employee.Emp_Employees.Emp_Gender, Employee.Emp_Employees.Emp_Status,
    Employee.Emp_Employees.Hire_Date, Employee.Emp_Employees.Conf_Date,
    Employee.Emp_Employees.Left_Date, Employee.Emp_Employees.Emp_Photo,
    Employee.Emp_Emp_Info.E_Mail,Employee.Emp_Employees.Dept_Head_Id FROM Employee.Emp_Employees, Common.Com_Branches,
    Common.Com_Companies, Common.Com_Departments, Common.Com_Religions, Common.Com_Premises,
    Employee.Emp_categories,
    Employee.Emp_Designations, Employee.Emp_Emp_Info, COMMON.COM_REGIONS,common.com_chapters
    Where (Employee.Emp_Employees.Branch_ID = Common.Com_Branches.Branch_ID(+))
    and (Employee.Emp_Employees.Company_ID = Common.Com_Companies.Company_ID(+))
    AND (COM_BRANCHES.REGION_ID = COM_REGIONS.REGION_ID(+))
    AND (COM_BRANCHES.CHAPTER_ID = COM_CHAPTERS.CHAPTER_ID(+))
    and (Employee.Emp_Employees.Department_ID = Common.Com_Departments.Department_ID(+))
    and (Employee.Emp_Employees.Religion_ID = Common.Com_Religions.Religion_ID(+))
    and (Employee.Emp_Employees.Premises_ID = Common.Com_Premises.Premises_ID(+))
    and (Employee.Emp_Employees.Categ_ID = Employee.Emp_Categories.Categ_ID(+))
    and (Employee.Emp_Employees.Desig_ID = Employee.Emp_Designations.Desig_ID(+))
    and (Employee.Emp_Employees.Employee_ID = Employee.Emp_Emp_Info.Employee_ID(+))
    UNION
    Select Common.Com_Non_Employees.Non_Employee_ID,
    trim(Common.Com_Non_Employees.First_Name) ||' '|| trim(Common.Com_Non_Employees.Last_Name)
    As Emp_Name, Common.Com_Non_Employees.Branch_ID,
    Common.Com_Branches.Br_Name, COMMON.COM_BRANCHES.REGION_ID,
    COMMON.COM_REGIONS.REGION_NAME, COMMON.COM_BRANCHES.CHAPTER_ID,
    COMMON.COM_CHAPTERS.CHAPTER_NAME, Common.Com_Non_Employees.Company_ID,
    Common.Com_Companies.Comp_Name, Common.Com_Non_Employees.Department_ID,
    Common.Com_Departments.Dept_Name, Common.Com_Non_Employees.Religion_ID,
    Common.Com_Religions.Religion_Name, NULL as Premises_ID,
    NULL as Premises_name, NULL as Categ_ID, NULL as Categ_Name,
    Common.Com_Non_Employees.Desig_ID, Common.Com_Non_Employees.Desig_Suffix,
    Employee.Emp_Designations.Designation, NULL as PAY_SCALE,
    NULL as BASIC_SAL, NULL as HEAD_OF_DEPT, NULL as Birth_Date,
    Common.Com_Non_Employees.Emp_Gender, NULL as Emp_Status,
    NULL as Hire_Date,NULL as Conf_Date,NULL as Left_Date,NULL as Emp_Photo,
    Employee.Emp_Emp_Info.E_Mail,Null as Dept_Head_ID
    FROM Common.Com_Non_Employees, Common.Com_Branches,
    Common.Com_Companies,
    Common.Com_Departments, Common.Com_Religions, Common.Com_Premises,
    Employee.Emp_categories, Employee.Emp_Designations, Employee.Emp_Emp_Info, COMMON.COM_REGIONS,
    common.com_chapters
    Where (Common.Com_Non_Employees.Branch_ID = Common.Com_Branches.Branch_ID(+))
    and (Common.Com_Non_Employees.Company_ID = Common.Com_Companies.Company_ID(+))
    AND (COM_BRANCHES.REGION_ID = COM_REGIONS.REGION_ID(+))
    AND (COM_BRANCHES.CHAPTER_ID = COM_CHAPTERS.CHAPTER_ID(+))
    and (Common.Com_Non_Employees.Department_ID = Common.Com_Departments.Department_ID(+))
    and (Common.Com_Non_Employees.Religion_ID = Common.Com_Religions.Religion_ID(+))
    and (Common.Com_Non_Employees.Desig_ID = Employee.Emp_Designations.Desig_ID(+))
    and (Common.Com_Non_Employees.NOn_Employee_ID = Employee.Emp_Emp_Info.Employee_ID(+))
    without UNION the two selet commands retrieve data in a quick manner.
    Plis help!
    Imran Baig

    use UNION ALL instead of UNION.
    If you still feel slow then generate the trace and see what is the bottle neck.
    alter session set events '10046 trace name context forever, level 8'
    select * from veww;
    alter session set events '10046 trace name context off';
    use tkprof to format the trace file generated by the event, you can find trace in your udump directory. And see what are the waiting events.
    Jaffar
    OCP DBA

  • Mac suddenly running very slow, need advice on EtreCheck results

    Problem description:
    After a week of vacation, Mac is running very slow and unable to accomplish simple tasks. Restart and automatic updates do not seem to help, this is the EtreCheck results after most recent restart. Is the problem my HD? I am about to run a hardware test. Thanks for any help!!
    EtreCheck version: 2.1.8 (121)
    Report generated March 26, 2015 at 12:36:10 PM PDT
    Download EtreCheck from http://etresoft.com/etrecheck
    Click the [Click for support] links for help with non-Apple products.
    Click the [Click for details] links for more information about that line.
    Hardware Information: ℹ️
        iMac (27-inch, Mid 2011) (Technical Specifications)
        iMac - model: iMac12,2
        1 3.4 GHz Intel Core i7 CPU: 4-core
        16 GB RAM Upgradeable
            BANK 0/DIMM0
                4 GB DDR3 1333 MHz ok
            BANK 1/DIMM0
                4 GB DDR3 1333 MHz ok
            BANK 0/DIMM1
                4 GB DDR3 1333 MHz ok
            BANK 1/DIMM1
                4 GB DDR3 1333 MHz ok
        Bluetooth: Old - Handoff/Airdrop2 not supported
        Wireless:  en1: 802.11 a/b/g/n
    Video Information: ℹ️
        AMD Radeon HD 6970M - VRAM: 2048 MB
            iMac 2560 x 1440
    System Software: ℹ️
        OS X 10.10.2 (14C1514) - Time since boot: 0:46:57
    Disk Information: ℹ️
        ST31000528AS disk0 : (1 TB)
            EFI (disk0s1) <not mounted> : 210 MB
            Macintosh HD (disk0s2) / : 899.32 GB (744.49 GB free) - 69 errors
            Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
            BOOTCAMP (disk0s4) /Volumes/BOOTCAMP : 100.03 GB (7.27 GB free)
        OPTIARC DVD RW AD-5690H 
    USB Information: ℹ️
        Apple Inc. FaceTime HD Camera (Built-in)
        BUFFALO INC. HD-GDU3 3 TB
            EFI (disk1s1) <not mounted> : 315 MB
            Time Machine (disk1s2) /Volumes/Time Machine : 700.00 GB (441.58 GB free)
            NTFS (disk1s3) /Volumes/NTFS : 1.80 TB (1.77 TB free)
            ExFAT (disk1s4) /Volumes/ExFAT : 500.01 GB (436.70 GB free)
        Apple Inc. BRCM2046 Hub
            Apple Inc. Bluetooth USB Host Controller
        Apple, Inc. Keyboard Hub
            Apple Inc. iPhone
            Apple Inc. Apple Keyboard
        Logitech USB LaserStream(TM) Mouse
        Apple Internal Memory Card Reader
        Apple Computer, Inc. IR Receiver
    Thunderbolt Information: ℹ️
        Apple Inc. thunderbolt_bus
    Gatekeeper: ℹ️
        Mac App Store and identified developers
    Kernel Extensions: ℹ️
            /Library/Extensions
        [not loaded]    org.virtualbox.kext.VBoxDrv (4.2.16) [Click for support]
        [not loaded]    org.virtualbox.kext.VBoxNetAdp (4.2.16) [Click for support]
        [not loaded]    org.virtualbox.kext.VBoxNetFlt (4.2.16) [Click for support]
        [not loaded]    org.virtualbox.kext.VBoxUSB (4.2.16) [Click for support]
            /System/Library/Extensions
        [not loaded]    com.livescribe.kext.LivescribeSmartpen (1) [Click for support]
    Startup Items: ℹ️
        VirtualBox: Path: /Library/StartupItems/VirtualBox
        Startup items are obsolete in OS X Yosemite
    Launch Agents: ℹ️
        [loaded]    com.oracle.java.Java-Updater.plist [Click for support]
        [running]    com.teamviewer.teamviewer.plist [Click for support]
        [running]    com.teamviewer.teamviewer_desktop.plist [Click for support]
    Launch Daemons: ℹ️
        [loaded]    com.adobe.fpsaud.plist [Click for support]
        [running]    com.livescribe.PenCommService.plist [Click for support]
        [loaded]    com.microsoft.office.licensing.helper.plist [Click for support]
        [loaded]    com.oracle.java.Helper-Tool.plist [Click for support]
        [loaded]    com.oracle.java.JavaUpdateHelper.plist [Click for support]
        [loaded]    com.teamviewer.Helper.plist [Click for support]
        [running]    com.teamviewer.teamviewer_service.plist [Click for support]
    User Launch Agents: ℹ️
        [loaded]    com.adobe.ARM.[...].plist [Click for support]
        [failed]    com.apple.CSConfigDotMacCert-[...]@me.com-SharedServices.Agent.plist [Click for details]
        [loaded]    com.google.keystone.agent.plist [Click for support]
        [running]    com.spotify.webhelper.plist [Click for support]
        [not loaded]    org.virtualbox.vboxwebsrv.plist [Click for support]
    User Login Items: ℹ️
        PollockShare    Volume  (/Volumes/PollockShare)
        Dropbox    Application  (/Applications/Dropbox.app)
        Google Drive    Application  (/Applications/Google Drive.app)
        BackUp    Volume  (/Volumes/BackUp)
        BootChamp    Application  (/Users/[redacted]/Downloads/BootChamp.app)
        Spotify    Application Hidden (/Applications/Spotify.app)
    Internet Plug-ins: ℹ️
        Flip4Mac WMV Plugin: Version: 2.4.4.2 [Click for support]
        FlashPlayer-10.6: Version: 16.0.0.305 - SDK 10.6 [Click for support]
        Default Browser: Version: 600 - SDK 10.10
        AdobePDFViewerNPAPI: Version: 10.1.13 [Click for support]
        AdobePDFViewer: Version: 10.1.13 [Click for support]
        Flash Player: Version: 16.0.0.305 - SDK 10.6 Outdated! Update
        QuickTime Plugin: Version: 7.7.3
        SharePointBrowserPlugin: Version: 14.4.8 - SDK 10.6 [Click for support]
        SiteAdvisor: Version: 2.0 - SDK 10.1 [Click for support]
        Silverlight: Version: 5.1.10411.0 - SDK 10.6 [Click for support]
        JavaAppletPlugin: Version: Java 7 Update 75 Check version
    Safari Extensions: ℹ️
        SiteAdvisor
    3rd Party Preference Panes: ℹ️
        Flash Player  [Click for support]
        Flip4Mac WMV  [Click for support]
        Java  [Click for support]
        Paragon NTFS for Mac ® OS X  [Click for support]
        TeXDistPrefPane  [Click for support]
    Time Machine: ℹ️
        Skip System Files: NO
        Mobile backups: OFF
        Auto backup: YES
        Volumes being backed up:
            Macintosh HD: Disk size: 899.32 GB Disk used: 154.83 GB
        Destinations:
            Time Machine [Local]
            Total size: 700.00 GB
            Total number of backups: 93
            Oldest backup: 2014-02-21 22:42:44 +0000
            Last backup: 2015-03-26 18:26:48 +0000
            Size of backup disk: Adequate
                Backup size 700.00 GB > (Disk used 154.83 GB X 3)
    Top Processes by CPU: ℹ️
            27%    com.apple.appkit.xpc.openAndSavePanelService
             5%    WindowServer
             4%    Get Backup Lite
             3%    Finder
             3%    Mendeley Desktop
    Top Processes by Memory: ℹ️
        344 MB    Mendeley Desktop
        241 MB    Google Chrome
        223 MB    mds_stores
        148 MB    Google Chrome Helper
        137 MB    Finder
    Virtual Memory Information: ℹ️
        8.52 GB    Free RAM
        4.86 GB    Active RAM
        2.13 GB    Inactive RAM
        1.66 GB    Wired RAM
        3.61 GB    Page-ins
        0 B    Page-outs
    Diagnostics Information: ℹ️
        Mar 26, 2015, 11:45:20 AM    Self test - passed

    armypunk wrote:
    My backup is up to date, I ran a hardware check and found no issues, then ran the Disk Utility and it also said it found no issues but I hit repair anyways. After a restart I ran EtreCheck again and this is what came out. The computer is still horribly sluggish. Do I just keep repeating the Disk Utility check and repair step???
    EtreCheck version: 2.1.8 (121)
    Report generated March 26, 2015 at 3:20:28 PM PDT
    Download EtreCheck from http://etresoft.com/etrecheck
    Click the [Click for support] links for help with non-Apple products.
    Click the [Click for details] links for more information about that line.
    Hardware Information: ℹ️
        iMac (27-inch, Mid 2011) (Technical Specifications)
        iMac - model: iMac12,2
        1 3.4 GHz Intel Core i7 CPU: 4-core
        16 GB RAM Upgradeable
            BANK 0/DIMM0
                4 GB DDR3 1333 MHz ok
            BANK 1/DIMM0
                4 GB DDR3 1333 MHz ok
            BANK 0/DIMM1
                4 GB DDR3 1333 MHz ok
            BANK 1/DIMM1
                4 GB DDR3 1333 MHz ok
        Bluetooth: Old - Handoff/Airdrop2 not supported
        Wireless:  en1: 802.11 a/b/g/n
    Video Information: ℹ️
        AMD Radeon HD 6970M - VRAM: 2048 MB
            iMac 2560 x 1440
    System Software: ℹ️
        OS X 10.10.2 (14C1514) - Time since boot: 0:13:41
    Disk Information: ℹ️
        ST31000528AS disk0 : (1 TB)
            EFI (disk0s1) <not mounted> : 210 MB
            Macintosh HD (disk0s2) / : 899.32 GB (745.69 GB free) - 24 errors
            Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
            BOOTCAMP (disk0s4) /Volumes/BOOTCAMP : 100.03 GB (7.27 GB free)
        OPTIARC DVD RW AD-5690H
    USB Information: ℹ️
        Apple Inc. FaceTime HD Camera (Built-in)
        Apple Inc. iPad
        Apple Inc. BRCM2046 Hub
            Apple Inc. Bluetooth USB Host Controller
        Apple, Inc. Keyboard Hub
            Apple Inc. Apple Keyboard
        Logitech USB LaserStream(TM) Mouse
        Apple Computer, Inc. IR Receiver
        Apple Internal Memory Card Reader
    Thunderbolt Information: ℹ️
        Apple Inc. thunderbolt_bus
    Gatekeeper: ℹ️
        Mac App Store and identified developers
    Kernel Extensions: ℹ️
            /Library/Extensions
        [not loaded]    org.virtualbox.kext.VBoxDrv (4.2.16) [Click for support]
        [not loaded]    org.virtualbox.kext.VBoxNetAdp (4.2.16) [Click for support]
        [not loaded]    org.virtualbox.kext.VBoxNetFlt (4.2.16) [Click for support]
        [not loaded]    org.virtualbox.kext.VBoxUSB (4.2.16) [Click for support]
            /System/Library/Extensions
        [not loaded]    com.livescribe.kext.LivescribeSmartpen (1) [Click for support]
    Startup Items: ℹ️
        VirtualBox: Path: /Library/StartupItems/VirtualBox
        Startup items are obsolete in OS X Yosemite
    Launch Agents: ℹ️
        [loaded]    com.oracle.java.Java-Updater.plist [Click for support]
        [running]    com.teamviewer.teamviewer.plist [Click for support]
        [running]    com.teamviewer.teamviewer_desktop.plist [Click for support]
    Launch Daemons: ℹ️
        [loaded]    com.adobe.fpsaud.plist [Click for support]
        [running]    com.livescribe.PenCommService.plist [Click for support]
        [loaded]    com.microsoft.office.licensing.helper.plist [Click for support]
        [loaded]    com.oracle.java.Helper-Tool.plist [Click for support]
        [loaded]    com.oracle.java.JavaUpdateHelper.plist [Click for support]
        [loaded]    com.teamviewer.Helper.plist [Click for support]
        [running]    com.teamviewer.teamviewer_service.plist [Click for support]
    User Launch Agents: ℹ️
        [loaded]    com.adobe.ARM.[...].plist [Click for support]
        [failed]    com.apple.CSConfigDotMacCert-[...]@me.com-SharedServices.Agent.plist [Click for details]
        [loaded]    com.google.keystone.agent.plist [Click for support]
        [running]    com.spotify.webhelper.plist [Click for support]
        [not loaded]    org.virtualbox.vboxwebsrv.plist [Click for support]
    User Login Items: ℹ️
        PollockShare    Volume  (/Volumes/PollockShare)
        Dropbox    Application  (/Applications/Dropbox.app)
        Google Drive    Application  (/Applications/Google Drive.app)
        BackUp    Volume  (/Volumes/BackUp)
        BootChamp    Application  (/Users/[redacted]/Downloads/BootChamp.app)
        Spotify    Application Hidden (/Applications/Spotify.app)
    Internet Plug-ins: ℹ️
        Flip4Mac WMV Plugin: Version: 2.4.4.2 [Click for support]
        FlashPlayer-10.6: Version: 16.0.0.305 - SDK 10.6 [Click for support]
        Default Browser: Version: 600 - SDK 10.10
        AdobePDFViewerNPAPI: Version: 10.1.13 [Click for support]
        AdobePDFViewer: Version: 10.1.13 [Click for support]
        Flash Player: Version: 16.0.0.305 - SDK 10.6 Outdated! Update
        QuickTime Plugin: Version: 7.7.3
        SharePointBrowserPlugin: Version: 14.4.8 - SDK 10.6 [Click for support]
        SiteAdvisor: Version: 2.0 - SDK 10.1 [Click for support]
        Silverlight: Version: 5.1.10411.0 - SDK 10.6 [Click for support]
        JavaAppletPlugin: Version: Java 7 Update 75 Check version
    Safari Extensions: ℹ️
        SiteAdvisor
    3rd Party Preference Panes: ℹ️
        Flash Player  [Click for support]
        Flip4Mac WMV  [Click for support]
        Java  [Click for support]
        Paragon NTFS for Mac ® OS X  [Click for support]
        TeXDistPrefPane  [Click for support]
    Time Machine: ℹ️
        Skip System Files: NO
        Mobile backups: OFF
        Auto backup: YES
        Volumes being backed up:
            Macintosh HD: Disk size: 899.32 GB Disk used: 153.63 GB
        Destinations:
            Time Machine [Local]
            Total size: 700.00 GB
            Total number of backups: 93
            Oldest backup: 2014-02-21 22:42:44 +0000
            Last backup: 2015-03-26 18:26:48 +0000
            Size of backup disk: Adequate
                Backup size 700.00 GB > (Disk used 153.63 GB X 3)
    Top Processes by CPU: ℹ️
             2%    WindowServer
             2%    mds_stores
             1%    mds
             0%    fontd
             0%    Dropbox
    Top Processes by Memory: ℹ️
        124 MB    mds_stores
        120 MB    Spotify Helper
        103 MB    Finder
        103 MB    Google Drive
        86 MB    Dropbox
    Virtual Memory Information: ℹ️
        12.99 GB    Free RAM
        2.25 GB    Active RAM
        561 MB    Inactive RAM
        1.37 GB    Wired RAM
        1.31 GB    Page-ins
        0 B    Page-outs
    Diagnostics Information: ℹ️
        Mar 26, 2015, 03:04:16 PM    Self test - passed
    You have had 2 experienced users tell you the HD may be failing, looking at your latest report this confirms the suspicion. Take the machine to either an Apple Store or AASP and have it professionally diagnosed.

  • First query very slow, subsequent queries fine

    In our 9i application when we first do a query it is extremely slow. If the database has not been used for sometime. This happens for sure after overnight, but also after an hour or so of inactivity during day.
    After the initial query eventually completes, subsequent queries seem fast and no problem. Is just problem with first query.
    This does not happen with all data. Just a particular group of data in our database.
    any suggestions?
    Thanks
    John

    Hi John !
    For mee, it looks like a data cache effect.
    A database need to manipulate data and use a data cache to avoid reading/writing data too much.
    So if the request don't find data in the cache, the database have to read it from disk and put it in the data cache (for me, your fist request). But if data are already in the cache, there is no need to reed them from disk. So the request time is very far better (for me, following requests).
    So if this is a very important problem what can you do ?
    - Check your query exec plan and try to need few data reads (avoid full scans tables for exemple...)
    - Rise the size of your db cache (check the cache hit ratio (1))
    - You can place data permanently in the cache (for table CACHE option) but only if these data sets are small (check dba_segments, [dba_tables after statistics]). If data sets are important, these data can eject other data from cache, so your request time will be good but other requests very bad.
    It could be a library cache effect too (same kind of problem: entries are made for querys already parsed, so the same query can avoid a hard parse) if, for exemple, you handle queries with 5,000 bind variables .
    You can check the library hit ratio too (2)
    To be sure of your problem, I think the best is to trace your request
    1) when executed first (cold request)
    2) and when executed 4th time (hot request)
    Tkprof the two traces and look where is the difference. There is 3 phases: parse, execute and fetch.
    Data cache problem is a high fetch, library, high parse. You will also find for your query the state which implies disk reads read (on execution plan)
    You can posts here cache query results and times for your 1st request and following requests. Even your trace files, if you want me to check your resolution.
    Regards,
    Jean-Luc
    (1)
    Cache hit ratio.
    Warning1: calculated from your last startup (so if your last startup is few weeks ago, you need to shutdwon, wait for a good sample of your batches executed, and try the following request)
    Warning2: There is no ">98 % is good" and "<90 % is bad". It depends on yours applications. For exemple, if same data is frequently acceded in a transactionnal database, you have rise it as high you can.
    But imagine databases for clients and clients who needs their data 1 time a day or a week (database or schema of client information like this very forum [Good exemple because I suspect them to use Oracle databases you know :)]). You can accept to have a high response time, lots of disk reads, and so a HR < 90.
    Cache hit ratio :
    select round((1-(pr.value/(bg.value+cg.value)))*100,2) cachehit
    from v$sysstat pr, v$sysstat bg, v$sysstat cg
    where pr.name = 'physical reads'
    and bg.name = 'db block gets'
    and cg.name = 'consistent gets';
    (2)
    Same warnings than (1)W1
    but not (1)W2: Library HR is generaly higher than cache hit ratio >98
    Library cache hit ratio :
    select round(sum(pinhits)/sum(pins) * 100,2) efficacite from v$librarycache;

  • Flashback and transaction query very slow

    Hello. I was wondering if anyone else has seen transaction queries be really slow and if there is anything I can do to speed it up? Here is my situation:
    I have a database with about 50 tables. We need to allow the user to go back to a point in time and "undo" what they have done. I can't use flashback table because multiple users can be making changes to the same table (different records) and I can't undo what the other users have done. So I must use the finer granularity of undoing each transaction.
    I have not had a problem with the queries, etc. I basically get a cursor to all the transactions in each of the tables and order them backwards (since all the business rules must be observed). However, getting this cursor takes forever. From that cursor, I can execute the undo_sql. In fact, I once had a cursor that did "union all" on each table and even if the user only modified 1 table, it took way too long. So now I do a quick count based on the ROWSCN (running 10g and tables have ROWDEPENDANCIES) being in the time needed to find out if this table has been touched. Based on that, I can create a cursor only for the tables that have been touched. This helps. But it is still slow especially compared to any other query I have. And if the user did touch a lot of tables, it is still way too slow.
    Here is an example of part of a query that is used on each table:
    select xid, commit_scn, logon_user, undo_change#, operation, table_name, undo_sql
    from flashback_transaction_query
    where operation IN ('INSERT', 'UPDATE', 'DELETE')
      and xid IN (select versions_xid
                  from TABLE1
                  versions between SCN p_scn and current_scn
                  where system_id = p_system_id)
      and table_name = UPPER('TABLE1')Any help is greatly appreciated.
    -Carmine

    Anyone?
    Thanks,
    -Carmine

  • SQL Query very slow.

    I have a table which has 40million data in it. Of-course partitioned!.
    begin
    pk_cm_entity_context.set_entity_in_context(1);
    end;
    SELECT COUNT(1) FROM XFACE_ADDL_DETAILS_TXNLOG;
    alter table XFACE_ADDL_DETAILS_TXNLOG rename to XFACE_ADDLDTS_TXNLOG_PTPART;
    SELECT COUNT(1) FROM XFACE_ADDLDTS_TXNLOG_PTPART;
    -- Create table
    create table XFACE_ADDL_DETAILS_TXNLOG
    REF_TXN_NO CHAR(40),
    REF_USR_NO CHAR(40),
    REF_KEY_NO VARCHAR2(50),
    REF_TXN_NO_ORG CHAR(40),
    REF_USR_NO_ORG CHAR(40),
    RECON_CODE VARCHAR2(25),
    COD_TASK_DERIVED VARCHAR2(5),
    COD_CHNL_ID VARCHAR2(6),
    COD_SERVICE_ID VARCHAR2(10),
    COD_USER_ID VARCHAR2(30),
    COD_AUTH_ID VARCHAR2(30),
    COD_ACCT_NO CHAR(22),
    TYP_ACCT_NO VARCHAR2(4),
    COD_SUB_ACCT_NO CHAR(16),
    COD_DEP_NO NUMBER(5),
    AMOUNT NUMBER(15,2),
    COD_CCY VARCHAR2(3),
    DAT_POST DATE,
    DAT_VALUE DATE,
    TXT_TXN_NARRATIVE VARCHAR2(60),
    DATE_CHEQUE_ISSUE DATE,
    TXN_BUSINESS_TYPE VARCHAR2(10),
    CARD_NO CHAR(20),
    INVENTORY_CODE CHAR(10),
    INVENTORY_NO CHAR(20),
    CARD_PASSBOOK_NO CHAR(30),
    COD_CASH_ANALYSIS CHAR(20),
    BANK_INFORMATION_NO CHAR(8),
    BATCH_NO CHAR(10),
    SUMMARY VARCHAR2(60),
    MAIN_IC_TYPE CHAR(1),
    MAIN_IC_NO CHAR(48),
    MAIN_IC_NAME CHAR(64),
    MAIN_IC_CHECK_RETURN_CODE CHAR(1),
    DEPUTY_IC_TYPE CHAR(1),
    DEPUTY_IC_NO CHAR(48),
    DEPUTY_NAME CHAR(64),
    DEPUTY_IC_CHECK_RETURN_CODE CHAR(1),
    ACCOUNT_PROPERTY CHAR(4),
    CHEQUE_NO CHAR(20),
    COD_EXT_TASK CHAR(10),
    COD_MODULE CHAR(4),
    ACC_PURPOSE_CODE VARCHAR2(15),
    NATIONALITY CHAR(3),
    CUSTOMER_NAME CHAR(192),
    COD_INCOME_EXPENSE CHAR(6),
    COD_EXT_BRANCH CHAR(6),
    COD_ACCT_TITLE CHAR(192),
    FLG_CA_TT CHAR(1),
    DAT_EXT_LOCAL DATE,
    ACCT_OWNER_VALID_RESULT CHAR(1),
    FLG_DR_CR CHAR(1),
    FLG_ONLINE_UPLOAD CHAR(1),
    FLG_STMT_DISPLAY CHAR(1),
    COD_TXN_TYPE NUMBER(1),
    DAT_TS_TXN TIMESTAMP(6),
    LC_BG_GUARANTEE_NO VARCHAR2(20),
    COD_OTHER_ACCT_NO CHAR(22),
    COD_MOD_OTHER_ACCT_NO CHAR(4),
    COD_CC_BRN_SUB_ACCT NUMBER(5),
    COD_CC_BRN_OTHR_ACCT NUMBER(5),
    COD_ENTITY_VPD NUMBER(5) default NVL(sys_context('CLIENTCONTEXT','entity_code'),11),
    COD_EXT_TASK_REV VARCHAR2(10)
    partition by hash (REF_TXN_NO)
    PARTITIONS 128
    store in (FCHDATA1,FCHDATA2,FCHDATA3,FCHDATA4, FCHDATA5, FCHDATA6, FCHDATA7, FCHDATA8);
    insert /*+APPEND NOLOGGING */ into XFACE_ADDL_DETAILS_TXNLOG
    select /*+PARALLEL */ * from XFACE_ADDLDTS_TXNLOG_PTPART;
    -- Add comments to the table
    comment on table XFACE_ADDL_DETAILS_TXNLOG
    is ' Additional Data log table ';
    -- Add comments to the columns
    comment on column XFACE_ADDL_DETAILS_TXNLOG.REF_TXN_NO
    is 'Transaction Reference Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.REF_USR_NO
    is 'User Reference Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.REF_KEY_NO
    is 'Unique key to identify a leg of the transaction';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.REF_TXN_NO_ORG
    is 'Original Transaction Reference Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.REF_USR_NO_ORG
    is 'Original Transaction User Reference Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.RECON_CODE
    is 'Reconciliation of transactions in future';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_TASK_DERIVED
    is 'Transaction mnemonic for the request';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_CHNL_ID
    is 'Channel ID';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_SERVICE_ID
    is 'Service ID';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_USER_ID
    is 'User ID';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_AUTH_ID
    is 'Authorizer ID';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_ACCT_NO
    is 'It can be Card number or MCA or GL or CASH GL';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.TYP_ACCT_NO
    is 'Type of input (Valid values CARD, MCA, GL, CASH, LN)';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_SUB_ACCT_NO
    is 'MC Sub Account Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_DEP_NO
    is 'Deposit Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.AMOUNT
    is 'Transaction Amount';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_CCY
    is 'Currency Code';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.DAT_POST
    is 'Posting Date of the transaction';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.DAT_VALUE
    is 'Value Date of the transaction';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.TXT_TXN_NARRATIVE
    is 'Text Transaction Narrative';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.DATE_CHEQUE_ISSUE
    is 'Date of Issue of Cheque';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.TXN_BUSINESS_TYPE
    is 'Transaction Business Type';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.CARD_NO
    is 'Card Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.INVENTORY_CODE
    is 'Inventory Code';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.INVENTORY_NO
    is 'Inventory Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.CARD_PASSBOOK_NO
    is 'Card Passbook Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_CASH_ANALYSIS
    is 'Cash Analysis Code';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.BANK_INFORMATION_NO
    is 'Bank Information Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.BATCH_NO
    is 'Batch Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.SUMMARY
    is 'Summary';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.MAIN_IC_TYPE
    is 'IC Type';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.MAIN_IC_NO
    is 'IC Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.MAIN_IC_NAME
    is 'IC Name';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.MAIN_IC_CHECK_RETURN_CODE
    is 'IC Check Return Code';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.DEPUTY_IC_TYPE
    is 'Deputy IC Type';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.DEPUTY_IC_NO
    is 'Deputy IC Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.DEPUTY_NAME
    is 'Deputy Name';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.DEPUTY_IC_CHECK_RETURN_CODE
    is 'Deputy IC Check Return Code';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.ACCOUNT_PROPERTY
    is 'Account Property';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.CHEQUE_NO
    is 'Cheque Number';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_EXT_TASK
    is 'External Task Code';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_MODULE
    is 'Module Code - CH, TD, RD , LN, CASH, GL';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.ACC_PURPOSE_CODE
    is 'Account Purpose Code';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.NATIONALITY
    is 'Nationality';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.CUSTOMER_NAME
    is 'Customer Name';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_INCOME_EXPENSE
    is 'Income Expense Code';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_EXT_BRANCH
    is 'External Branch Code';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_ACCT_TITLE
    is 'Account Title Code';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.FLG_CA_TT
    is 'Cash or Funds Transfer flag';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.DAT_EXT_LOCAL
    is 'Local Date';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.ACCT_OWNER_VALID_RESULT
    is 'Account Owner Valid Result';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.FLG_DR_CR
    is 'Flag Debit Credit - D, C.';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.FLG_ONLINE_UPLOAD
    is 'Flag Online Upload - O, U.';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.FLG_STMT_DISPLAY
    is 'Statement Display Flag - Y/N, Y(Normal Reversal), N(Correction Reversal)';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_TXN_TYPE
    is 'To denote the kind of transaction:
    1 ?Cash Credit Transaction
    2 ?Cash Debit Transaction
    3 ?Funds Transfer Credit Transaction
    4 ?Funds Transfer Debit Transaction
    comment on column XFACE_ADDL_DETAILS_TXNLOG.DAT_TS_TXN
    is 'Date and Timestamp of the record being inserted';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.LC_BG_GUARANTEE_NO
    is 'LC/BG Guarantee Number for which the request for the Liquidation has been initiated.';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_OTHER_ACCT_NO
    is 'Other Account No';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_MOD_OTHER_ACCT_NO
    is 'Module Code of Other Account No - CH, TD, RD , LN, CASH, GL';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_CC_BRN_SUB_ACCT
    is 'Branch Code for Sub Account';
    comment on column XFACE_ADDL_DETAILS_TXNLOG.COD_CC_BRN_OTHR_ACCT
    is 'Branch Code for Other Account';
    -- Create/Recreate indexes
    drop index IN_XFACE_ADDL_DETAILS_TXNLOG_1;
    drop index IN_XFACE_ADDL_DETAILS_TXNLOG_2;
    drop index IN_XFACE_ADDL_DETAILS_TXNLOG_3;
    drop index IN_XFACE_ADDL_DETAILS_TXNLOG_4;
    drop index IN_XFACE_ADDL_DETAILS_TXNLOG_5;
    drop index IN_XFACE_ADDL_DETAILS_TXNLOG_6;
    drop index IN_XFACE_ADDL_DETAILS_TXNLOG_7;
    drop index IN_XFACE_ADDL_DETAILS_TXNLOG_8;
    create index IN_XFACE_ADDL_DETAILS_TXNLOG_1 on XFACE_ADDL_DETAILS_TXNLOG (REF_TXN_NO, REF_KEY_NO, COD_SUB_ACCT_NO, COD_ENTITY_VPD)
    GLOBAL PARTITION BY HASH (REF_TXN_NO, REF_KEY_NO, COD_SUB_ACCT_NO) PARTITIONS 128 STORE IN (FCHINDX1, FCHINDX2, FCHINDX3, FCHINDX4) PARALLEL (DEGREE 32) NOLOGGING;
    create index IN_XFACE_ADDL_DETAILS_TXNLOG_2 on XFACE_ADDL_DETAILS_TXNLOG (REF_USR_NO, REF_KEY_NO, COD_SUB_ACCT_NO, COD_ENTITY_VPD)
    GLOBAL PARTITION BY HASH(REF_USR_NO, REF_KEY_NO, COD_SUB_ACCT_NO) PARTITIONS 128 STORE IN (FCHINDX1, FCHINDX2, FCHINDX3, FCHINDX4) PARALLEL (DEGREE 32) NOLOGGING;
    create index IN_XFACE_ADDL_DETAILS_TXNLOG_3 on XFACE_ADDL_DETAILS_TXNLOG (COD_SUB_ACCT_NO, FLG_STMT_DISPLAY,DAT_POST COD_ENTITY_VPD)
    GLOBAL PARTITION BY HASH(COD_SUB_ACCT_NO, FLG_STMT_DISPLAY) PARTITIONS 128 STORE IN (FCHINDX1, FCHINDX2, FCHINDX3, FCHINDX4) PARALLEL (DEGREE 32) NOLOGGING;
    create index IN_XFACE_ADDL_DETAILS_TXNLOG_4 on
    XFACE_ADDL_DETAILS_TXNLOG (COD_ACCT_NO, REF_TXN_NO, COD_TXN_TYPE, COD_USER_ID, COD_EXT_BRANCH, COD_ENTITY_VPD)
    GLOBAL PARTITION BY HASH(COD_ACCT_NO, REF_TXN_NO, COD_TXN_TYPE, COD_USER_ID, COD_EXT_BRANCH)
    PARTITIONS 128 STORE IN (FCHINDX1, FCHINDX2, FCHINDX3, FCHINDX4) PARALLEL (DEGREE 32) NOLOGGING;
    create index IN_XFACE_ADDL_DETAILS_TXNLOG_5 on XFACE_ADDL_DETAILS_TXNLOG (COD_USER_ID, DAT_POST, COD_ENTITY_VPD)
    GLOBAL PARTITION BY HASH(COD_USER_ID) PARTITIONS 128 STORE IN (FCHINDX1, FCHINDX2, FCHINDX3, FCHINDX4) PARALLEL (DEGREE 32) NOLOGGING;
    create index IN_XFACE_ADDL_DETAILS_TXNLOG_6 on XFACE_ADDL_DETAILS_TXNLOG (REF_TXN_NO_ORG, COD_ENTITY_VPD)
    GLOBAL PARTITION BY HASH(REF_TXN_NO_ORG) PARTITIONS 128 STORE IN (FCHINDX1, FCHINDX2, FCHINDX3, FCHINDX4) PARALLEL (DEGREE 32) NOLOGGING;
    create index IN_XFACE_ADDL_DETAILS_TXNLOG_7 on XFACE_ADDL_DETAILS_TXNLOG (DAT_EXT_LOCAL, DAT_POST,TXN_BUSINESS_TYPE, FLG_ONLINE_UPLOAD, COD_CHNL_ID, REF_TXN_NO, COD_ENTITY_VPD)
    GLOBAL PARTITION BY HASH(DAT_EXT_LOCAL) PARTITIONS 128 STORE IN (FCHINDX1, FCHINDX2, FCHINDX3, FCHINDX4) PARALLEL (DEGREE 32) NOLOGGING;
    /* Previous Key order: (COD_EXT_BRANCH,DAT_POST,REF_TXN_NO_ORG,COD_SERVICE_ID,COD_ENTITY_VPD) */
    create index IN_XFACE_ADDL_DETAILS_TXNLOG_8 on XFACE_ADDL_DETAILS_TXNLOG (DAT_POST, COD_EXT_BRANCH, REF_TXN_NO_ORG, COD_SERVICE_ID, COD_ENTITY_VPD)
    GLOBAL PARTITION BY HASH(DAT_POST) PARTITIONS 128 STORE IN (FCHINDX1, FCHINDX2, FCHINDX3, FCHINDX4) PARALLEL (DEGREE 32) NOLOGGING;
    ALTER TABLE XFACE_ADDL_DETAILS_TXNLOG NOPARALLEL PCTFREE 50 INITRANS 128 LOGGING;
    ALTER index IN_XFACE_ADDL_DETAILS_TXNLOG_1 NOPARALLEL INITRANS 128;
    ALTER index IN_XFACE_ADDL_DETAILS_TXNLOG_2 NOPARALLEL INITRANS 128;
    ALTER index IN_XFACE_ADDL_DETAILS_TXNLOG_3 NOPARALLEL INITRANS 128;
    ALTER index IN_XFACE_ADDL_DETAILS_TXNLOG_4 NOPARALLEL INITRANS 128;
    ALTER index IN_XFACE_ADDL_DETAILS_TXNLOG_5 NOPARALLEL INITRANS 128;
    ALTER index IN_XFACE_ADDL_DETAILS_TXNLOG_6 NOPARALLEL INITRANS 128;
    ALTER index IN_XFACE_ADDL_DETAILS_TXNLOG_7 NOPARALLEL INITRANS 128;
    ALTER index IN_XFACE_ADDL_DETAILS_TXNLOG_8 NOPARALLEL INITRANS 128;
    BEGIN
    DBMS_RLS.ADD_POLICY(OBJECT_SCHEMA => UPPER('FCR44HOST'),
    OBJECT_NAME => UPPER('XFACE_ADDL_DETAILS_TXNLOG '),
    POLICY_NAME => 'FC_ENTITY_POLICY',
    FUNCTION_SCHEMA => UPPER('FCR44HOST'),
    POLICY_FUNCTION => 'pk_cm_vpd_policy.get_entity_predicate',
    STATEMENT_TYPES => 'select,insert,update,delete',
    UPDATE_CHECK => TRUE,
    ENABLE => TRUE,
    STATIC_POLICY => FALSE,
    POLICY_TYPE => DBMS_RLS.SHARED_STATIC,
    LONG_PREDICATE => FALSE,
    SEC_RELEVANT_COLS => NULL,
    SEC_RELEVANT_COLS_OPT => NULL);
    END;
    begin
    dbms_stats.gather_table_stats(ownname => 'FCR44HOST',tabname => 'XFACE_ADDL_DETAILS_TXNLOG', cascade=>true,method_opt=>'for all columns size 1',degree => 32, GRANULARITY => 'PARTITION');
    end;
    Query which takes time.
    INSERT INTO xface_addl_dtls_tlog_temp
    (ref_txn_no,
    ref_usr_no,
    ref_key_no,
    ref_txn_no_org,
    ref_usr_no_org,
    recon_code,
    cod_task_derived,
    cod_chnl_id,
    cod_service_id,
    cod_user_id,
    cod_auth_id,
    cod_acct_no,
    typ_acct_no,
    cod_sub_acct_no,
    cod_dep_no,
    amount,
    cod_ccy,
    dat_post,
    dat_value,
    txt_txn_narrative,
    date_cheque_issue,
    txn_business_type,
    card_no,
    inventory_code,
    inventory_no,
    card_passbook_no,
    cod_cash_analysis,
    bank_information_no,
    batch_no,
    summary,
    main_ic_type,
    main_ic_no,
    main_ic_name,
    main_ic_check_return_code,
    deputy_ic_type,
    deputy_ic_no,
    deputy_name,
    deputy_ic_check_return_code,
    account_property,
    cheque_no,
    cod_ext_task,
    cod_module,
    acc_purpose_code,
    nationality,
    customer_name,
    cod_income_expense,
    cod_ext_branch,
    cod_acct_title,
    flg_ca_tt,
    dat_ext_local,
    acct_owner_valid_result,
    flg_dr_cr,
    flg_online_upload,
    flg_stmt_display,
    cod_txn_type,
    dat_ts_txn,
    lc_bg_guarantee_no,
    cod_other_acct_no,
    cod_mod_other_acct_no,
    cod_cc_brn_sub_acct,
    cod_cc_brn_othr_acct,
    cod_ext_task_rev,
    sessionid)
    SELECT ref_txn_no,
    ref_usr_no,
    ref_key_no,
    ref_txn_no_org,
    ref_usr_no_org,
    recon_code,
    cod_task_derived,
    cod_chnl_id,
    cod_service_id,
    cod_user_id,
    cod_auth_id,
    cod_acct_no,
    typ_acct_no,
    cod_sub_acct_no,
    cod_dep_no,
    amount,
    cod_ccy,
    dat_post,
    dat_value,
    txt_txn_narrative,
    date_cheque_issue,
    txn_business_type,
    card_no,
    inventory_code,
    inventory_no,
    card_passbook_no,
    cod_cash_analysis,
    bank_information_no,
    batch_no,
    summary,
    main_ic_type,
    main_ic_no,
    main_ic_name,
    main_ic_check_return_code,
    deputy_ic_type,
    deputy_ic_no,
    deputy_name,
    deputy_ic_check_return_code,
    account_property,
    cheque_no,
    cod_ext_task,
    cod_module,
    acc_purpose_code,
    nationality,
    customer_name,
    cod_income_expense,
    cod_ext_branch,
    cod_acct_title,
    flg_ca_tt,
    dat_ext_local,
    acct_owner_valid_result,
    flg_dr_cr,
    flg_online_upload,
    flg_stmt_display,
    cod_txn_type,
    dat_ts_txn,
    lc_bg_guarantee_no,
    cod_other_acct_no,
    cod_mod_other_acct_no,
    cod_cc_brn_sub_acct,
    cod_cc_brn_othr_acct,
    cod_ext_task_rev,
    var_l_sessionid
    FROM xface_addl_details_txnlog
    WHERE cod_sub_acct_no = var_pi_cod_acct_no
    AND dat_post between var_pi_start_dat AND var_pi_end_dat;
    Index referred is in_xface_addl_details_txnlog_3.
    First time when i execute the query it takes huge time. but subsequent queries are faster. This is only if i pass same account and criteria again.
    Observed that first time it goes for physical reads which takes time. and subsequent runs physical reads are less.....
    Request suggestions.....this is account statement inquiry user may have 10000txns in a day as well
    Bymistake earlier i raised this in "Oracle -> Text"
    Slow inserts due to physical reads every time for fresh account i am passin
    They suggested to use bind variable. But as i know, we are already using bind variables to bind account number and start and end date.

    My Replies below.
    Whenever you post provide your 4 digit Oracle version (SELECT * FROM V$VERSION).
    Ans :
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    "CORE     11.2.0.3.0     Production"
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    1. If your question is about the INSERT query into xface_addl_dtls_tlog_temp why didn't you post any information about the DDL for that table? Is it the same structure as the table you did post DDL for?
    Ans :
    -- Create table
    create global temporary table XFACE_ADDL_DTLS_TLOG_TEMP
    REF_TXN_NO CHAR(40) not null,
    REF_USR_NO CHAR(40) not null,
    REF_KEY_NO VARCHAR2(50),
    REF_TXN_NO_ORG CHAR(40),
    REF_USR_NO_ORG CHAR(40),
    RECON_CODE VARCHAR2(25),
    COD_TASK_DERIVED VARCHAR2(5),
    COD_CHNL_ID VARCHAR2(6),
    COD_SERVICE_ID VARCHAR2(10),
    COD_USER_ID VARCHAR2(30),
    COD_AUTH_ID VARCHAR2(30),
    COD_ACCT_NO CHAR(22),
    TYP_ACCT_NO VARCHAR2(4),
    COD_SUB_ACCT_NO CHAR(16),
    COD_DEP_NO NUMBER(5),
    AMOUNT NUMBER(15,2),
    COD_CCY VARCHAR2(3),
    DAT_POST DATE,
    DAT_VALUE DATE,
    TXT_TXN_NARRATIVE VARCHAR2(60),
    DATE_CHEQUE_ISSUE DATE,
    TXN_BUSINESS_TYPE VARCHAR2(10),
    CARD_NO CHAR(20),
    INVENTORY_CODE CHAR(10),
    INVENTORY_NO CHAR(20),
    CARD_PASSBOOK_NO CHAR(30),
    COD_CASH_ANALYSIS CHAR(20),
    BANK_INFORMATION_NO CHAR(8),
    BATCH_NO CHAR(10),
    SUMMARY VARCHAR2(60),
    MAIN_IC_TYPE CHAR(1),
    MAIN_IC_NO VARCHAR2(150),
    MAIN_IC_NAME VARCHAR2(192),
    MAIN_IC_CHECK_RETURN_CODE CHAR(1),
    DEPUTY_IC_TYPE CHAR(1),
    DEPUTY_IC_NO VARCHAR2(150),
    DEPUTY_NAME VARCHAR2(192),
    DEPUTY_IC_CHECK_RETURN_CODE CHAR(1),
    ACCOUNT_PROPERTY CHAR(4),
    CHEQUE_NO CHAR(20),
    COD_EXT_TASK CHAR(10),
    COD_MODULE CHAR(4),
    ACC_PURPOSE_CODE VARCHAR2(15),
    NATIONALITY CHAR(3),
    CUSTOMER_NAME CHAR(192),
    COD_INCOME_EXPENSE CHAR(6),
    COD_EXT_BRANCH CHAR(6),
    COD_ACCT_TITLE VARCHAR2(360),
    FLG_CA_TT CHAR(1),
    DAT_EXT_LOCAL DATE,
    ACCT_OWNER_VALID_RESULT CHAR(1),
    FLG_DR_CR CHAR(1),
    FLG_ONLINE_UPLOAD CHAR(1),
    FLG_STMT_DISPLAY CHAR(1),
    COD_TXN_TYPE NUMBER(1),
    DAT_TS_TXN TIMESTAMP(6),
    LC_BG_GUARANTEE_NO VARCHAR2(20),
    COD_OTHER_ACCT_NO CHAR(22),
    COD_MOD_OTHER_ACCT_NO CHAR(4),
    COD_CC_BRN_SUB_ACCT NUMBER(5),
    COD_CC_BRN_OTHR_ACCT NUMBER(5),
    COD_EXT_TASK_REV VARCHAR2(10),
    SESSIONID NUMBER default USERENV('SESSIONID') not null
    on commit delete rows;
    -- Create/Recreate indexes
    create index IN_XFACE_ADDL_DTLS_TLOG_TEMP on XFACE_ADDL_DTLS_TLOG_TEMP (COD_SUB_ACCT_NO, REF_TXN_NO, COD_SERVICE_ID, REF_KEY_NO, SESSIONID);
    2. Why doesn't your INSERT query use APPEND, NOLOGGING and PARALLEL like the first query you posted? If those help for the first query why didn't you try them for the query you are now having problems with?
    Ans :
    I will try to use append but i cannot use parallel since i have hardware limitations.
    3. What does this mean: 'Index referred is in_xface_addl_details_txnlog_3.'? You haven't posted any plan that refers to any index. Do you have an execution plan? Why didn't you post it?
    Ans :
    Plan hash value: 4081844790
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | INSERT STATEMENT | | | | 5 (100)| | | |
    | 1 | LOAD TABLE CONVENTIONAL | | | | | | | |
    | 2 | FILTER | | | | | | | |
    | 3 | PARTITION HASH ALL | | 1 | 494 | 5 (0)| 00:00:01 | 1 | 128 |
    | 4 | TABLE ACCESS BY GLOBAL INDEX ROWID| XFACE_ADDL_DETAILS_TXNLOG | 1 | 494 | 5 (0)| 00:00:01 | ROWID | ROWID |
    | 5 | INDEX RANGE SCAN | IN_XFACE_ADDL_DETAILS_TXNLOG_3 | 1 | | 3 (0)| 00:00:01 | 1 | 128 |
    4. Why are you defining 37 columns as CHAR datatypes? Are you aware that CHAR data REQUIRES the use of the designated number of BYTES/CHARACTERS?
    Ans :
    I understand and appreciate your points, but since it is huge application and is built over a period of time. I am afraid if i will be allowed to do change on datatypes. there are lot of queries over this table.
    5. Are you aware that #4 means those 37 columns columns, even if all of them are NULL, mean that your MINIMUM record length is 1012? Care to guess how many of those records Oracle can fit into an 8k block? And that is if you ignore the other 26 VARCHAR2, NUMBER and DATE columns.
    Two of your columns take 192 bytes MINIMUM even if they are null
    CUSTOMER_NAME CHAR(192),
    COD_ACCT_TITLE CHAR(192)
    Why are you wasting all of that space? If you are using a multi-byte character set and your data is multi-byte those 37 columns are using even more space because some characters will use more than one byte.
    If the name and title average 30 characters/bytes then those two columns alone use 300+ unused bytes. With 40 million records those unused bytes, just for those two columns take 12 GB of space.
    WIth a block size of 8k that would totally waste 1.5 million blocks that Oracle has to read just to ignore the empty space that isn't being used.
    I highly suspect that your use of CHAR is a large part of this performance problem and probably other performance problems in your system. Not only for this table but for any other table that uses similar CHAR datatypes and wastes space.
    Please reconsider your use of CHAR datatypes like this. I can't imagine what justification you have for using them.
    Ans :
    I understand your points, but since it is huge application is built over a period of time. I am afraid if i will be allowed to do change on datatypes.
    I have to manage in current situation. Not expecting query to respond in millisecs but not even 40secs which is happening currently.
    Edited by: Rohit Jadhav on Dec 30, 2012 6:44 PM

Maybe you are looking for

  • Logic Pro 9 will not start in Mountain Lion

    I have gotten so much great info here, that I thought this would be the best place to ask my question. I am using a Mac Pro 3, 1 (early 2008). I bought the machine running Leopard, upgraded to Snow Leopard, lion, and Mountain lion with no problems. I

  • How do I edit/delete the same section of multiple tracks?

    Basically I'm doing a podcast with multiple voice tracks. Once I sync and line everything up, I still have sections of audio I want to take out. But obviously with the tracks synced, I need to delete it from all of them at once and have the audio "sn

  • DVI to RGB  cable does not seem to work

    When I connect my MBP to my HDTV via a DVI to HMDMI converter cable I get excellent, razor sharp images. However when I connect using a DVI to RGB cable all I get is garbled signals. Any ideas on what I should be doing different? Thanks in advance!

  • ITunes 11 not responding on my mac.

    Have tried removing the .plist files but that didn't work, although it did try to start opening the library but then went to not responding again. Any ideas please?

  • Insert/Update On Oracle to MS SQL Server Gateway

    I have been successful in creating a gateway between Oracle and SQL Server. Everything works fine for a Select Stmt. But not for an Insert or Update, I get a message about a "Read Only Cursor". I have setup a HS_TRANSACTION_LOG table in the SQL Serve