List:General Discussion« Previous MessageNext Message »
From:Gaspar Bakos Date:June 10 2006 9:29pm
Subject:Re: dropping primary key - 99%CPU
View as plain text  
Hi, Dan,

RE:
> Currently mysql handles all "ALTER TABLE" commands by rebuilding the
> entire table and all indexes.

OK, so an "add index" is mapped to "alter table", and the "alter table"
rebuilds everything.

This means if I have a table with multiple indexes, it does not make
too much sense to create the indexes  separately?

For example:
alter table add index name1 (name1);
alter table add index name2 (name2);
alter table add index name3 (name3);

Instead, something like:

alter table add index name1 (name1), add index name2 (name2), \
	add index name3 (name3);

should work better.

I am dealing with a table of ~100Gb size that will be purely readonly,
and i am trying to optimize the reads by creating indexes on the
columns that are most popular in the "where" statements".

G
Thread
dropping primary key - 99%CPUGaspar Bakos10 Jun
  • Re: dropping primary key - 99%CPUDan Nelson10 Jun
    • Re: dropping primary key - 99%CPUGaspar Bakos10 Jun
      • Re: dropping primary key - 99%CPUmos11 Jun
      • Re: dropping primary key - 99%CPUebergen11 Jun