MySQL的联合索引和覆盖索引

关于MySQL的联合索引,覆盖索引一直蒙蒙哒,所以写点东西来熟悉一下
首先创建一个表orders,结构如下:

create table orders(
order_id int unsigned auto_increment,
order_status int not null,
total_price int unsigned,
settle_type int,
store_id int,
buyer_id int,
goods varchar(20),
create_time datetime default current_timestamp,
primary key(order_id)
);

然后我们创建一个存储过程,向这个表中插入一些数据:

drop procedure if exists load_orders;
delimiter //
create procedure load_orders(count int unsigned)
begin
declare status int default 0;
declare type int default 0;
declare store int default 133;
declare price int default 85;
declare buyer int default 1001;
declare goods varchar(20) ;
declare i int unsigned default 0;
SET goods= 'al';
while i<count DO
  SET status=mod (status,77);
  SET type=mod(type,29);
<
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值