Oracle Database / SQL Performance & Memory
Check optimizer statistics for the actual table and partition
An optimizer can estimate poorly when statistics no longer represent the data. Inspect relevant table and partition statistics before gathering everything.
Environment and inputs: Oracle Database 19c baseline · SQL*Plus-compatible SQL unless RMAN, DGMGRL, ADRCI or a host shell is specified. Check release, patch level, edition and container first.
Start with this diagnostic
Use the stated SQL, RMAN, DGMGRL or host shell and replace sample names with approved targets. DBA and V$ views need authorized catalog access in the correct container. Do not grant broad privileges for an example.
SELECT owner, table_name, partition_name, num_rows, last_analyzed, stale_stats FROM dba_tab_statistics WHERE owner = 'APP_OWNER' AND table_name = 'APP_ORDERS';
Read the result
NUM_ROWS reflects statistics, not a live row count. STALE_STATS and LAST_ANALYZED need interpretation with modifications, partitioning and statistics preferences.
Resolve and verify
Compare the affected plan with data changes and statistics history. Plan a targeted approved statistics collection and validate critical statements afterward.
Operational precautions
Statistics collection consumes resources and can change plans. Do not gather schema-wide statistics during an incident without impact assessment.