https://bugzilla.wikimedia.org/show_bug.cgi?id=65246

Brad Jorsch <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #3 from Brad Jorsch <[email protected]> ---
Ok, that matches my assumption. Thanks for clarifying.

Once we have queries that we're reasonably sure won't kill the database, adding
it to the API should be easy.

Conceptually, getting the count is as simple as "SELECT COUNT(*) FROM watchlist
WHERE wl_user = ? AND wl_notificationtimestamp IS NOT NULL" and getting the
list of only the unread changes would be a matter of adding "AND
wl_notificationtimestamp IS NOT NULL" to the existing queries in
list=watchlist.[1] But if someone has a watchlist with 1000000 pages and only
10 of them are unseen, that might overload the database. So it might be that we
need to add an index on (wl_user,wl_notificationtimestamp), or do things in a
less perfect way (e.g. fetch the 500 lines that would actually be displayed on
Special:Watchlist using the existing queries and count up which ones would be
bold). Part of my problem is that the watchlist queries are already fairly
awful by my rules-of-thumb so I can't tell if they're getting worse or not. And
Sean knows much more about the database stuff than I do, which is why I suggest
asking him.


 [1]: Those queries look something like "SELECT ... FROM recentchanges INNER
JOIN watchlist ON (wl_user = ? AND wl_namespace = rc_namespace AND wl_title =
rc_title) LEFT JOIN page ON (rc_cur_id = page_id) WHERE rc_timestamp >= ? AND
rc_timestamp <= ? AND wl_namespace IN (...) AND (rc_this_oldid=page_latest OR
rc_type=3) [and maybe more filtering on
rc_minor/rc_bot/rc_user/rc_patrolled/rc_type fields here] AND (rc_type!=3 OR
(rc_deleted&9)!=9) ORDER BY rc_timestamp, rc_id LIMIT 5001

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to