SELECT with query variables not using INDEXes
问题 I was playing around (out of interest) with retrieving a tree of nodes in a simple adjacency list with a recursive query using local variables. The solution i have so far is fun but i wonder (and this is my only question) why MySQL refuses to use any INDEX to optimize this query. Shouldn't MySQL be able to lookup the nearest child(s) by using an INDEX ? I'm curious why MySQL doesn't. Even when i use FORCE INDEX the execution plan doesn't change. This is the query so far, with 5 being the ID