Link to home
Start Free TrialLog in
Avatar of Jasmin shahrzad
Jasmin shahrzad

asked on

Oracle statistik

How to check the statistic is bad.  can i have a formula with cardinality and cost?
Avatar of Geert G
Geert G
Flag of Belgium image

statistics are never bad, they can only be out of date

there is no real formula ... it depends what you are doing

first check user_tables (or dba_tables) in column last_analyzed
if that date is very old then gather stats

exec dbms_stats.gather_table_stats  ...
http://docs.oracle.com/database/121/ARPLS/d_stats.htm#ARPLS68582

it's also possible the optimizer doesn't have enough information to find a good plan
or is checking too much conditions
ASKER CERTIFIED SOLUTION
Avatar of Alex [***Alex140181***]
Alex [***Alex140181***]
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
bad ... evil ... good ... ugly
they made a lot of films about those words

the stats are correct a certain point in time
out of date after a certain time

change the data back and your stats are "good" again :)