Professional Web Applications Themes

Does a MySql database get padded out? - MySQL

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 ...

  1. #1

    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

    trashman.horlicks@btinternet.com Guest

  2. #2

    Default Re: Does a MySql database get padded out?

    com wrote: 

    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.
    net
    ==================
    Jerry Guest

  3. #3

    Default Re: Does a MySql database get padded out?



    On 24 Jan, 17:03, Jerry Stuckle <net> wrote: 


    >
    > 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.[/ref]

    Thanks!
    So, using a simple example, if I have a table with
    1 x 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

    trashman.horlicks@btinternet.com Guest

  4. #4

    Default Re: Does a MySql database get padded out?

    com wrote: 
    >> 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.[/ref]
    >
    > Thanks!
    > So, using a simple example, if I have a table with
    > 1 x 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
    >[/ref]

    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.
    net
    ==================
    Jerry Guest

Similar Threads

  1. MySQL Database not retrieving the full database
    By geetha.veeraiah@gmail.com in forum MySQL
    Replies: 4
    Last Post: July 21st, 09:34 PM
  2. CF MX 6 -- automatically padded integer with decimals?
    By gmu in forum Macromedia ColdFusion
    Replies: 1
    Last Post: June 29th, 06:02 PM
  3. Padded position in Consensus sequence
    By Jayaprakash Rudraraju in forum PERL Miscellaneous
    Replies: 0
    Last Post: August 14th, 06:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139