Sql statement takes long to execute even with index

Hi
I have the following sql statement.
Its explain plan states its "TABLE ACCESS FULL".
But upon creation of index for table PWRKF2MV, using
IDX(pafidt,ppdept,prodno,ppname) and IDX2(pmfaci,prodno), it uses both indexes
but time taken to execute is still the same as when there is no indexes.
Why is that so? Appreciate any help. Thank you.
Pls take note that the PWRKF2MV is a materialized view and MITBALC0 is a synonym.
SQL statement: -
select a.ppdept dept, rtrim(b.mbsttx) prod, to_char(to_date(a.pafidt,'YYYYMMDD'),'Y')||to_char(to_date(a.pafidt,'YYYYMMDD'),'WW') as yrweek, sum(pmoqty) moqty
from pwrkf2mv a, mitbalc0 b
where a.pafidt between :p_startdate and :p_enddate
and a.ppdept = nvl(:p_dept,a.ppdept)
and a.prodno = nvl(:p_prodno,a.prodno)
and a.ppname like '%'||:p_proddesc||'%'
and rtrim(a.prefno) is not null
and rtrim(b.mbsttx) is not null
and a.pmfaci = b.mbwhlo
and a.prodno = b.mbitno
group by a.ppdept, b.mbsttx, to_char(to_date(a.pafidt,'YYYYMMDD'),'Y')||to_char(to_date(a.pafidt,'YYYYMMDD'),'WW')
order by a.ppdept, yrweek, b.mbsttx;
Siti

Hi Siti,
Is your table goes through frequent update and delete statements? if YES=>
Free blocks created during this operation may dgrade the performance during full
Tbale scan.
If you are using Oracle 10g, you can shrink the segments. But first enable the row movement
sql> alter table emp enable row movement;
http://www.oracle.com/technology/oramag/oracle/05-may/o35tuning.html
JAI HIND
Darshan

Similar Messages

  • SELECT statement takes long time

    Hi All,
    In the following code, if the T_QMIH-EQUNR contains blank or space values ,SELECT statement takes longer time to acess the data from OBJK table. If it T_QMIH-EQUNR contains values other than blank, performance is good and it fetches data very fast.
    Already we have indexes for EQUNR in OBJK table.
    Only for blank entries , it takes much time.Can anybody tell why it behaves for balnk entries?
    if not T_QMIH[] IS INITIAL.
            SORT T_QMIH BY EQUNR.
            REFRESH T_OBJK.
            SELECT EQUNR OBKNR
              FROM OBJK INTO TABLE T_OBJK
              FOR ALL ENTRIES IN T_QMIH
              WHERE OBJK~TASER = 'SER01' AND
             OBJK~EQUNR = T_QMIH-EQUNR.
    Thanks
    Ajay

    Hi
    You can use the field QMIH-QMNUM with OBJK-IHNUM
    in QMIH table, EQUNR is not primary key, it will have multiple entries
    so to improve the performance use one dummy internal table for QMIH  and sort it on EQUNR
    delete adjacent duplicates from d_qmih and use the same in for all entries
    this will improve the performance.
    Also use the fields in sequence of the index and primary keys also in select
    if not T_QMIH[] IS INITIAL.
    SORT T_QMIH BY EQUNR.
    REFRESH T_OBJK.
    SELECT EQUNR OBKNR
    FROM OBJK INTO TABLE T_OBJK
    FOR ALL ENTRIES IN T_QMIH
    WHERE  IHNUM =  T_QMIH-QMNUM
    OBJK~TASER = 'SER01' AND
    OBJK~EQUNR = T_QMIH-EQUNR.
    try this and let me know
    regards
    Shiva

  • See all SQL statements that have been executed in an active transaction?

    When I query v$transaction, v$session and v$sql, all I can see is the SQL statement that is currently running in an active transaction.
    How can I view all SQL statements that have been executed in a currently running transaction since that transaction began?

    Dana N wrote:
    When I query v$transaction, v$session and v$sql, all I can see is the SQL statement that is currently running in an active transaction.
    How can I view all SQL statements that have been executed in a currently running transaction since that transaction began?In the general case: impossible.
    In some special cases you can use v$sql, v$open_cursor, or "Availabilty>View and Manage Transactions" or something else.
    But be aware, transaction could be started long time ago, all cursor could be flushed from shared pool and closed, and redo (the page from Grid Control bring Log Miner) may not always be available.

  • Why outlook2011 mac version* takes long time to boot with OSX

    why outlook2011 mac version* takes long time to boot with OSX

    Okay, so after doing all of the above, the computer still takes between 40 seconds and 1 minute or so to boot up, and the VersionCue messages still appear. However I discovered that the "kdcmond cannot retrieve..." messages disappeared after I disabled my ethernet connections. So at least I know that that had nothing to do with the extended boot-up time.
    I have heard that the more RAM you have, the longer it takes to boot due to the RAM count. Since I have 10 GB, maybe this is why?
    I've included the most recent Console messages below:
    22/4/08 9:56:16 AM com.apple.launchctl.System[2] launchctl: Please convert the following to launchd: /etc/mach_init.d/dashboardadvisoryd.plist
    22/4/08 9:56:16 AM com.apple.launchd[1] (com.adobe.versioncueCS3) Unknown key: ServiceDescription
    22/4/08 9:56:16 AM com.apple.launchd[1] (org.cups.cups-lpd) Unknown key: SHAuthorizationRight
    22/4/08 9:56:16 AM com.apple.launchd[1] (org.cups.cupsd) Unknown key: SHAuthorizationRight
    22/4/08 9:56:16 AM com.apple.launchd[1] (org.ntp.ntpd) Unknown key: SHAuthorizationRight
    22/4/08 9:56:39 AM com.apple.SystemStarter[28] Starting Aladdin USB daemon
    22/4/08 9:56:39 AM org.ntp.ntpd[25] Error : nodename nor servname provided, or not known
    22/4/08 9:56:39 AM com.apple.launchd[1] (com.apple.UserEventAgent-LoginWindow[74]) Exited: Terminated
    22/4/08 9:56:39 AM com.apple.launchctl.Aqua[90] launchctl: Please convert the following to launchd: /etc/machinit_peruser.d/com.adobe.versioncueCS3.monitor.plist
    22/4/08 9:56:42 AM com.apple.launchd[82] (0x1011e0.VersionCueCS3monitor) Failed to check-in!

  • When I tap safari, I get a completely white page.  Pages take forever to load, even with strong wifi.  Any ideas?

    When I tap safari, I get a completely white page.  Pages take forever to load, even with strong wifi.  Any ideas?

    you may have a strong wifi signal but what kind of speed are you getting,
    are you able to connect to wifi and see if it goes any faster then?
    it might just be that the cellular data connection is slow

  • DELETE Statement takes long time running

    Hi,
    DELETE statements take a very long time to complete.
    Can you advice me how can I diagnostic the slow performance
    Thanks

    Deleting rows can be an expensive operation.
    Oracle stores entire row as the 'before image' of deleted information (table and index data) in
    rollback segments, generates redo (keeps archiver busy), updates free lists for blocks that are
    falling below PCTUSED setting etc..
    Select count(*) runs longer because oracle scans all blocks (upto the High Water Mark) whether
    there are or are not any rows in the blocks.
    These operations will take more and more time, if the tables are loaded with APPEND hint or
    SQL*Loader using direct mode.
    A long time ago, I ran into a similar situation. Data was "deleted" selectively, SQL*Loader was
    used (in DIRECT mode) to add new rows to the table. I had a few tables using more number of blocks
    than the number of rows in the table!
    Needless to say, the process was changed to truncate tables after exporting/extracting required
    data first, and then loading the data back. Worked much better.

  • Batching SQL Statements - Return Long Raw

    I have been using the .NET Framework Data Provider for Oracle and have run into the following limitation.
    I need to batch several SQL statements at one time and return a datareader (or another object) with those values. The .NET Framework Data Provider for Oracle from Microsoft doesn't support batching up SQL statements in this manner. Additionally, the values I need to return include a LONGRAW field. From the research I've done PL-SQL can only return 32KB of data for a LONGRAW field if we were to try a different approach like using a stored procedure and a REF CURSOR.
    My questions are:
    1.) Will the ODP support batched SQL statements? For example, can I issue the following SQL statements and get a datareader?
    Select field1, field2 from table1;
    Select feild1, field2 from table2;
    Select feild1, field2 from table3;
    2.) Is there the 32 KB limitation on LONGRAW fields and PL-SQL in Oracle 8.1.7.2.0?
    3.) Any suggestions?

    1. With ODP.NET, you can batch your SQL statements using anonymous PL/SQL block. For example,
    begin
    open :1 for select * from emp;
    open :2 for select * from dept;
    open :3 for select col1 from test;
    end;
    You need to create three parameters with type OracleDbType.RefCursor and bind them as Output parameters. If you execute the above statement using OracleCommand's ExecuteNonQuery method, you would get three REF Cursors in the Value property of OracleParameter object. You can create an OracleDataReader or populate the Data Set using any or all of these REF Cursors in any order. If you execute the above statement using OracleCommand's ExecuteReader method, you would get OracleDataReader for the first REF Cursor and you would be able to get the OracleDataReader for other REF Cursors using OracleDataReader's NextResult method. Note that ODP.NET does not impose a limitation of closing the first OracleDataReader before opening the second one.
    2. Long/Long Raw 32K limitation is imposed by PL/SQL and one way to bypass that limitation is to use LOBs instead. Having LOBs in the stored procedure or anonymous PL/SQL blocks allow you to access data upto 4GB.

  • How to get SQL statement from (Collection) query.execute();

    We have a JDO Persistence class ClassName that execute query using following code. After this statement get executed, record does not get updated in the DB. Is there a way to check what SQL statement got submitted in the (Collection) query.execute(); ??? <br><br>
    Extent extent = pm.getExtent(ClassName.class, false); <br>
    Query query = null; <br>
    try { <br>
    query = pm.newQuery(extent, filter); <br>
    Collection results = (Collection) query.execute();<br>
    Iterator i = results.iterator();<br>
    if (i.hasNext()) {<br>
    ...<br>
    }<br>

    You can always find out the names of tables that are views, using java.sql.DatabaseMetaData and its getTables() method.
    This tends to be a nice source of examples:
    javaalmanac.com
    However, if you're asking for the underlying SQL used to CREATE VIEW, I don't see anything in the API that will give you that. After all, JDBC shouldn't have to know if it's dealing with an ordinary table or a view. I think you'd have to ask your DBA for the underlying SQL.
    Once you have it, what do you plan to do with it?
    %

  • Java Stored Procedures take longer to execute

    Hi,
    I am doing a comparison of Oracle and Java Stored procedures in terms of execution time. I have created a java stored proc and an Oracle stored proc both of which perform the same task. Upon execution, I find that the java proc takes longer time to execute.
    I have the following qs:-
    Why are Java Stored Procs slower than Oracle Stored Procs?
    How is a java stored proc executed as compared to an Oracle Stored Proc?
    Can someone give a detailed explanation of -
    - how a java stored proc is stored in the database?
    - what happens when it is executed?
    Thanks in advance
    Nusrat

    Why are Java Stored Procs slower than Oracle Stored Procs?java program slower than native code! hold the front page!
    On second thoughts don't bother.
    Cheers, APC

  • Update statement takes long time - Why so ?

    Dear DBAs;
    Daily update statement takes 20 mins. But today update takes more time.
    What is the reason how to resolve ?
    Thanks in advance ..

    8f953842-815b-4d8c-833d-f2a3dd51e602 wrote:
    Dear DBAs;
    Daily update statement takes 20 mins. But today update takes more time.
    What is the reason how to resolve ?
    Thanks in advance ..
    More time? How much more?

  • Iphone takes LONG time to sync with iTunes?

    Hi all,
    I have and Iphone 3G with 8GB pretty much stuffed, I have only 200MB free and 1000 audio, 50 podcast video, 60 photo and TONS of apps..
    I just check how long it would take to sync with my PC yeasterday... 10 hours... is that normal for a backup and sync? how can I speed up the process?
    thanks

    I'm having the same problem. It's definitely the backup portion. I located my backup folder, and it had over 20k files! I tried deleting the folder and backing up again, and have yet to complete a full backup (they're just too long - I'm constantly having to stop the process to take the phone with me). The latest one was 2 hours and only half done (with 8k files in the folder). I did have facebook and linkedin on the phone, so I've removed those and restarted the backup. It doesn't seem much different so far, but I think I may leave it overnight to see what happens. Could it be that the files (like caches or whatever) used by facebook and linkedin are still on the iphone even w/o the apps? How can I clean up my iphone w/o resetting it completely (I don't want to lose the data on there and I don't currently have a complete backup - though maybe after tonight I will).
    Any other apps you know of that have this issue? I can't believe Apple just lets this type of sloppy file management occur.

  • GT70 takes longer to shut down with Windows 8.1

    Hello all,
    Hope at this time I am not the only one experiencing my laptop taking longer to shutdown before 8.1. I am wondering what I can do to lessen my shut down time for my laptop. I have a GT70-0ne. The shut down process before I upgraded took less then three minutes but now that I upgraded to 8.1 takes around five to six or even longer.  I have read several ways to get rid of the longer shut down period is two make two accounts and delete one, change the performance options, and last revert back to regular windows 8. Hope to hear some advice on the best option to resolve the issue.

    Lots of things can prevent Windows from shutting down. Even when I forgot to close my document file, Windows just won't shut down and won't log me off, instead it just dim the background and pop up some options.
    Having Malwarebytes and Kaspersky running is not ideal, because they will likely to conflict with each other. Turn off 1 of them.
    It can also means your hard disk fragmentation is high. Try to defrag your harddisk once in a while.
    It could be one annoying features that Windows try to compensate its sluggish OS called hybrid shutdown (this is to hibernate your computer instead really shut down, so your computer can boot up faster in the next time you turn it on). You can google it.

  • Replication update statement takes long time

    Hi Replication experts,
    I have a issue and please suggest if my understanding and solution is correct.
    We have a transactional replication setup for data warehouse, from today morning replication got huge latency so when I looked into it I saw the "sp_MSupd_< tablename >" was running for very long time and by this time it was running for 9 hours
    still no data was updated, Latency went very high. What we feel is that the index maintenance was not done in subscriber also it was not replicated too. So due to high fragmentation the update statement could take very long.
    As there was no error message or blocks found all we see is the update taking very long. So to avoid this we are planning to remove the index, as this is just data warehouse index maintenance is not required by removing we can gain some space too. Is this a
    good Idea to implement?
    When we ran profiler nothing was found, no error or alert logged.
    Please let me know your suggestions
    Thanks
    Best Regards Moug

    Hi All,
    The Issue we found to be is that a day before, new column was added to the table and 9000 rows were updated ... This caused the distributor to slow down the update operation as the index in subscriber(15 million rows) was updating every time  a row
    is updated.. So we suspect that adding a new column and updating it at the same time is the culprit..
    But still am not convinced as per my understanding the distributor operates by comparing the primary key of publisher that was changed with the primary key of the subscriber and apply those change.. If that is the case why should it worry about the new column
    added or the number of updates..
    Also one strange thing is another table was also lagging behind in its operation ,though that table was updated with just 18 rows.. So in a nutshell the update operation was totally down by distributor operation on that day..
    Can someone please shed some light on this, Replication is my favorite topic but now I got fear of it.. after failing to know what could be issue... 
    Best Regards Moug

  • T400 boot time takes long time & has issue with restart

    Not sure if any one has already posted this and got replies...
    my T400 has a strange issue. it takes a lot time in pre-boot... a cursor blinks on the top left corner for 5+ minutes and then loads the 'Windows loading...' screen for about another 5 mins and finally shows the windows logon screen.
    Additionaly, when i hit shutdown, i am fine. if i hit restart - i am sitting there for ever. 
    my laptop has 8GB RAM + 256 GB SSD + Windows 7 Ultimate x64.

    Srini,
    I brought your tweet in and started a new thread and then found you already had a forum discussion going, so I'll just apend to your original thread and will leave this since I tweeted the link back to you to let you know we were taking a look.(Apologies) 
    Does this abnormally long startup of your T400 occur when docked or by itself?  On battery or on AC power?   
    Have you checked the boot device order in BIOS?  Make sure HDD is listed first.
    Are there a lot of applications being loaded in the startup folder?
    Have you tried using the MSCONFIG utility (start -> run ->msconfig) and then selected the startup tab to see what programs are being loaded during boot and if you can uncheck some that you don't always need to load?
    This could reduce your boot time.  I believe this, along with some setting tweaks was suggested in a similar T400 slow boot thread here...
    Perhaps other members will have additional suggestions....
    Mark
    ThinkPads: S30, T43, X60t, X1, W700ds, IdeaPad Y710, IdeaCentre: A300, IdeaPad K1
    Mark Hopkins
    Program Manager, Lenovo Social Media (Services)
    twitter @lenovoforums
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество

  • Specific reports take longer to execute

    We have three reports that take almost 5 minutes to run. They do bring back the proper data once finished.
    this suddenly happened since last friday and they are our power reports.
    Two reports are part of a batch process and now do not complete with this error from email output:
    Error executing query: [ourserver name]/[appname]/[dbname]/[batchuserID]/Error(1013009) Administrator Has Temporarily Disabled User Commands
    I have tried to rename the reports but to no avail.
    I don't want to rebuild this reports and I could restore BIPLUS to development, export then import but looking to see if there are other avenues to go down to see where the bottleneck might be occuring.
    JTS
    Edited by: jts on Oct 26, 2009 1:47 PM

    Ok rebuilt the essbase db and things are flying but I am getting this error when I run our batch report via workspace and not batch scheduler?
    Anyone see this error?
    5200: Error executing query: [servername]/[appname]/[dbname]//Error(1013009) Administrator Has Temporarily Disabled User Commands;hasPovDims=1;povXML=<?xml version="1.0"?><datasources><datasource name="dsource" dsid="-4e61bfb4_11faa8d3534_-7fc5" allowEdit="0"><dim name="Version" dimIndex="6" dsName="dsname" keyDimName="Version" memberName="Blue Book" displayName="Version: Performance Budget"/></datasource></datasources>

Maybe you are looking for

  • How do you get iPhoto albums on to an external HD and not by date?

    I really hope someone can help me with this. I don't know if I am missing some really easy step, but I recently bought an external 100GB FireLite drive to back up all my photos and music. The problem is that when I drag the albums on to the hard driv

  • HVDVD TS foler vs VIDEO TS folder

    I'm trying to create an SD .img disc image (all the assets are SD and all settings I can find are set for SD), but DVDSP keeps creating a HVDVD TS folder. What needs to be changed to create a standard DVD? Thanks.

  • HT204088 how can I see the gift cards redeemed on my account

    I redeemed all of our itunes gift cards but they don't add up to what's been charged before it started charging my credit card again. We downoladed atleast $80 in itunes cards then after $40 using the credit, itunes started charging my credit card an

  • Any ideas as to when the HTC One (M7) will receive Andriod Lollipop?

    Any ideas as to when the HTC One (M7) will receive Andriod Lollipop?

  • Can't run iTunes or Quicktime

    I had iTunes 7.5 running smoothly on Vista. Then I was asked to upgrade to 7.6, which I did. iTunes stopped working ever since. I install iTunes (including Quicktime), everything works untill I eventually try to run iTunes. The program doesn't run, a