/** InnoDB B-tree index */
typedef struct dict_index_struct dict_index_t;
/** Data structure for an index.  Most fields will be
initialized to 0, NULL or FALSE in dict_mem_index_create(). */
struct dict_index_struct{
    index_id_t    id;    /*!< id of the index */
    mem_heap_t*    heap;    /*!< memory heap */
    const char*    name;    /*!< index name */
    const char*    table_name;/*!< table name */
    dict_table_t*    table;    /*!< back pointer to table */ //详见
#ifndef UNIV_HOTBACKUP
    unsigned    space:;
                /*!< space where the index tree is placed */
    unsigned    page:;/*!< index tree root page number */
#endif /* !UNIV_HOTBACKUP */
    unsigned    type:DICT_IT_BITS;
                /*!< index type (DICT_CLUSTERED, DICT_UNIQUE,
                DICT_UNIVERSAL, DICT_IBUF, DICT_CORRUPT) */
#define MAX_KEY_LENGTH_BITS 12
    unsigned    trx_id_offset:MAX_KEY_LENGTH_BITS;
                /*!< position of the trx id column
                in a clustered index record, if the fields
                before it are known to be of a fixed size,
                0 otherwise */
#if (1<<MAX_KEY_LENGTH_BITS) < MAX_KEY_LENGTH
# error (<<MAX_KEY_LENGTH_BITS) < MAX_KEY_LENGTH
#endif
    unsigned    n_user_defined_cols:;
                /*!< number of columns the user defined to
                be in the index: in the internal
                representation we add more columns */
    unsigned    n_uniq:;/*!< number of fields from the beginning
                which are enough to determine an index
                entry uniquely */
    unsigned    n_def:;/*!< number of fields defined so far */
    unsigned    n_fields:;/*!< number of fields in the index */
    unsigned    n_nullable:;/*!< number of nullable fields */
    unsigned    cached:;/*!< TRUE if the index object is in the
                dictionary cache */
    unsigned    to_be_dropped:;
                /*!< TRUE if this index is marked to be
                dropped in ha_innobase::prepare_drop_index(),
                otherwise FALSE. Protected by
                dict_sys->mutex, dict_operation_lock and
                index->lock.*/
    dict_field_t*    fields;    /*!< array of field descriptions */
#ifndef UNIV_HOTBACKUP
    UT_LIST_NODE_T(dict_index_t)
            indexes;/*!< list of indexes of the table */
    btr_search_t*    search_info; /*!< info used in optimistic searches */
    /*----------------------*/
    /** Statistics for query optimization */
    /* @{ */
    ib_int64_t*    stat_n_diff_key_vals;
                /*!< approximate number of different
                key values for this index, for each
                n-column prefix where n <=
                dict_get_n_unique(index); we
                periodically calculate new
                estimates */
    ib_int64_t*    stat_n_non_null_key_vals;
                /* approximate number of non-null key values
                for this index, for each column where
                n < dict_get_n_unique(index); This
                is used when innodb_stats_method is
                "nulls_ignored". */
    ulint        stat_index_size;
                /*!< approximate index size in
                database pages */
    ulint        stat_n_leaf_pages;
                /*!< approximate number of leaf pages in the
                index tree */
    /* @} */
    rw_lock_t    lock;    /*!< read-write lock protecting the
                upper levels of the index tree */
    trx_id_t    trx_id; /*!< id of the transaction that created this
                index, or 0 if the index existed
                when InnoDB was started up */
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_BLOB_DEBUG
    mutex_t        blobs_mutex;
                /*!< mutex protecting blobs */
    void*        blobs;    /*!< map of (page_no,heap_no,field_no)
                to first_blob_page_no; protected by
                blobs_mutex; @see btr_blob_dbg_t */
#endif /* UNIV_BLOB_DEBUG */
#ifdef UNIV_DEBUG
    ulint        magic_n;/*!< magic number */
/** Value of dict_index_struct::magic_n */
# define DICT_INDEX_MAGIC_N
#endif
};

结构体dict_index_t;的更多相关文章

  1. Go结构体实现类似成员函数机制

    Go语言结构体成员能否是函数,从而实现类似类的成员函数的机制呢?答案是肯定的. package main import "fmt" type stru struct { testf ...

  2. C#基础回顾(二)—页面值传递、重载与重写、类与结构体、装箱与拆箱

    一.前言 -孤独的路上有梦想作伴,乘风破浪- 二.页面值传递 (1)C#各页面之间可以进行数据的交换和传递,页面之间可根据获取的数据,进行各自的操作(跳转.计算等操作).为了实现多种方式的数据传递,C ...

  3. go语言结构体

    定义: 是一种聚合的数据类型,是由零个或多个任意类型的值聚合成的实体. 成员: 每个值称为结构体的成员. 示例: 用结构体的经典案例处理公司的员工信息,每个员工信息包含一个唯一的员工编号.员工的名字. ...

  4. C语言中的结构体

    用户自己建立自己的结构体类型 1.  定义和使用结构体变量 (1).结构体的定义 C语言允许用户自己建立由不同类型数据组成的组合型的数据结构,它称为结构体. (2).声明一个结构体类型的一般形式为: ...

  5. C++_系列自学课程_第_12_课_结构体

    #include <iostream> #include <string> using namespace std; struct CDAccount { double bal ...

  6. java socket传送一个结构体给用C++编写的服务器解析的问题

    另一端是Java写客户端程序,两者之间需要通信.c++/c接收和发送的都是结构体,而Java是直接发送的字节流或者byte 数组.解决方法:c++/c socket 在发送结构体的时候其实发送的也是字 ...

  7. swift学习笔记3——类、结构体、枚举

    之前学习swift时的个人笔记,根据github:the-swift-programming-language-in-chinese学习.总结,将重要的内容提取,加以理解后整理为学习笔记,方便以后查询 ...

  8. HDOJ 1009. Fat Mouse' Trade 贪心 结构体排序

    FatMouse' Trade Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  9. C语言结构体对齐

    1.结构体变量中的元素如何访问? (1)数组中元素的访问方式:表面上有2种方式(数组下标方式和指针方式):实质上都是指针方式访问.(2)结构体变量中的元素访问方式:只有一种,用.或者->的方式来 ...

随机推荐

  1. 【mysql】【分组】后取每组的top2

    DROP TABLE IF EXISTS `tb1`; CREATE TABLE `tb1` ( `id` ) NOT NULL AUTO_INCREMENT, `a` ) DEFAULT NULL, ...

  2. CSU-ACM2016暑假集训训练2-DFS(C - Network Saboteur)

    C - Network Saboteur Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu ...

  3. 初学C++,开博第一篇

    几个维度相同的数组转置算法,这两种完全相同://注意:如果维度不同,转置会出错误,因为下标会越界...解决办法是把数组的维度调齐,或者是写到另一新数组中. for(int i=0;i<row;i ...

  4. Where does Windows store MSI files for uninstallation?

    Original link: Where does Windows store MSI files for uninstallation? Following content are only use ...

  5. C#与C++相比较之STL篇

    引言 Program into Your Language, Not in It--<代码大全>.如何深入一门语言去编程?我认为有三步:熟悉它:知道它的局限性:扩展它.如何熟悉?不必说,自 ...

  6. 九度OJ 1349 数字在排序数组中出现的次数 -- 二分查找

    题目地址:http://ac.jobdu.com/problem.php?pid=1349 题目描述: 统计一个数字在排序数组中出现的次数. 输入: 每个测试案例包括两行: 第一行有1个整数n,表示数 ...

  7. 模板:函数memcpy

    函数原型 void *memcpy(void *dest, const void *src, size_t n); 2功能 从源src所指的内存地址的起始位置开始拷贝n个字节到目标dest所指的内存地 ...

  8. C#拓展练习之模拟键盘录入

    摘自<31天学会CRM项目开发<C#编程入门级项目实战>> 使用C#调用Windows API使程序模拟键盘输入,也可模拟按下快捷键.本例中,单击“模拟输入”按钮,可录入字符“ ...

  9. centos7下添加win7引导

    这次在centos7下添加为win7引导的过程可谓是一波三折,首先是在网上找教程,这个过程还是很顺利的,通不断的 搜索,找到了两个办法.第一个办法就是在root下执行这样的一个命令: grub2-mk ...

  10. fedora 非root用户访问socket 没用权限

    在非root用户下执行基于Libpcap库编写的应用程序时不能正常运行,原因是由于libpcap库使用raw socket的套接字.而Raw Socket的使用需要root权限,否则raw socke ...