Manual:text テーブル

From mediawiki.org
This page is a translated version of the page Manual:Text table and the translation is 71% complete.
Manual:コンテンツ MediaWiki のデータベース レイアウト text テーブル
MediaWiki バージョン:
1.5

text テーブルには各ページの更新バージョンそれぞれに対するウィキテキストが保存されます。 PostgresまたはOracleを使う場合、このテーブルの名前は pagecontent になります。 拡張機能 のデータもここに保存されるかもしれません。

項目名は MediaWiki 1.4以前で使われていた old リビジョンテーブルからの名残です。

MediaWiki 1.4以前のバージョンから1.4より新しいバージョンへと更新し、1回でも update.php を実行した場合、text テーブルにはまだ古い列がまだ残っているでしょう。この中に書かれている内容は page テーブルと revision テーブルに移行されました(内容は移動ではなくコピーされています)。 text テーブル中にあるこれらの列は今後使われることはありません。 text テーブル中にある except old_id, old_text and old_flags の項目はいずれも今後必要ないものなので削除しても問題ありません。

text テーブルの内容は圧縮されているか、または外部に保存されているため、このテーブルから内容を得るのは簡単ではありません。 メンテナンススクリプトの fetchText.php を使うと、指定した old_id に対応するテキストを取り出すことができます。

Extensions can add other custom flags.

This table can also hold metadata of files if the metadata is too big to store in img_metadata, oi_metadata or fa_metadata.

フィールド

old_id

各テキストを特定するため用いられる一意な整数。 content テーブルの content.content_address から参照されます。 複数内容の版管理を実装する前であれば、revision テーブルの revision.rev_text_id archive テーブルの ar_text_id はこの項目に対するキーになっています。

Also img_metadata, oi_metadata or fa_metadata can refer to this column when being used to store file metadata.

old_text

ページのウィキテキスト、または DB://cluster/id の書式で示される外部ストレージへのポインタ。

old_flags

コンマ区切りのフラグリスト。 以下の値を取ることができます:

gzip テキストはPHPの gzdeflate() 関数を使って圧縮されます。
If the $wgCompressRevisions option is on, new rows (=current revisions) will be gzipped transparently at save time. Previous revisions can also be compressed by using the script compressOld.php
utf-8 テキストはUTF-8で保存されます。
If the $wgLegacyEncoding option is on, rows without this flag will be converted to UTF-8 transparently at load time.
object Text field contained a serialized PHP object.
The object either contains multiple versions compressed together to achieve a better compression ratio, or it refers to another row where the text can be found.
external テキストは old_text で指定された外部の場所に保存されます。
Any additional flags apply to the data stored at that URL, not the URL itself. The 'object' flag is not set for URLs of the form 'DB://cluster/id/itemid', because the external storage system itself decompresses these. $wgDefaultExternalStore も参照してください。

スキーマの要約

MediaWiki バージョン:
1.10

DESCRIBE text;

+-----------+------------------+------+-----+---------+----------------+
| Field     | Type             | Null | Key | Default | Extra          |
+-----------+------------------+------+-----+---------+----------------+
| old_id    | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| old_text  | mediumblob       | NO   |     | NULL    |                |
| old_flags | tinyblob         | NO   |     | NULL    |                |
+-----------+------------------+------+-----+---------+----------------+
MediaWiki バージョン:
1.5 – 1.9

DESCRIBE text;

+-----------+-----------------+------+-----+---------+----------------+
| Field     | Type            | Null | Key | Default | Extra          |
+-----------+-----------------+------+-----+---------+----------------+
| old_id    | int(8) unsigned | NO   | PRI | NULL    | AUTO_INCREMENT |
| old_text  | mediumblob      | NO   |     | NULL    |                |
| old_flags | tinyblob        | NO   |     | NULL    |                |
+-----------+-----------------+------+-----+---------+----------------+

インデックス

MediaWiki バージョン:
1.5

SHOW INDEX IN text;

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

関連項目