slow / server crash when adding a column to a big table
am 30.03.2006 04:12:29 von Bennett HaseltonI have a table with about 100,000 records whose description is:
+-----------------------+----------------------+------+----- +---------+----------------+
| Field | Type | Null | Key | Default |
Extra |
+-----------------------+----------------------+------+----- +---------+----------------+
| ID | int(10) unsigned | | PRI | NULL |
auto_increment |
| url | varchar(255) | YES | MUL | NULL |
|
| how_found | varchar(255) | YES | | NULL |
|
| use_for_parser | smallint(5) unsigned | YES | | 1
| |
| checked_by_parser | smallint(5) unsigned | YES | MUL | NULL
| |
| monitored | smallint(5) unsigned | YES | MUL | NULL |
|
| date_found | datetime | YES | | NULL |
|
+-----------------------+----------------------+------+----- +---------+----------------+
I tried adding a column with the command:
alter table url add column use_for_aol_mail smallint unsigned default 1
after checked_by_parser;
This caused the command prompt to hang and apparently crashed the Web
server which then had to be rebooted. Is there anything special to
keep in mind about adding columns to such a large table?