I have a table with more than 100 millions rows in Innodb.
I have to know if there is more than 5000 rows where the foreign key = 1. I don\'t need the exact number.<
Finally the fastest was to query the first X rows using C# and counting the rows number.
My application is treating the data in batches. The amount of time between two batches are depending the number of rows who need to be treated
SELECT pk FROM table WHERE fk = 1 LIMIT X
I got the result in 0.9 seconds.
Thanks all for your ideas!