I don't think the edits count on my stats page on my wiki is correc. Where does it calculate the number from? What is the SQL (I suppose) it uses?
http://en.chainki.org/index.php?title=Special:Statistics
Thanks!
Hugh
On 11/07/06, Hugh Prior mediawiki@localpin.com wrote:
I don't think the edits count on my stats page on my wiki is correc. Where does it calculate the number from? What is the SQL (I suppose) it uses?
All of these figures come from the site_stats table to save time on larger sites, since COUNT(*) queries against huge tables can be downright expensive.
In this case, the ss_total_edits column is being referenced. What makes you think the total is incorrect?
Rob Church
I know the values are being taken from the site_stats table, but my question is really what is the SQL which is used to calculate those values? For testing purposes, I don't mind how expensive it is to do the SQL directly to check, even if it is a big SUM().
The reason I'm pretty sure it cannot be right is that at the moment about the only person on the site is me or a page creating robot, and about the only thing which I am doing is creating pages (which would I suppose count as 1 edit). And yet the figures (from http://en.chainki.org/index.php?title=Special:Statistics though your mileage may vary) are: There are 4,794 total pages in the database.
Excluding those, there are 3,504 pages that are probably legitimate content pages.
There have been a total of ...799,814 page edits since the wiki was setup.
This last figure I would expect to be somewhere around 3600 (i.e. not much more than 1 edit per page). It is not even remotely close to that. Because the code at the point of displaying these figures only reads the apparently wrong site_stats table I'm not sure how/where the actual calculation of this table is done.
"Rob Church" robchur@gmail.com wrote in message news:e92136380607110728i21e10f05r9cd1322259e48d5a@mail.gmail.com...
On 11/07/06, Hugh Prior mediawiki@localpin.com wrote:
I don't think the edits count on my stats page on my wiki is correc. Where does it calculate the number from? What is the SQL (I suppose) it uses?
All of these figures come from the site_stats table to save time on larger sites, since COUNT(*) queries against huge tables can be downright expensive.
In this case, the ss_total_edits column is being referenced. What makes you think the total is incorrect?
Rob Church
On 11/07/06, Hugh Prior mediawiki@localpin.com wrote:
I know the values are being taken from the site_stats table, but my question is really what is the SQL which is used to calculate those values? For testing purposes, I don't mind how expensive it is to do the SQL directly to check, even if it is a big SUM().
When an edit is made, the value is incremented.
Rob Church
My guess then is, either: a) my code, in trying to auto-create pages, gets a little too over-enthusiastic in forcing the save and somehow the increment happens too many times (let's say it is most probably my code causing the problem) b) some other bug in MediaWiki software which does not normally show up but because of the slightly non-standard way I am using MediaWiki it manifests itself
Either way, I think I'm just going to hack the stats page (http://en.chainki.org/index.php?title=Special:Statistics) so that the edit count and related goodies are just not displayed.
Or is there a way (or a reasonable need to consider writing) to do a recalcEditCount()? I suppose it is possible (though very expensive) to calculate it from scratch, since you "only" need to look at how many pages there are and how many history edits each has. Or is that logic basically wrong? If not, then would I be right that a maintanance "recalcEditCount" script would be possible?
Hugh
"Rob Church" robchur@gmail.com wrote in message news:e92136380607111538y4559c946i3f4c38023ede2075@mail.gmail.com...
On 11/07/06, Hugh Prior mediawiki@localpin.com wrote:
I know the values are being taken from the site_stats table, but my question is really what is the SQL which is used to calculate those values? For testing purposes, I don't mind how expensive it is to do the SQL directly to check, even if it is a big SUM().
When an edit is made, the value is incremented.
Rob Church
On Wed, 12 Jul 2006 00:32:47 +0200 "Hugh Prior" mediawiki@localpin.com wrote:
<snip>
There are 4,794 total pages in the database.
Excluding those, there are 3,504 pages that are probably legitimate content pages.
There have been a total of ...799,814 page edits since the wiki was setup.
You think that's odd? Try this: There are 1,559 total pages in the database. there are 18,446,744,073,709,551,609 pages that are probably legitimate content pages.
mediawiki-l@lists.wikimedia.org