How AUTO stats job decides on histograms and sample size?

Hi All,
I am on Oracle 11.2.0.3 .
I have a table with 161M records. In fact it is an IOT. We are running the default stats collection job from Oracle (not even the time is changed !!).
This is the nature of stats on this table
SQL> select column_name, num_distinct, num_nulls, num_buckets, sample_size, histogram
  2  from dba_tab_col_statistics where table_name='TABLE1';
COLUMN_NAME                    NUM_DISTINCT  NUM_NULLS NUM_BUCKETS SAMPLE_SIZE HISTOGRAM
COLUMN1                                   1          0           1   162988917 NONE
COLUMN2                                   0  162988917           0             NONE
COLUMN3                           119808000          0         254        5548 HEIGHT BALANCED
COLUMN4                                3048          0         254        5548 HEIGHT BALANCED
COLUMN5                                   1          0           1   162988917 NONE
COLUMN6                                 173          0          77        5549 FREQUENCY
COLUMN7                            43225088          0           1   162988917 NONE
7 rows selected.I have so many question on this
Why sample size is so small on the columns where histogram exists?
Why sample size is 100% on the columns where there is no histogram? (I am assuming NONE means there is no histogram on this column)
COLUMN6 is a really skewed column. There are actually 173 distinct values in there. How come Oracle found that correctly in such a small sample size?
Thanks in advance

rahulras wrote:
SQL> select column_name, num_distinct, num_nulls, num_buckets, sample_size, histogram
2  from dba_tab_col_statistics where table_name='TABLE1';
COLUMN_NAME                    NUM_DISTINCT  NUM_NULLS NUM_BUCKETS SAMPLE_SIZE HISTOGRAM
COLUMN1                                   1          0           1   162988917 NONE
COLUMN2                                   0  162988917           0             NONE
COLUMN3                           119808000          0         254        5548 HEIGHT BALANCED
COLUMN4                                3048          0         254        5548 HEIGHT BALANCED
COLUMN5                                   1          0           1   162988917 NONE
COLUMN6                                 173          0          77        5549 FREQUENCY
COLUMN7                            43225088          0           1   162988917 NONE
7 rows selected.Why sample size is so small on the columns where histogram exists?
Because the code decided that the histogram it generated at that size was sufficiently accurate - but I can't tell how it came to that conclusion.
Why sample size is 100% on the columns where there is no histogram? (I am assuming NONE means there is no histogram on this column)
COLUMN6 is a really skewed column. There are actually 173 distinct values in there. How come Oracle found that correctly in such a small sample size?
The answer is probably that it didn't. I suspect you have enabled the approximate_ndv mechanism, which applies in the first pass for collecting simple stats, and the num_distinct in every case was therefore very close to perfect with a 100% sample size. The histograms would then have been collected in a second pass. You have only 77 buckets in the frequency histogram on column6, which means Oracle knows about just 77 values for that column despite reporting 173 as the number of distinct values. to my mind, the inconsistency between num_distinct (which should have been pretty accurate) and the number of buckets should have made Oracle collect another, larger sample size of the histogram.
Regards
Jonathan Lewis

Similar Messages

  • I'm using iphone 5 but its camera is not properly working. all the images i'm clicking are of dimension 600X800 and the size of the image is just 60-70 kb. now please tell me how to increase the dimension of images and its size.

    i'm using iphone 5 but its camera is not properly working. all the images i'm clicking are of dimension 600X800 and the size of the image is just 60-70 kb. now please tell me how to increase the dimension of images and its size.

    ''rojere [[#question-1055991|said]]''
    <blockquote>
    i try to keep my thumb palms off the mouse pad when i am typing but every now and then my screen resizes larger or smaller until i take my left palm off the keyboard base its only when my left palm is resting on the base next to the touch pad. i type pretty fast so it gets annoying and yes it also jumps screens or reverts back to previous message and i have to choose ctrl z to undo and get back to my message i was typing... it also switches tabs on me as well... not sure why my palm being on the left of the keypad on the base should effect anything but it does after a while. and i have to stop what i am doing...and go to the firefox menu and change the screen size back down to 100% sometimes it goes up to 200-300 other times it goes down to 70-80% i find it annoying i i wish there was a way to turn off the screen resize in the setup panel. if its just left to be 100% i am happy with that... i don't need it to be bigger or smaller... there should be a way to LOCK it down... i understand that there are people out there with eye problems and needs to have the screen size increase using the + or - but there should be a lock so it just stays no matter what is happening on my keypad or touch pad or base of the pad... that screen size will not increase or decrease. unless i turn off the lock... perhaps this is something they can implement in the next version or do a quick update of the browser
    </blockquote>
    sorry that is all greek to me thanks for attempting to explain what you were trying to explain sorry i just not tech person to be able to understand or where to begin ... have good day and thanks for again trying

  • How do I find, at-a-glance, the sample size used in several music files?

    How do I find, at-a-glance, the sample size used in several music files?
    Of all the fields available in a FInder Search, "Sample Size" is not available. Finder does offer a "Bits per Sample" field, but it only recognized graphic files and not music files.
    Running 10.8.5 on an iMac i5.
    I did search through a couple of communities but came up empty.
    Thank you,
    Craig

    C-squared,
    There is no View Option to allow display of a column of sample size. 
    For WAV or Apple Lossless files, it is available on the Summary tab (one song at a time, as you know).  For MP3 and AAC it is not available at all.
    You can roughly infer it from the files that are larger than expected for their time.
    99% of the music we use is at the CD standard of 16-bit, so I can guess that displaying it has never been a priority.  However, if you want to make a suggestion to Apple, use this link:
    http://www.apple.com/feedback/itunesapp.html

  • How change state when card is inserted and pulled out

    It is not Java Card question, but I think it is better place to post question like this. I have running Java Card applet on card, the communication between card and host application works, but could you anybody tell me how handle inserting and pulling card out? My idea is, I have running Java 6 SE application:
    1. and I will insert the card into a reader and application will automatically find out that card was inserted and write out it.
    2. and I will pull out the card from a reader and application will automatically find out that card was pulled out and write out it.
    Could you anybody help me, please?
    Thank you very much for any answer.
    Martin

    mFilo wrote:
    It is not Java Card question, but I think it is better place to post question like this. I have running Java Card applet on card, the communication between card and host application works, but could you anybody tell me how handle inserting and pulling card out? My idea is, I have running Java 6 SE application:
    1. and I will insert the card into a reader and application will automatically find out that card was inserted and write out it.
    2. and I will pull out the card from a reader and application will automatically find out that card was pulled out and write out it.I think you can address only terminals. A way to identify a card is with additional info like ATR, CPLC data or specific applet's file control information (response to select command). I found in javax.smartcardio.CardTerminals following methods that might help:
    waitForChange
    public void waitForChange()
                       throws CardException
        Waits for card insertion or removal in any of the terminals of this object.
        This call is equivalent to calling waitForChange(0).
        Throws:
            IllegalStateException - if this CardTerminals object does not contain any terminals
            CardException - if the card operation failed
    waitForChange
    public abstract boolean waitForChange(long timeout)
                                   throws CardException
        Waits for card insertion or removal in any of the terminals of this object or until the timeout expires.
        This method examines each CardTerminal of this object. If a card was inserted into or removed from a CardTerminal since the previous call to waitForChange(), it returns immediately. Otherwise, or if this is the first call to waitForChange() on this object, it blocks until a card is inserted into or removed from a CardTerminal.
        If timeout is greater than 0, the method returns after timeout milliseconds even if there is no change in state. In that case, this method returns false; otherwise it returns true.
        This method is often used in a loop in combination with list(State.CARD_INSERTION), for example:
          TerminalFactory factory = ...;
          CardTerminals terminals = factory.terminals();
          while (true) {
              for (CardTerminal terminal : terminals.list(CARD_INSERTION)) {
                  // examine Card in terminal, return if it matches
              terminals.waitForChange();
        Parameters:
            timeout - if positive, block for up to timeout milliseconds; if zero, block indefinitely; must not be negative
        Returns:
            false if the method returns due to an expired timeout, true otherwise.
        Throws:
            IllegalStateException - if this CardTerminals object does not contain any terminals
            IllegalArgumentException - if timeout is negative
            CardException - if the card operation failed

  • How to find out the Pixel Dimensions and Document Size of placed images?

    Is it possible to find out the placed image details like Pixel Dimensions(Width,Height) Document Size(Width,Height) in illustrator through scripting. Kindly advice me with some examples.

    http://www.adobeforums.com/webx/.3bbaa316.59b84fd8
    I hope the snippet therein will get you started.
    But after all, when you place an image via pi=layer.placedItems.add() it should pop in with its default dimensions, so that you have pi.height and pi.width ready.
    Is this what you are aiming at?

  • Script to know how many statements are not loaded in oracle CM

    Hi,
    Can some one would help me on how to prepare a script to know the bank statements are not loaded into oracle CM and how many checks under that particular statement are not loaded??
    I have the following info with me..
    1. The statements are loaded in a temporary table as soon as we run statement loader program.
    2. Then the records will get into ce_statement_headers_int_all and ce_statement_lines_interface.
    3. Then they will get loaded into ce_statement_headers_all and ce_statement_lines tables.
    Now, the only thing i am confused is how to get to know the statements list that are not loaded into oracle along with the error message. i am confused which tables will give the exact info ce_statement_headers_int_all and ce_statement_lines_interface or ce_headers_interface_errors and ce_lines_interface_errors??? immediate help would be highly appreciated and its very urgent...........
    Thanks.

    Hi Helios,
    I dint get you. This is not something which SR can be raised. I need to know how script can be written to know the statements that are not loaded in oracle cash management. I need to prepare a notification where in that should contain how many statements have been loaded successfully and how many are not on a daily basis...
    Thanks.

  • Need working cairngorm and sample app...

    Hi,
    Our team is evaluating Cairngorm and I downloaded and tried to build it and am having some of the same problems reported before.
    Does this framework work and if so, how can I run and test the sample app quickly without spending many days trying to build and debug it?
    It seems from a previous post, the swcs are only available with commercial LCDS - they seem to have been removed.
    Can you please point me on how to get the non-commercial framework and sample working quickly?
    Thanks,
    Steve.

    Hi Steve,
    The issues related to property files should be fixed. You can build the projects using maven or simply import the insync sample applications and download the required libraries swc files from our repository.
    Let me know if you are still experiencing issues running the samples.
    Best,
    Nicolas

  • Result Recording and Sample calculation

    Dear Experts,
    I have a concern regarding the sampling designed
    According to the sampling plan in local SOP the samples to be taken for all ZAPI and ZRAW as per below points.
    Withdraw sample from each container for Identification test. Here the sample size will very form material to material.
    Make a pool of sample according to No. of containers /5 for Other tests, like Assay,LOD,Potency,Microbiological tests etc...
    And there is Retention Sample.
    To meet this requirement, I have designed the sample management like this......
    There will be two partial Samples for Sample drawing procedure
    Partial Sample 010 has formula for Primary Samples :- P2.
    Partial Sample 010 has no Pooled Sample
    Partial Sample 010 has Reserved Sample; Fixed No 1;  along with Sample Size.
    Partial Sample 020 has Primary Sample IF P2>=5 THEN P2/5 ELSE P2 to meet the pooling of containers for other test than Identification.
    Partial Sample 020 has Pooled sample 1
    Partial Sample 020 has no Reserved Sample.
    No at the other end In inspection plan we have two operations;
    Operation 0010 ; Identification where all the MICs will be linked with Partial Sample 010 and Sample size for Identification test will be assigned along with Sampling procedure.
    Operation 0020; QC Laboratory where all the MICs will be linked with Partial Sample 020 and Sample size for Chemical and Micro Analysis tests will be assigned along with Sampling procedure.
    For an example for Material X:-
    Sample Size = 2gm, for Identification (ID) is maintained at respective MICs in Inspection plan
    Sample Size = 50gm, for Chemical and Micro Analysis tests  maintained at respective MICs in Inspection plan
    Sample Size = 150gm maintained at SDP for Reserved.
    If we receive a consignment 10 Containers for Material X. Then system will create sample as below.
    10 Primary samples from Partial Sample 010 of SDP each have sample size 2 and result needs to be recorded for each sample. This is very lengthy hence not acceptable to business.
    02 Primary samples from Partial Sample 020 of SDP each have sample size 25 and result not required to be recorded for it.
    01 Pooled samples from Partial Sample 020 of SDP each have sample size 50 and result needs to be recorded for it.
    01 Reserved Sample (There is no issue with this so not elaborating more)
    Total Sample size is 220 (20+50_150)
    {10*2=20 Primary Samples for ID
    2*25=50 Pooled Samples for Chem and Micro
    150 Retain Sample}
    Now the requirement is We don't want to record result for all 10 Primary sample from Partial Sample 010 but want to calculate the sample size as per above quantity.
    Kindly give me some guidance!!!!!!!
    Regards,
    Shyamal

    I think what you'll need to do is create a sampling procedure for each container type you expect to receive. So if you get BUOM KG's  in 55 gal drums, you'll need a sampling procedure for drums. If you get it in a 2000lb super sac, you'll need a sampling procedure for that.  And of course separate inspection plans for the drum material and one for the super sac material since the same characteristic will specify different sampling procedures.
    The sampling procedure will specify a sampling scheme for that container.  I.e. for the super sacs with normal inspection you would specify 0-2000 = 2 g sample.  2001-4000  - 4 g sample.  4001-6000 = 6 g.  etc. etc..
    When the sample size for the ID characteristic is figured out, it will be 10g or 20 g.  Whatever.  It is based on the total lot size.
    The sample drawing procedure will take the sample size of 20 g now, and apply that to the pooled sample.  That will be divided by the primary samples, (P2 = 10) for a set of 10 primary samples of 2 g each.
    A second alternative would be to create the inspection plan in the alternative UOM. Say super sacs.  You receive in 10.  You could create a large sampling scheme for this where a lot size of 1 = 2 g.  2 = 4 g, 3 = 6 g, etc...   While it would be a large sampling scheme, you'd only need one sampling procedure and one sampling scheme.  The inspection plan will see a BUOM of 20,000Kg but convert that to 10 super sacs.  The sampling procedure would see an inspection lot qty of 10 super sacs.  The sampling scheme calcualtes a sample size of 20 for a lot size of 10.  The sample size is applied to the pooled sample and then distributed to the 10 primary samples. 
    This should work for all container types.  If the plan was in drums, 20,000 kgs might calcuate out to 30 drums.  The sampling procedure looks up 30 to find that is 60 and returns a sample size of 60g. That is applied to the pooled sample and divided amoung the primary samples, (P2 = 30), for 2 g per primary sample. 
    FF

  • Make Draw Procedure and Sampling Procedure Quantities Match?

    I need to set up an inspection plan where one item is taken from each container and combined into 1 pooled sample. The items in the containers are in eaches and the number may vary from container to container. Think 5 buckets filled with pebbles. I want to end up with a pooled sample that is a total quantity of 5, total containers to sample is 5 and sample size per container is 1.
    On my inspection plan, my Sampling Procedure is set for a fixed sample size of 1.
    The number of buckets may vary from shipment to shipment, so my Draw Procedure is set to have the number of primary samples be P2. However, when I set the number of pooled samples to 1, I end up with sampling instructions that say to take 0.2 pebbles from each of 5 buckets.
    I can set up the Draw Procedure to only have Primary Samples and my sampling instructions will show 5 primary samples but it will not indicate that they should be taken 1 per container.
    Setting my fixed sample size to 5 solves this particular problem but as my material may arrive in 6 containers next time, it is not a long term solution.
    It seems to me that I need to be able to set my sample size to also vary based on the number of containers. I can't do that using a pebble to bucket conversion, as this is not a constant number. Ideally I would like a Sampling Procedure with a sample size of P2.
    Is there a way to create a Sampling Procedure that varies based on the number of containers received? Or is there another option?
    Thanks,
    Deb

    You can achieve this by using Sampling Determination "300-Sample schema" If require modify Function Module "QDRS_SAMPLING_PLAN_SAMPLE"
    Thanx!!

  • Can we change GATHER_STATS_PROG (auto gather stat job) behavior

    Hi All,
    Is anyway we can change default oracle auto gather job ?
    We know that oracle gather job (GATHER_STATS_JOB, below 11g) will trigger base on the Maintenance Window, we have few huge Production environment.
    We're thinking to gather application schema stat by using our own scripts, thus would like to know is anyway we can still enable oracle auto gather stat
    but exclude application schema?
    Thanks in advance.
    Regards,
    Klnghau

    Hi All,
    Forgot to mention my oracle version is 10.2.0.4, and I think i find the solution from My Oracle support,
    Oracle10g: New DBMS_STATS parameter AUTOSTATS_TARGET [ID 276358.1]
    This is a new parameter in Oracle10g for the DBMS_STATS package.
    According to the documentation for this package in file dbmsstat.sql
    (under ORACLE_HOME/rdbms/admin):
    This parameter is applicable only for auto stats collection.
    The value of this parameter controls the objects considered for stats collection.
    It takes the following values:
    'ALL' -- statistics collected for all objects in system
    'ORACLE' -- statistics collected for all oracle owned objects
    'AUTO' -- oracle decides for which objects to collect stats
    Default is AUTO, i think i can chenge to ORACLE in my environment.
    Thanks

  • Is 11g auto stats collection automatic on? where can I find this job?

    Is 11g auto stats collection automatic on?
    I manually created a 11g database, but I did not see auto stats collection job. where can I find this job? or how could I verify this is on?
    Thank you.

    Found in Automated Maintenance Tasks.

  • How to decide no.Technical and Business Systems required for any senario

    Hi XI experts
         I am very new to XI but it is very interesting ....
         To develop any scenario how to decide Technical systems and Business
         Systems...
         For any scenario but how to decide the systems howmany to create ?
         I had a scenario like SOAP to RFC to SOAP ? For this how to decide?
         One more like FILES to BPM to JDBC ...like
         Can any one explain me for any scenario which may include SAP
         R/3,CRM,APO,BW,JDBC,SOAP,RFC...any system.
    Adv..thanks and points to all
    Kiranlvs

    Hi Kiran.
    Ok here I will try to answer your question.
    1) SOAP (Web Service) -> RFC (R/3) -> SOAP (Web Service)
    a) you will need to create a Business System for R/3.
    b) you will need to create a third party business system or a business service for the Web Service system.
    2) File (File System) -> XI -> JDBC (Database)
    a) you will need to create a third party business system or a business service for the File system.
    b) you will need to create a third party business system or a business service for the Database system.
    note: BPM is one of the functionality of XI so there is no need to create a BS or TS for it.
    3) CRM or APO or BW (SAp Systems) -> XI -> IDoc (R/3)
    a) Business System for CRM or APO or BW
    b) Business System for R/3.
    The bottom line is you need to create Business System for any SAP system that is part of you integration scenario or when you have to Idoc, RFC and Proxies.
    If the business system already exists for the SAP system then you just need to attach your SWCV or Product to that Business System.
    Regards,
    Ashish

  • My auto install for Premiere Elements failed and told me i needed to do a restart and try installing again. Having restarted my laptop, how do I install the software? There are two .exe files in the folder - oem and start-up. Which should i run?

    My auto install for Premiere Elements failed and told me i needed to do a restart and try installing again. Having restarted my laptop, how do I install the software? There are two .exe files in the folder - oem and start-up. Which should i run?
    thanks

    for windows you should have an exe and a 7z file.  put both in the same directory and double click the exe.
    Downloadable installation files available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4, CS4 Web Standard | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 | 12 | 11, 10 | 9, 8, 7 win | 8 mac | 7 mac
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7 win | 8 mac | 7 mac
    Lightroom:  5.7.1| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5.5, 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • When trying to download Itunes this pops up " key not valid for use in specified state" what does this mean and how can I fix it?

    When trying to download Itunes this pops up " key not valid for use in specified state" what does this mean and how can I fix it? I am using a pc laptop if that makes any difference.

    Try reading through this thread: key not valid for use in specified state. Possible solution involves moving the RSA folder. Rather than deleting it as aniwack suggested I'd try this:
    For "Key not valid for use in specified state" errors try moving the folder RSA from C:\Users\<User>\AppData\Roaming\Microsoft\Crypto\RSA to say C:\RSA (just in case there should be a need to restore it) then try installing again. This folder appears to act as a cache and should be rebuilt automatically as required.
    tt2

  • What SQL Server Agent jobs are currently running and for how long

    Is there a way to tell what SQL Server Agent jobs are currently running and for how long?  View history isn't working in my case because it's only showing completed jobs.  John Schroeder

     You can use the "Job Activity Monitor" for doing this.  Do the following steps. It will open up the Job Activity Monitor.
    1.    In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.
    2.    Expand SQL Server Agent.
    3.    Right-click Job Activity Monitor and click View Job Activity.
    4.    In the Job Activity Monitor, you can view details about each job that is defined for this server.
    In Job Activity Monitor page, we have column called Status. It will indicate whether job is executing or idle. Last Run column will give you the last invocation time of this job.
    Use the following link for further reference.
    http://msdn.microsoft.com/en-us/library/ms187449.aspx
    Thanks,
    Sateesh.
    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

Maybe you are looking for

  • RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed

    HI All, Im getting the following error while trying to call a RFC through JCO. {0}#1#com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed Connect_PM  TYPE=A ASHOST=R3ip SYSNR=00 GWHOST=R3ip GWSERV=sapgw00 PCS=1 L

  • ELECTRONIC SIGNATURE DEVICE FOR TAX AUTHORITIES (TAX REGISTERS)

    Many countries today have special laws in place that make it obligatory for anyone who is selling goods or services to consumers to use approved by the tax authorities cash registers that have special security features that enable the authorities to

  • Is it normal streaming video lagged through AirPlay?

    I just got new iPad and new AppleTV, I played streaming video on my iPad, (which is an app using wi-fi bandwith), I also turn on AirPlay on iPad and mirror to TV through AppleTV2. The router is AirPort, I believe the mirroring also use wi fi bandwith

  • DW050 Error installing InDesign CS6 trial

    I am trying to install the Trial version of InDesign on a Mac running OS 10.7.5.  I get the following list of errors.  Help! Exit Code: 7 Please see specific errors and warnings below for troubleshooting. For example,  ERROR: DW050 ... --------------

  • My iPhone 5 speaker just stopped working.

    I can listen to music through headphones, can hear phone call but once I put it on speaker it wont work. It does not have water damamge and it was working just fine when I was watching a video the speaker crackled and now I cant hear any notification