Answer the question
In order to leave comments, you need to log in
How to speed up sampling ( freeing items, cleaning up) from InnoDB by primary key?
Good afternoon!
I make a query on a table in which there are 100 records in the id (PK) field
select * from table_name where id = n
and the result is 1.8ms - of which 1ms is freeing items and cleaning up.
Why is this happening, and how can it be accelerated?
Disk ssd nvme; MySQL 8; InnoDB;
When it is necessary to make 100 requests, this is 100ms, what exactly is felt ... it was not possible to google ...
Profile:
Answer the question
In order to leave comments, you need to log in
It seems that it is more logical to store your data in some kind of key-value storage, in the same radish, for example...
It seems that all this happens after the data is returned to the client, so the processing itself will be faster from the client’s point of view. And there you can add servers, if that.
In addition, in some libraries, it seems to be possible to select from different tables with one query (not joins or even unions, but several queries through ; ).
It can also happen if the log files are full, slow disks, etc.
Try innodb_flush_log_at_trx_commit = 2
if anything - to the docs: https://dev.mysql.com/doc/refman/8.0/en/general-th...
Two milliseconds doesn't suit you? And why, may I ask? Do you have a high-load project that runs thousands of such requests per second, or did you just decide to play with premature optimization (c)?
When it is necessary to make 100 requests it is 100ms
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question