Add some logging to debug the actual query being run.