title: Create a MySQL index on already existing table with a lot of data
body: <p>I have a Spring Boot service with a MySQL database (AWS RDS).</p>
  <p>There is a specific table, that contains around 2 millions of rows, and some queries on it make the CPU go up to the database instance.</p>
  <p>I noticed that there isn't an index on the used column so I would like to try to add this index.</p>
  <p>The questions are:</p>
  <ul>
  <li>Can I add (without any problems) this index on this table that
  already contains a lot of rows? I'm using Flyway to manage the db
  migrations.</li>
  <li>The specific column contains strings, are there some
  other index configurations that It's better to use for this scenario?</li>
  </ul>
  <p>Some additional infos:</p>
  <ul>
  <li><p>MySQL version is <code>5.7.33</code>;</p>
  </li>
  <li><p>The table, at the moment, does not contain any other relationships;</p>
  </li>
  <li><p>The table is very simple and it's reported below:</p>
  <p>CREATE TABLE IF NOT EXISTS <code>info</code>(</p>
  <p><code>field_1</code> varchar(36) NOT NULL,</p>
  <p><code>field_2</code> text DEFAULT NULL,</p>
  <p><code>my_key</code> varchar(36) DEFAULT NULL,</p>
  <p><code>field_3</code> varchar( 255) DEFAULT NULL,</p>
  <p><code>field_4</code> varchar(10) DEFAULT NULL,</p>
  <p><code>field_4</code> varchar(10) DEFAULT NULL,</p>
  <p><code>field_6</code> varchar(10) DEFAULT NULL,</p>
  <p><code>field_7</code> varchar(36)NOT NULL,</p>
  <p><code>creation_date</code> datetime DEFAULT NULL,</p>
  <p><code>modification_date</code> datetime DEFAULT NULL,</p>
  <p>PRIMARY KEY (<code>field_1</code>)</p>
  <p>) ENGINE=InnoDB DEFAULT CHARSET=utf8;</p>
  </li>
  <li><p>The table contains now around <strong>2 millions</strong> of rows;</p>
  </li>
  <li><p>The query is something like:</p>
  <p>SELECT * FROM info WHERE my_key = &quot;xxxx&quot;</p>
  <p>and it will be executed a lot of times</p>
  </li>
  </ul>
  <p>The idea is to create this index:</p>
  <pre><code>CREATE INDEX my_key ON info (my_key);
  </code></pre>