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

Enable OpenSSH on Windows 11

Step 1: Install OpenSSH Server You can do this via PowerShell (run as Administrator ): Check if it's already available: Get-WindowsCapab...