473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

SQL server 7 physical storage

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,

Jul 23 '05 #1
3 1321

"Pablo Wolfus" <pw*****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.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
Jul 23 '05 #2
First of all, thanks for your quick response.

I am at design phase now, so i can't test the impact of this changes.
The modification i'm trying to apply is to the design data model
specification.

I didn´t understand what you meant with "the table data is still in
the leaf level". 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.

If the answer is true, what is the sense that those columns data are
duplicated?

Regards,

Jul 23 '05 #3
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
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Cherrish Vaidiyan | last post by:
Hello, Thank you for replying to my previous doubts. I have a query regarding Shared Storage. Here is my strategy. I have two system with 20 GB HDD running on Windows 2000 Server and an...
2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
1
by: David Fitzjarrell | last post by:
omlet@omlet.org wrote in message news:<dc6c1ff0.0406300739.5001ae2a@posting.google.com>... > fitzjarrell@cox.net (David Fitzjarrell) wrote in message...
0
by: chris6995 | last post by:
I'm looking for a way to programatically query for the association between a physical device (i.e. removable USB storage) and it's logical drive letter. I've gone through Win32_LogicalDisk,...
0
by: Cindy B | last post by:
Please send your resume and position to Cindy@AtlanticResource.com! I CAN NOT accept candidates that ARE OUTSIDE OF THE US! NO PHONE CALLS PLEASE! Email your resume to me! Position:SQL...
0
by: tiacux | last post by:
Tech Associates is recruiting for: A SQL Server Database Systems Administrator for Jacksonville, Florida. Salary to $75,000. Description The Database Systems Administrator's role is to...
2
by: gdabbara | last post by:
Hi, We have a situation where we want to move our current database server to a different hardware and rename the server. If we change the Physical server name, do we have to go thru the whole...
4
by: Prince Kumar | last post by:
I joined a company recently and they have a java program which hangs (does nothing) after a while. This is no way consistent. It could succeed quite a few times and can fail a few other times....
0
by: lknight643 | last post by:
I have an asp.net application that works with a SQL server database on server No. 1 but I want to upload files for storage to Server No. 2 that is accessible only from the Internet. If the file...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.