GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 关于Mysql-据库索引总结1-使用索引的注意事项中,“加索引的列设置为 NOT NULL ,而进行全表扫描” · Issue #758 · Snailclimb/JavaGuide

关于Mysql-据库索引总结1-使用索引的注意事项中,“加索引的列设置为 NOT NULL ,而进行全表扫描” #758

New issue
Copy link
New issue
Copy link
Closed
Closed
关于Mysql-据库索引总结1-使用索引的注意事项中,“加索引的列设置为 NOT NULL ,而进行全表扫描”#758
Copy link
Labels
enhancementNew feature or request or suggestion

Description

@nudt681
nudt681
opened on Apr 28, 2020
Issue body actions

加索引的列设置为 NOT NULL ,否则将导致引擎放弃使用索引而进行全表扫描
经过试验把某一列设置为default null,where是可以走索引

Activity

  1. LiWenGu commented on Apr 29, 2020

    @LiWenGu
    LiWenGu
    on Apr 29, 2020
    Contributor
    More actions

    先说结论,你是对的,确实会走索引,文章中描述是有问题的。
    另外 index 是否设置 NULL 是不影响性能的

    And, in case you’re wondering, allowing NULL values in the index really doesn’t impact performance
    来源:高性能MySQL第四章

    NULL 值的索引查找流程参考:https://juejin.im/post/5d5defc2518825591523a1db

  2. Snailclimb
    added
    enhancementNew feature or request or suggestion
    on May 8, 2020
  3. Snailclimb
    closed this as completedon May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request or suggestion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.