Manual:ip_changes テーブル

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

ログアウトした利用者による編集が保存されるたびに、ip_changes テーブルの行が作成されます。 これは IP アドレスを十六進表記で格納し、ある IP 範囲内の編集をより発見しやすくします。 One of the primary purposes of the table is to support IP range queries at Special:Contributions. このテーブルは Gerrit change 370946 で導入されました。

フィールド

ipc_rev_id

revision テーブルへの外部キー。一意な主キーとしての役割も果たします。

ipc_rev_timestamp

リビジョンのタイムスタンプ。

ipc_hex

IP::toHex() から返される IP アドレスの十六進表記。

  • IPv4 の場合は以下のようになります: ABCD1234
  • IPv6 の場合: v6-ABCD1234000000000000000000000000

指定された範囲のリビジョンを特定するために BETWEEN が利用されます。

スキーマの要約

MediaWiki バージョン:
1.36

DESCRIBE ip_changes;

+-------------------+------------------+------+-----+---------+-------+
| Field             | Type             | Null | Key | Default | Extra |
+-------------------+------------------+------+-----+---------+-------+
| ipc_rev_id        | int(10) unsigned | NO   | PRI | 0       |       |
| ipc_rev_timestamp | binary(14)       | NO   | MUL | NULL    |       |
| ipc_hex           | varbinary(35)    | NO   | MUL |         |       |
+-------------------+------------------+------+-----+---------+-------+
MediaWiki バージョン:
1.30 – 1.35

DESCRIBE ip_changes;

+-------------------+------------------+------+-----+----------------+-------+
| Field             | Type             | Null | Key | Default        | Extra |
+-------------------+------------------+------+-----+----------------+-------+
| ipc_rev_id        | int(10) unsigned | NO   | PRI | 0              |       |
| ipc_rev_timestamp | binary(14)       | NO   | MUL |                |       |
| ipc_hex           | varbinary(35)    | NO   | MUL |                |       |
+-------------------+------------------+------+-----+----------------+-------+

インデックス

MediaWiki バージョン:
1.30

SHOW INDEX IN ip_changes;

+------------+------------+-------------------+--------------+-------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table      | Non_unique | Key_name          | Seq_in_index | Column_name       | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+------------+------------+-------------------+--------------+-------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| ip_changes |          0 | PRIMARY           |            1 | ipc_rev_id        | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| ip_changes |          1 | ipc_rev_timestamp |            1 | ipc_rev_timestamp | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| ip_changes |          1 | ipc_hex_time      |            1 | ipc_hex           | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| ip_changes |          1 | ipc_hex_time      |            2 | ipc_rev_timestamp | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
+------------+------------+-------------------+--------------+-------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+