#1054 (ok 3.4) Faster way to move tables



It currently looks like phpMyAdmin uses a Create table statement, and then inserts data using a sub select on the table. (Method found in Operations tab of a table) A much faster way would be to use "RENAME TABLE" provided by MySQL. It is Exponentially faster in comparison to the old method:

A 2.1 GB table (~2,500,000 rows)

phpMyAdmin way:
Took upwards of 28 minutes to do

MySQL's Rename Table way:
Your SQL query has been executed successfully (Query took 0.0103 sec)



  • Marc Delisle

    Marc Delisle - 2007-11-15

    Logged In: YES
    Originator: NO

    From our comments in the code:

    FIXME: use RENAME for move operations
    * - would work only if the databases are on the same filesystem,
    * how can we check that? try the operation and
    * catch an error?
    * - for views, only if MYSQL > 50013
    * - still have to handle pmadb synch.

  • Michal Čihař

    Michal Čihař - 2010-01-20
    • assigned_to: nobody --> nijel
  • Michal Čihař

    Michal Čihař - 2010-01-21

    Implemented in SVN, thanks for suggestion.

  • Michal Čihař

    Michal Čihař - 2010-01-21
    • priority: 5 --> 1
    • summary: Faster way to move tables --> (ok 3.4) Faster way to move tables
    • status: open --> open-fixed
  • Michal Čihař

    Michal Čihař - 2011-05-11
    • status: open-fixed --> closed-fixed
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks