I am using MySQL database engine. My Java application uses simple JDBC to retrieve data from database.
I have following database schema: main table with two columns: (INTEGER id, BLOB data). id is primary key.
From user actions I have set of few ids (x, y, ... all integers) for which I want to fetch data.
What is most efficient way to build query? Is there any performance difference if I use
SELECT data FROM table WHERE id IN (x, y, ...)
or
SELECT data FROM table WHERE id = x OR id = y OR ...
or maybe there is another way to build that query?
xandy? User supplied values? Or columns in (other or this) table? – ypercube Feb 11 at 14:22