How to find AUTO_SAMPLE_SIZE set at the DB level?

Version: 11.2.0.4

OS: RHEL 6.4

We use below collect stats procedure for gathering statistics for our tables.

exec dbms_stats.gather_table_stats (-)

ownname = > 'QMP, -.

tabname = > 'HRTB_MASTER ', -.

estimate_percent = > DBMS_STATS. AUTO_SAMPLE_SIZE, -.

Cascade = > TRUE;

method_opt = > 'for all THE COLUMNS of SIZE AUTO '.

);

We use a custom procedure that runs dbms_stats.gather_table_stats for the selected tables.

Lately that gather employment stats took longer. When we checked DBA_TABLES. SAMPLE_SIZE these tables, we noticed that it is 100%. That is to say Oracle is 100% sampling.

We thought that DBMS_STATS. AUTO_SAMPLE_SIZE was 10%, by default. How can I determine DBMS_STATS. AUTO_SAMPLE_SIZE currently set at the level of the DB? Google search did not help

It's a shame the manuals do not tell you anything on the algorithm and particularly the effect of the global preference APPROXIMATE_NDV setting to true.

Check the result of:

Select dbms_stats.get_prefs ('approximate_ndv') of double;

If the result is "true" then you have activated the mechanism of approximate_ndv for the collection of statistics on the table and Oracle will use 100% the size of the sample of auto. The advantage of this is that is don't do massive unique on each column to get the num_distinct, and it will get the correct answer to about 1.5% in time to make a small percentage using the older mechanism. If this is the case in your system, as has been pointed out by Stefan, the extra time can result from several work to calculate a number accumulated histograms; It can also disappear for large sample sizes used for indexes more.  NOTE: even with auto to 100% on the table with approximate_ndv, histograms, and index, always use the same sample old 'auto '.

Here is a link that will take you to a whitepaper on the subject if you are interested: https://jonathanlewis.wordpress.com/2009/03/20/hotsos-2009/

There are some side effects, however, which could have a significant impact on a few unfortunate, for example: https://jonathanlewis.wordpress.com/2014/03/02/auto-sample-size/

Concerning

Jonathan Lewis

Tags: Database

Similar Questions

  • How to find this value in the oracle database to find out the table

    Hi expert,

    I know there is a value in the oracle database, please show me how to find this value in the oracle database to find out the table that contains this value.

    Thank you very much

    918440 wrote:
    Hi expert,

    I know there is a value in the oracle database, please show me how to find this value in the oracle database to find out the table that contains this value.

    Thank you very much

    Go to the online documentation and discover the data dictionary. You may be interested in reading about ALL_TAB_COLUMNS, but you will need to know what you want until you can query the view to find information

  • Is it possible to set the character set to the instance level?

    Hi all

    I have some confusion.

    means my database character set AL32UTF8.

    and I want tio character set of instance is WE8MSWIN1252

    He is liable to set the character set to the instance level?

    Please answer Yes or no and why?




    Thank you and best regards,

    Instance is memory process structure and background.

    Character set is for the data and the data is stored in the database that differentiate the instance.

    So the answer is no.

    Kind regards
    Teymur Hajiyev
    Oracle 10g certified master
    http://Teymur-Hajiyev.blogspot.com
    http://DBA.AZ

  • How to find valid cases in the truth table?

    Hello

    I am using a truth table to select the next case in my state machine. The number of possible cases is 256 with a set of 8 input of Boolean values. The following is a generic example.

    Obviously, I don't need the conditions of passage, but how to weed them out of the table?

    0          1          2          3          4          5          6          7          8          9          10        11        12        13        14            15in house?            F          T          F          T          F          T          F          T          F          T          F          T          F          T          F            Tpassed test?       F          F          T          T          F          F          T          T          F          F          T          T          F          F          T            Tscrapped?          F          F          F          F          T          T          T          T          F          F          F          F          T          T          T            T in inventory?      F          F          F          F          F          F          F          F          T          T          T          T          T          T          T            T

    The numbers along the top refer to the result of the code just before the structure case in the attached vi.

    Tay

    jcarmody wrote:

    I often do.  Take each of your eight Boolean and consolidate them in a table, convert the table number and select your case on that based on the number.  Thus, if the first fifth suite and boolean (from above) are true, you have 25 case (10011000 = 25).  You can have a case manage multiple values, separate them with a comma in the selector.  It will make you famous.

    I do the same thing, but the value of the radix of the binary display case.

  • How to find which user have the Channel Manager

    Hello

    How to find which user are responsible for R12 Channel Manager.

    And how to invite the partner already in the list of my partners.

    Please answer me as soon as possible

    Thank you
    Vivek

    How to find which user are responsible for R12 Channel Manager.

    You can run 'The responsibility one users' simultaneous program or run the script in (how to find Out who the responsibility has been granted to A specific user? [ID] 304687.1).

    Please answer me as soon as possible

    For the responses of the ASAP, please log an SR.

    Thank you
    Hussein

  • How to find null values in the table

    Hi experts,

    my version is oracledb10g:

    I am doubted simple.

    for example:

    create table ex1 (e varchar2 (20));

    Insert ex1 (null).

    insert into ex1 (e)

    number of will be: 2

    I can easily find the value "e".

    so my question is:

    How can I find null values in the table and I want to remove the null values from the table.

    ADF 7 wrote:
    Hi experts,

    my version is oracledb10g:

    I am doubted simple.

    for example:

    create table ex1 (e varchar2 (20));

    Insert ex1 (null).

    insert into ex1 (e)

    number of will be: 2

    It depends on what you expect. If you issue count (*) you ask Oracle "how many lines there. If you issue a County () you ask Oracle 'how non null values for are there. "

    ADF 7 wrote:

    I can easily find the value "e".

    so my question is:

    How can I find null values in the table and I want to remove the null values from the table.

    delete from 
    where  is null;
    

    Ideally you would simply place a NOT NULL constraint on the column in question, thus prohibiting NULL values into the system (assuming that your business needs, it is that the column MUST always have a value).

  • How do find no data in the table

    Hi all

    I have 250 table in my diagram and when I query like this

    Select * from object where type_objet = 'TABLE' and owner = 'MATTELLI.
    order by object_name CSA


    Some tables have no data in it. How to find the tables that not have data or records

    Thanks and greetings
    Srikkanth.M

    Hi Srikkanth,

    First of all, if you are only interested in object TABLE type, so you should better use dba_tables instead of dba_objects.
    Then, assuming that your statistics are up to date, it would look like:

    SELECT *
      FROM all_tables
     WHERE owner = 'MATTELLI'
      AND num_rows > 0
     ORDER BY table_name ASC
    

    Otherwise, you can go with a subquery and a 'select count.

    HTH,
    Thierry

  • How to find a table behind the OA framework page

    Hello
    can any body tell me how to find the tables behind any page of OA framework in particular for screens of ALS.
    Concerning

    On the tab of the page-->, click on expand all link.

    Here you can find the area of the table and the VO rasthaus to it. When you've got the name of the View object.

    Then click on details of the Business component references-->

    In the object section View find your viewObject and click on it. Here you can find the application attached to it.

    Thank you
    -Anil

  • How to find a table, using the name of the column in the database schema

    Dear all,

    Please help me on

    using the name of the column, how to find a table name in the database schema.

    Thanks in advance

    Hello

    You can query the data dictionary views all_tab_columns and user_tab_columns.
    For example, to find the tables in the scott schema have called deptno columns:

    SELECT  table_name
    FROM    all_tab_columns
    WHERE   owner           = 'SCOTT'
    AND     column_name     = 'DEPTNO';
    

    Remember that anything inside quotes is case-sensitive.

    The all_tab_columns view has one row for each column in each table (or view) that you have the privileges to use.
    The user_tab_columns view is a subset of all_tab_columns, containing only your own tables (and views).

  • How to find a day in the next few days 27

    Hello

    How to find a date = "Wednesday" in the coming days 27? " The script below does not work. Could someone tell me what's wrong with this code? I suspect that the WHERE clause which make the mistake!


    SELECT TO_DATE (SYSDATE + ROWNUM, 'DD-MON-YY')
    DUAL CONNECT BY ROWNUM FROM < = 27
    WHERE TO_CHAR (DAY, 'DAY') = 'SUNDAY '.

    johnsyns wrote:
    Why doesn't it for the other days? When I tried to change the day except Wednesday. It returns nothing.

    Reason why Justin code does not work for the other days is a date format mask DAY Returns padded white day to 9 characters which is the longest name of day, yes you guessed right, is WEDNESDAY. You must either virgins pad or use modifier format FM:

    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'DAY') = 'TUESDAY'
      5  /
    
    no rows selected
    
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'DAY') = 'TUESDAY  '
      5  /
    
    DT
    ---------
    07-APR-09
    14-APR-09
    21-APR-09
    28-APR-09
    
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'FMDAY') = 'TUESDAY'
      5  /
    
    DT
    ---------
    07-APR-09
    14-APR-09
    21-APR-09
    28-APR-09
    
    SQL> 
    

    SY.

  • How to find out who is the administrator account on my laptop if there are three users

    My son and daughter created the user account on my laptop how I tell me who is the administrator user and change in me. now, I can not even run or install your antivirus to protect my laptop because it asks me to the administrator. any suggestions?   either by the way, I have version XP of Windows 7... the gardener in version in the forum section has no XP version of windows 7.

    My son and daughter created the user account on my laptop how I tell me who is the administrator user and change in me. now, I can not even run or install your antivirus to protect my laptop because it asks me to the administrator. any suggestions?   Incidentally, I have version XP of Windows 7... the gardener in version in the forum section has no XP version of windows 7.

    What does that mean? There is a Windows 7 or Windows XP, but not the version XP of Windows 7. Or do you mean "Windows XP Mode", which has been installed on a full Windows 7 Edition-Professional host? I'm a bit confused.

    Next the administrator account number-> may request to your son or doughter - they know what account is a member of the admin group (and they also know the password for this account).

  • Number of elements must be set to the logical level

    In the channel Business model, mapping, dimension > logic > > number of items at this logical level

    I came across two different versions of how to treat this

    First version - the OBE and the server admin guide, it says "the number does.
    no need to be exact, but the numbers of one logic level to the other, rates should be accurate."

    Second Version - a question asked about what defines the number level both as best practices

    To set the number of items at each level of a dimension, what number would you use?

    A. the number of columns in a logical table
    B. the number of levels in a dimension
    C. the number of dimensions in a business model
    D. the number of tables in a physical model
    E. the number of separate lines in the physical column

    It comes
    What is the rule to set the number of items at this level?

    If its been settled according to the rows in the table. What happens if the lines gets added every hour?

    Edited by: ZSAM June 8, 2011 07:06

    Edited by: ZSAM June 8, 2011 08:22

    The relationship between the levels, which is important according to me. BI Server will use this information to determine which source of aggregation to use. You must use the number of separate lines as the value.

    You can also right-click on the hieracny and "Levels of estimate" allows you to automatically fill in the numbers for you.

    Paul

  • How to disable, disable or reset the ink level warnings and messages

    I spent hours on the internet trying to figure out how to turn it off, disable or reset the ink level warnings and messages. The ink cartridges, I bought are not the expensive brands of HP, but generic print cartridges at a reasonable price. They work great, and I have no problem printing. But apparently HP went through a lot of trouble, making it difficult for customers to disable the annoying low ink level warnings that pester you every time that you try to print a page. It doesn't matter if the ink cartridges are completely full. It is obviously an attempt to punish consumers who buy anything other than HP products. I'm about to recant to never, EVER, buy another HP product again. I'm also about to post horrible comments on Amazon, Ebay, new egg and any other place I can think to warn potential clients of this heinous behavior of HP.

    Model: CN219A

    Serial number:[personal information deleted]

    Name: Series of HP Photosmart Plus B210e (network)

    Windows 7, the printer is on my wireless network.

    If anyone knows how to do this, let me know, before you take a hammer to my HP printer. Thank you

    Hi portaadonai,

    I want to help you with your ink pop up of disorders. Open this link by wade1027 on how to disable ink level notifications. You should be able to disable the pop out.

    Let me know if this helped.

    Thank you

  • Have lost the ability to change the level of difficulty on the games of Freecell. It was there originally, but is now set to the hardest level? can anyone help please?

    Until recently, I was able to choose several levels of difficulty for Freecell card game using the 'Options '. Now there is no choice available under 'Option' or any other position. The game is stuck at the highest level with all combinations of 4. How can I get games with least difficulty IE 1 or 2 costumes? Please can someone help?

    Hello

    1. Since when are you facing this problem?

    2. are you aware of the changes made to the computer before the show?

    Method 1: Try to turn off the game by going to enable or disable the functionality of Windows and later the tower and check if that helps. Follow the link given below for the same thing.

    Enable or disable Windows features:

    http://Windows.Microsoft.com/en-us/Windows-Vista/turn-Windows-features-on-or-off

    Method 2: Run the (SFC.exe) System File Checker tool to determine which file is causing the issue, and then replace the file. To do this, follow the form of measures the following link:

    http://support.Microsoft.com/kb/929833

    I hope this helps.

  • How to make all audio at the same level?

    I have a sequence of many clips in first pro, and I could swear I've heard of a way to make all audio on the same level or db. Is there a way to do this? I have a few clips in the timeline with different levels and should be old enough to go to manually balance their volume.

    There is a way to do what you want, but it must be used with caution.  If you open the Audio Mixer Panel, select mixer of track and the track that your clips are on.  Click on the arrow at the top left of the track work (you may need to do it twice) and and access the small white window that goes down.  (See using Adobe https://helpx.adobe.com/pdf/premiere_pro_reference.pdf page 365 if you have not done this before) In the right side of this window, right-click on one of the spikes back arrow and select Amplitude and Compression and dynamics.

    The word dynamic appears in the white window at the top of channel mixer.  Left click on the word dynamic and select Edit.  I pasted below the appropriate settings.

    If you are not familiar with Compressor/Limiter, use the parameter above.

    Now read your timeline and listen carefully while I look at the counters this setting should be good for normally recorded material, and I hope that you do have to do something more. If there is still following problems may be necessary. Schedule audio below (2) drag any clip that's too soft.  All that is too strong to do drag on the calendar below that (3). For the dynamic audio editing 2 repeat the process with the effect but change the makeup to 12.00dB.  For editing audio 3 change the makeup to 0dB setting.  It's not perfect, but it should give you a low-tech solution.   I hope this helps.

Maybe you are looking for

  • I'm having problems to make one of the 3rd party fitness on my watch applications

    I'm having a lot of trouble getting my watch to load up one of the applications of 3rd party fitness. Apps for example Strava & Wahoo fitness... In particular, two applications have support iwatch announced when download you from the App store. You d

  • Tecra A11 - Battery Health Monitor - Message: unknown

    Hello PC for my TECRA A11 - 12F battery health monitor (2 weeks) shows an unknown messageheatlh.If anyone else has had a similar problem and has it been resolved?

  • Windows Vista has II of x 86 64-bit to 32-bit x 86

    Cannot use my printer much that everything seems to have shifted to x 86 32 bit x 86 64-bit. A lot of things that came with the computer is missing and the icons are different. Can help you. Thank you BJ

  • How to do a zoo tycoon 2 big screen

    I searched the internet trying to find out how to make my 2 fill game zoo tycoon ultimate collection the screen! I tried to change the resolution in the game and via the options of the computer, but nothing works. We thought one of the hotfixes can b

  • Panasonic webcam

    USB connection to comp.but nothing works.what is average for the fixed