/** 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. 使用jQuery调用ASP.NET WebService的简易教程

    鉴于使用Javascript调用Web Service配置略麻烦,所以记录一下. 1. 新建一个Web服务(WebService.asmx) 2. 取消注释// [System.Web.Script. ...

  2. 安装sinopia-ldap

    背景: 已经安装好sinopia,配置好本地npm源 安装sinopia-ldap: npm install -g sinopia-ldap 配置: 修改sinopia的配置文件config.yaml ...

  3. Headfirst设计模式的C++实现——迭代器(Iterator)改良版

    iterator.h #ifndef _ITERATOR_H_ #define _ITERATOR_H_ class Iterator { public: ; ; }; #endif menu.h # ...

  4. CSS3之渐变效果

    在css3出来之前,想要出现渐变效果必须就要制作一张图片.不过css3的出现使得渐变效果变得简单.由于不是所有的浏览器都支持css3,所以不是所有的浏览器都能够呈现出css3的效果出来.因此目前大部分 ...

  5. web api 如何接收post过来的json字符串

    前言 好久没有写博客了,有一天同学问我咋不写了,我说没啥写的,都是一些基础的东西.然后他说,难道写东西不是为了总结吗?我说是的.....额,我是不知道怎么说了.确实是写博客也是给自己的一种总结,一种理 ...

  6. django 中的延迟加载技术,python中的lazy技术

    ---恢复内容开始--- 说起lazy_object,首先想到的是django orm中的query_set.fn.Stream这两个类. query_set只在需要数据库中的数据的时候才 产生db ...

  7. C#中的socket编程方法

    服务器: 第一步,准备socket套接字:Socket sockfd = new Socket(AddressFamily.InterNetwork,SocketType.Stream,Protoco ...

  8. NetBeans8 类编缉器及控制台中文乱码解决

    1.类编辑器中文乱码的解决: 工具-->选项-->字体和颜色-->"语法"选项卡:右侧选择字体的地方设置一个支持中文的字体,如宋体.新宋体.微软雅黑等 2.控制台 ...

  9. JLink软件升级到4.92之后,Jlink不能用了

    JLink软件升级到4.92之后,Jlink不能用了                                                       情景描述: Jlink软件升级到4.9 ...

  10. 一步步学习NHibernate(3)——NHibernate增删改查

    请注明转载地址:http://www.cnblogs.com/arhat 在上一章中,我们配置了以下NHibernate的运行环境, 并介绍了NHibernate的中两个非常中重要的接口"I ...