A method, a query optimizer, and computer program product are provided for
implementing live switchover to a temporary sparse index for faster query
performance. A first plan using an existing index is used for processing
a query. A temporary sparse index is built for the query simultaneously
with the first plan processing the query. When the temporary sparse index
is built, processing the query with the first plan is stopped and a live
switchover to the temporary sparse index is provided. Then a second plan
using the temporary sparse index is used to continue processing the query
at a point where processing stopped with the first plan.