PROV-660 Workaround for MySQL query hang on "NOT" queries