WikibaseQualityConstraints can check “type” and “value type” constraints in PHP or in SPARQL: first it attempts to check whether item A is an instance of item B (or its subclasses) by loading the statements of A, and its “instance of” item(s), and their “subclass of” items, etc. – but if a certain, configurable limit of entities is exceeded, this check is aborted and we fall back to asking the Wikidata Query Service instead via a SPARQL query.
The tracking we added in T204715: Add more tracking for constraint checks reveals that, currently, the PHP checks are much faster than the SPARQL checks (both the successful ones and the ones that fall back to SPARQL), and the majority of successful checks are in PHP rather than in SPARQL – see the “Type Check Runtimes” and “Type Check Distribution” panels. I think we should therefore raise the limit on the PHP checks, to give them more time before falling back to SPARQL. (The limit is the WBQualityConstraintsTypeCheckMaxEntities setting, configured in wmf-config/InitialiseSettings.php.)
I think the “Type Check Distribution” panel could be used to validate the change: preferably, the ratio of successful PHP checks to successful SPARQL checks should increase, I believe.