Hi,

On Feb 19, 2008 5:20 PM, Mike Spreitzer <[EMAIL PROTECTED]> wrote:
> I am new to MySQL, and wonder if I have done something terribly stupid.  I
> have an InnoDB table with 27 million rows.  Without thinking very much, I
> issued the following command through the GUI administration tool:
>
> ALTER TABLE `wyky`.`externallinks` ADD COLUMN `el_p2` BLOB  NOT NULL AFTER
> `el_index`,
>  ADD INDEX `el_p2`(`el_p2`(150))
>
> Of course, all the values in this column will be the same.  The index
> will, if this ever completes, indicate that one value is associated with
> all 27E6 rows.  My primary question is, will this take O(27E6) time or
> something worse (e.g., O(27E6 squared) time)?
>
> Of course my plan is to eventually put some interesting data in that new
> column.  I do not really need the index until the data is there.
>
> This database is not being used on-line, this is just for study, so I do
> not mind large batch operations.  I just don't want to be grossly stupid
> in my choice of batch operations.
>
> My second question is: if I have indeed done something grossly stupid,
> what is the best (if there is any at all!) way to interrupt it and
> proceed.

If the table is bigger than memory, building the index will be very slow.

If you interrupt it, it's just going to roll back everything it's done
so far.  So you have the choice of either letting it finish and then
dropping the index, or killing it and letting it roll back.  (You
can't prevent the roll back, even if you restart).

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to