Improved support for custom query planning using models and stores.