0
votes

I have a database which gets populated with results from sports events. A few days ago I realized that results are not being written down. I'm using MySQL 5.6.14 on Ubuntu Linux 64 bit.

I have tried these steps so far:

  1. Check all logs I can find. No errors in any log file.

  2. Status of the largest table:

mysql> show table status like 'results';
+---------+--------+---------+------------+---------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-------------------+----------+----------------+---------+
| Name    | Engine | Version | Row_format | Rows    | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collation         | Checksum | Create_options | Comment |
+---------+--------+---------+------------+---------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-------------------+----------+----------------+---------+
| results | InnoDB |      10 | Compact    | 1774207 |            222 |   394149888 |               0 |    218644480 |  28311552 |           NULL | 2014-07-03 21:40:39 | NULL        | NULL       | latin1_swedish_ci |     NULL |                |         |
+---------+--------+---------+------------+---------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-------------------+----------+----------------+---------+
1 row in set (0.00 sec)
  1. Number of rows for largest table:
mysql> select count(*) from results;
+----------+
| count(*) |
+----------+
|  1763471 |
+----------+
1 row in set (0.89 sec)
  1. Tried to find any limit which I exceed but have not found any.

Any ideas on what I can do?

1
What happens when you execute an insert manually?Markus Malkusch
How do the results end up in the database? For example, if it's via an HTTP request, does that request still work? If it's PHP, turn on all error reporting and see if something shows up. If nothing shows up, copy an insert query from your script and try to execute it on the database and see what happens.vrijdenker
I have tried some manual inserts. They went well. But then I tested getting results from one event. That is 470 rows. Only 100 or so got inserted. That got me to suspect there might be some limit which I have reached.Markus Johansson
what happens if you try to insert all 470 manually (or more than 100... manually == through console)? there could be a lot of causes. are there constraints on the table? are there transactions involved? mysql show table statusgloomy.penguin
I got warnings. And when I looked closer I could see that the result id was no longer an int, but a 36 byte hex string. I guess I have to do 'ALTER TABLE' now.Markus Johansson

1 Answers

0
votes

Mysql has a max size for the table files. you find it here:

Mysql

A table can contain a maximum of 1000 columns.

The InnoDB internal maximum key length is 3500 bytes, but MySQL itself restricts this to 3072 bytes. (1024 bytes for non-64-bit builds before MySQL 5.0.17, and for all builds before 5.0.15.)

An index key for a single-column index can be up to 767 bytes. The same length limit applies to any index key prefix. See Section 13.1.8, “CREATE INDEX Syntax”.

The maximum row length, except for variable-length columns (VARBINARY, VARCHAR, BLOB and TEXT), 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 BLOB and TEXT columns, must be less than 4GB.

If a row is less than half a page long, all of it is stored locally within the page. If it exceeds half a page, variable-length columns are chosen for external off-page storage until the row fits within half a page, as described in Section 14.2.10.2, “File Space Management”.

Although InnoDB supports row sizes larger than 65,535 bytes internally, MySQL itself imposes a row-size limit of 65,535 for the combined size of all columns: