> I have columsn c1, c2, c3, c4 with indexes
Do you mean
INDEX(c1),
INDEX(c2),
INDEX(c3),
INDEX(c4)
or do you mean a composite index:
INDEX(c1,c2,c3,c4)
?
[/code]
select c1,c2 from table1 where c1=a and c2=b and c3 = d
[/code]
Needs
INDEX(c1,c2,c3)
with the columns in any order.
select c5 from table1 where c5>a and c1=b
needs, in _this_ order,
INDEX(c1, c5)
31 indexes is too many. I suspect the optimizer is throwing up its hands.
With either of the composite indexes I mentioned, you would not longer need
INDEX(c1)
because it is a prefix of them, hence redundant.
If you want to discuss speed differences, please provide
EXPLAIN SELECT ...
and
SHOW CREATE TABLE
Here's my cookbook on building the optimal index from a SELECT:
http://mysql.rjweb.org/doc.php/index_cookbook_mysql