MySql, how can I export indexes from my development database to my production database?

前端 未结 6 756
南方客
南方客 2020-12-11 00:59

I\'ve been working on my development database and have tweaked its performance.

However, to my surprise I can\'t find a way to export the indexes to my production da

6条回答
  •  感动是毒
    2020-12-11 01:35

    I believe you're trying to export the indexes themselves and not just the code to regenerate them in production, right? (I'm assuming this because the load of generating these indexes is not favorable in most production environments.)

    The mysqldump utility is useful if performance isn't your main concern, and I use it all the time. If you're looking for a very fast method, though, I would suggest copying the actual InnoDB files from one cold database to the other (assuming they're exactly the same MySQL version with the exactly the same configuration and the exactly the same expected behavior, etc). This method is dangerous if there any differences between the systems.

    It sounds like, in your situation, you might want to copy your good data to your testing environment first. My development cycle typically follows this approach: DDL flows from testing to production via programming, and DML flows from production to testing via actual use of the system.

提交回复
热议问题