Answer the question
In order to leave comments, you need to log in
How to QUICKLY display several million lines in txt from mariaDB (mySQL)?
There is a DB containing in itself 10 million records in one table, and approximately 1.5 billion in another. And a couple of small (up to 200 records) tables. This is only for development, then there will be at least 20 times more.
Server - dedicated i7-7700k, 32GB RAM, SSD 2*256GB (we'll add more later);
View request
SELECT DISTINCT acc.email, acc.password
FROM accounts acc JOIN accounts_status st ON acc.id_account=st.account_id
WHERE st.service_id in(1,5,8,7,122,147,80,58,77,60,55,15,22,14,16,78,75) AND st.status = 1
LIMIT 1000000
it, the output occurs in a minute. When using INTO OUTFILE
- the situation is similar. Answer the question
In order to leave comments, you need to log in
Hmm, let me think... maybe because there request('image')
is null
? Did such an elementary thought cross your mind?
Are you sure that the record is slowing down, and not the request itself?
In your case, if the average length of the result is 50 bytes, then 1 million of such records is approximately 50 MB, i.e. it will be written to the SSD in 1 sec.
Do
explain SELECT DISTINCT acc.email, acc.password
FROM accounts acc JOIN accounts_status st ON acc.id_account=st.account_id
WHERE st.service_id in(1,5,8,7,122,147,80,58,77,60,55,15,22,14,16,78,75) AND st.status = 1 LIMIT 100000
Perhaps the problem is in the indexes. SHOW INDEXES FROM accounts
, SHOW INDEXES FROM accounts_status
innodb_buffer_pool_size
in your mysql configs, it should be 22400M for about 32 GB.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question