Pablo Wolfus (pw*****@gmail.com) writes:
I didn´t understand what you meant with "the table data is still in
the leaf level".
Simon was talking about a clustered index. In a clustered index, the
data is in the leaf level of the index.
I know there will be a slight growth if i use natural
keys (due to references) but i need to measure this growth, that is, i
need to know if -fisically- the FK consisting of several data columns
(resident in another master table) is stored in both tables.
Yes, they are.
If the answer is true, what is the sense that those columns data are
duplicated?
That is a question that can lead into an answer of quite a philosophical
nature. But I let it suffice to point out two things:
1) Simplicity. Having each table in a space of its own, makes the design
of the storeage engine considerably simpler. And that pays back to
users with improved performance and stability.
2) Conserving space is not all. Sometimes, using more space can improve
performance. Consider:
SELECT * FROM tbl_with_many_foriegn_keys
Assumed that SQL Server did not duplicate the FK columns in this
table. Then this query would have to access the data pages of
the referred tables, and this could be very costly.
As for the design question, using artificial keys for relations can
sometimes be useful when the number of columns gets difficult to manage.
But adding an artificial key can also make queries much more complex.
The space consumption is only one aspect of it all. Ease of development
and performance are others.
--
Erland Sommarskog, SQL Server MVP,
es****@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp