Collection of statistics on partitioned and non-partitioned tables

Hi all
My DB is 11.1

I find that the collection of statistics on partitioned tables are really slow.
TABLE_NAME                       NUM_ROWS     BLOCKS SAMPLE_SIZE LAST_ANALYZED PARTITIONED COMPRESSION
------------------------------ ---------- ---------- ----------- ------------- ----------- -----------
O_FCT_BP1                        112123170     843140    11212317 8/30/2011 3:5            NO                    DISABLED
LEON_123456                      112096060     521984    11209606 8/30/2011 4:2           NO                   ENABLED
O_FCT                           115170000     486556      115170 8/29/2011 6:3            YES         

SQL> SELECT COUNT(*)  FROM user_tab_subpartitions
  2  WHERE table_name =O_FCT'
  3  ;

  COUNT(*)
----------
       112
I used the following script:
BEGIN
  DBMS_STATS.GATHER_TABLE_STATS(ownname          => user,
                                tabname          => O_FCT',
                                method_opt       => 'for all columns size auto',
                                degree           => 4,
                                estimate_percent =>10,
                                granularity      => 'ALL',
                                cascade          => false);
END;
/
It costs 2 minutes for the first two tables to gather statistics respectively, but more than 10 minutes for the partitioned table.
Time of collection of statistics represents a large part of the time of the whole lot.
Most of the work of the lot are at full load, which case all partitions and subpartitions will be affected and we cannot collect just specified partitions.

Does anyone have experiences on this subject? Thank you very much.

Best regards
Leon

Published by: user12064076 on August 30, 2011 01:45

Hi Leon

Why don't collect you statistics to the partition level? If your data partitions will not change after a day (score range date for ex), you can simply do to the partition level

GRANULARITY-online 'SCORE' for partition level and
GRANULARITY-online 'SUBPARTITION' for subpartition level

You collect global stats whenever you can not require.

Published by: user12035575 on August 30, 2011 01:50

Tags: Database

Similar Questions

  • Script to collect some statistics on hosts and virtual machines

    I'm trying to accomplish to get the following statistics, put into a script.

    When I run this script, it must be run by "vcenter" and result the following items.

    The cluster name / number of hosts / number of computers models and virtual / assigned the total memory of all the virtual machines on the cluster (not what is actually to be in use)

    Thus, for example, in the XYZ group with 4 guests, if I have 20 MV that I have 4 GB of RAM for each virtual machine, the output should be 80 GB

    XYZ 4 20 80 GB

    I suspect that you forgot the Select at the end in order to recover the amount.

    @{N = 'CPU'; E = {}

    Notice-EEG-Id (Get-View-Id $_.) ExtensionData.Host - VM property | %{$_. VM}) - property 'Config.Hardware.NumCPU ' |

    %{$_. Config.Hardware.NumCPU} | Measure-object-sum |  Select - ExpandProperty sum}},

  • Partitioned Tables and indexes

    Hello


    I have a question on the table and index partitioning. My scenario is:

    Charge 2 mio records in table T once a month. Loaded records are added to existing records, and once loaded data is never changed.
    At some point, I want to delete the older recordings, so I intend to this partition table.

    T table looks like:
    create table t (id       number(10) not null  constraint t_pk primary key,
                    period   number(10) not null,
                    contract number(10) not null,
                    attr     number(10) not null);
    
    create unique index t_ux1 on t(contract,period);
    
    create index t_ix2 on t(period);
    My plan is to partition T over the period, and I'm trying to read through the concepts
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14220/partconc.htm#g471747


    My question is now, how to manage the indexes, the t_pk, the t_ux1 and the t_ix2. Concepts of say,

    «1. If the table partitioning column is a subset of index keys, use a local index.»

    "2. If the index is unique, use a global index. If this is the case, you are finished. »


    So, that's how I read it
    -t_pk is unique, so this should be global
    -t_ux1 of columns is a subset, unless I have misunderstood (?), which should be local
    -index t_ix2 column is the same as the partitioning column, so it must be local

    Is this right, this t_ux1 should be a local partioned index, even if the period is the second column in the index?

    If true, what will happen when a partion fell?


    I am new in this area, so please feel the comment as you wish.


    Concerning
    Peter


    BANNER
    ----------------------------------------------------------------
    Oracle Database 10 g Enterprise Edition release 10.2.0.3.0 - 64bi
    PL/SQL version 10.2.0.3.0 - Production
    CORE Production 10.2.0.3.0
    AMT for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - production
    NLSRTL Version 10.2.0.3.0 - Production

    Peter Gjelstrup wrote:

    My question is now, how to manage the indexes, the t_pk, the t_ux1 and the t_ix2. Concepts of say,

    «1. If the table partitioning column is a subset of index keys, use a local index.»

    "2. If the index is unique, use a global index. If this is the case, you are finished. »

    So, that's how I read it
    -t_pk is unique, so this should be global
    -t_ux1 of columns is a subset, unless I have misunderstood (?), which should be local
    -index t_ix2 column is the same as the partitioning column, so it must be local

    Is this right, this t_ux1 should be a local partioned index, even if the period is the second column in the index?

    A partitioned index locally can only be defined as unique if the partition key is part of the columns in the index. Imagine what the database would have to do if this is not the case: in order to verify if a newly added or updated value violates the uniqueness, it will have to travel all the partitions in a serialized operation - means that no one else could do the same thing at the same time. Since he is a killer of serious scalability in terms of locking and contention, this is not allowed.

    So: Your T_UX1 index can be defined as a unique index that is local because it contains the partition key. Although the index is not prefixed ("Prefix" means that it is divided by the left side of the columns in the index) which means that there may be access patterns where all partitions should be scanned or the optimizer cannot use a method of size of effective partition according to the way the index is reached.

    Your T_PK index cannot be set as local because it must be unique (you can not use a local non-unique index in this case), but does not contain your partition key. It must be a global index. An overall index can be partitioned as well (different from the underlying table) but it doesn't have to be.

    Depends on how you access your data you have not T_IX2 index when partitioning by this key because it corresponds to the partition key and therefore could not actually be used by the mechanism of partition pruning that limit your query to the scores of individuals.

    If you have more than one MAS environment where running queries are used longer, you should be fine with the index the in general (because they could be analyzed in parallel in parallel operations), but if you have an OLTP environment, then you should avoid local no prefix indexes due to the potential problem that you need to analyze all partitions.

    Be borne in mind that with partitioning adds an important layer of complexity to other areas: in particular the options available to the optimizer and analyze cost optimizer statistics. Depends on how you access your statistical data must be maintained on several levels now (level of score and at the global level, in the case of subpartitioning may be still at this level). If your data is important and you rely on "global" level statistics (these are always the case when the optimizer at the time analysis cannot limit access to a single partition) then in the pre - 11 g databases analyze these "global" level statistics can take a lot of time and resources, since actually , you need data several times (once for the partition and even global level).

    Presenting this partitioning may mean other potential problems in terms of execution that change (not for the better sometimes) plans and how to effectively collect statistics. Note that g 11 addresses the issue of 'statistics' by introducing the so-called "extra" global statistics. Greg Rahn wrote a [blog note | http://structureddata.org/2008/07/16/oracle-11g-incremental-global-statistics-on-partitioned-tables/] on this nice feature.

    >

    If true, what will happen when a partion fell?

    Since you're already on 10g, you can specify the database to update the scores of the local index using the UPDATE of the INDEX clause, while 9i could maintain only an overall index and it is up to you to rebuild the local index partitions after the partition DDL on the table (according to the DDL operation).

    Kind regards
    Randolf

    Oracle related blog stuff:
    http://Oracle-Randolf.blogspot.com/

    SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676 /.
    http://sourceforge.NET/projects/SQLT-pp/

    Published by: Randolf Geist on Sep 30, 2008 16:39

    Added statistics / optimizer warning when you use the partitioning

  • 11g auto States meet on partitioned tables

    Ive looked at notes

    Collecting statistics on partitioned Table 10g and 11g (Doc ID 1417133.1()

    and

    Database RAC DataGaurd and APPS: DBMS_STATS enhancements in Oracle Database 11g

    11.2.0.2

    Ive just noticed that automatic statistics maintenance night window collect works at the level of the table, but not on the scores of partitioned tables (stats white poster) still a global stats meet at the end of week doesn't work.   If someone looked before can you specify

    I need set at the database level so that a change will result in that all my partitioned tables get analyses during the race every night.  IM guess incremental = true.

    Or a level table, it looks like additional dbms_stats.set_prefs = true will work according to the above.  ID rather self-employment prepare tho so I did not do it at the table level.

    How can I change nightly differential work = true if that's what is necessary?

    Thank you.

    ignore this.  We had a bug that disabled our auto stats every night gather running works now.

    I opened a call, asides stats collection not... the real answer to my question (which Im sure some of you knew anyway) is that the incremental stats every night together stats if (score > 10% Rassi) and overall stats are collected if (total variations in all partitions stale > 10%)...

    If the stats are gathered first at the partition level and based on these changes that the overall statistics are developed.

  • Scans of partition take longer than a full table on a non-partitioned table scan?

    Hello

    I have a PART_TABLE range partitioned table that has 10 million documents and 10 partitions having 1 million records each. Partition is based on a column named ID, which is a sequence of 1 to 10 million.

    I created another P2_BKP table (do a select * from part_table) which has the same group of data than that of PART_TABLE, except that this table is not partitioned.

    Now, I run the same query on the tables to get a range of data. Precisely, I'm reading only the data present in 5 partitions of the partitioned tables that requires theoretically less reading than when done on non partitioned tables.

    Yet the query seems to take more time on a table that is partitioned only when running on a non-partitioned table. No reason precisely why is this the case?

    Here's the query I am trying to run on the tables and their Plans to explain corresponding.

    ASK A

    =========

    Select * from P2_BKP where id < 5000000;

    ----------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

    ----------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |        |  6573K |   720 M | 12152 (2) | 00:02:26 |

    |*  1 |  TABLE ACCESS FULL | P2_BKP |  6573K |   720 M | 12152 (2) | 00:02:26 |

    ----------------------------------------------------------------------------

    QUERY B

    ========

    Select * from part_table where id < 5000000;

    -------------------------------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

    -------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |            |  3983K |   436 M | 22181 (73) | 00:04:27 |       |       |

    |   1.  RANGE OF PARTITION ITERATOR.            |  3983K |   436 M | 22181 (73) | 00:04:27 |     1.     5.

    |*  2 |   TABLE ACCESS FULL | PART_TABLE |  3983K |   436 M | 22181 (73) | 00:04:27 |     1.     5.

    -------------------------------------------------------------------------------------------------------

    016f62a3-35cf-4f4e-B812-95774e4d662f wrote:

    Now, I run the same query on the tables to get a range of data. Precisely, I'm reading only the data present in 5 partitions of the partitioned tables that requires theoretically less reading than when done on non partitioned tables.

    Yet the query seems to take more time on a table that is partitioned only when running on a non-partitioned table. No reason precisely why is this the case?

    Have you actually run the queries, or you assume that they will take different amounts of time because the execution plans show different numbers?

    It is clear from the output of the execution plan that the statistics are not very good, since Oracle should have estimated about 5 M of lines for each request. That said, however, Oracle should have used the counties of partition block level to estimate the cost of the analysis of the 5 score - and we could expect them to a total of less space than a full copy.

    Of course, it is possible that your partitioned table has been the subject of many DML involving the line movement and line of chaining; It is possible he has been the subject of many lots of parallel or direct path loads inserts leaving much free space in each partition. It is also possible that you have created the copy in a tablespace that table of default compression!

    What are the stats for the original table partition level?   (select nom_partition, num_rows, blocks of user_tab_partitions where table_name = 'T1' partition_position order)

    Concerning

    Jonathan Lewis

  • A slower loading into partitioned table as the non partitioned table - why?

    Hello

    Using oracle 11.2.0.3.

    Have a large fact table and do some comparative tests on the loading of large amounts of data histroical (several hundred GB) in fact range partitioned to date table.

    Although I understand if use exhange partition loading may be faster to load a partitioned table, trying to figure out why a standard sql insert takes 3 x long to load a table partitioned compared to an identical table but not partitioned. Identical EVERYHING in terms of columsn and the sql that the insert and second partitioned sql execution to
    ensure caching with no impact.

    Local partitioned table a partitioned bitmap index as compared to the non-partitioned table that has standardnon-partioned bitmap indexes.

    Any ideas/thoughts?

    Thank you

    One would expect that the queries that cannot no partition pruning may be slowed down, Yes.

    An easy way to see this is to imagine that you have a partitioned local index b-tree and a query that needs to scan all partitions of the index to find a handful of lines that interest you (of course, this is not likely to be exactly what you see probably but we hope informative of the source of the problem). Let's say that each partition of the index has a height of 3, so for each partition, Oracle has read 3 blocks to reach the correct terminal node. So to analyze each of the N index partitions, you need block index 3 * N bed. If the index is not partitioned, perhaps the height of the index would go up to 4 or 5 If, in that case not partitioned, you must read 4 or 5 blocks. If you have hundreds or thousands of partitions, it can easily be hundreds of times more work to analyze all the index partitions individual he would to analyze one unpartitioned index.

    Partitioning is not a magical option "go faster". It is a compromise - you optimize certain operations (such as those that can partition pruning) at the expense of operations that do not partition size.

    Justin

  • Is it possible to copy a table partitioned to another different partitioned table statistics?

    Hello

    Using oracle 11.2.0.3 and study the possibility to copy his stats of a hash range partitioned table to another partitioned table range-hash.

    New table is based on the old table with the same structure, about right. of lines.

    estimate_percent auto not practical sample - size took 10 hours in tests and careful to just down for example 1% percent estimate.

    Is it possible to simply copy the stats on our old table

    Thank you

    Mismatch / typo in statid?

    statid-online "CURRENT_STATS."

    statid => ' CURRENT_STATUS

  • Assistance button works do not (= does ' t start VAIO Care Rescue) after having lost and recover the partition table / MBR

    Hello

    For some reason that I lost my patition table but I was able to get it back and I'm rewriting MBR. I'll be back all my partition and files contain the VAIO recovery partition except files on the operating system partition ("C:\ »). It's an unformatted partition. VAIO Care rescue didn't work so I had to format "C:\". "and reinstall windows 7 and now all is good.

    I have VAIO Care Rescue. I think that it is enough to change the partition table / MBR. What exactly is the problem and is it possible to fix the problem of button Assist?


    And if one removes all xxxx (include VAIO Recovery) and creates new ones, is it possible, software or image of the recovery restore partition and Assist button start VAIO Care Rescue?

    My laptop model: VPCEA25FG

    Thank you

    You can restore your computer back to factory with all the pre program and software installed by using recovery discs. For further assistance, please recommend contacting Sony's Support Center in your area at http://www.sony-asia.com/support/product/VPCEA25FGfor your model of Asia-Pacific computer. Thank you.

    If my post answered your question, please mark it as "accept as a Solution.

  • Conversion of non partitioned in partitioned table


    Hi gurus,

    I need to convert the partition table not in the partition.  More flexible way is to use the DBMS_REDEFINITION package for this.
    I do not have access to run this package, when I asked the EXECUTE permission for my dev
    CUSTOMER rejected suggestion that
    "DBMS_REDEFINITION is a method very slow migration that has never been used before here for these migrations.
    so I do not recommend using it as it can trigger bugs and unexpected side effects.


    is this true?

    What will be the alternative method, I can go away?

    Please suggest

    S

    I don't think DBMS_REDEFINITION has bugs.  However, you (and the client) should be familiar with the steps involved.

    Other that that, you will need to create a partitioned table and insert data to the existing table.  You can speed up integration through parallel direct-path insert.

    You will also need to build indexes on the new (partitioned) table.  Define constraints if necessary.  Run grants to other patterns, if necessary.

    Hemant K Collette

  • How to find the partitioned tables and the number of sheets in each table

    Hello friends,

    I have a scheme called ICS_OWNER where I partitioned and tables not partitoined.

    I want to list all the tables that are partitioned.

    and also

    I want to know what partitions exists in every partitioned table.

    with respective schema specified

    Thank you/Kumar

    When you have questions like this, you don't ask here.
    but you take your (or should I say 'your') keyboard
    and type
    Select *.
    dict
    where table_name like ' % PART %.
    /

    All the dictionary views are listed in the DICT.

    ----------
    Sybrand Bakker
    Senior Oracle DBA

  • Update of the partition table and update rank with php.

    Hello

    I have a partition table on my site which is

    Scores: id - userid - ranking - points-

    Get points for doing things while using the site users. Points are updated, but I don't know how

    to update this user's position by comparing everyone elses points and rank numbers update

    based on the users with most points in php.

    Hope you can help. Thank you

    Weird, the link I provided is not what I wanted; It seems very different and is difficult to read. Anyway, you don't mention what goes wrong with the code you provided. I also don't think that you want to prepend rank alias with the table name 'notes' because it is not a table column. I do not use MySQL, but I think you want to use ' @' for your SQL local variables, so something like:

    $sqlgo = mysql_query ("SET @rank = 0; SELECT @rank: = @ row + 1 rank Users.id, Users.username, Users.profilepic, Scores.scoreid, Scores.userid, Scores.level, Scores.points, rank, Scores.badges OF Scores INNER JOIN users ON Scores.userid = Users.id ORDER BY invoking DESC LIMIT 30 ");

  • import a table that is partitioned into non partitioned table?

    Hello

    RDBMS 10 g

    It's my scenario:
    I took an export datapump of a schema containing partitioned tables.

    Now, I'm supposed to import this schema in another data base were partitioning option is not installed, so it must be converted to a table somehow unique bunch.

    What are my options to achieve this without having to install partitioning... ?

    Thank you!

    Extract the ddl, create the tables (not cut) at the front, and then import data only (or table_exists_action = add).

    Nicolas.

  • Partitioning and Clustering of Table

    I just inherited a table with 10 million discs. Data can be grouped against a key, every key with usually around 10-200 lines.

    Given against this key gets dragged over a large period of time. The separate keys in this table at present are ~.7 million.

    All our access to this table is based on this key. As you can image data are scattered in several blocks, so there is considerable I/O and it takes a long time for all queries to run. Ours can be described as instance Reporting however inserts and updates this table up-to-date produce 24/7 and access to the system is 24/7.

    My question is threefold

    Should I create a cluster from the unique table on that table with my key as the cluster column?

    Partitioning coexist with clusters?

    Other strategies exist to optimize in this case?

    Thanks in advance

    Daniel

    If each key corresponds to 10-200 lines, however, and it is a regular b-tree on the key index, the fact that there are millions of rows in the table should be (mostly) not relevant - Oracle will get 10-200 ROWID of the index and 10-200 one-piece extractions. This should be pretty quick, so I'd be interested in why you think that this distribution is causing significant delays in reporting instance.

    Are you a license for partitioning (it's an extra cost option on top of your enterprise edition license)? If you are partitioning table would seem reasonable. A cluster of the unique table or a table in index also seems to be reasonable. Cluster table, however, will slow down inserts and updates. However, you cannot partition a table cluster.

    Justin

  • With respect to the analysis and collection of statistics

    Hello

    Why the collection of statistics is necessary in the DB?

    Thank you

    Hello Balmo-Oracle

    You can start reading this document for example: Managing optimizer statistics

    or this: http://www.oracle.com/technetwork/database/bi-datawarehousing/twp-optimizer-stats-concepts-110711-1354477.pdf

    The best way if you check yourself in google.

    Best regards, David

  • Statisctis for the partition table

    I want to collect statistics for a partition of the table (say part1) instead of gathering statistics for the entire partition table. Is this possible and if yes how can I do this.
    Experts entered are highly appreciated.
    DB version: 9.2.0.6
    Thank you all...

    Yes it is possible using the partname parameter:

    exec dbms_stats.gather_table_stats (-online 'owner' ownname, tabname => partname-online 'partname', 'table');

Maybe you are looking for

  • Cannot connect to Game Center after updating iOS 10

    I know that in the update it delete the Game Center app (which personally I didn't really like that) but now when I try to play a game involving the Game Center, it said something like if please connect to Game Center or unable to connect to Game Cen

  • Disk utility OSX not letting u/c partition names

    I recently changed the HARD drive on my Macbook Pro to a crucial SSD 1 TB.  At the time I thought that the HARD drive was faulty so used the Mac online recovery to reinstall the original OSX (Mountain Lion).  When I appointed the SSD partition it onl

  • Photosmart 5520 all-in-one printer

    I have had this printer for about a year.  No problem whatsoever first. Recently, when I try and print a document, print a page entirely and the second page island in the part, then it stops.  Then sometimes it pushes on a white sheet.   Print queue

  • My HP 5650 printer does not print

    My HP Deskjet 5650 does not print documents today. He says it's printing ' the power light is on, and printer produced noises every once in a while, so I think that the cable is OK. I use Windows Vista. Toshiba Satellite A135-S4407, OS 4.0 GB 32-bit,

  • Map Microsoft 6 to 4

    6 to 4 adapter #39 installation is not Microsoft