List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:August 29 1999 7:48am
Subject:Re: Sorting large numbers of records
View as plain text  
On Fri, 1999-08-27 16:29:33 -0400, Kelly Yancey wrote:
>   So there are 2 questions here (finally :) )...
> 	1. Is there another way that I am missing to run isamchk
>          without killing mysqld?
[...]
> I really appreciate the help, and I really appreciate the time to
> read all of this :)

Well, I'm really happy to notice if somebody has done profound
research before asking a question (and that's my impression here :-).
So many others pour simple questions into the mailing list, that
easily could have been answered within 5 minutes browsing through the
MySQL Reference manual ...

Here's an untested idea for your question (1):
  You could make copies of the database files (very fast)
  and run isamchk on these copies.
  After the physical sorting of the copies has been done,
  move them back overwriting the actual database files.

  For data consistency this probably has to look like that
  for a given table "tbl":

  a) LOCK TABLES tbl READ;
     FLUSH TABLES;
     now copy the db files tbl.*
     /* _no_ UNLOCK TABLES here */

  b) isamchk <on copies>

  c) LOCK TABLES tbl WRITE;
     FLUSH TABLES;
     move reorganized copies back in place
     FLUSH TABLES;
     UNLOCK TABLES;

I've been away for a week (mountain hiking in the Dolomites) and are
just catching up with all the list mail, so I don't know if there are
already clear facts on when FLUSH TABLES might make trouble and when
it does work properly, but maybe the scheme above is a possibility for
you ...?

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
Sorting large numbers of recordsKelly Yancey27 Aug
  • Re: Sorting large numbers of recordsMartin Ramsch29 Aug
  • Sorting large numbers of recordsMichael Widenius29 Aug
    • RE: Sorting large numbers of recordsKelly Yancey31 Aug
      • Re: Sorting large numbers of recordsJames Manning31 Aug
        • RE: Sorting large numbers of recordsKelly Yancey1 Sep
          • Re: Sorting large numbers of recordsScott Hess1 Sep
            • Re: Sorting large numbers of recordsMichael Widenius1 Sep