0

I recently altered a table in MySQL 8.0 to with new Primary key and created partitions with them to improve the query performance. which worked fine in main instance. My assumption was that the Partitions and primary key will get transferred to the read replica as well. But It didn’t. even the table structure in the read replica shows the old primary key. will there any significant delay in getting this transferred?

5
  • That's naughty. In non-cloud replication, ALTER statements are replicated. Did you type ALTER TABLE ...? Or do it some other way? Was there a way to say "do this only on the Primary"?
    – Rick James
    Feb 24, 2021 at 21:51
  • Yeah. I did with Alter statement
    – Azar
    Feb 25, 2021 at 22:20
  • If you actually saw any performance improvement, please show us the CREATE TABLE before and after the addition of partitions. It is a common misconception that partitioning can magically add performance better than indexing. I have found only 4 cases for that. Maybe you have a 5th for me??
    – Rick James
    Feb 27, 2021 at 1:01
  • After more than dozens of the experimenting, found the partitions had skew of data depended on the values I was using which was causing the performance impairment and i had to select the right partition category to equally weigh the partitions. that did the trick.
    – Azar
    Apr 5, 2021 at 11:27
  • Please provide more details on your schema, query, and solution. That will help others with similar problems.
    – Rick James
    Apr 5, 2021 at 15:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.