Database Tuning (MOSC)

MOSC Banner

Why does dynamic sampling lead to incorrect execution plans?

edited Sep 13, 2024 9:05AM in Database Tuning (MOSC) 3 commentsAnswered

A new table is created every month to store log information, with about 200 million data per month. The table is named EVENT_USAGE_<YYYYMM>.
Example: EVENT_USAGE_202407 EVENT_USAGE_202408 EVENT_USAGE_202409 Statistics were collected for the tables in August and September, when there was no data on these tables.
It was never collected again Statistics. EVENT_USAGE_202408 query is fine in August, execution plan can use index.
The statistics for table EVENT_USAGE_202409 were deleted in August, and in September, the query for table EVENT_USAGE_202409 appeared
Because of performance problems, the execution plan is changed to full table scan (the execution plan is dynamic statistics used: dynamic sampling (level=2)).

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center