Manual:comment テーブル

From mediawiki.org
This page is a translated version of the page Manual:Comment table and the translation is 90% complete.
Manual:コンテンツ MediaWiki のデータベース レイアウト comment table
MediaWiki バージョン:
1.30

comment テーブルには、編集、ブロック、その他の操作が格納され、通常は操作を説明するテキスト コメントを含みます。 これらは、メインのテーブルのサイズを小さくし、重複を排除できるようにするため、別のテーブルに格納されています。

重複排除は現在、厳密な重複排除に必要な挿入時のロックを回避するためベスト エフォート型です。 同じ comment_textcomment_data を持つ行が複数存在するかもしれません

このテーブルは Gerrit change 357892 で導入されました。

フィールド

comment_id

各コメントを識別するためのユニークな ID です。

comment_hash

重複排除のための comment_textcomment_data のハッシュ。 The current algorithm is a signed CRC32 of the comment text XOR'd with a CRC32 of any comment data.

comment_text

変更を要約するテキスト コメント。例: 編集者の編集の要約。 このテキストは、履歴投稿記録 に表示されます。 It is also used for recent changes , related changes , watchlists , and, in the case of page creation, for the list of new pages . これは、MediaWiki\CommentFormatter\CommentFormatter::format() によってウィキ マークアップのサニタイズされた下位集合でレンダリングされます。 サイズ制限はアプリケーション レベルで実施され、UTF-8 文字列を適切にクロップされるように注意する必要があります。

comment_data

自動生成されたコメントの地域化を目的とした JSON データ。 自動生成されたコメントを地域化して提供するための構造化データを保持します。 空ではない場合、comment_text はウィキのコンテンツ言語を使用して地域化された生成済みコメントであるべきです。

スキーマ

MediaWiki バージョン:
1.30

DESCRIBE comment;

+--------------+---------------------+------+-----+---------+----------------+
| Field        | Type                | Null | Key | Default | Extra          |
+--------------+---------------------+------+-----+---------+----------------+
| comment_id   | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment |
| comment_hash | int(11)             | NO   | MUL | NULL    |                |
| comment_text | blob                | NO   |     | NULL    |                |
| comment_data | blob                | YES  |     | NULL    |                |
+--------------+---------------------+------+-----+---------+----------------+

インデックス

MediaWiki バージョン:
1.30

SHOW INDEX IN comment;

+---------+------------+--------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table   | Non_unique | Key_name     | Seq_in_index | Column_name  | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+---------+------------+--------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| comment |          0 | PRIMARY      |            1 | comment_id   | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| comment |          1 | comment_hash |            1 | comment_hash | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
+---------+------------+--------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+

コードのスチュワード権限

See also