I have a mysql DB which has 32 mill rows…myisam tables and mysql version is 4.0.20.
The table in which i have 32 mill rows is minmax table where we store info of all attributes the schema is given below.
“RESID” integer not null,
“DURATION” integer not null,
“ATTRIBUTEID” integer not null,
PRIMARY KEY (“ARCHIVEDTIME”,“RESID”,“DURATION”,“ATTRIBUTEID”)
Now we decided to split this 32 mill rows and put in new tables according to attribute id column. for that i use
insert into newTable select * from minmax where attributeid =708
.but this query takes too much time …for tis particular attributeid 708 there are 5002047 rows.Also in minmax table attributeid column is indexed.
HOW do i improve the performance of the splitting the table
Thanks n advance