title: MariaDB update query taking a long time
body: <p>I'm currently having some problems with our mysql replication. We're using a master-master setup for failover purposes.</p>
  
  <p>The replication itself is working and I believe thats setup right. But we're having troubles with some queries that takes a cruciating time to execute.</p>
  
  <p>Example:</p>
  
  <blockquote>
    <p>| 166 | database | Connect | 35 | updating | update <code>xx</code> set <code>xx</code> =
    'xx' where <code>xx</code> = 'xx' and <code>xx</code> = 'xx' | 0.000 |</p>
  </blockquote>
  
  <p>These update queries are taking a 20-30+ seconds sometimes to complete and because of that the replication starts lagging behind and within a day, it will be behind for a couple of hours. Strange part is that it will eventually catchup with the other master.</p>
  
  <p>The table is around ~100MM rows big and around 70GB large. On the master where the queries are executed they take less than a second.</p>
  
  <p>Both configurations, mysql and server, are near identical and we tried optimizing the table and queries, but no luck so far.</p>
  
  <p>Any recommendations we could try to solve this? Let me know if I can provide you with any more information.</p>
  
  <p>Using:</p>
  
  <p>MariaDB 10.1.35 -
  CentOS 7.5.1804</p>