'A INSERT SQL is MySQL use memory too much

when MySQL is running a insert data, the count of number is about 20w, and is about 100M but the memory useage is about more than 4G enter image description here the SQL memory from

SELECT a.thread_id, a.event_name,
  sys.format_bytes(CURRENT_NUMBER_OF_BYTES_USED), sql_text
FROM performance_schema.memory_summary_by_thread_by_event_name a,
  performance_schema.events_statements_current b
WHERE a.thread_id=b.thread_id
ORDER BY CURRENT_NUMBER_OF_BYTES_USED DESC
LIMIT 10;

CURRENT_NUMBER_OF_BYTES_USED is about 3GB

why the insert SQL use so much memory



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source