search

Home  >  Q&A  >  body text

In mysql optimization, the field setting is not null.

In mysql optimization, try to avoid setting fields to null, which will affect the query speed. This refers to only whether the index field is not set to null, or it is best not to set all fields to null

CraileCraile1703 days ago1384

reply all(3)I'll reply

  • 查无此人

    查无此人2020-04-07 10:38:55

    For the string type, just use EMPTY STRING as the default value. If you don’t use null, the problem you mentioned will not occur.

    In the MyISAM engine of Mysql, the null value occupies additional storage space. (1bit), the empty string takes up no space at all.

    Null values ​​cannot be stored in B-tree indexes, which will cause serious performance problems when the amount of data is large

    reply
    0
  • Mr.B/Two㊣

    Teacher, in your tutorial on PhpSpreadsheet for quickly controlling Excel with PHP, there is a 100php public method library. Can you send it to us? If you see the information, can you send it to my email (88303059@qq.com) Thank you

    Mr.B/Two㊣ · 2020-06-05 22:04:35
    Mr.B/Two㊣

    By the way, there’s that CSS, haha

    Mr.B/Two㊣ · 2020-06-05 22:06:27
  • Cancelreply