Peformance question TKPROF/Autotrace Cost High when using index why?

I'm going through a legacy database application to do some application code performance tuning of the PL/SQL.
I am constrained from changing the code logic so I can only add indexes and hints. As I identify full-table-scans I'm using hints to force the code to use the index and now the Cost is Higher than with full table scans. Though the application code runs in batch mode and processes a lot of records.
Can anyone provide any insight into why the cost goes up when using Hints in the SQL?
I have additional testing to do though I just wanted to pose the question.

Firstly, the cost can be less for a full table scan because with a full table scan Oracle can do multi block IO with a full scan. So reading a large amount of data from a table will go much faster if the table is full scanned as opposed to accessed by an index (your forcing the query with a hint can actually be extremely detrimental to the query).
Secondly, if you are not allowed to make any code changes, i'd recommend not taking the path you are currently on (adding hints). That may be warranted in a few situations, but likely not many assuming you have accurate statistics set up on your database.
Here's an article that deals with full table scans ....
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9422487749968
Hope that Helps.

Similar Messages

  • Question about the CSS behavior when using layer 3 sticky and sticky table

    Hi everyone,
    I have a question about the CSS behavior when using layer 3 sticky and sticky table is full.
    If I configure layer 3 sticky and specify the inactivity timeout as below, how does the CSS
    handle subsequent needed sticky requests ?
    advanced-balance sticky-srcip
    sticky-inact-timeout 30
    CSS document says that
    Note:
    If you use the sticky-inact-timeout command to specify the inactivity timeout
    period on a sticky connection, when the sticky table becomes full and none of
    the entries have expired from the sticky table, the CSS rejects subsequent
    needed sticky requests.
    My question is what is the next reaction by doing the CSS if the CSS is in the
    following condition:
    when the sticky table becomes full and none of the entries have expired from
    the sticky table, the CSS rejects subsequent needed sticky requests
    Does CSS just rejects/drops subsequent needed sticky requests ?
    or
    Does CSS does not stick subsequence requests to particular service but CSS forward
    subsequence requests with round-robin basis ? which means if the sticky table is full,
    the CSS just works round-robin load balancing fashion for subsequence requests ?
    Your information would be appreciated.
    Best regards,

    Hello,
    There is a good document explaining this on Cisco web site
    http://www.cisco.com/en/US/products/hw/contnetw/ps789/products_tech_note09186a0080094b4b.shtml
    It depends if the sticky-inact-timeout is used or not. If not, it's FIFO (the oldest entry in the sticky table is removed). If yes, the CSS will reject the next sticky request.
    Rgds,
    Gaetan
    Rgds
    Gaetan

  • Report for cost centers when using MVT 261

    Guru's,
    Most of the request for material for our storerooms are done through a work order and issued out using MVT 261. We're trying to find a report that shows the cost centers used when using MVT 261. I've tried using MB51 and MVT 261 but no cost centers populate. When I use MB51 and MVT 201 for reservations created manually there's no problem, all cost centers are populated.
    Thanks
    Eric

    Hi,
    The movement 261 is for Issue to Order & no issue to Cost Center, hence you have the problem.
    You will get only the order number is case of 261.
    Regards,
    Prashant

  • Not getting Cost information when using /*+ RULE */ in toad 9.5

    Hi,
    While optimizing a query when I am using /*+RULE */ in the query I am not getting any info for cost and cardinality.
    Can you tell me is the /*+RULE* / obsolete in oracle or what can be the reason.
    Help me..
    Thanks in advance.

    948707 wrote:
    Hi,
    While optimizing a query when I am using /*+RULE */ in the query I am not getting any info for cost and cardinality.
    Can you tell me is the /*+RULE* / obsolete in oracle or what can be the reason.
    Why are you using that hint?
    Aside from the fact that rule based optimization is obsolete, the optimiser can either do Rule based optimization or Cost based optimization. Why would you expect to get Cost based information when using Rule based optimization?
    Don't use such hints. Cost based optimization is far superior to rule based.

  • Question on how to getParameter when using VewLink

    Hi,
    How do I use a getParameter on when using viewlink in a PPR action
    Currently I am getting a null value for the pagecontext.getParameter("LineItem");
    thanks

    Welcome to the Apple Community.
    That's not currently possible, sorry.

  • Query takes 5 min when using Indexes and 1 Second without Indexes !!

    Hi,
    We have been using indexes on all tables until recently when we faced problems with queries like the one below:
    SELECT a.std_id FROM students a, student_degree b, student_course c, course d
    WHERE b.std_id = a.std_id
    AND c.std_id = a.std_id
    AND d.crn = c.crn
    AND b.in_progress = 'Y'
    AND b.major_code = 'ABTC'
    AND a.program_code = 'DP'
    AND a.level_code = 'S2'
    AND a.campus_code = '05'
    AND a.termcode = '200702';
    This query takes more than 5 minutes to return a result, but as soon as we remove indexes on the columns termcode and campus_code,it shows result in 1 second.
    What could be the problem ?, Is there an attribute that need to be set when creating these indexes ?
    Thanks in advance
    Madani

    Thank you Karthik for your reply.Here are the explain plan report (as shown on Oracle 9i Enterprise Manager)
    *1-Explain plan without Indexes:*
    Execution Steps:
    Step # Step Name
    11 SELECT STATEMENT
    10 MERGE JOIN
    7 SORT [JOIN]
    6 NESTED LOOPS
    4 NESTED LOOPS
    1 ERMS.STUDENT_DEGREE TABLE ACCESS [FULL]
    3 ERMS.STUDENTS TABLE ACCESS [BY INDEX ROWID]
    2 ERMS.SYS_C006642 INDEX [UNIQUE SCAN]
    5 ERMS.SYS_C007065 INDEX [RANGE SCAN]
    9 SORT [JOIN]
    8 ERMS.COURSE TABLE ACCESS [FULL]
    Step # Description
    1 This plan step retrieves all rows from table STUDENT_DEGREE.
    2 This plan step retrieves a single ROWID from the B*-tree index SYS_C006642.
    3 This plan step retrieves rows from table STUDENTS through ROWID(s) returned by an index.
    4 This plan step joins two sets of rows by iterating over the driving, or outer, row set (the first child of the join) and, for each row, carrying out the steps of the inner row set (the second child). Corresponding pairs of rows are tested against the join condition specified in the query's WHERE clause.
    5 This plan step retrieves one or more ROWIDs in ascending order by scanning the B*-tree index SYS_C007065.
    6 This plan step joins two sets of rows by iterating over the driving, or outer, row set (the first child of the join) and, for each row, carrying out the steps of the inner row set (the second child). Corresponding pairs of rows are tested against the join condition specified in the query's WHERE clause.
    7 This plan step accepts a row set (its only child) and sorts it in preparation for a merge-join operation.
    8 This plan step retrieves all rows from table COURSE.
    9 This plan step accepts a row set (its only child) and sorts it in preparation for a merge-join operation.
    10 This plan step accepts two sets of rows sorted on the join key. By walking both sets of rows in the order of the join key, every distinct pair of rows satisfying the join condition in the WHERE clause is found through a single pass of the row sets.
    11 This plan step designates this statement as a SELECT statement.
    *2-Explain plan with Indexes:* (I added index on column campus_code which is a varchar2 column)
    Execution Steps:
    Step # Step Name
    11 SELECT STATEMENT
    10 MERGE JOIN
    7 SORT [JOIN]
    6 NESTED LOOPS
    4 NESTED LOOPS
    1 ERMS.COURSE TABLE ACCESS [FULL]
    3 ERMS.STUDENTS TABLE ACCESS [BY INDEX ROWID]
    2 ERMS.INDEX_STUDENTS_CAMPUS_CODE INDEX [RANGE SCAN]
    5 ERMS.SYS_C007065 INDEX [RANGE SCAN]
    9 SORT [JOIN]
    8 ERMS.STUDENT_DEGREE TABLE ACCESS [FULL]
    Step # Description
    1 This plan step retrieves all rows from table COURSE.
    2 This plan step retrieves one or more ROWIDs in ascending order by scanning the B*-tree index INDEX_STUDENTS_CAMPUS_CODE.
    3 This plan step retrieves rows from table STUDENTS through ROWID(s) returned by an index.
    4 This plan step joins two sets of rows by iterating over the driving, or outer, row set (the first child of the join) and, for each row, carrying out the steps of the inner row set (the second child). Corresponding pairs of rows are tested against the join condition specified in the query's WHERE clause.
    5 This plan step retrieves one or more ROWIDs in ascending order by scanning the B*-tree index SYS_C007065.
    6 This plan step joins two sets of rows by iterating over the driving, or outer, row set (the first child of the join) and, for each row, carrying out the steps of the inner row set (the second child). Corresponding pairs of rows are tested against the join condition specified in the query's WHERE clause.
    7 This plan step accepts a row set (its only child) and sorts it in preparation for a merge-join operation.
    8 This plan step retrieves all rows from table STUDENT_DEGREE.
    9 This plan step accepts a row set (its only child) and sorts it in preparation for a merge-join operation.
    10 This plan step accepts two sets of rows sorted on the join key. By walking both sets of rows in the order of the join key, every distinct pair of rows satisfying the join condition in the WHERE clause is found through a single pass of the row sets.
    11 This plan step designates this statement as a SELECT statement.

  • HT2452 When using Facetime why do I go mute after 3 or 4 minutes

    When using Facetime or Skype why do I go mute after 3 or 4 minutes?

    You probably have a email client setup on your computer, which is deleting the emails from the server. Try checking web-based email to see if they show up there.
    Who is your email provider? Are you using a POP or IMAP email service?
    If you're using a POP email service, you may want to take a look at this Apple doc -> Using a POP account with multiple devices

  • When using ipad4, why do videos not play on Google?  Audio works fine

    WWhen using ipad,why do videos not play on Google? Audio still plays. I have reset the Google app and it will be ok for short time but then reverts back to not playing videos.

    Hi Vernon70,
    Welcome to the Apple Support Communities!
    I understand that an application you downloaded from the App Store, Google, is not functioning as you would expect. In this situation, I would recommend following the troubleshooting steps outlined in the attached article. 
    If an app you installed unexpectedly quits, stops responding, or won’t open - Apple Support
    Best regards,
    Joe

  • Is it possible to preset to JPEG High when using 'Save for Web...'?

    Hi,
    I am using photoshop elements 10. When I am ready to save an image under 'SAVE FOR WEB..' can I preset it to 'JPEG HIGH' cos right now it will pop up 'GIF'.
    When I am using PSE2, I am able to launch it as JPEG HIGH. Now, I have to click on the popdown menu to select 'JPEG High'.

    You need to right-click on the PSE desktop icon and choose "Run as Administrator".
    Then, open a file in PSE, use Save for Web and change all the settings to what you prefer. Hold down the Alt key and the "Done" button will change to a "Remember" button. Click it and then save your image. The settings will be saved and you do not have to run PSE as an administrator again.
    Ken

  • Low resolution AirPlay when using MacBook Pro but high when using iPad

    I have a very strange issue. When I use Airplay from my iPad the image on the television is very clear and sharp, looking like a great HD picture. Wen I stream from my MacBook Pro, or mirror the screen, to the Apple TV the image degrades to a choppy, low-resolution, muddy version that looks terrible! It's strange because I have not had this issue before.
    Anyone have any ideas on what is going on with this? Again, the image from the iPad is fine, the image from the MacBook Pro is low-resolution. Thanks in advance for any help you can offer.
    - MayaAnim8or

    Ike582 wrote:
    Maya,
    I just had a new TV, DVD, Apple TV et al installed today, and the installer told me that he generally sees better performance using Airplay from an iPad vs a Mac.  As I began to play around with my device today, this was certainly true for me as well.  No idea why.
    Ike
    But the OP said that it was not like that before.

  • Fan running high when using word

    never had trouble with the fan but i recently started using word more often which causes the fan to run at high rpms - i know it´s usually around 1800, word causes it to be around 6200 rpm.
    this is quite annoying since it lasts as long as i´m using word. anyone knowing a solution?

    I use the PPC version 10.0.0 of Word and it runs cool. Use Activity Monitor to see how much CPU % Word is using. Mine uses in the single digit percentage.
    I wonder if there is something in Word's Preferences that is turn ON that could be turned OFF, something on the order of a virus checker or some other utility that is unnecessary, which is consuming a lot of power? I really have no better idea than that but thought I would through it out since it would not hurt to look and see if there is something suspicious in Prefs.

  • Costing error when using UNBW material

    We are providing services to customer provided material (UNBW- non valuated). We would like to associate service charges  e.g. machine charge/ resourse charge etc to the production charge. The only material used in this BOM /process is the unvaluated material. How do we set this up so the production costs can be associated with it. We are getting errors relative to costing.
    Thanks
    Raj

    the finished material is Valuated. The  system does not allow us to associate costing to this production order.
    Raj

  • How much would it cost me when using Adobe Flash?

    Hey,
    If I were to develop an app through Adobe Flash (on Windows 8), how much would it eventually cost me to upload it to the App Store?
    Kind regards

    I would have a mac available (from a friend) if I only needed it to upload.
    So to summarize:
    * Develop .ipa file on Windows
    * Upload it to the appstore with a Mac
    -> $99?

  • Does Facetime on my Iphone 4 cost money when used internationally?

    I have a friend who lives in the states and I live in Canada and she just got an Iphone 4S and we want to Facetime and I wonder if it will cost money?

    No cost, other than the price you may already be paying for Internet access.
    Stedman

  • Would Leanprint help me save toner or ink costs/usage when using microsoft publisher?

    I am new to using Adobe so am wondering if I should purchase the Leanprint aoftware.  I haven't bought a printer yet and not sure whether to purchase ink or toner based model.  I will be using the printer for creating marketing documents on Microsoft Publisher such as leaflets and flyers, probably not very often but in large quantities.

    Hello,
    Adobe LeanPrint is not available for Microsoft Publisher. However, you can convert (Save As) the publisher files into PDF files and use Adobe LeanPrint through Adobe Reader/Acrobat.
    Adobe LeanPrint is supported on following applications:
    Microsoft Office 2007 with SP2 or Microsoft Office 2010 32 or 64 bit
    Adobe Acrobat or Adobe Reader 9, 10 or 11
    Firefox 4.x–17, Internet Explorer 8.x or 9.x or Chrome
    Refer http://www.adobe.com/products/lean-print/tech-specs.html for more details.
    Thanks,
    Adobe LeanPrint Team

Maybe you are looking for

  • I have some questions regarding setting up a software RAID 0 on a Mac Pro

    I have some questions regarding setting up a software RAID 0 on a Mac pro (early 2009). These questions might seem stupid to many of you, but, as my last, in fact my one and only, computer before the Mac Pro was a IICX/4/80 running System 7.5, I am a

  • HD file size

    Does anyone know how I can reduce the file size for an HD codec, say HDV 1080i60, or any other. I tried limiting the bit rate, but still end up with the same file size. I'm need to get my HD video under 1gb.

  • Hierarchy data(Profit center Hierarchy,Cost element)

    Hi every one, How can i load the hierachy data from R3 to BW? Please search the forum Edited by: Pravender on Jul 13, 2010 6:56 PM

  • Unable to download new apps on iPad, iPhone, and in iTunes

    I download LOTS of apps and they are all still working fine. Last weekend I tried to download a few new apps and they wouldn't download. (This also happens with updates.) On my iPad they would load 3/4 of the way and start over...and over again. On m

  • My computer was stolen, can i synch from my ipod to my new computer?

    all of my music, both purchased through itunes and burned cd's are all on my ipod.  i have a new computer as my other one was stolen.  is there any way i can get all of my music and playlists from my ipod onto my new computer?