473,463 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

The allowed maximum number of Columns and actual data in a row - What is it?

Hi There,

SUMMARY:
I need to know what the actual maximum date limit possible on a row of
a MYSQL database.
MORE DETAILS:

For example, does a MYSQL database only allow 4032 bytes of data to be
stored in one row or is there no limit? Does it only allow a maximum
of 50 colmums?

I tried googling on this, but all the results seem to be about
recommended maximums or design style. As an ex-Access developer I
remeber hitting a limit with the Access DB which I think was that one
row could contain 2048 bytes max(things like blobs do not contribute
to this limit). I'm hoping there are no limitations with MYSQL.

My reason for asking is that I have been asked to add new fields to
someone elses DB. There are already a lot of columns and the short and
dirty fix for me which would mean minimul PHP script changes is by
adding new fields to the current table. But there are already quite a
few so thought I would check.

TIA

Kind regards

D
Jul 23 '05 #1
3 4997
Dave Crypto wrote:
I need to know what the actual maximum [data] limit possible on a row of
a MYSQL database.
I couldn't find a limit on a row size in a MyISAM table, but for InnoDB
tables:

http://dev.mysql.com/doc/mysql/en/in...trictions.html

"The maximum row length, except for BLOB and TEXT columns, is slightly
less than half of a database page. That is, the maximum row length is
about 8000 bytes. LONGBLOB and LONGTEXT columns must be less than 4GB,
and the total row length, including also BLOB and TEXT columns, must be
less than 4GB. InnoDB stores the first 512 bytes of a BLOB or TEXT
column in the row, and the rest into separate pages."

It sounds like the limit is on the total record length, not the number
of columns.
My reason for asking is that I have been asked to add new fields to
someone elses DB. There are already a lot of columns ...


How many is a lot?

Can you make a copy of the database and do some tests?

Regards,
Bill K.
Jul 23 '05 #2
Replay at bottom
I couldn't find a limit on a row size in a MyISAM table, but for InnoDB tables:

http://dev.mysql.com/doc/mysql/en/in...trictions.html

"The maximum row length, except for BLOB and TEXT columns, is slightly less than half of a database page. That is, the maximum row length is about 8000 bytes. LONGBLOB and LONGTEXT columns must be less than 4GB, and the total row length, including also BLOB and TEXT columns, must be less than 4GB. InnoDB stores the first 512 bytes of a BLOB or TEXT
column in the row, and the rest into separate pages."
How many is a lot?


Thanks for that Bill. In this case the table is going to go from aboout
32 columns to 45. There was a lack of normalisation to the DB (e.g. it
has email1, email2 and email3 fields) when I adopted it and all the php
code is based around the current structure. Not wanting to change much
of the code I'm also just extending the same table.

However, when I total up all the varchars, chars, date fields etc. that
are possible in a single row it comes to less then 8000 so I think that
means I am safe.

Hypothetical Example. (And this is how it was in Access)

Lets says I have a DB with a 1000 byte row limit.
I am able to create a table with 10 varchars with 255 size.
However If I was to write a row that contained the first four field
containting the full 255 chars (Therefore 1020) I would get an error as
it is over my 8000 byte total.

The above is what happened in my Access DB and because I did not know
about it before hand it caused a bug that took time to resovle. Wanted
to avoid the same problem with MySQL.
Any more pointers welcome.

Kind regards

Jul 23 '05 #3
Gr*************@lycos.co.uk wrote:
How many is a lot?

Thanks for that Bill. In this case the table is going to go from aboout
32 columns to 45.


I thought you might have a table with hundreds of columns, and were
doubling it or something. I agree I think you're probably safe. But on
the other hand, I always test out *any* schema change in a development
environment before I make the change in a live system.

Regards,
Bill K.
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: valexena | last post by:
What is the maximum number of tablespaces that contain data for a table containing two LOB columns? -- Posted via http://dbforums.com
6
by: John Bentley | last post by:
John Bentley writes at this level: If we think about our savings accounts then division never comes in (as far as I can see). We deposit and withdraw exact amounts most of the time. Occasionaly...
9
by: Till Crueger | last post by:
Hi, I have to implement some simple sorting algorithm. I am NOT asking for you to do my homework, but my question is rather on how to store the integers. I recall reading once in here that there...
2
by: jasperdejonge | last post by:
Does anybody know the maximum length of a record in MS-Access? I keep getting "record is too long" messages. Until now I found out (I think) that this message has nothing to do with the...
19
by: Jerry | last post by:
I am wondering what is the maximum size of memory that malloc() could handle. Is there any limitation on that? Where am I supposed to get this kind of information? Thank you everybody.
11
by: Leroy | last post by:
Hello, I have a question regarding the maximum number of parameters that can be passed to a procedure. In VB 6 the max was 60. What is the max for Dot Net? please and thanks.
3
by: ramraj | last post by:
Hello people, I might sound a little bit crazy, but is there any possibility that you can incorporate 4^15 (1,073,741,824) tables into a SQL Database? I mean, is it possible at all? There might...
29
by: garyusenet | last post by:
I'm trying to investigate the maximum size of different variable types. I'm using INT as my starting variable for exploration. I know that the maximum number that the int variable can take is:...
6
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I'm using the VScrollBar and set it as follow: m_vScrollBar.Minimum = -19602; m_vScrollBar.Maximum = 0; m_vScrollBar.SmallChange = 1; m_vScrollBar.LargeChange = 1089; m_vScrollBar.Value =...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.