title: Creating partitions locks the table?
body: <p>I have a couple of big tables (from 60M rows to 2Bi rows) to create some partitions on it, as they are used in the core of our platform we are trying to find out if when we start to create the partitions in the production environment the database will generate any kind of lock on those tables?</p>
  
  <p>We are on MariaDB 10.0.24 and 10.1.34.</p>
  
  <pre class="lang-sql prettyprint-override"><code>ALTER TABLE data_history PARTITION BY RANGE ( period ) (
      PARTITION past VALUES LESS THAN (201801),
      PARTITION p2018 VALUES LESS THAN (201901),
      PARTITION p2019 VALUES LESS THAN (202001),
      PARTITION p2020 VALUES LESS THAN (202101),
      PARTITION future VALUES LESS THAN MAXVALUE
      );
  </code></pre>
  
  <p><code>period</code> column is an integer field that goes with year+month (YYYYMM) format.</p>