Page MenuHomePhabricator

refreshLinkRecommendations should batch SELECTs when checking for existing records
Open, Needs TriagePublic

Description

From https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/1121387/comment/e6e1d0bf_b72ee92f/

@Urbanecm_WMF wrote:
this now issues an extra SELECT for each potential article to figure out if it has recommendations or not. it might make sense to do the gelr_data IS NOT NULL filtering in bulk here via a single query.

@Michael wrote:
True, though this is something that we're already doing. We could probably reduce that to two queries per batch, one for existing recommendations and one for non-existing ones. Then we would only process the titles that do not have an entry.

@Michael wrote:
Not implemented yet.

I wonder if this should be part of this change though. In principle, this could be an improvement for both the new and the legacy topic-based approach.