At 09:43 AM 8/15/2006, Randy Paries wrote:
On 8/15/06, mos <[EMAIL PROTECTED]> wrote:
At 09:24 AM 8/15/2006, you wrote:
>Dan
>
>thanks for the help
>so i will remove the redundant keys
>below is the explain plans
>but here is the weird part.
>I exported the database and imported into a testDB to play with and
>the query that was giving me grief in the previous message returned
>immediately
>
>Thanks
>Randy

Randy,
         Then it could have been index corruption. You could do a back up
of the table  and then run a Repair Table on it (or MyISAMChk) and then
Optimize it.
See http://dev.mysql.com/doc/refman/5.0/en/repair.html

Mike


Mike

Thanks for the help,

I will try that this evening.

Is there some sort of maintenance i should be running on this db
routinely to help this?

Some people will routinely do a Repair Table every time MySQL starts up just in case MySQL was shut down inappropriately. This could be a bit anal if you ask me, but it seems to work for them. There is a quick repair that does a quick test of the table(s).

http://mysql.com/doc/refman/5.0/en/table-maintenance.html

If you do a lot of deletes from the table then you will need to OPTIMIZE the table to remove the holes. If you want to just rebalance the index trees then use ANALYZE TABLE (shouldn't be necessary if you just did an Optimize Table).

Keep in mind if you are dealing with large tables, > 10 million rows, then you may need to change your My.Cnf (or my.ini) file to allocate more RAM to key_buffer_size because rebuilding indexes will need quite a bit of RAM. On my larger tables (60 million rows) it took 24+ hours to rebuild the index. After getting 3gb more RAM and incrementing key_buffer_size=1500M, the keys were rebuilt in 40 minutes or so.

http://www.databasejournal.com/features/mysql/article.php/3367871

Hope this helps.

Mike



Thanks

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to