if the table table has a federated index (sex, id)
and id itself is the primary key
, does the following sql go to the index?
select * from table where sex="m" order by id limit 1000000,10
my feeling is that according to the execution order of sql
, we should first execute from table where sex="m", to filter out the result set, and then go to order by id, so I don"t feel like I"m going to index
, so I have to
select * from table in (select id from table where sex="m" order by id limit 1000000,10)
is that so?