I'm using MySQL instance for read only operations (data migration to another DB).
I'm reading several dozens of millions rows from one table using limited portions of data (100 000 rows) using select SQL_NO_CACHE * from TABLE
.
After each read portion MySQL consumes about 50-100 MB of RAM, and doesn't free memory.
I have no idea, why it does consumes memory as I read data with SQL_NO_CACHE
parameter.
At least after several iterations of reading all memory becomes eaten and server starts dropping incoming connections.
So my question is: how to avoid this constant memory consuming for read-only usage?
UPD If it matters, it is AWS RDS instance of MySQL