I have a question regarding this answer.
I also posted this question as a comment to that answer, but didn't get any response.
It states that in the case of indexing on a non-key field, the schema would be:
Field name Data type Size on disk firstName Char(50) 50 bytes (record pointer) Special 4 bytes
My question is that why is there a need to store firstName
again? Isn't the pointer enough? We'll just have to simply change the sorting comparison function to compare on (*pointer).firstName
, rather than firstName
.