php - Searching for a single in a SQL database -


i new mysql , php , i'm stuck performance problem. have database different unique ids , want extract several rows id (from array) out of on 5000. best solution came far use:

select * `table` id in ($idarray); 

is there more efficient way this? 'id' in 'table' unique string.

i have seen 70,000 numbers in in list "sluggish".

part of issue indexing. table needs index(id) (or, better yet, primary key(id)).

part of issue caching. if table small enough fit in buffer_pool, , cache warm, more warm , wet stuff falling off shovel.

but... if "array" already in table, join table. faster. otoh, building table purpose slower.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -