Sunday, February 4, 2024

Explain plan concepts cardinality & selectivity

Cardinality is the estimated number of rows the step will return. cost is the estimated amount of work the plan will do. A higher cardinality => you're going to fetch more rows => you're going to do more work => the query will take longer. Thus the cost is (usually) higher

Selectivity  = No. of rows returning from the query / total no of rows 

i.e. Selectivity = (select * from table where rownum<40) / select * from table 

Cardinality = total no of rows * Selectivity 

 

No comments:

Post a Comment

opatchauto

# Log in as root su - root # Execute opatchauto against the unzipped patch directory /u01/app/19.0.0/ grid /OPatch/opatchauto apply /tmp/pat...