Mysql load data in file making a lot of read operations

111 views Asked by At

When I am inserting a lot of data, from memory (I am using /dev/shm folder, its memory [RAM]) but it makes a lot of read i/o operations. It stuck on Reading file status of query. And I don't now why and how to fix that.

I have disabled keys for this table, except primary key.

Query is:

LOAD DATA INFILE  '/dev/shm/d/data_file.csv' IGNORE
        INTO TABLE table_sample
        character set UTF8
        FIELDS TERMINATED BY ','
        OPTIONALLY ENCLOSED BY '"'
        LINES TERMINATED BY '\n'
        (column1, column 2)

I have set PDO::MYSQL_ATTR_LOCAL_INFILE => false and have added

[mysqld]    
local-infile=0
tmpdir          = /dev/shm/mysql_temp

[mysql]    
local-infile=0

What can be the reason of that? And is there any way to fix that?

Maybe you know a better way to insert data from memory to mysql tables.

Thank you!

0

There are 0 answers