Sean Pringle <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #3 from Sean Pringle <> ---
Even the solution without GROUP BY could be slow for very active users. The
index used is probably always revision user_timestamp (rev_user,
rev_timestamp). Since rev_timestamp is in second place MAX() must still do a
range scan on the user's portion of the btree.

As we're already proposing to query separately for each user then pulling the
user data out first in bulk and removing the join in the individual user
queries would be predictable and faster:

SELECT user_id, user_editcount FROM user WHERE user_name in (...);

foreach $user_id:
    SELECT MAX(rev_timestamp) FROM revision WHERE rev_user = $user_id;

*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: NULL
         type: NULL
possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: NULL
        Extra: Select tables optimized away
1 row in set (0.29 sec)

Each user needs a single Handler_read_key hit on revision rev_timestamp
(rev_timestamp) index regardless of how many revisions they have authored.

Worth considering.

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

Reply via email to