jcrespo created this task.
jcrespo added projects: Wikidata, Wikibase.
Restricted Application added a subscriber: Aklapper.

TASK DESCRIPTION
  This weekend, while an ongoing incident was being handled, I checked and saw 
several badly performing queries running. These didn't have (I believe) any 
relation with the incident, but any web request that takes more than 1 or a few 
seconds (in the worse possible case) is worrying, as they can pile up and 
create load issues on the database.
  
  While there was several queries with bad performance (mostly related to 
recentchanges and API), the worst occurring query right now is:
  
    SELECT /* Wikibase\Lib\Store\Sql\SiteLinkTable::getLinks */ count(*) FROM 
`wb_items_per_site` WHERE ips_site_id = '?';
    
    where '?' can be any production wiki, but in particular, for enwiki, it 
selects over **8 million rows**. We saw over 30 of those, over all s8 servers, 
today Mar 8 at 8:18 UTC.
    
    
    This not only takes over 1 minute to run, but is likely to be not useful 
due to the amount of memory consumed.
    While reading large number of rows can be useful for something like a 
dump/analytics, it is unlikely to be useful for a web request. Moreso, the 
application server will struggle to handle 2GB of data at a time, even in 
memory, that this query returns.
    
    Is it possible some extra WHERE or LIMIT was missing from the query?

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

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

To: jcrespo
Cc: Marostegui, hoo, Aklapper, jcrespo, maantietaja, Akuckartz, darthmon_wmde, 
Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, 
rosalieper, Scott_WUaS, abian, Wikidata-bugs, aude, Lydia_Pintscher, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to