Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code DEF204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.

Rechercher dans le manuel MySQL

25.39.30 The INFORMATION_SCHEMA INNODB_VIRTUAL Table

The INNODB_VIRTUAL table provides metadata about InnoDB virtual generated columns and columns upon which virtual generated columns are based.

A row appears in the INNODB_VIRTUAL table for each column upon which a virtual generated column is based.

The INNODB_VIRTUAL table has these columns:

  • TABLE_ID

    An identifier representing the table associated with the virtual column; the same value as INNODB_TABLES.TABLE_ID.

  • POS

    The position value of the virtual generated column. The value is large because it encodes the column sequence number and ordinal position. The formula used to calculate the value uses a bitwise operation:

    ((nth virtual generated column for the InnoDB instance + 1) << 16)
    + the ordinal position of the virtual generated column

    For example, if the first virtual generated column in the InnoDB instance is the third column of the table, the formula is (0 + 1) << 16) + 2. The first virtual generated column in the InnoDB instance is always number 0. As the third column in the table, the ordinal position of the virtual generated column is 2. Ordinal positions are counted from 0.

  • BASE_POS

    The ordinal position of the columns upon which a virtual generated column is based.

Example

  1. mysql> CREATE TABLE `t1` (
  2.          `a` int(11) DEFAULT NULL,
  3.          `b` int(11) DEFAULT NULL,
  4.          `c` int(11) GENERATED ALWAYS AS (a+b) VIRTUAL,
  5.          `h` varchar(10) DEFAULT NULL
  6.        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  7.  
  8. mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_VIRTUAL
  9.        WHERE TABLE_ID IN
  10.          (SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_TABLES
  11.           WHERE NAME LIKE "test/t1");
  12. +----------+-------+----------+
  13. | TABLE_ID | POS   | BASE_POS |
  14. +----------+-------+----------+
  15. |       98 | 65538 |        0 |
  16. |       98 | 65538 |        1 |
  17. +----------+-------+----------+

Inhoudsopgave Haut

Notes

  • If a constant value is assigned to a virtual generated column, as in the following table, an entry for the column does not appear in the INNODB_VIRTUAL table. For an entry to appear, a virtual generated column must have a base column.

    1. CREATE TABLE `t1` (
    2.   `a` int(11) DEFAULT NULL,
    3.   `b` int(11) DEFAULT NULL,
    4.   `c` int(11) GENERATED ALWAYS AS (5) VIRTUAL

    However, metadata for such a column does appear in the INNODB_COLUMNS table.

  • You must have the PROCESS privilege to query this table.

  • Use the INFORMATION_SCHEMA COLUMNS table or the SHOW COLUMNS statement to view additional information about the columns of this table, including data types and default values.


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-innodb-virtual-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