Last modified: 2013-10-10 13:29:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T56107, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54107 - *_userindex tables need to be documented
*_userindex tables need to be documented
Status: RESOLVED FIXED
Product: Wikimedia Labs
Classification: Unclassified
tools (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Marc A. Pelletier
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-13 19:24 UTC by Robin Krahl
Modified: 2013-10-10 13:29 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Robin Krahl 2013-09-13 19:24:49 UTC
Some SQL queries on the replica tables take much longer than on the Toolserver. For example, this query for the first edit of a user takes 0.01 sec on the Toolserver and 49.08 sec on Tool Labs (for dewiki_p):

select rev_timestamp from revision where rev_user=336793 order by rev_timestamp asc limit 1;


This is critical for tools as `stimmberechtigung` that checks the right to vote of a user in the German Wikipedia (Toolserver: toolserver.org/~stimmberechtigung/, Labs: tools.wmflabs.org/stimmberechtigung/). While it runs very fast on the Toolserver, it takes several minutes to load it on Labs.
Comment 1 Tim Landscheidt 2013-09-13 19:46:34 UTC
For queries that select on rev_user, there is the table "revision_userindex":

| MariaDB [dewiki_p]> select rev_timestamp from revision_userindex where rev_user=336793 order by rev_timestamp asc limit 1;                                   
| +----------------+                                                                                                                                           
| | rev_timestamp  |                                                                                                                                           
| +----------------+
| | 20070115154431 |
| +----------------+
| 1 row in set (0.05 sec)

| MariaDB [dewiki_p]>

Unfortunately, it isn't documented at [[wikitech:Nova Resource:Tools/Help]] (so far :-)).  I'll leave that to Coren as my knowledge of what and when is purely based on word of mouth.
Comment 2 Robin Krahl 2013-09-13 20:10:14 UTC
Hi Tim, thanks! This helps a lot. My tool is now working fine. :) Of course, it would be great to have this documented for further use.
Comment 3 Morten Wang 2013-09-13 21:25:56 UTC
I've added a first pass on documenting this to the Tool Labs help, see https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools/Help#Tables_for_revision_or_logging_queries_involving_user_names_and_IDs
Comment 4 Marc A. Pelletier 2013-09-16 18:29:51 UTC
The canonical source of information for what "special" views exists is the source of the maintenance script:

https://git.wikimedia.org/blob/operations%2Fsoftware/HEAD/maintain-replicas%2Fmaintain-replicas.pl

Where the definition of the views themselves can be found.
Comment 5 Marc A. Pelletier 2013-10-10 13:14:35 UTC
Has been documented since.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links