MySQL database configuration for fastening the select and insert queries

MySQLmysql-5.5

There are several DBEngines are available for MySQL DB. Currently I'm using InnoDB. My actual problem is, I have a table that consist of millions of data. Therefore the select queries that given to this table is extremely slow. I need to know which configuration should I use to make the select query faster, that doesn't affects the speed of insertion.

Best Answer

Your problem is not the DB Engine, but the lack of the indices. Indices make possible for your database to find things (records) much faster. You had to make some.

I suggest to read an sql indexing tutorial (google is your friend), and then come back with a new question, if you have yet one.

Extension after you gave your query: in this case there is two problem. First, LIMIT isn't really simple to make faster with indices. But it is not a big problem, because in your query is it visible, what is the cause of the sloooow query. It is the multiple inequality conditions in the WHERE. I didn't give a medal for the liferay programmers for this sh... sometimes-maybe-not-really-useful solution.

The greatest problem is, that such indices can't be make faster by indices easily. On big tables they should be avoided, if we want to develop high-quality software.

The solution - indexing a table for multiple inequality search term - isn't known currently also for me, thus I opened a new question for you, what can be done in MySQL in your problem. Maybe we get some interesting answer and in this case I will be able to extend also this question.