title: What is a tablespace and why is it used?
body: <p>While investigating an issue, I came across this error:</p>
  
  <blockquote>
    <p>30503 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_index_stats uses space ID: 2 at filepath: ./mysql/innodb_index_stats.ibd. Cannot open tablespace Mydb/be_command_log which uses space ID: 2 at filepath: ./Mydb/be_command_log.ibd</p>
  </blockquote>
  
  <p>After reading a bit about this issue, I came to know that this is <a href="https://bugs.mysql.com/bug.php?id=68267" rel="noreferrer">a known issue of MySQL</a>.</p>
  
  <p>But my problem is that I don't know much about how tablespaces really work. How are they useful? I read <a href="https://en.wikipedia.org/wiki/Tablespace" rel="noreferrer">this definition</a>, but it does not give all the information.</p>
  
  <p>Can someone share some detailed information about <strong>what are tablespaces and how do they work?</strong></p>