Manual:Hitcounter table

From MediaWiki.org
(Redirected from Hitcounter table)
Jump to: navigation, search

Other languages:
English • ‎日本語
Manual:Contents MediaWiki database layout hitcounter table


MediaWiki versions: 1.3 – 1.25

The hitcounter table in MediaWiki is a temporary buffer for storage of page view information. If $wgHitcounterUpdateFreq is set to a value bigger than 1, this table stores the page_id value of every page that was visited. The value of $wgHitcounterUpdateFreq is then fed into a randomizer, which then updates the page_counter fields of the stored pages when the random number is equal to a particular value. This reduces database load; updating the page_counter field with every page hit is a main source for slow queries. After this batch update of the page_counter fields has been done, the hitcounter table is emptied.

This table was introduced in MediaWiki 1.3, and will always be empty if $wgDisableCounters is set to true. Additionally, if $wgHitcounterUpdateFreq is set to 1, the page table is directly updated, and this table is not used.

This table has been removed in MediaWiki 1.25 since the page counter feature has been removed entirely. See Requests for comment/Removing hit counters from MediaWiki core.

Fields[edit | edit source]

hc_id[edit | edit source]

Contains the page_id of each visited page in the buffer.

Schema summary[edit | edit source]

MediaWiki version: 1.3

DESCRIBE hitcounter gives the following:

+-------+------------------+------+-----+---------+-------+
| Field | Type             | Null | Key | Default | Extra |
+-------+------------------+------+-----+---------+-------+
| hc_id | int(10) unsigned | NO   |     | NULL    |       |
+-------+------------------+------+-----+---------+-------+
Databases Engines: MySQLOraclePostgreSQLSQLite
Technical documentation: Schema (tables) – API property associationsField prefixesPrimary key storage in other fieldsWikimedia extension tables
Configuration: SettingsSharing
Development: AccessOptimizationPolicyUpdaterExtension schema updatesPatch file
Core tables: archivecategorycategorylinkschange_tagconfigexternallinksfilearchivehitcounterimageimagelinksinterwikiiwlinksipblocksjobl10n_cachelanglinkslogginglog_searchmsg_resourcemsg_resource_linksmodule_depsobjectcacheoldimagepagepagelinkspage_propspage_restrictionsprotected_titlesquerycachequerycachetwoquerycache_inforecentchangesredirectrevisionsearchindexsitessite_statstag_summarytemplatelinkstexttranscacheupdateloguploadstashuseruser_former_groupsuser_groupsuser_newtalkuser_propertiesvalid_tagwatchlist