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, ...)
SELECT data FROM table WHERE id = x OR id = y OR ...
or maybe there is another way to build that query?