is it wasted of space

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
rami
Forum Contributor
Posts: 217
Joined: Thu Sep 15, 2005 8:55 am

is it wasted of space

Post by rami »

Suppose i make field for image name varvhar 25 in database
then if user submit image its ok
but if user doesnt submits photo is that image field take any space or is that waste of space.
Does it effect in performance?

i mean does the blank filed effect in perfomance or consume space...
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

it certainly consumes space, but not that much space to bother IMHO.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

From the trusty manual: "VARCHAR values are stored using only as many characters as are needed, plus one byte to record the length (two bytes for columns that are declared with a length longer than 255)." Shouldn't represent much of a performance issue, but it would be better not to insert blank rows into the database if you can avoid it.
rami
Forum Contributor
Posts: 217
Joined: Thu Sep 15, 2005 8:55 am

Post by rami »

well i cannot means some people will have image but other wont have
or they dont want but i should give them option...
but i dont know how many will upload image so i was bother about either keeping it or not
thanks for answers
Post Reply