Lucas_Werkmeister_WMDE added a comment.

Okay, so it’s actually the opposite. We’re somehow asking for the latest revision IDs of an empty array of entity IDs. And WikiPageEntityMetaDataLookup has a special safeguard for this:

		if ( empty( $where ) ) {
			// If we skipped all entity IDs, select nothing, not everything.
			return '0';
		}

And here’s what the DB does with $conds => '0'.

		if ( !empty( $conds ) ) {
			if ( is_array( $conds ) ) {
				$conds = $this->makeList( $conds, self::LIST_AND );
			}
			$sql = "SELECT $startOpts $vars $from $useIndex $ignoreIndex " .
				"WHERE $conds $preLimitTail";
		} else {
			$sql = "SELECT $startOpts $vars $from $useIndex $ignoreIndex $preLimitTail"; // YOU ARE HERE
		}

So we were actually asking for all of the revision IDs. All of them. Some safeguard…

I thought you had posted/screenshoted reduced versions of the query, and omitted the WHERE part because it could contain sensitive information or whatever… no, the query just didn’t have any WHERE, that’s why it was so expensive.


TASK DETAIL
https://phabricator.wikimedia.org/T184812

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: greg, Ladsgroup, jcrespo, Marostegui, TerraCodes, Stashbot, Liuxinyu970226, Jonas, Aklapper, gerritbot, Lucas_Werkmeister_WMDE, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Baloch007, Darkminds3113, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, Lewizho99, Maathavan, Agabi10, Wikidata-bugs, aude, ArielGlenn, He7d3r, Mbch331, Jay8g, mmodell
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to