Re: Gather table stats without partition stats

From: Moustafa Ahmed <moustafa_dba_at_hotmail.com>
Date: Fri, 18 Jun 2021 16:30:50 +0000
Message-ID: <BN6PR06MB27852FCE394D38C63FD79B5EE10D9_at_BN6PR06MB2785.namprd06.prod.outlook.com>


Stefan

> Anyway partition statistics are used only in case of partition pruning to one single partition (and when the partition is known at hard parsing / optimization time).

So do you agree that we do not need partition stats? What is sensation for 2nd case partition known at hard arse time ?

>
> 2) I guess what you are looking for is DBMS_STATS.GATHER_TABLE_STATS(granularity => 'GLOBAL') - you can also set it as default on table level.
I did that but it is still gather stats for partition what do you think could be the reason ?

> On Jun 18, 2021, at 1:00 AM, Stefan Koehler <contact_at_soocs.de> wrote:
>
> Hello Moustafa,
>
> 1) Maybe you are referring to this one "Statistics at the subpartition level are gathered and stored by the database, but note that synopses are created at the partition level only. This means that if the statistics for a subpartition become stale due to data changes, then the statistics (and synopsis) for the parent partition will be refreshed by examining all of its subpartitions. The database only regathers subpartition-level statistics on subpartitions that are stale." - https://blogs.oracle.com/optimizer/efficient-statistics-maintenance-for-partitioned-tables-using-incremental-statistics-part-1 - but not quite sure as this talks about subpartitions
>
> Anyway partition statistics are used only in case of partition pruning to one single partition (and when the partition is known at hard parsing / optimization time).
>
> 2) I guess what you are looking for is DBMS_STATS.GATHER_TABLE_STATS(granularity => 'GLOBAL') - you can also set it as default on table level.
>
> Best Regards
> Stefan Koehler
>
> Independent Oracle performance consultant and researcher
> Website: http://www.soocs.de
> Twitter: _at_OracleSK
>

>> Moustafa Ahmed <moustafa_dba_at_hotmail.com> hat am 17.06.2021 20:22 geschrieben:
>> 
>> Listers
>> 
>> 1-on 19c I believe I read before that not gathering partition statics is much safer specially since 12c and we should be enough with table stats..
>> Is that true?
>> 
>> 2-how can we ignite gathering partition stats for a table?
>> 
>> Thank you!--
>> http://www.freelists.org/webpage/oracle-l

†Ûiÿü0ÁúÞzX¬¶Ê+ƒün– {ú+iÉ^ Received on Fri Jun 18 2021 - 18:30:50 CEST

Original text of this message