Bluehost.com Web Hosting $6.95

Does a MySql database get padded out?

This is a discussion on Does a MySql database get padded out? within the MySQL Database forums, part of the Database Forums category; Hi all, I'm designing a database for use in a program, and I am worried about the size ramifications. ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-24-2007
trashman.horlicks@btinternet.com
 
Posts: n/a
Default Does a MySql database get padded out?

Hi all,
I'm designing a database for use in a program, and I am worried about
the size ramifications. Basically, I'd like to store text in one of the
database columns; this text will typically be ~a few thousand bytes,
but could conceivably be a few million. If I was to declare the type of
this column as MEDIUM TEXT, this would be big enough to allow for all
sizes of character strings.
However, if I only have a few entries at first that are a few thousand
characters, would the unused space in the cell be padded out to fill it
up to MEDIUM TEXT size? And would it do this if I had 2 records of a
thousand characters, and one of size MEDIUM TEXT?

TIA

Paul

Reply With Quote
  #2 (permalink)  
Old 01-24-2007
Jerry Stuckle
 
Posts: n/a
Default Re: Does a MySql database get padded out?

trashman.horlicks@btinternet.com wrote:
> Hi all,
> I'm designing a database for use in a program, and I am worried about
> the size ramifications. Basically, I'd like to store text in one of the
> database columns; this text will typically be ~a few thousand bytes,
> but could conceivably be a few million. If I was to declare the type of
> this column as MEDIUM TEXT, this would be big enough to allow for all
> sizes of character strings.
> However, if I only have a few entries at first that are a few thousand
> characters, would the unused space in the cell be padded out to fill it
> up to MEDIUM TEXT size? And would it do this if I had 2 records of a
> thousand characters, and one of size MEDIUM TEXT?
>
> TIA
>
> Paul
>


Paul,

The data will take only as much space as is required.

The only problem you can run into is when you update a row with new text
which is larger. In that case the old row will be marked invalid and a
new row written. So when the table starts taking up too much space you
will want to compress it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
  #3 (permalink)  
Old 01-24-2007
trashman.horlicks@btinternet.com
 
Posts: n/a
Default Re: Does a MySql database get padded out?



On 24 Jan, 17:03, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> trashman.horli...@btinternet.com wrote:
> > Hi all,
> > I'm designing a database for use in a program, and I am worried about
> > the size ramifications. Basically, I'd like to store text in one of the
> > database columns; this text will typically be ~a few thousand bytes,
> > but could conceivably be a few million. If I was to declare the type of
> > this column as MEDIUM TEXT, this would be big enough to allow for all
> > sizes of character strings.
> > However, if I only have a few entries at first that are a few thousand
> > characters, would the unused space in the cell be padded out to fill it
> > up to MEDIUM TEXT size? And would it do this if I had 2 records of a
> > thousand characters, and one of size MEDIUM TEXT?

>
> > TIA

>
> > PaulPaul,

>
> The data will take only as much space as is required.
>
> The only problem you can run into is when you update a row with new text
> which is larger. In that case the old row will be marked invalid and a
> new row written. So when the table starts taking up too much space you
> will want to compress it.


Thanks!
So, using a simple example, if I have a table with
1 xxxxxxx 2 3 4

with the maximum size of the second cell being (say) 10 and I want to
update it with yyyyyyyyyyy (or 11 characters, so there is an overflow)
will I get
1 yyyyyyyyyy 2 3 4
2 y ? ? ?

TIA

Paul

Reply With Quote
  #4 (permalink)  
Old 01-24-2007
Jerry Stuckle
 
Posts: n/a
Default Re: Does a MySql database get padded out?

trashman.horlicks@btinternet.com wrote:
>
> On 24 Jan, 17:03, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> trashman.horli...@btinternet.com wrote:
>>> Hi all,
>>> I'm designing a database for use in a program, and I am worried about
>>> the size ramifications. Basically, I'd like to store text in one of the
>>> database columns; this text will typically be ~a few thousand bytes,
>>> but could conceivably be a few million. If I was to declare the type of
>>> this column as MEDIUM TEXT, this would be big enough to allow for all
>>> sizes of character strings.
>>> However, if I only have a few entries at first that are a few thousand
>>> characters, would the unused space in the cell be padded out to fill it
>>> up to MEDIUM TEXT size? And would it do this if I had 2 records of a
>>> thousand characters, and one of size MEDIUM TEXT?
>>> TIA
>>> PaulPaul,

>> The data will take only as much space as is required.
>>
>> The only problem you can run into is when you update a row with new text
>> which is larger. In that case the old row will be marked invalid and a
>> new row written. So when the table starts taking up too much space you
>> will want to compress it.

>
> Thanks!
> So, using a simple example, if I have a table with
> 1 xxxxxxx 2 3 4
>
> with the maximum size of the second cell being (say) 10 and I want to
> update it with yyyyyyyyyyy (or 11 characters, so there is an overflow)
> will I get
> 1 yyyyyyyyyy 2 3 4
> 2 y ? ? ?
>
> TIA
>
> Paul
>


No, the original row will get marked completely invalid and the new row
will be added at the end of the table. The old location of the row is
now available for reallocation when another row comes along.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 03:22 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0