Upload
amol-patil
View
217
Download
0
Embed Size (px)
Citation preview
8/8/2019 Overcome Mysql 4gb Limitations
http://slidepdf.com/reader/full/overcome-mysql-4gb-limitations 1/3
8/8/2019 Overcome Mysql 4gb Limitations
http://slidepdf.com/reader/full/overcome-mysql-4gb-limitations 2/3
| Field | Type | Null | Key | Default |Extra |+-----------+--------------+------+-----+------------+-------+| city | varchar(100) | | MUL | |
|| high_temp | tinyint(4) | | | 0 ||| low_temp | tinyint(4) | | | 0 ||| the_date | date | | | 0000-00-00 ||+-----------+--------------+------+-----+------------+-------+4 rows in set (0.01 sec)
To find its size limit, we'll use SHOW TABLE STATUS
mysql> show table status like 'weather' \G*************************** 1. row***************************
Name: weatherType: MyISAM
Row_format: DynamicRows: 0
Avg_row_length: 0Data_length: 0
Max_data_length: 4294967295Index_length: 1024
Data_free: 0Auto_increment: NULL
Create_time: 2003-03-03 00:43:43Update_time: 2003-03-03 00:43:43Check_time: 2003-06-14 15:11:21
Create_options:
Comment:1 row in set (0.00 sec)
There it is. Notice that Max_data_length is 4GB. Let's fix that.
mysql> alter table weather max_rows = 200000000000avg_row_length = 50;
8/8/2019 Overcome Mysql 4gb Limitations
http://slidepdf.com/reader/full/overcome-mysql-4gb-limitations 3/3
Query OK, 0 rows affected (0.03 sec)Records: 0 Duplicates: 0 Warnings: 0
mysql> show table status like 'weather' \G*************************** 1. row
***************************Name: weatherType: MyISAM
Row_format: DynamicRows: 0
Avg_row_length: 0Data_length: 0
Max_data_length: 1099511627775Index_length: 1024
Data_free: 0
Auto_increment: NULLCreate_time: 2003-06-17 13:12:49Update_time: 2003-06-17 13:12:49Check_time: NULL
Create_options: max_rows=4294967295 avg_row_length=50Comment:
1 row in set (0.00 sec)
Excellent. Now MySQL will let us store a lot more data in that table.
Too Many Rows?
Now, the astute reader will notice the Create_options specify a limit of 4.2 billion rows. That's
right, there's still a limit, but now it's a limit on number of rows, not the size of the table. Even if
you have a table with rows that are 10 times as large, you're still limited to roughly 4.2 billion
rows.
Why?
Again, this is 32-bit hardware. If you move to a 64-bit system, the limit is raised accordingly.