On Mon, Sep 26, 2011 at 4:59 PM, Ariel T.
Glenn<ariel(a)wikimedia.org> wrote:
Στις 26-09-2011, ημέρα Δευ, και ώρα 08:47 +0200,
ο/η melvin_mm έγραψε:
>> mysql> select max(rev_id) from revision;
>> +-------------+
>> | max(rev_id) |
>> +-------------+
>> | 452476647 |
>> +-------------+
>> 1 row in set (0.00 sec)
>>
As you say, there are gaps in the rev_id sequence due to undeleted
revisions and possibly the occasional transaction-rollback-induced
gap. The real real number would be SELECT COUNT(*) FROM revision; but
that'll probably take like half an hour to count all rows.
Roan Kattouw (Catrope)
Wouldn't it be able to use the index in rev_id to return it in O(1) ?
It takes ages in the toolserver view, but I guess it would be the
428660376 rows it shows in the explain.