Rechercher dans le manuel MySQL

25.17 The INFORMATION_SCHEMA PARTITIONS Table

The PARTITIONS table provides information about table partitions. Each row in this table corresponds to an individual partition or subpartition of a partitioned table. For more information about partitioning tables, see Chapter 23, Partitioning.

The PARTITIONS table has these columns:

  • TABLE_CATALOG

    The name of the catalog to which the table belongs. This value is always def.

  • TABLE_SCHEMA

    The name of the schema (database) to which the table belongs.

  • TABLE_NAME

    The name of the table containing the partition.

  • PARTITION_NAME

    The name of the partition.

  • SUBPARTITION_NAME

    If the PARTITIONS table row represents a subpartition, the name of subpartition; otherwise NULL.

    For NDB: This value is always NULL.

  • PARTITION_ORDINAL_POSITION

    All partitions are indexed in the same order as they are defined, with 1 being the number assigned to the first partition. The indexing can change as partitions are added, dropped, and reorganized; the number shown is this column reflects the current order, taking into account any indexing changes.

  • SUBPARTITION_ORDINAL_POSITION

    Subpartitions within a given partition are also indexed and reindexed in the same manner as partitions are indexed within a table.

  • PARTITION_METHOD

    One of the values RANGE, LIST, HASH, LINEAR HASH, KEY, or LINEAR KEY; that is, one of the available partitioning types as discussed in Section 23.2, “Partitioning Types”.

  • SUBPARTITION_METHOD

    One of the values HASH, LINEAR HASH, KEY, or LINEAR KEY; that is, one of the available subpartitioning types as discussed in Section 23.2.6, “Subpartitioning”.

  • PARTITION_EXPRESSION

    The expression for the partitioning function used in the CREATE TABLE or ALTER TABLE statement that created the table's current partitioning scheme.

    For example, consider a partitioned table created in the test database using this statement:

    1.     c1 INT,
    2.     c2 INT,
    3.     c3 VARCHAR(25)
    4. )
    5. PARTITION BY HASH(c1 + c2)
    6. PARTITIONS 4;

    The PARTITION_EXPRESSION column in a PARTITIONS table row for a partition from this table displays c1 + c2, as shown here:

    1. mysql> SELECT DISTINCT PARTITION_EXPRESSION
    2.        FROM INFORMATION_SCHEMA.PARTITIONS
    3.        WHERE TABLE_NAME='tp' AND TABLE_SCHEMA='test';
    4. +----------------------+
    5. | PARTITION_EXPRESSION |
    6. +----------------------+
    7. | c1 + c2              |
    8. +----------------------+
  • SUBPARTITION_EXPRESSION

    This works in the same fashion for the subpartitioning expression that defines the subpartitioning for a table as PARTITION_EXPRESSION does for the partitioning expression used to define a table's partitioning.

    If the table has no subpartitions, this column is NULL.

  • PARTITION_DESCRIPTION

    This column is used for RANGE and LIST partitions. For a RANGE partition, it contains the value set in the partition's VALUES LESS THAN clause, which can be either an integer or MAXVALUE. For a LIST partition, this column contains the values defined in the partition's VALUES IN clause, which is a list of comma-separated integer values.

    For partitions whose PARTITION_METHOD is other than RANGE or LIST, this column is always NULL.

  • TABLE_ROWS

    The number of table rows in the partition.

    For partitioned InnoDB tables, the row count given in the TABLE_ROWS column is only an estimated value used in SQL optimization, and may not always be exact.

    For NDB tables, you can also obtain this information using the ndb_desc utility.

  • AVG_ROW_LENGTH

    The average length of the rows stored in this partition or subpartition, in bytes. This is the same as DATA_LENGTH divided by TABLE_ROWS.

    For NDB tables, you can also obtain this information using the ndb_desc utility.

  • DATA_LENGTH

    The total length of all rows stored in this partition or subpartition, in bytes; that is, the total number of bytes stored in the partition or subpartition.

    For NDB tables, you can also obtain this information using the ndb_desc utility.

  • MAX_DATA_LENGTH

    The maximum number of bytes that can be stored in this partition or subpartition.

    For NDB tables, you can also obtain this information using the ndb_desc utility.

  • INDEX_LENGTH

    The length of the index file for this partition or subpartition, in bytes.

    For partitions of NDB tables, whether the tables use implicit or explicit partitioning, the INDEX_LENGTH column value is always 0. However, you can obtain equivalent information using the ndb_desc utility.

  • DATA_FREE

    The number of bytes allocated to the partition or subpartition but not used.

    For NDB tables, you can also obtain this information using the ndb_desc utility.

  • CREATE_TIME

    The time that the partition or subpartition was created.

  • UPDATE_TIME

    The time that the partition or subpartition was last modified.

  • CHECK_TIME

    The last time that the table to which this partition or subpartition belongs was checked.

    For partitioned InnoDB tables, the value is always NULL.

  • CHECKSUM

    The checksum value, if any; otherwise NULL.

  • PARTITION_COMMENT

    The text of the comment, if the partition has one. If not, this value is empty.

    The maximum length for a partition comment is defined as 1024 characters, and the display width of the PARTITION_COMMENT column is also 1024, characters to match this limit.

  • NODEGROUP

    This is the nodegroup to which the partition belongs. This is relevant only to NDB Cluster tables; otherwise, the value is always 0.

  • TABLESPACE_NAME

    The name of the tablespace to which the partition belongs. The value is always DEFAULT, unless the table uses the NDB storage engine (see the Notes at the end of this section).

Notes

  • The PARTITIONS table is a nonstandard INFORMATION_SCHEMA table.

  • A table using any storage engine other than NDB and which is not partitioned has one row in the PARTITIONS table. However, the values of the PARTITION_NAME, SUBPARTITION_NAME, PARTITION_ORDINAL_POSITION, SUBPARTITION_ORDINAL_POSITION, PARTITION_METHOD, SUBPARTITION_METHOD, PARTITION_EXPRESSION, SUBPARTITION_EXPRESSION, and PARTITION_DESCRIPTION columns are all NULL. Also, the PARTITION_COMMENT column in this case is blank.

  • An NDB table which is not explicitly partitioned has one row in the PARTITIONS table for each data node in the NDB cluster. For each such row:

    • The SUBPARTITION_NAME, SUBPARTITION_ORDINAL_POSITION, SUBPARTITION_METHOD, PARTITION_EXPRESSION, SUBPARTITION_EXPRESSION, CREATE_TIME, UPDATE_TIME, CHECK_TIME, CHECKSUM, and TABLESPACE_NAME columns are all NULL.

    • The PARTITION_METHOD is always AUTO.

    • The NODEGROUP column is default.

    • The PARTITION_EXPRESSION and PARTITION_COMMENT columns are empty.


Zoek in de MySQL-handleiding

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 26/06/2006 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/mysql-rf-partitions-table.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:en Manuel MySQL : https://dev.mysql.com/

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut