I’m trying to work out how many pages would be required If I was to index carID on the following table.
employeeID | name | carID
1 | John | null
2 | Jack | 52
3 | Rob | 42
and so on…
If each page was able to hold, say, 100 record pointers and the table had 3000 rows. Then I know if there were no null values then there would be:
(3000/ 100) = 30 pages of leaf nodes. So 31 pages total to index carID.
However, I’m unsure what happens if there are null values. Surely you don’t need to index them? If there were only 1000 cars in the car table lets say (so 2000 null values were present). Would the index of carID require (1000/100) = 10 pages?
Thanks
NULLvalues do not get indexed.As far as exactly how many pages are needed, it depends on the specific database you’re using and probably database settings.