Learned plan-selection optimizers combine the conventional and learned approaches by generating diverse candidate plans through multiple optimizers and selecting the best via value models. However, these eagerly-generated plans incur high optimization overhead, as they require multiple invocations of the native optimizer. In this paper, we propose MoEPlan, which learns a routing policy to select top- \(k\) experts (different optimizers) via query embedding and learnable parameters, avoiding pre-generation of candidate plans. Our approach integrates two optimization strategies: (1) a virtual ideal expert to guide the best plan selection through learned plan similarities, and (2) a query-irrelevant expert sampling strategy to balance the training cost and effectiveness of selected plans in the first round of expert selection. Furthermore, we design a two-phase training process: the first phase pre-trains the model with complete expert feedback, while the second phase filters the full expert pool to yield a promising subset and refines the selection to pinpoint the optimal expert. Experimental studies show that MoEPlan, with only two plans generated, takes less inference time, while still producing more efficient plans than other learned plan-selection optimizers.
Liu et al. (Wed,) studied this question.