473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

slow / server crash when adding a column to a big table

I 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?

Mar 30 '06 #1
1 3153
be*****@peacefire.org wrote:
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?


Any ALTER TABLE statement causes MySQL to "rebuild" the table. That is,
it creates a new table according to the schema changes you specified,
copies all data to a new table, then removes the old version of the table.

This can take a while if the table is populated with many rows, and it
requires additional disk space temporarily. It could also cause a lot
of resource usage (I/O, CPU, memory) that competes with the activity of
other services.

I would expect it to cause some slowness on the system, but I'd be
surprised if it caused a crash of any kind, unless your server is
severely undersized.

Regards,
Bill K.
Mar 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Xiao Li | last post by:
I have an application written in ASP. It only uses JavaScript (.js) on client side. If the browser is accessing the web site through fast connections, like intranet or broadband, everything is...
4
by: Edward | last post by:
Access 2k -> SQL Server 2k My client has an app that is A2k FE with A2k BE. They have asked me to move the BE to SQL Server. I have a bit of experience with SQL Server, and I'm happy with...
2
by: Benoit Le Goff | last post by:
Hello. I test some query on sql server 2000 (sp2 on OS windows 2000) and i want to know why a simple query like this : select * from Table Where Column like '%value' is more slow on 2000 than...
4
by: M Wells | last post by:
Hi All, I have a table that currently contains approx. 8 million records. I'm running a SELECT query against this table that in some circumstances is either very quick (ie results returned in...
2
by: Rod | last post by:
I have a dataset which originally came from an Access table. I then add a column using code to the table in the dataset and fill it with data. (About 1000 records) . The column is not in the...
1
by: Programmer | last post by:
Hi All Here is my problem I'm using a SQLDataAdapter and DataSet I use the method FillSchema(myDataset, SchemaType.Source) The problem is that when i Check the default Values of the Dataset...
2
by: William Cleveland | last post by:
I'm working on a system right now where I have a database (two, actually, but one is discarded halfway through), but it's created and used as part of a process (reporting), rather than as the...
9
by: billmiami2 | last post by:
I was playing around with the new SQL 2005 CLR functionality and remembered this discussion that I had with Erland Sommarskog concerning performance of scalar UDFs some time ago (See "Calling...
13
by: eighthman11 | last post by:
using Access 2003 and sql server version 8.0 Hey everyone. Created a text box where the user types in an Inventory number and it takes them to that inventory number on the contimuous form. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.