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. Struts Spring Plugin注意点

    Settings The following settings can be customized. See the developer guide. Setting Description Defa ...

  2. The user specified as a definer (&#39;root&#39;@&#39;%&#39;) does not exist

     通常是因为root用户对全局host无訪问权限.因此仅仅要给root用户加入一个訪问权限就可以. 解决的方法: 登陆mysql .运行 mysql -u root -pPasswd mysql ...

  3. iDempiere = OSGi + ADempiere 一款ERP&CRM&SCM系统、助力中小企业发展

    怀揣着为中小企业量身定做一整套开源软件解决方案的梦想开始了一个网站的搭建.http://osssme.org/ iDempiere = OSGi + ADempiere 一款ERP&CRM&a ...

  4. a标签上的点击事件

    当我们在处理a标签上的点击事件时发现即使href=""里面为空,点击事件的效果也不明显,这种情况该如何处理呢?常见的处理方法有以下几种: 1.a href="javasc ...

  5. Codeforces 476C Dreamoon and Sums (水

    题目链接:点击打开链接 题意: 给定a,b 对于一个数x.若x是nice number,则满足(x/b)/(x%b) == [1,a](即结果在1-a之间) 问: 输出一个数表示 全部nice num ...

  6. chrome mp4格式支持问题

    经过一些搜索得知,其实根本的问题是虽然大家都是.mp4后缀的文件,但是编码方式不同,而video标签的标准是用H.264方式编码视频的MP4文件(当然video标签还可以播放WebM和OGG格式的文件 ...

  7. [置顶] Android开发笔记(成长轨迹)

    分类: 开发学习笔记2013-06-21 09:44 26043人阅读 评论(5) 收藏 Android开发笔记 1.控制台输出:called unimplemented OpenGL ES API ...

  8. [转]jsonp详解

    jsonp详解 json相信大家都用的多,jsonp我就一直没有机会用到,但也经常看到,只知道是“用来跨域的”,一直不知道具体是个什么东西.今天总算搞明白了.下面一步步来搞清楚jsonp是个什么玩意. ...

  9. SDUTOJ 2772 KMP简单应用

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvUl9NaXNheWE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA ...

  10. spring cloud与K8S

    链接:https://www.zhihu.com/question/50806354/answer/139653085 spring cloud +docker 当然没有问题,只是当我们搭建集群实现高 ...