How do children and adults search for information when stepwise-optimal strategies fail to identify the most efficient query? The value of questions is often measured in terms of stepwise information gain (expected reduction of entropy on the next time step) or other stepwise-optimal methods. However, such myopic models are not guaranteed to identify the most efficient sequence of questions, that is, the shortest path to the solution. In two experiments we contrast stepwise methods with globally optimal strategies and study how younger children (around age 8, N=52), older children (around age 10, N=99), and adults (N=101) search in a 20-questions game where planning ahead is required to identify the most efficient first question. Children searched as efficiently as adults, but also as myopically. Both children and adults tended to rely on heuristic stepwise-optimal strategies, focusing primarily on questions implications for the next time step, rather than planning ahead.