----- Original Message ----- 
From: "Jeremy Zawodny" <[EMAIL PROTECTED]>
> On Wed, May 30, 2001 at 11:32:16PM -0400, Michael Villalba wrote:
> >
> > I have a rather large MyISAM table (~230 million rows) running under
> > MySQL 3.23.30.  It has 10 columns and 3 indices.  The data and index
> > files each occupy about 10GB.
> > 
> > My problem is that sorting the rows using myisamchk --sort-records
> > takes an extremely long time.  The last sort took 95 hours (that's
> > right...almost four days).
> > 
> > The machine is a four-processor Sun E450 with 4GB of memory.
> > The OS is Solaris 2.7.  The database files reside on a 12-disk
> > SCSI RAID 5 array.  The machine was essentially idle with the
> > exception of the sort job.
> > 
> > The previous time I ran myisamchk --sort-records, the table
> > had ~170 million rows, and it only took 12 hours.
> > 
> > The specific command I used in both cases was:
> > myisamchk -O sort_buffer_size=1024M -O key_buffer_size=1024M 
> > -O read_buffer_size=64M -O write_buffer_size=64M --sort-records=2
> > 
> > 95 hours to sort and reindex 10 GB of data does not seem
> > reasonable.  Anyone have any idea what's going on here?
> 
> Off the top of my head, I'd suggest increasing the size of the read
> and write buffers.
> 
> If you run vmstat (or something similar) when the sort is going on, do
> you see lots of CPU use, lots of I/O, both, neither? You won't get
> much help from the other 3 CPUs, but you should be able to get a lot
> done with 4GB of RAM.

Thanks Jeremy.  Next time I'll increase the sizes of the read and
write buffers, but I'm still curious why a 35% increase in data would
result in 8 times the execution time.

The only thing I did differently between the 12 hour run and the 
4-day run was that for the latter I did not sort the index tree
blocks first (myisamchk --sort-index).  Do you think that would
make a difference?

During the latest run I monitored mpstat.  The processor that the
myisamchk process happened to be on always had a low idle time, but
user time was only ~20% and system time was ~10%.  Wait time was of
course the balance.

Michael


Reply via email to