Added option to only plan and not execute a query.