|
Posted by Simon Hayes on 09/27/02 11:16
"Pablo Wolfus" <pwolfus@gmail.com> wrote in message
news:1116526548.511905.314760@g43g2000cwa.googlegroups.com...
>I need to bulk insert very large amount of data into several MSSQL
> tables.
> The first Data model definition used identities to mantain relationship
> between those tables but we found that natural keys (compound) are
> better for
> bulk insert (there is no need to obtain the identity first)
>
> My question is, changing the identities to natural keys (in some tables
> in
> order of 4, 5 attributes) will enlarge my database storage?
>
> I think MSSQL implements relationships with pointers (or hashcodes), so
> the
> storage size will be similar, right?
>
> Regards,
>
It probably depends on where you have your indexes, and particularly your
clustered index. If it used to be on the artificial key but is now on the
natural key, then it will be bigger - the table data is still in the leaf
level, but the size of the non-leaf levels will have increased. Of course,
if you remove the existing IDENTITY columns, then you'll save some space
there (4 bytes per row, assuming it's integer type, plus the index). But you
seem to be saying that you've made this change already, so presumably you
can just check the table sizes directly?
Even if the table size does increase noticeably, since disks are so cheap
compared to other system components, it's worth using more space if it gives
you a cleaner data model and better performance.
Simon
Navigation:
[Reply to this message]
|