I executed an INSERT IGNORE
combined with SELECT
from large table. The SELECT
took up 16GB of memory and went into SWAP before I terminated it with CTRL+C
.
INSERT IGNORE INTO sid(sid)
SELECT sid FROM data WHERE sid != "";
The data contains 64 million rows.
Data type of sid
is VARCHAR(13)
. There were 28.2M records that matched the SELECT
(I ran it afterwards). That results in around 350MB of data that needs to be SELECTed
and INSERTed
.
Is it possible to release memory allocated by MySQL? The query was terminated and there is no longer a need for that memory. Why is it still lingering?
Here are some config details:
max_allowed_packet=1024M
# Memory Table
max_heap_table_size=8192M
Everything else is default.
MySQL version 5.5.25, using MyISAM
Inserts into ndbcluster 7.2.7
NDB Config
SharedGlobalMemory=256M
DataMemory=2048M
IndexMemory=512M
My box runs 1/3 SQL nodes, management node. 2 other servers run data nodes.