Temporal query add condition only if primary_key check is enabled