GATHER_TABLE_STATS - Can "Estimate percent" be 50?

Hi All,
I am using the DBMS_STATS utility to gather statistics for a table containing 700,000 rows.
Before:
Estimate_Percent was 20.
It took a query 45 mins to execute.
After:
I increased Estimate_Percent to 50.
It took the same query 7 mins to execute.
Is something going wrong?
Specifying 50 did the job but, I am worried it might cause some problem in future because of wrong calcution of statistics.
Oracle chooses between 5% to 20% for a sample_size when using automatic sampling. Would specifying 50 cause any problem?
Rgds,
BRK.

The more percentage of an object is analyzed, the more accurate execution plan can be selected.
For our common databases we use an estimate of NULL, which means a full compute.
A higher percentage however takes an evenly higher amount of time to complete.
Our large databases now use an estimate of 5 percent, to get the stats through the weekend.
I would recommend that you compare the execution plans of both query's, so after gathering stats with an estimate of 20 and with an estimate of 50.
And maybe have a look here: http://www.dba-oracle.com/t_dbms_stats.htm

Similar Messages

  • Auto estimate percent and histograms or small est percent no histograms by default?

    In the past I've used custom written statistics gathering scripts that by default gather statistics on large tables with a small estimate percentage and FOR ALL COLUMNS SIZE 1.  They allow the estimate percentage to be set higher on individual tables and allow me to choose individual columns to have histograms with the maximum number of buckets.  The nice thing about this approach was that the statistics ran very efficiently by default and they could be dialed up as needed to tune individual queries.
    But, with 11g you can set preferences at the table level so that the automatic stats job or even a manual run of gather_table_stats will use your settings.  Also, there is some special sampling algorithm associated with auto_sample_size that you miss out on if you manually set the estimate percentage.  So, I could change my approach to query tuning and statistics gathering to use AUTO_SAMPLE_SIZE and FOR ALL COLUMNS SIZE AUTO by default and then override these if needed to tune a query or if needed to make the statistics run in an acceptable length of time.
    I work in an largish company with a team of about 10 DBAs and a bunch of developers and over 100 Oracle databases so we can't really carefully keep track of each system.  Having the defaults be less resource intensive saves me the grief of having stats jobs run too long, but it requires intervention when a query needs to be tuned.  Also, with my custom scripts I get a lot of hassles from people wanting to know why I'm not using the Oracle default settings so that is a negative.  But I've seen the default settings, even on 11.2, run much too long on large tables.  Typically our systems start small and then data grows and grows until things start breaking so the auto stats may seem fine at first, but eventually they will start running too long.  Also, when the stats jobs run forever or with the automatic jobs don't finish in the window I get complaints about the stats taking too long or not being updated.  So, either direction has its pros and cons as far as I can tell.
    So, my question, fueled by a post work day Sierra Nevada Pale Ale, is whether anyone else has this same dillema and how you have resolved it.  I appreciate any input on this subject.
    - Bobby

    Hi Bobby,
    > Also, when the stats jobs run forever or with the automatic jobs don't finish in the window I get complaints about the stats taking too long or not being updated
    Complaints about "not updated" statistics are very common, but they don't need to be "up-to-date" ... they just need to be representative ... a very important difference
    > I think it comes down to estimate percentage and histograms.  If you can't get the percentage and histograms you want to complete in time you have to dial them back but then the stats aren't as good.
    Be aware of how histograms are gathered under-the-hood for each column. There are some nice improvements with AUTO_SAMPLE_SIZE (Blog: How does AUTO_SAMPLE...). However if you want to know more about the NDV improvements or the synopses - please check out the paper of Amit Poddar One Pass Distinct Sampling.
    Personally i usually start with "FOR ALL COLUMNS SIZE 1" and AUTO_SAMPLE_SIZE (from the scratch) and change only the table preferences that need to be adjusted (like histograms due to data skew, etc.). The other basic stuff works pretty well in most cases and so i usually don't need to put much effort in it (you don't need to fix something, that is not broke). There also issues with aggressive sampling and CBO behavior changes (like fix_control 5483301:off/on), but this needs to be cross-checked from case to case of course.
    Regards
    Stefan

  • Is there any OOB algo which can estimate missing reads for one day???

    Hi,
    We have a requirement where we need to calcuate missing reads for previous day before creating usageTransction.
    So is there any OOB batch is there which can do this everday??
    I cam across one algo, but dont know how to use it in batch??
    Thanks
    Amaresh

    Hello all,
    sorry, I don't know whether my 1st message was clear, so I am trying to rewrite it.
    I'm thinking about a software which creates a database objects list report; this report shows all database objects being accessed by the form - for example, it can list all tables being accessed by the form, showing a CRUD (Create, Read, Update and Delete) for each accessed table, or list all packages being executed by the same form, and so on. For example:
    Form: CLI0001.FMB
    Package -> Operation
    PCK_ACCOUNTS -> E (Execute; but that's a suggestion, we can have 'R' instead)
    Table -> Operation
    ACCOUNTS -> CR (Create + Read)
    PAYMENTS -> D (Delete)
    Sequence -> Operation
    SEQ_ACCOUNTS -> R (Read)
    View -> Operation
    VW_CLIENTES -> R (Read)
    If there's any software which can do it, please let me know. Thanks in advance.
    Best regards,
    Franklin
    Edited by: franklinbrasil on 15/10/2008 19:26

  • How can I remove only the middle elements from a 2-D array?

    Hello all!
    We have had an issue at my work where some of our graphs featuring a Gaussian curve have an unusual rectangular distortion in the middle of the curve (sorry that I have no image to show you, the error is before my time at the company, and I've been asked to find a solution before it happens again). Basically, what should be a Gaussian curve is leveling off briefly and looking like a rounded square wave. We know what causes the distortion, so I only wish to remove the middle part, giving it the appearance of a Gaussian. It's odd, but it actually offers a good approximation of what we want. The graph is made from a 2-D array of Double values, and we can estimate the size of the leveled-area, so I figured that removing the middle elements from the graph would accomplish this. Does anybody know a way I can accomplish this?
    -Gobble
    LabView 8.5.1

    Raven,
    Thank you very much, I'll try that!
    -Gobble
    LabView 8.5.1

  • How can I detect the Mac OS version in JavaScript?

    I know how to detect the OS (e.g. Mac or Win) using navigator.userAgent, but I need a way to know the OSX "version" that the user is running.

    You cannot detect the Mac OS X version directly through JavaScript; you can use this information to determine whether they're using a PowerPC or Intel Mac. If a visitor is using Safari, you can estimate the Mac OS X version by getting the browser's version and then using this table to translate that.
    (19662)

  • Can we change physical SQL generated by BI Server?

    Hello gurus:
    I have a doubt. How can we change the physical SQL generated by OBIEE?
    is there any way we can modify the SQL Cost?
    Let me know.
    Thanks.
    Vinay R.

    So If I have a View and a physical table, so View will have lower cost compared to Table?
    Can you explain a bit more about this?There is absolutely no way we can estimate the cost of a view or a table we don't know. There are too many variables so your question is too wide and unprecise. Generally speaking views that select from only one table do not add any extra cost to the execution plan, Oracle will convert them to the underlaying table. Having said the usual reason to have a view is to join different tables and apply some data filtering conditions so it will depend a lot on what kind of query you are running.

  • Estimate size of an planned table

    Hi,
    I need to estimate size of a table wich has to be created.
    I know the Oracle DATA BLOCK SIZE,
    the columns
    and the number of rows..
    As I said, the table does not exist in Oracle yet, thats why I can not do following select:
    select bytes/1024/1024 MB from dba_segments where owner = <USER>
    and segment_type = 'TABLE'
    and segment_name = <TABLE_NAME>
    I know there is a feature in EM where you can estimate the size of a table...
    Thanks

    Then upgrade your database.
    Or use the search feature against the forum (done for you), there is a plenty example how calculate the table size.
    Nicolas.

  • How to estimate WIFI coverage given an AP and Antenna?

    Hi guys,
    I want to use Cisco Access point to extend coverage on a college campus.
    My question is how do I determine the range of the wireless signal  before actual deployment.. say if I mount the antenna on my building and  the parking lot is immediately adjacent to it, how deep into the  parking lot will my signal be. I would like to know how to calculate  this (or at least roughly estimate it). Once I've estimated the range and coverage patterns, then I can estimate the total amount of AP's that we will require to achieve total coverage on the campus. (Note that our goal is to achieve coverage outside... we already have wireless AP's inside each of the buildings on the campus)
    For the purpose of discussion:
    I was looking at the Cisco Aeronet 3500 series AP (I'm aware that I will need a 5508 wireless controller)
    and I plan to use external antennas Cisco AIR-ANT25137NP-R
    Looking at the spec sheet for the antenna, I can see the "antenna pattern", but it's not function of distance. I know a lot of factors can influence the range, but it would be nice to have a ballpark (square footage coverage etc.)
    Any help would be appreciated.
    thanks

    JP,
         In terms of the density per access point, the rule of thumb is 20-25 users per ap, but it could be less than that or more than that depending on the traffic patterns. Think of it this way, a wireless access point is more like a hub than a switch because it's a shared media. So if you have a typical 802.11g access point and you have a 54mbps link your actual throughput is probably closer to 36mbps; so a 54 mbps link really has a maximum of 36mbps throughput and you have 3 users on the access point trying to watch streaming video they each could concievably get 12mbps of average throughput each since 12mpbs x 3 users = 36mbps; but if you had 100 users and each one was only passing say 100k of traffic then thoretically you could get like 360 users on that access point (36,000,000 bps / 100,000bps = 360 users). There are some other factors that play into this like retries, CTS, etc.... but that's why the typical rule of thumb is 20-25 users per radio on an access point.
         In terms of approved antennas it's not Cisco that certifies the antenna, it more to do with the local governments restrictions, I'd read thru this document in Section A9 covers the questions you have regarding your certification question. Always remember that the restriction is based on the EIRP of your system and if the antenna gain is too high you can lower your transmitter power to get in compliance (Typically).
    http://www.ic.gc.ca/eic/site/smt-gst.nsf/vwapj/rss210-i8.pdf/$FILE/rss210-i8.pdf
         In terms of antennas, you can use a single antenna or seperate antennas either will work, you could also look at www.terrawave.com they have similar antennas; although typically it's best to stay with a purely Cisco solution.
    Hope that helps.

  • Estimate Database Size

    We are planning to use Oracle database (Oracle 10g in Unix). We are in the process of estimating the hard disk capacity(in GB) required based on the past data for each business process. But we are faced with following queries
    1. Assuming the structure for a table is as follows :-
    create table temp1(
    Name varchar2(4),
    Age Number(2),
    Salary Number(8,2),
    DOB Date)
    The estimated records per year is assumed to be 500. How can we estimate the size that will be required for this table.
    2. We are planning to allocate 20% space for indexes on each table. Is it ok?
    3. Audit Logs (to keep track of changes made through update) :- Should it be kept in different partition/hard disk?
    Is there anything else to consider. Is there a better way to estimate the hard disk capacity required in more accurate manner?
    Our current database in Informix takes around 100GB per year, but there r lot of redundant data and due to business process change we cannot take that into consideration.
    Kindly guide. Thanks in advance.

    Well you can estimate the size of a table by estimating the average row size then multiplying this by the expected number of rows then add in overhead.
    3 for the row header + 4 for name + 2 for age + 5 for Salary + 7 for a date + 1 for each column null/length indicator is about 25 bytes per row (single byte character set) * 500 rows * 1.20 (20% overhead) = small.
    The overhead is the fixed block header, the ITL, the row table (2 bytes per row) and the pctfree. You can estimate this but I just said 20% which is probably a little high.
    The total space needed by indexes often equals or surpassed the space needed by tables. You need to know the design and be pretty sure additional indexes will not be necessary for performance reasons before you allocate such a small percentage of the table space to index space.
    Where you keep audit tables or extracts is totally dependent on your disk setup.
    HTH -- Mark D Powell --

  • Running out of space--how can I manage my space better?

    I've just started work on a AVCHD project, and am using an external drive as my scratch. It's got about 125 gigs free on it, but already after my first import (approx 6 gigs from memory stick) it's chewed through almost 18 gigs on the disk.
    Once I've added all the clips I want in the timeline, is there any non-risky way to delete clips off the scratch drive to free up space for more incoming footage? Or is there a "space saver" action that dumps unused and non-favorited clips like in iMovie?
    I've heard that FCE is extremely picky about original clips being altered or removed in any way, but there's got to be a better way to conserve space.
    Help!

    Well, it's a fact of digital video life that you're going to need more and bigger hard drives over time. Expect to invest in a 500GB or 1TB drive if you are doing any kind of serious video work. Fortuantely they aren't that expensive - a 500GB Lacie d2Quadra is only about $155 at newegg.com these days.
    You can estimate disk space needs starting here -->
    -DV requires ~13GB per hour of video
    -HDV & AVCHD (AIC) require 25-50GB per hour of video depending on whether you shoot 720p or 1080i. (See this article for more info - Final Cut Pro 5: About HDV and the Apple Intermediate Codec.
    -And that's just your source media clips. You also need space for render files, exports, iDVD projects, and archives, which can easily double the amount of disk space you need for a project.
    You can minimize space needs by doing the following -
    -Keep only the source media clips that you actually use in your project
    -Export QuickTime reference movies, not self-contained movies
    -When you archive your FCE project, only keep the _source media_ (clips, photos, etc) that you used in the project + your _FCE project file_. Get rid of all the render files, audio render files, waveform & thumbnail cache files. (But be careful about that if you make it a practice to work on more than one FCE project at at time, as the project folders will be intermixed underneath your +Final Cut Express Documents+ folder.

  • Estimate the Import Time by viewing the DUMP File Size

    Its very generic question and I know it can varry from DB to DB.
    But is there any standard way that we can Estimate the Oracle dump import time by viewing the Export Dump file size ?

    Well, it's going to be vaguely linear, in that it probably takes about twice as long to load a 2 GB dump file as to load a 1 GB dump file, all else being equal. Of course, all things rarely are equal.
    For example,
    - Since only index DDL is stored in the dump file, dumps from systems with a lot of indexes will take longer to load than dumps from systems with few indexes, all else being equal.
    - Doing a direct path load will generally be more efficient than doing a conventional path load
    Justin

  • Can CS-MARS perform mitigation access-list on FWSM?

    Hi guys!
    I have couple questions:
    1)Can CS-MARS perform mitigation access-list on FWSM?
    2)How I can estimate how many events and netflows in one second recieve my MARS box.
    Thanks

    Don't do mitigation and don't have FWSM, so I can't answer your first question. Regarding the second...There are a couple ways, neither is perfect but give you a good approximation.
    a) Use the "Events and NetFlow" graph on the summary page. Divide the peak "avg/min" values by 60.
    b) collect the logs using the pnlog command in the CLI. in the janus-logs.tar.gz you will find a janus_log file. This is the same data shown in Admin->System Maintenance->View Log Files...except now you can search through it better. Use a tool like grep to pull out and sort the message rates. the last entry is your peak.
    > grep "PN-2016" janus_log | cut -d" " -f7 | sort -n

  • Estimate temp usage

    Hello all,
    we have a quite complex query (based on several views) that works fine in a test environment but fails in the production environment because the temp segment is too small (ORA-01652).
    Fixing this problem is quite easy obviously by increasing the size of the tablespace. We'd like to find an "optimal" size for this - big enough, but not wasting space. So I would like to estimate the (current) usage of temp space of the query in some way.
    Is there any way of finding out the correct size without an incremental increase of the tablespace (add 100MB, try again, if it fails add another 100MB and so on).
    Would the "BYTES" column of an explain plan indicate the "correct" size for the temp segment?
    Kind regards
    Thomas

    Thomas, first you should run an explain plan and see why the temp segment space is used: order by, group by, hash area, etc....
    It is very possible for one statement to require multiple three temp areas concurrently.
    You may want to compare the test and production plans to be sure the query does not need tuning, that an index added to test exists in production, etc....
    Then based on the number of rows you expect to be passed to the temp area you can estimate how much space is required to support the query.
    HTH -- Mark D Powell --

  • "analyze index"  vs  "rebuild index"

    Hi,
    I don't undestand the difference between "analyze index" and "rebuild index".
    I have a table where I do a lot of "insert" and "update" and "query", What is the best thing to do ??
    thanks
    Giordano

    When you use dbms_stats.gather_schema_stats package with cascade=>true option, you are also collecting stats for the indexes, no need to collects stats separately using dbms_stats.gather_index_stats.Of course, but I refered to the rebuild index question. Therefore I only mentioned the GATHER_INDEX_STATS.
    Auto_sample_size has many problems/bugs in 9iOk didn't know that - I'm using 10gR2.
    But this discussion made me curious. So I tried something (10gR2):
    CREATE TABLE BIG NOLOGGING AS
    WITH GEN AS (
    SELECT ROWNUM ID FROM ALL_OBJECTS WHERE ROWNUM <=10000)
    SELECT V1.ID,RPAD('A',10) C FROM GEN V1,GEN V2
    WHERE ROWNUM <=10000000;
    SELECT COUNT(*) FROM BIG;
    COUNT(*)
    10000000
    So I had a Table containing 10 Million rows. Now I indexed ID:
    CREATE INDEX BIG_IDX ON BIG(ID)
    I tested two different methods:
    1.) GATHER_TABLE_STATS with estimate 10%
    EXEC DBMS_STATS.GATHER_TABLE_STATS(TABNAME=>'BIG',OWNNAME=>'DIMITRI',CASCADE=>TRUE,ESTIMATE_PERCENT=>10);
    It took about 6 seconds (I only set timing on in sqlplus, no 10046 trace) Now I checked the estimated values:
    SELECT NUM_ROWS,SAMPLE_SIZE,ABS(10000000-NUM_ROWS)/100000 VARIANCE,'TABLE' OBJECT FROM USER_TABLES WHERE TABLE_NAME='BIG'
    UNION ALL
    SELECT NUM_ROWS,SAMPLE_SIZE,ABS(10000000-NUM_ROWS)/100000 VARIANCE,'INDEX' OBJECT FROM USER_INDEXES WHERE INDEX_NAME='BIG_IDX';
    NUM_ROWS SAMPLE_SIZE VARIANCE OBJEC
    9985220 998522 ,1478 TABLE
    9996210 999621 ,0379 INDEX
    2.) GATHER_TABLE_STATS with DBMS_STATS.AUTO_SAMPLE_SIZE
    EXEC DBMS_STATS.DELETE_TABLE_STATS(OWNNAME=>'DIMITRI',TABNAME=>'BIG');
    EXEC DBMS_STATS.GATHER_TABLE_STATS(TABNAME=>'BIG',OWNNAME=>'DIMITRI',CASCADE=>TRUE,ESTIMATE_PERCENT=>DBMS_STATS.AUTO_SAMPLE_SIZE);
    It took about 1,5 seconds. Now the results:
    NUM_ROWS SAMPLE_SIZE VARIANCE OBJEC
    9826851 4715 1,73149 TABLE
    10262432 561326 2,62432 INDEX
    The estimate 10% was more exact - also a 1,7 and 2,6 percent variance is still ok. It's also very interesting, that using AUTO_SAMPLE_SIZE
    causes oracle to execute a estimate 5% for the index and a estimate 0.5 for the table.
    I tried again with a table containing only 1 Million records and oracle did an estimate with 100% for the index.
    So for me I will continue using AUTO_SAMPLE_SIZE. Its very flexible, fast and accurate.
    Dim
    PS: Is there a way to format code like one can do in HTML using <code> or <pre>?

  • Wish List

    1. FTP client that shows you your progress. If it's going to
    be 1/2 an hour, it makes sense to something else. Currently, I
    often use FTPVoyager because it shows me the progress per file and
    overall. and shows the percent complete so I can estimate the total
    time before it finishes.
    2. CSS displayed in design view like it does in a browser.
    One cannot design with CSS layout without running the app in a real
    browser. Maybe they could use the browser's API in Dreamweaver
    something like Netscape does with IE.
    3. A trial for each new version. I'm not putting out money
    and going through a learning curve just because Adobe says it's new
    and improved. If they don't have a trial, that implicitly states
    that Adobe doesn't believe the upgrade justifies the cost. I'm not
    ujpgrading.
    4. An FTP client that can upload and download binary or ASCII
    based on file CONTENTS. Very often web apps are encrypted with
    ZEND. Baring that, the ability to specify that a certain site
    always does binary transfers, regardless of file extension, since
    uploading unencrypted ASCII files to a ?nix environment without
    stripping out the DOS <CR>s does not negatively impact their
    execution by the web server nor most server-side utilities. Without
    this ability, you can easily corrupt your entire site.

    > Referencing the start of the thread, not if you work in
    CSS layout.
    Sure it does. Where are you seeing it not do so?
    > For all intents and purposes there are at most 3.
    FireFox, 1.5 and
    > greater,
    > IE 6, and IE 7. You could practically narrow it down to
    two, with FireFox
    > and
    > IE7 on one side, and IE6 on the other. If it works in
    those, it will very
    > likely work in the remainder.
    That's a pretty lax approach, I think. How about Safari and
    FF on the Mac?
    > >e.g. the box model in IE6 and IE7 differs
    markedly.<
    >
    > I agree with that, and I might add there is no hack
    required for
    > transparent
    > PNGs in IE 7 either.
    It's identical on the two if you have a valid and complete
    doctype. That's
    one of the things I meant by coding to standards.
    > it needs to provide that functionality with CSS layout.
    Show us where it's not doing that, please.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Jack Toering" <[email protected]> wrote in
    message
    news:[email protected]...
    > >Look - code to standards, and this problem goes way
    down on the priority
    > list.<
    >
    > Referencing the start of the thread, not if you work in
    CSS layout.
    >
    > >There are too many browsers and versions of
    browsers<
    >
    > For all intents and purposes there are at most 3.
    FireFox, 1.5 and
    > greater,
    > IE 6, and IE 7. You could practically narrow it down to
    two, with FireFox
    > and
    > IE7 on one side, and IE6 on the other. If it works in
    those, it will very
    > likely work in the remainder.
    >
    > >e.g. the box model in IE6 and IE7 differs
    markedly.<
    >
    > I agree with that, and I might add there is no hack
    required for
    > transparent
    > PNGs in IE 7 either.
    >
    > Using CSS layout in design is way past starting to gain
    in popularity.
    > The
    > whole point of and IDE is to be able to efficiently
    design. That requires
    > a
    > tool that accurately reflects your page during design.
    For Dreamweaver to
    > retain it's crown, it needs to provide that
    functionality with CSS layout.
    > There is little point for someone who spends most of his
    time in CSS
    > layout to
    > spend $400 for a complex piece of software that from his
    standpoint now
    > only
    > offers little more than text editor and an FTP client.
    He will attempt to
    > find
    > that functionality elsewhere or create it himself.
    >
    > Thanks all
    >

Maybe you are looking for

  • My iphone won't allow me to download new apps

    I have never had this issue before. It tells me I can retry. I am downloading apps directly on my phone. I was able to last night. It is not saying I need to reconnect to the internet but I am wondering if this is because of a bad internet connection

  • How do I delete all my contacts from my iPod Touch?

    I'm giving my iPod touch to my grandson and want to delete all my contacts from my iPod Touch. These have been synched from Mobile Me (.Mac). I've unchecked the synch contact box in the setting section of iTunes, but the contacts do not get deleted.

  • CRM PCUI Issue; tab product; no of items displayed configurable?

    Hello everybody, I am facing one CRM PCUI problem. customer would like to set no of items, which can be max. displayed in CRM PCUI application CRMD_BUS2000115, on tab "product" on Level "Detail Area 1". As default max. 10 could be displayed, this is

  • Armoured

    I recently had to reinstall my Photshop 6.0 following hard drive problems.  Now I am presented with the following message when I attempt to access the organiser. MS Visual C++ Runtime Library This application has requested the runtime to terminate it

  • Big big problems using Generics, BeanInfo and Introspector

    I'm having a big big problem with Introspector class. Let me setup the problem: public interface VO<T, V> {   public T getOid();   public void setOid(T oid);   public V getVersion();   public void setVersion(V version); public interface CarVO extends