Jump to content

How Many columns is too many in a database


Claudia M

Recommended Posts

Hi,

I've added some columns to my inventory database and have a total of 73.  Many of them are CubeCart core and not used. Ex. the dimensions and all that go with it, and the upn,ean,jan etc.... I've commented out the code for them in the admin/skins/product file.  On the columns I've added I've used. Is this ok? Thanks in advance for any and all responses

Type:  varchar (30)  SEE EACH

collaltion: ut8_unicode_ci

Null:  no

Default:  none

Attributes:  Blank

Link to comment
Share on other sites

Depending how many items are in CubeCart_inventory, a KEY (INDEX) for each new column may prove useful, especially if you want to find a given value, or to sort on it.

You might also find MySQL complain of a non-null column not having a default value to use. This will then require you to make very sure a data value is supplied for this column when INSERTing a new record. The database engine can be configured to ignore this condition, but you may not have the ability to make that configuration.

I do not know what is meant by Attributes.

Link to comment
Share on other sites

Attributes is the column next to collation in Cpanel with a drop down of binary,unsigned,unsigned-zerofill,and on update CURRENT_Timestamp. When you click change on a column

" You might also find MySQL complain of a non-null column not having a default value to use. This will then require you to make very sure a data value is supplied for this column when INSERTing a new record. " - Not ALL products will have data in every column. For ex. if an item doesn't come in a box, box_size will not have data. So should I mark null yes or no?

" You might also find MySQL complain of a non-null column not having a default value to use. This will then require you to make very sure a data value is supplied for this column when INSERTing a new record. "  Here's some of mine

252916449_Captureinventorystructure.thumb.PNG.0d46d48f6a4aed8edb517cbdbe090536.PNG

 

" Depending how many items are in CubeCart_inventory, a KEY (INDEX) for each new column may prove useful, especially if you want to find a given value, or to sort on it."

This is what I have:

1231027849_Capturekeyindexinventorytable.thumb.PNG.b633a1fc3e70b063498f86fb7fd5beec.PNG

Link to comment
Share on other sites

If some of the columns will be empty, then allow those columns to hold a null value. The NULL column in the table above should say Yes.

The new columns suggest they will be informational only, that is, info to be used to guide outside processes, as opposed to searching or sorting on them. In that case, you may not need to have indexes on them.

Link to comment
Share on other sites

Thanks Brian, I'll get on that ASAP

When you say some of the columns will be empty do you mean the columns I will never use that are stock with CubeCart or the example from above about if the item doesn't come in a box  it won't use the box_size column?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...