Determine the sampling method on table
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: Determine the sampling method on table

  1. #1
    Join Date
    Feb 2001
    Posts
    128

    Determine the sampling method on table

    Hi,

    I have some tables for which stats are collected using block sampling.

    Is there a data dictionary view that can tell me which tables stats have block sampling on them?

    Thanks
    Jay

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    dba_tables

  3. #3
    Join Date
    Feb 2001
    Posts
    128
    I checked dba_tables before and could not find any column that suggested if the stats were collected using block or row sampling method.

    Regards
    Jay

  4. #4
    Join Date
    Mar 2006
    Location
    Charlotte, NC
    Posts
    865
    Check SAMPLE_SIZE column in DBA_TABLES.

    If you used DBMS_STATS package with " estimate_percent => xx " for row sampling instead of block sampling then you will see the value in SAMPLE_SIZE column.

    Thanks,
    Vijay Tummala

    Try hard to get what you like OR you will be forced to like what you get.

  5. #5
    Join Date
    Feb 2001
    Posts
    128
    the column Sample_size has a number value in it, how do we determine if it was gathered using row/block sampling?

  6. #6
    Join Date
    Mar 2006
    Location
    Charlotte, NC
    Posts
    865
    well, I am not sure if we have any thumb rule to find that. My best guess is, you can only identify if you are sure that you have taken estimate_percent some value less than 100 like 30 or 40.

    block_sample - NUM_ROWS = SAMPLE_SIZE
    estimate_percent - NUM_ROWS != SAMPLE_SIZE

    Some one please correct me if i am wrong.

    Thanks,
    Vijay Tummala

    Try hard to get what you like OR you will be forced to like what you get.

  7. #7
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    I don't think Oracle keeps track on where you asked for blocks or rows sampling.

    At the end of the line Oracle would sample rows, whatever random rows when you ask for rows or all the rows in a sample of blocks when you ask for blocks.

    In general you are going to get a better random sample when asking for rows.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width