Answer the question
In order to leave comments, you need to log in
MySQL. How to check for records faster and more correctly?
It is necessary to constantly check for the presence of records by their ID. The flow of incoming data is large (5000 IDs), you need to check about 90 records per 1 operation. What is the best way to do this? You need to add those records whose IDs are not found in the database.
If you just need a request with the following meaning:
1. Take a list of IDs
2. Search in your database and return to me those that you did not find
Answer the question
In order to leave comments, you need to log in
Offhand, I don't remember such operations in sql, most likely they don't exist. It's easier to return the
select id from table WHERE id IN (1,2,3...) set and compare the arrays on the client. All the same I so understand you on the client form requests.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question