w

https://dev.mysql.com/doc/refman/5.7/en/create-index.html

MySQL :: MySQL 5.7 Reference Manual :: B.5.4.3 Problems with NULL Values
https://dev.mysql.com/doc/refman/5.7/en/problems-with-null.html

You can add an index on a column that can have NULL values if you are using the MyISAMInnoDB, or MEMORY storage engine. Otherwise, you must declare an indexed column NOT NULL, and you cannot insert NULL into the column.

MySQL :: MySQL 5.7 Reference Manual :: 14.1.14 CREATE INDEX Syntax
https://dev.mysql.com/doc/refman/5.7/en/create-index.html

The MyISAMInnoDBNDB, and ARCHIVE storage engines support spatial columns such as (POINT and GEOMETRY. (Section 12.5, “Extensions for Spatial Data”, describes the spatial data types.) However, support for spatial column indexing varies among engines. Spatial and nonspatial indexes are available according to the following rules.

Spatial indexes (created using SPATIAL INDEX) have these characteristics:

  • Available only for MyISAM and InnoDB tables. Specifying SPATIAL INDEX for other storage engines results in an error.

  • Indexed columns must be NOT NULL.

  • Column prefix lengths are prohibited. The full width of each column is indexed.

Characteristics of nonspatial indexes (created with INDEXUNIQUE, or PRIMARY KEY):

  • Permitted for any storage engine that supports spatial columns except ARCHIVE.

  • Columns can be NULL unless the index is a primary key.

  • For each spatial column in a non-SPATIAL index except POINT columns, a column prefix length must be specified. (This is the same requirement as for indexed BLOB columns.) The prefix length is given in bytes.

  • The index type for a non-SPATIAL index depends on the storage engine. Currently, B-tree is used.

  • You can add an index on a column that can have NULL values only for InnoDBMyISAM, and MEMORY tables.

  • You can add an index on a BLOB or TEXT column only for using the InnoDB and MyISAM tables.

  • When the innodb_stats_persistent setting is enabled, run the ANALYZE TABLE statement for an InnoDB table after creating an index on that table.

You can add an index on a column that can have NULL values if you are using the MyISAM, InnoDB, or MEMORY storage engine.的更多相关文章

  1. Java ArrayList add(int index, E element) example

    Simple add() method is used for adding an element at the end of the list however there is another va ...

  2. MongoDB Sort op eration used more than the maximum 33554432 bytes of RAM. Add an index, or speci fy a smaller limit.

    最近在获取mongodb某个集合的数据过程中,在进行排序的过程中报错,具体报错信息如下: Error: error: { , "errmsg" : "Executor e ...

  3. eclips git中的add to Index无效解决

    今天在使用eclips git中的add to Index,发现其无效,具体如下 问题描述: 通过export导入一个git java项目 在java工程中新增一个类文件IndicatorCalcTe ...

  4. sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) Cannot add a NOT NULL column with default value NULL [SQL: u'ALTER TABLE address_scopes ADD COLUMN ip_version INTEGER NOT NULL']

    root@hett-virtual-machine:~# su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neu ...

  5. list.add(int index, E element)和list.addAll(list1)

    List.add(int index, E element): 在列表的指定位置插入指定元素(可选操作).将当前处于该位置的元素(如果有的话)和所有后续元素向右移动(在其索引中加 1). 参数:ind ...

  6. com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'goodsName' cannot be null

    com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'goodsName' cannot be n ...

  7. select 下拉菜单Option对象使用add(elements,index)方法动态添加

    原生js 的add函数为下拉菜单增加选项 1.object.add(oElement [, iIndex]) index 可选参数:指定元素放置所在的索引号,整形值.如果没有指定值,将添加到集合的最后 ...

  8. 关于 NPOI 报 Invalid column index (256). Allowable column range for BIFF8 is (0..255) or ('A'..'IV') 错误的解决办法

    当看到这个错误的时候,网上搜索可以会有些说列数有限制之类的说法,这个说法是相对于 Office 2003 的,在 Office 2007 之前,最多只可以创建  列:在 Office 2007 之后, ...

  9. [转]jQuery: get table column/row index remove table column (by column number)

    本文转自:http://www.xinotes.org/notes/note/1087/ <!DOCTYPE html><html><head> <title ...

随机推荐

  1. NYOJ1097 Ugly Numbers 【丑数】

    Ugly Numbers 时间限制:1000 ms  |  内存限制:65535 KB 难度:2 描写叙述 Ugly numbers are numbers whose only prime fact ...

  2. Alternating Least Squares(ASL) for Implicit Feedback Datasets的数学推导以及用Python实现

    近期在看CF的相关论文,<Collaborative Filtering for Implicit Feedback Datasets>思想非常好,非常easy理解.可是从目标函数 是怎样 ...

  3. 【Java】Java_07 浮点型

    浮点型 类型 占用存储空间 表数范围 Float 4字节 -3.403E38~3.403E38 Double 8字节 -1.798E308~1.798E308 float类型又被称作单精度类型,尾数可 ...

  4. mongoDB 高级查询之取模查询$mod

    http://hancang2000.i.sohu.com/blog/view/235140698.htm $mod取模运算   查询age取模10等于0的数据 db.student.find( { ...

  5. js 页面离开前触发事件

    当前窗口载入新的dom文档前发生 window.onbeforeunload = function(event) { return confirm("确定离开此页面吗?");

  6. win10 在当前目录下 打开cmd

    windows7 : 按住 shift 键 , 右键 就有该选项. windows10 : 运行下面的 注册表文件: 该注册表文件内容如下: Windows Registry Editor Versi ...

  7. XX年年终总结---重新飞跃

    XX年年终总结---重新飞跃 写之前先解释一下为什么是年终总结,由于在提高班学习,每年结束于暑假:新的一年開始于9月. 肚子里的墨水已经找不到新的词语来形容时间过得快了,一年结束了.还有一年又结束了: ...

  8. Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器(第6版)(转)

    转自:http://blog.s135.com/nginx_php_v6/] 前言:本文是我撰写的关于搭建“Nginx + PHP(FastCGI)”Web服务器的第6篇文章.本系列文章作为国内最早详 ...

  9. atitit.解决struts2 SpringObjectFactory.getClassInstance NullPointerException  v2 q31

    atitit.解决struts2 SpringObjectFactory.getClassInstance NullPointerExceptionv2 q31 1. #--现象 java.lang. ...

  10. JAVA 利用SimpleDateFormat将String转换为格式化的日期

    1. /** * 使用用户格式提取字符串日期 * * @param strDate 日期字符串 * @param pattern 日期格式 * @return */ public static Dat ...