您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

完全优化MYSQL数据库性能的八个方法

2024/6/11 4:00:05发布19次查看
delete from customerinfo where customerid not in (select customerid from salesinfo ) select * from customerinfo where customerid not in (select customerid from salesinfo ) select * from customerinfo left join salesinfoon customerinfo.custo
delete from customerinfo
where customerid not in (select customerid from salesinfo )
select * from customerinfo
where customerid not in (select customerid from salesinfo )
select * from customerinfo
left join salesinfoon customerinfo.customerid=salesinfo.
customerid
where salesinfo.customerid is null
select name, phone from client
union
select name, birthdate from author
union
select name, supplier from product
begin;
insert into salesinfo set customerid=14;
update inventory set quantity=11
where item='book';
commit;
lock table inventory write
select quantity from inventory
whereitem='book';
...
update inventory set quantity=11
whereitem='book';
unlock tables
create table customerinfo
(
customerid int not null ,
primary key ( customerid )
) type = innodb;
create table salesinfo
(
salesid int not null,
customerid int not null,
primary key(customerid, salesid),
foreign key (customerid) references customerinfo
(customerid) on deletecascade
) type = innodb;
select * from order where year(orderdate)<2001;
select * from order where orderdate<2001-01-01;
select * from inventory where amount/7<24;
select * from inventory where amount<24*7;
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product