In any relational database, we can create indexes that increase query speed. But creating a larger index can damage the update / insert speed, because the Db system will have to update each index when new data arrives (insert, update, merge, etc.).
We use an example. we can create index index1 ADD INDEX index1 ( order_id ASC, buyer_id ASC) OR we can create 2 indexes, index2 and index3 ADD INDEX index2 ( order_id ASC) ADD INDEX index3 ( buyer_id ASC)
In such a query, select * from tablename, where order_id> 100 and buyer_id> 100
Which one is faster? Using Index1 or index2 and index3?
On the other hand, when I insert or update the equation, I assume that it will be much faster to use one index instead of 2, but I have not tested it on the MySql or MSSQL server, so I canβt be like that of course. If anyone has experience in this matter, please share it.
And the last, as far as int values ββare concerned, I considered it impossible or advisable to create an index only for int columns, because it does not increase the query time, is this true?
source share