when create a new page at mediawiki, the following sql-statements will be created.

(从MySQL的log分析得出,不保证Mediawiki本身就一定按照此顺序执行,

其中也省略了一些临时的步骤,红色表示关键步骤,可以保证mediawiki的该page的正常查看以及查找)

1. insert into page。(page_latest = 0,len = 0 at this insert)

2.insert into text。

3.insert into revision。

(以上三个表有外键关联,

page.page_id = revision.rev_page ,

page.page_latest = revision.rev_id,

revsion.rev_text_id = text.old_id

)

4. update page set page_lastest, len.

5. insert logging.

6. update user set user_editcount = user_editcount + 1

7. update user set user_touch = nowdate()

8. insert into objectcache( this table is used for a few generic cache operations if not using Memcached)

9. update site_stats set ss_total_edit and ss_total_page ( add 1)

10. replace into searchindex.

转载请注明来源:Leoncom-《MediaWiki创建Page时的数据库操作》
Trackback

no comment untill now

Add your comment now