Page MenuHomePhabricator

DBQ-171 Bug In wachlist Query
Closed, ResolvedPublic

Description

This issue was converted from https://jira.toolserver.org/browse/DBQ-171.
Summary: Bug In wachlist Query
Issue type: Task - A task that needs to be done.
Priority: Major
Status: Done
Assignee: Hoo man <hoo@online.de>


From: reza <reza.energy@gmail.com>

Date: Thu, 08 Dec 2011 00:06:27

I wanted to list fa.wiki notifications and I used these queries and I had different answers.

SELECT Wl_title,Count(Wl_title),ts_wl_user_touched_cropped  FROM watchlist JOIN page ON page_title=Wl_title WHERE page_len>0 AND page_is_redirect=0 and Wl_namespace=0 GROUP BY Wl_title ORDER BY count(Wl_title) DESC LIMIT 20;

SELECT Wl_title,Count(Wl_title) FROM watchlist JOIN page ON page_title=Wl_title WHERE page_len>0 AND page_is_redirect=0 and Wl_namespace=0 GROUP BY Wl_title ORDER BY count(Wl_title) DESC LIMIT 20;

all of the Count numbers are different!

also according to
http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/maintenance/tables.sql?view=markup
and
http://www.mediawiki.org/wiki/Manual:Watchlist_table
it have wl_user and wl_notificationtimestamp Fields but with describe command it shows ts_wl_user_touched_cropped !
also none of my result are not equal with (page count)
http://toolserver.org/~mzmcbride/watcher/?db=fawiki_p


Version: unspecified
Severity: major

Details

Reference
bz59442

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:31 AM
bzimport set Reference to bz59442.

From: reza <reza.energy@gmail.com>

Date: Thu, 08 Dec 2011 00:12:52

also for

SELECT Wl_title,Count(Wl_title) FROM watchlist JOIN page ON page_title=Wl_title WHERE page_title="فرح_پهلوی" AND Wl_namespace=0 AND page_len>0 GROUP BY Wl_title;

and http://toolserver.org/~mzmcbride/watcher/?db=fawiki_p&titles=%D9%81%D8%B1%D8%AD_%D9%BE%D9%87%D9%84%D9%88%DB%8C

has different answers


From: Hoo man <hoo@online.de>

Date: Thu, 08 Dec 2011 22:46:24

In the query within the comment you forgot AND page_namespace=0
So the right query is:

SELECT Wl_title,Count(Wl_title) FROM watchlist JOIN page ON page_title=Wl_title WHERE page_title="فرح_پهلوی" AND Wl_namespace=0 AND page_len>0 AND page_namespace=0 GROUP BY Wl_title;

Which should be equal to

SELECT Wl_title,Count(Wl_title) FROM watchlist WHERE wl_title = 'فرح_پهلوی' AND wl_namespace = 0;

I think you did the same mistake in the queries within the description, but I don't have enough time to test that atm... It would be fine, if you could tell, if it's the solution.


From: reza <reza.energy@gmail.com>

Date: Thu, 08 Dec 2011 23:15:35

thank you now it is correct but why Fields are not the same as help and trunk?


From: Hoo man <hoo@online.de>

Date: Thu, 08 Dec 2011 23:21:34

Great ![][1]

The toolserver tables don't include all information the "real" databases do, mostly because of privacy reasons. So in the given example the timestamp is cropped so that only year, month and day can be seen.

[1]: https://jira.toolserver.org/images/icons/emoticons/smile.gif

From: DaB. <dab@ts.wikimedia.org>

Date: Thu, 08 Dec 2011 23:27:12

Please notice that ts_wl_user_touched_cropped is not a cropped wl_notificationtimestamp, but a cropped user_touched (the watchlist-table is joined with the user-table for that view).


From: reza <reza.energy@gmail.com>

Date: Thu, 08 Dec 2011 23:58:20

Thank you

This bug was imported as RESOLVED. The original assignee has therefore not been
set, and the original reporters/responders have not been added as CC, to
prevent bugspam.

If you re-open this bug, please consider adding these people to the CC list:
Original assignee: hoo@online.de
CC list: reza.energy@gmail.com, hoo@online.de, wikimedia-bugzilla@dabpunkt.eu