# mysql performance

**URL:** <https://forums.percona.com/t/mysql-performance/408>\
**Category:** Other MySQL® Questions\
**Created:** [August 8, 2007, 1:07am UTC](https://forums.percona.com/t/mysql-performance/408 "2007-08-08T01:07:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adorearun](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@adorearun](https://forums.percona.com/u/adorearun)\
**Post date:** [August 8, 2007, 1:07am UTC](https://forums.percona.com/t/mysql-performance/408/1 "2007-08-08T01:07:56Z")

</div>

Hi All,  
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.

“ARCHIVEDTIME” BIGINT,  
“RESID” integer not null,  
“DURATION” integer not null,  
“ATTRIBUTEID” integer not null,  
“MINVALUE” BIGINT,  
“MAXVALUE” BIGINT,  
“TOTAL” BIGINT,  
“TOTALCOUNT” BIGINT,  
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  
Arun

---

<div class="post-metadata">

**Author:** ![Peter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/peter/32/2_2.png) [@Peter](https://forums.percona.com/u/Peter)\
**Post date:** [August 16, 2007, 6:34am UTC](https://forums.percona.com/t/mysql-performance/408/2 "2007-08-16T06:34:12Z")

</div>

What is EXPLAIN for such SELECT query alone ?

In this case as a lot of rows match full table scan would be best (so you can use IGNORE KEY to force it)

For insert part - make sure you insert into the empty table and your myisam\_sort\_buffer\_size and myisam\_max\_sort\_file\_size are large enough.
