Mysql 插入100条数据存储过程。每次使用完删除。

##gns 推送存储过程。每次需要删除原来的。


DELIMITER $$


DROP PROCEDURE IF EXISTS test_insert $$ 
create procedure test_insert
( a int)
begin
   declare i int;
   declare str VARCHAR(15);
   declare result_str VARCHAR(30);
   set str='PNXIA';
   set result_str='';
   set i=1;
   WHILE i  <= a DO 
     SET  result_str = CONCAT(str,i); 
     SET  i = i + 1; 


     insert into `push_notice` (`pn_no`, `user_no`, `registration_id`, `title`, `alert`,
`platform`, `state`, `result`, `reason_code`, `reason_desc`, `extras`, `date_gen`, `date_send_start`, `date_send_end`) values(result_str,'UR1209192899439251456','18071adc03020a4fee3','免息券领取通知','免息券到手,借款5000元可免7日利息。简直白拿!马上用起来>>','all','NOTSEND','',NULL,NULL,NULL,'2017-01-07 13:31:54','2017-01-07 17:18:21','2017-01-07 17:18:21');
       
END WHILE; 
  
end $$;




call test_insert(100);


select * from push_notice where pn_no like 'PNXIA%' AND registration_id = '18071adc03020a4fee3'  AND date_send_end >DATE_FORMAT('2017-01-09 10:47','%Y-%m-%d %H:%i')


delete from push_notice where pn_no like 'PNXIA%';








select DATE_FORMAT(date_send_end,'%Y-%m-%d %H:%i'),count(*) from  push_notice where pn_no like 'PNXIA%' AND registration_id = '18071adc03020a4fee3'  and date_send_end>date_created and date_created>DATE_FORMAT('2017-01-09 10:47','%Y-%m-%d %H:%i') GROUP BY DATE_FORMAT(date_send_end,'%Y-%m-%d %H:%i')








select UNIX_TIMESTAMP(date_send_end)-UNIX_TIMESTAMP(date_created) from push_notice where pn_no like 'PNXIA%' AND registration_id = '18071adc03020a4fee3' AND date_send_end>date_created AND date_created>DATE_FORMAT('2017-01-09 10:40','%Y-%m-%d %H:%i')






100个
   
并发数         推送的平均时间
100            13.77ms
200            26.6ms
400             59.92ms        有 RESULT ='FAIL'  code_reason=2002      119 errors           29.7%        Request times of the app_key exceed the limit of current time window

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值