Unix Technical Forum

Too many columns for table

This is a discussion on Too many columns for table within the MySQL forums, part of the Database Server Software category; --> Hi, I have a difficult problem. When I try to create a table I getting an error message "1117: ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:22 AM
Matthias Braun
 
Posts: n/a
Default Too many columns for table

Hi,

I have a difficult problem. When I try to create a table I getting an
error message "1117: too many columns". Well, the table have more than
1300 columns, according to

http://dev.mysql.com/doc/refman/5.1/...trictions.html

there is a limit for InnoDB (and probably also MyISAM) tables of 1000
columns. Problem - I can't split the table because in that case I have
to restructure my whole framework. Anybody know's a solution? Probably
another Storage engine?

Thanks,

Matthias
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 11:22 AM
strawberry
 
Posts: n/a
Default Re: Too many columns for table

On 6 Aug, 16:16, Matthias Braun <mat_br...@web.de> wrote:
> Hi,
>
> I have a difficult problem. When I try to create a table I getting an
> error message "1117: too many columns". Well, the table have more than
> 1300 columns, according to
>
> http://dev.mysql.com/doc/refman/5.1/...trictions.html
>
> there is a limit for InnoDB (and probably also MyISAM) tables of 1000
> columns. Problem - I can't split the table because in that case I have
> to restructure my whole framework. Anybody know's a solution? Probably
> another Storage engine?
>
> Thanks,
>
> Matthias


You must have a legitimate reason, but you've got to wonder at the
need for 1300 columns.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 11:22 AM
Peter H. Coffin
 
Posts: n/a
Default Re: Too many columns for table

On Mon, 06 Aug 2007 17:16:07 +0200, Matthias Braun wrote:
> Hi,
>
> I have a difficult problem. When I try to create a table I getting an
> error message "1117: too many columns". Well, the table have more than
> 1300 columns, according to
>
> http://dev.mysql.com/doc/refman/5.1/...trictions.html
>
> there is a limit for InnoDB (and probably also MyISAM) tables of 1000
> columns.


The documentation doesn't mention a limit, and a bit of digging shows
that the number of columns a table has is stored in the MyISAM .myi file
in four bytes. That kind of hints that two wasn't big enough. (The
number of blobs, for contrast, is stored in two bytes.)

> Problem - I can't split the table because in that case I have
> to restructure my whole framework. Anybody know's a solution? Probably
> another Storage engine?


Honestly, if you're getting to the point where you have rows even
numbering in the hundreds, much less thousands, you probably ought to be
rethinking the design anyway, Is this some kind of QUALITY_867 kind of
deal that might be better addressed pivoted around vertically and then
joined in?

--
6. I will not gloat over my enemies' predicament before killing them.
--Peter Anspach's list of things to do as an Evil Overlord
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 11:23 AM
Matthias Braun
 
Posts: n/a
Default Re: Too many columns for table

Hi Peter,

could you explain how this pivot and pivoted around vertically works?

All,

the table structure is already normalized. The huge structure is for a
telecommunication switch producing for each 15 minutes exact 1300 data
sets per logical node. So splitting tables means getting rid of
normalization.

Matthias

Peter H. Coffin schrieb:
> On Mon, 06 Aug 2007 17:16:07 +0200, Matthias Braun wrote:
>> Hi,
>>
>> I have a difficult problem. When I try to create a table I getting an
>> error message "1117: too many columns". Well, the table have more than
>> 1300 columns, according to
>>
>> http://dev.mysql.com/doc/refman/5.1/...trictions.html
>>
>> there is a limit for InnoDB (and probably also MyISAM) tables of 1000
>> columns.

>
> The documentation doesn't mention a limit, and a bit of digging shows
> that the number of columns a table has is stored in the MyISAM .myi file
> in four bytes. That kind of hints that two wasn't big enough. (The
> number of blobs, for contrast, is stored in two bytes.)
>
>> Problem - I can't split the table because in that case I have
>> to restructure my whole framework. Anybody know's a solution? Probably
>> another Storage engine?

>
> Honestly, if you're getting to the point where you have rows even
> numbering in the hundreds, much less thousands, you probably ought to be
> rethinking the design anyway, Is this some kind of QUALITY_867 kind of
> deal that might be better addressed pivoted around vertically and then
> joined in?
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 11:23 AM
Dennis
 
Posts: n/a
Default Re: Too many columns for table

On Mon, 06 Aug 2007 18:52:43 +0200, Matthias Braun <mat_braun@web.de>
wrote:

>All,
>
>the table structure is already normalized. The huge structure is for a
>telecommunication switch producing for each 15 minutes exact 1300 data
>sets per logical node. So splitting tables means getting rid of
>normalization.
>
>Matthias


Instead of:

tblNode
-------
tblNode_Id (unique primary key - ex: 1234)
tblNode_DataSet_0001 (ex: "98.6")
....
tblNode_DataSet_1300

Try:

tblNode
-------
tblNode_Id (unique primary key - ex: 1234)

tblDataSet
----------
tblDataSet_Id (unique primary key - ex: 9876)
tblDataSet_tblNode_Id (ex: 1234) *
tblDataSet_Name (ex: 0001) *
tblDataSet_Value (ex: "98.6")

* 2nd and 3rd columns together make a unique secondary key

--

Dennis
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-28-2008, 11:23 AM
Peter H. Coffin
 
Posts: n/a
Default Re: Too many columns for table

On Mon, 06 Aug 2007 13:44:23 -0400, Dennis wrote:
> On Mon, 06 Aug 2007 18:52:43 +0200, Matthias Braun <mat_braun@web.de>
> wrote:
>
>>All,
>>
>>the table structure is already normalized. The huge structure is for a
>>telecommunication switch producing for each 15 minutes exact 1300 data
>>sets per logical node. So splitting tables means getting rid of
>>normalization.
>>
>>Matthias

>
> Instead of:
>
> tblNode
> -------
> tblNode_Id (unique primary key - ex: 1234)
> tblNode_DataSet_0001 (ex: "98.6")
> ...
> tblNode_DataSet_1300
>
> Try:
>
> tblNode
> -------
> tblNode_Id (unique primary key - ex: 1234)
>
> tblDataSet
> ----------
> tblDataSet_Id (unique primary key - ex: 9876)
> tblDataSet_tblNode_Id (ex: 1234) *
> tblDataSet_Name (ex: 0001) *
> tblDataSet_Value (ex: "98.6")
>
> * 2nd and 3rd columns together make a unique secondary key


Bingo. That's it exactly.

--
6. I will not gloat over my enemies' predicament before killing them.
--Peter Anspach's list of things to do as an Evil Overlord
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:47 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com