I'm running MySQL 5.7.10 in MacOS 10.11.2 on a Mac Mini with 16 GB of memory and a 1 TB SSD drive that has 160 GB free space.
There is a table with 1.2 billion records, Totaling about 400 GB in size. It's working fine for al intents and purposes, gathering data for a year. But now I need a new composite index.
Using the mysql
command-line utility:
CREATE INDEX composite_IDX USING BTREE ON db.stats (foo,bar(2),baz,quux,fum,shme);
However, whether I run it remotely, locally, locally in a screen
session, during the day, at night, or while listening to Patience by Guns n' Roses, sooner or later it will always fail:
ERROR 2013 (HY000): Lost connection to MySQL server during query
This message doesn't tell me a lot. Why can't I create this index? What can I do?
I've tried adding absurd timeouts to /etc/mysql/my.cnf
:
[mysqld]
default_password_lifetime=0
max_allowed_packet = 1G
net_read_timeout = 240
net_write_timeout = 1800
innodb_buffer_pool_size = 8G
innodb_flush_log_at_trx_commit = 2
# Add absurd timeout
wait_timeout = 172800
interactive_timeout = 172800
[mysqldump]
max_allowed_packet = 1G
But it didn't change anything. I'm basically grasping at straws here.