BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

harddisk space SQL fields

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Hans
Guest





PostPosted: Tue May 01, 2007 8:50 pm    Post subject: harddisk space SQL fields Reply with quote



What consumes more diskspace in a SQL database:
empty nchar or empty nvarchar fields?

Hans
Back to top
Craig Stuntz [TeamB]
Guest





PostPosted: Tue May 01, 2007 9:36 pm    Post subject: Re: harddisk space SQL fields Reply with quote



Depends on the DB. However, the difference will be small on *any* DB.
Since HDDs go for something like $0.50/GB these days, if you have to
ask this question, you likely have other problems.

What problem are you trying to solve?

--
Craig Stuntz [TeamB] · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Want to help make Delphi and InterBase better? Use QC!
http://qc.borland.com -- Vote for important issues
Back to top
Andrew V. Fionik
Guest





PostPosted: Tue May 01, 2007 11:18 pm    Post subject: Re: harddisk space SQL fields Reply with quote



Hello, Hans!
You wrote on Tue, 1 May 2007 17:50:05 +0200:

H> What consumes more diskspace in a SQL database:
H> empty nchar or empty nvarchar fields?

It depends from database you use and in some cases from order of fields in
the table (see Oracle) and other storage parameters.

---
Andrew V. Fionik. SQL Maestro Group, http://www.sqlmaestro.com
Database administration, management and development tools for
Oracle, MS SQL Server, PostgreSQL, Firebird, MySQL, MaxDB, SQLite.
Back to top
Oliver Townshend
Guest





PostPosted: Wed May 02, 2007 3:24 am    Post subject: Re: harddisk space SQL fields Reply with quote

Quote:
What consumes more diskspace in a SQL database:
empty nchar or empty nvarchar fields?

empty nchar.

Oliver Townshend
Back to top
Marc Rohloff [TeamB]
Guest





PostPosted: Wed May 02, 2007 3:54 am    Post subject: Re: harddisk space SQL fields Reply with quote

On Tue, 1 May 2007 17:50:05 +0200, Hans wrote:

Quote:
What consumes more diskspace in a SQL database:
empty nchar or empty nvarchar fields?

Generally nvarchar takes less space unless you are comparing nchar(1)
to nvarchar(1) in which case the opposite is true.

--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com
Back to top
Andrew V. Fionik
Guest





PostPosted: Wed May 02, 2007 8:11 am    Post subject: Re: harddisk space SQL fields Reply with quote

Hello, Hans!
You wrote on Wed, 2 May 2007 07:43:03 +0200:

H> Hans
H> We are running an SQL database with a table with 250 columns.
H> There will be 50.000 to 100.000 records in that database, so
H> that's why we are looking for the best and fastest way to do this.

250 columns sounds too much for a table. 10..20, maybe 50 is acceptable, but
250!!! It looks like someone trying to place all data in one plain table.
What about normalization? Usually such "wide" tables is sign of lack of
normalization.

Even if you really (i highly doubt in this) need a row with 250 fields you
can determine what group(s) of fields most likely will be filled with NULL
values and move them to separate table(s) connecting it(them) with main
table through one-to-one relationship.

---
Andrew V. Fionik. SQL Maestro Group, http://www.sqlmaestro.com
Database administration, management and development tools for
Oracle, MS SQL Server, PostgreSQL, Firebird, MySQL, MaxDB, SQLite.
Back to top
Craig
Guest





PostPosted: Wed May 02, 2007 8:11 am    Post subject: Re: harddisk space SQL fields Reply with quote

Quote:
We are running an SQL database with a table with 250 columns. There will be
50.000 to 100.000 records in that database, so that's why we are looking
for the best and fastest way to do this.

Hans

Like Craig said HDD space is so cheap these days it is not even
something worth worrying about. 50-100k records would not be considered
a very large DB anyway and wouldn't be more than 1GB max I would think
unless you are storing lots of BLOBs in there. I would have to question
the 250 columns though. As soon as I read that I think of 'code smell'.
http://en.wikipedia.org/wiki/Code_smell

Craig 2
Back to top
Hans
Guest





PostPosted: Wed May 02, 2007 8:11 am    Post subject: Re: harddisk space SQL fields Reply with quote

We are running an SQL database with a table with 250 columns. There will be
50.000 to 100.000 records in that database, so that's why we are looking
for the best and fastest way to do this.

Hans

"Craig Stuntz [TeamB]" <craig_stuntz (AT) nospam (DOT) please [a.k.a. acm.org]> schreef
in bericht news:46376c91$1 (AT) newsgroups (DOT) borland.com...
Quote:
Depends on the DB. However, the difference will be small on *any* DB.
Since HDDs go for something like $0.50/GB these days, if you have to
ask this question, you likely have other problems.

What problem are you trying to solve?

--
Craig Stuntz [TeamB] · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Want to help make Delphi and InterBase better? Use QC!
http://qc.borland.com -- Vote for important issues
Back to top
Craig Stuntz [TeamB]
Guest





PostPosted: Wed May 02, 2007 5:54 pm    Post subject: Re: harddisk space SQL fields Reply with quote

Andrew V. Fionik wrote:

Quote:
250 columns sounds too much for a table. 10..20, maybe 50 is
acceptable, but 250!!! It looks like someone trying to place all data
in one plain table. What about normalization? Usually such "wide"
tables is sign of lack of normalization.

The only reason I'd even consider a table so wide would be precisely
because it was denormalized; e.g., a data warehouse. Now that's a
legitimate design in some cases, but should you build such a thing you
should not care about saving a few MB of HDD space.

--
Craig Stuntz [TeamB] · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Everything You Need to Know About InterBase Character Sets:
http://blogs.teamb.com/craigstuntz/articles/403.aspx
Back to top
Andrew V. Fionik
Guest





PostPosted: Wed May 02, 2007 8:51 pm    Post subject: Re: harddisk space SQL fields Reply with quote

Hello, Craig!
You wrote on 2 May 2007 05:54:24 -0700:

??>> 250 columns sounds too much for a table. 10..20, maybe 50 is
??>> acceptable, but 250!!! It looks like someone trying to place all data
??>> in one plain table. What about normalization? Usually such "wide"
??>> tables is sign of lack of normalization.

CST> The only reason I'd even consider a table so wide would be precisely
CST> because it was denormalized; e.g., a data warehouse. Now that's a
CST> legitimate design in some cases, but should you build such a thing you
CST> should not care about saving a few MB of HDD space.

100% agreed. However from initial letter it is unclear was the table
denormalized or it is just bad design.

---
Andrew V. Fionik. SQL Maestro Group, http://www.sqlmaestro.com
Database administration, management and development tools for
Oracle, MS SQL Server, PostgreSQL, Firebird, MySQL, MaxDB, SQLite.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.