
Mysql
雷小农
舒服是留给死人的
展开
-
SQL优化
1.对查询进行优化,要尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如: select id from t where num is null 最好不要给数据库留NULL,尽可能的使用 NOT NULL填充数据库. 备注、描述、评论之类的可以设置为 ...原创 2019-07-01 22:10:46 · 107 阅读 · 0 评论 -
Mysql建表语句
show variables like ‘character_set_client’;#查询字符集 2 show databases;#列出所有的服务器上的数据库alter 3 create database if not exists test;#创建一个数据库 4 drop database fk;#删除数据库 5 show tables from test;#显示一个数据库中的表 6 use...原创 2019-06-30 23:08:08 · 222 阅读 · 0 评论