Let's take the table below as an example:
id empresa forneedor
1 10 105
2 10 102
3 10 105
4 10 112
5 10 105
Using business and vendor as indexes.
Making SELECT * FROM table WHERE empresa = 10;
- > returns 5 rows which is expected.
Making SELECT * from table WHERE fornecedor = 105;
- > returns 3 rows which is expected.
Making SELECT * from table WHERE empresa = 10 AND fornecedor = 105;
- > returns only 1 row, not result expected.
The table is in the INNODB format
I already used the OTPIMIZE TABLE command, but it did not solve.
Does anyone have any idea where the problem is?
I have already detected that the problem is occurring with partitioned tables and index_merge. I think it's a problem similar to this link .