MySQL : InnoDB : RAM
Ben Osborne

Ben Osborne @mrbenosborne

Location:
London, UK
Joined:
Sep 17, 2018

MySQL : InnoDB : RAM

Publish Date: Nov 10 '18
5 5

Are InnoDB tables held in RAM even if they are not frequently queried or at all?

How does MySQL work out which table to hold in memory etc?

For example, if I had 5 tables and all 5 were InnoDB, I query only two of the five tables, will the other three tables still be held in memory?

Comments 5 total

  • Nurbol Alpysbayev
    Nurbol AlpysbayevNov 10, 2018

    Why do you think they are held in memory? They are not. MySQL stores data on disk. However, there is an in-memory mode, but it is off by default. However, if you enable it, the WHOLE DB will constantly will live in memory, i.e. if it has 3GB of data, you will have 3GB of RAM taken for that. That is from my experience.

    • Ben Osborne
      Ben OsborneNov 11, 2018

      Basically I have a 40gb table which is not accessed frequently however, I only have 10gb left of RAM, which made me think that it was holding that table.

      Total server RAM is 61GB, AWS Aurora.

      • Nurbol Alpysbayev
        Nurbol AlpysbayevNov 11, 2018

        Dian Fay may be correct about buffer pool. But I don't think it can take 50 Gb of RAM. Can it be your application that extracts data from DB and holds it in memory? I bet it is, especially if it is not Node.js or PHP app, but persistent daemon-like e.g. Java app.

  • Dian Fay
    Dian FayNov 11, 2018

    You want to read about the buffer pool.

    • Ben Osborne
      Ben OsborneNov 11, 2018

      Thanks Dian,

      I did but I still don’t understand fully.

Add comment