Click here to Skip to main content
15,887,875 members
Home / Discussions / Database
   

Database

 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Roger Wright20-Oct-11 5:21
professionalRoger Wright20-Oct-11 5:21 
AnswerRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Chris C-B19-Oct-11 22:30
Chris C-B19-Oct-11 22:30 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Roger Wright20-Oct-11 5:27
professionalRoger Wright20-Oct-11 5:27 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Chris C-B20-Oct-11 6:01
Chris C-B20-Oct-11 6:01 
AnswerRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Eddy Vluggen20-Oct-11 2:09
professionalEddy Vluggen20-Oct-11 2:09 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Roger Wright20-Oct-11 5:28
professionalRoger Wright20-Oct-11 5:28 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Eddy Vluggen20-Oct-11 8:01
professionalEddy Vluggen20-Oct-11 8:01 
AnswerRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
jschell20-Oct-11 9:05
jschell20-Oct-11 9:05 
Roger Wright wrote:
rom a coding standpoint, a single master Transformer table is far easier to manage, and is the approach I'd prefer to follow. But if 90% of the transformers in use have 40% of their data fields set to null, will they still consume the same storage space as they would if all fields contained data?


Say you have 1000 columns for transformers and 900 of them are empty thus can be null.
Also say that a null takes one byte (could take less but one byte is possible.)
The other 100 columns take an average of 1000 bytes which is only 10 bytes per column.

So a record takes 1900 bytes and lets add 100 bytes for overhead (which is way high but makes the math easier.)

So a total of 2000 bytes per record.

TigerDirect (just an example) has an external 2 Terabyte drive for $120 and you need 3 (1 main, 1 failover, 1 backup). So $360

You will be able to store one billion transformers on that drive (one of them.)

Do you have one billion transformers?


And of course if the nulls take no space then you can store even more.
(Note that one design trick which I would suspect might not be relevant but could be is that you put null columns at the end of the table schema. Then it is more likely the database will drop them so no space.)

Roger Wright wrote:
I'll have to manage a dozen or more different tables,


Far as I am concerned you don't have a space problem. You do however have a management problem.

Now if you ONLY need to manage inventory then you should use a meta data design.

The idea in this case is simple. Following tables/columns are examples, variations, are driven by actual requirements. Following are table descriptions.
item: item_id, inventory_number, item_name
property_type: property_type_id, name, description, units
Property: property_id, item_id, property_type_id, the_value

Thus for a pad mounted 24kv transformer the data would look like the following
item: 1, 'tns001', 'big blue transformer'

property_type: 1, 'mount', 'transformer mount', null
property_type: 2, 'volts', 'volts', 'volt'

Property: 1, 1, 1, 'pad'
Property: 2, 1, 2, '24000'

There are many possible variations on the above.
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Roger Wright20-Oct-11 10:25
professionalRoger Wright20-Oct-11 10:25 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
jschell21-Oct-11 10:54
jschell21-Oct-11 10:54 
QuestionSQL Query Select Pin
reogeo200817-Oct-11 21:26
reogeo200817-Oct-11 21:26 
AnswerRe: SQL Query Select Pin
Blue_Boy17-Oct-11 22:34
Blue_Boy17-Oct-11 22:34 
GeneralRe: SQL Query Select Pin
AditSheth17-Oct-11 23:09
AditSheth17-Oct-11 23:09 
AnswerRe: SQL Query Select PinPopular
Mycroft Holmes17-Oct-11 22:53
professionalMycroft Holmes17-Oct-11 22:53 
AnswerRe: SQL Query Select Pin
Niladri_Biswas26-Oct-11 16:27
Niladri_Biswas26-Oct-11 16:27 
QuestionDB2 Commands Pin
Manivannan Dheena17-Oct-11 19:17
Manivannan Dheena17-Oct-11 19:17 
AnswerRe: DB2 Commands Pin
Manivannan Dheena17-Oct-11 23:52
Manivannan Dheena17-Oct-11 23:52 
Questionisnull in linq where condition Pin
yesu prakash13-Oct-11 20:02
yesu prakash13-Oct-11 20:02 
AnswerRe: isnull in linq where condition Pin
Johan Hakkesteegt13-Oct-11 21:37
Johan Hakkesteegt13-Oct-11 21:37 
AnswerRe: isnull in linq where condition Pin
Niladri_Biswas26-Oct-11 16:14
Niladri_Biswas26-Oct-11 16:14 
QuestionData warehouse Pin
coder199113-Oct-11 1:25
coder199113-Oct-11 1:25 
QuestionLinked Server Query Returning No Records Pin
Frank Lepkowski12-Oct-11 3:26
Frank Lepkowski12-Oct-11 3:26 
AnswerRe: Linked Server Query Returning No Records Pin
Eddy Vluggen12-Oct-11 7:35
professionalEddy Vluggen12-Oct-11 7:35 
Generalerror to mysql Pin
a2bj11-Oct-11 0:16
a2bj11-Oct-11 0:16 
GeneralRe: error to mysql PinPopular
phil.o11-Oct-11 0:56
professionalphil.o11-Oct-11 0:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.