摘要: SELECT * as total FROM ( (SELECT live_msg.id AS oid from stat_user_liver_refer_stock,live_msg WHERE l_id not in ($liveLids) and live_msg.rec_time>DATE 阅读全文
posted @ 2021-12-30 16:15 17601621550 阅读(481) 评论(0) 推荐(0)
摘要: 现有:user 用户表 user_msg 用户文章表 需求:批量取一定时间范围内注册的各个用户发表的前3条文章 select * from user_msg a where a.u_id in (SELECT id FROM `user` where rec_time>="2021-11-07") 阅读全文
posted @ 2021-12-07 18:27 17601621550 阅读(1412) 评论(0) 推荐(0)
摘要: 一个神奇的网站:https://www.cs.usfca.edu/~galles/visualization/Algorithms.html 可以准确的看到B+树插入、删除、查找的动态过程 B树和B+树的区别: B树的数据和索引在每一个节点上,B+树的所有数据都存在于叶子结点,非叶子结点只是主键。正 阅读全文
posted @ 2021-11-19 09:24 17601621550 阅读(66) 评论(0) 推荐(0)
摘要: 1.单独需要这样查,循环查的话效率很慢。 select profit_rate_w as w_r,profit_rate_t as t_r ,profit_rate_m as m_r,profit_rate_d as d_r from replica_profit where u_id=36273 阅读全文
posted @ 2021-08-31 16:49 17601621550 阅读(299) 评论(0) 推荐(0)
摘要: 一:残余检查: 1:卸载python(以免有些同学没有卸载干净) 1 2 3 rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps #强制删除已安装程序及其关联 whereis python|xargs rm -frv #删除所有残余文件 # 阅读全文
posted @ 2021-08-10 11:01 17601621550 阅读(617) 评论(0) 推荐(0)
摘要: 一、冒泡排序 基本思想: 对需要排序的数组从后往前(逆序)进行多遍的扫描,当发现相邻的两个数值的次序与排序要求的规则不一致时,就将这两个数值进行交换。这样比较小(大)的数值就将逐渐从后面向前面移动。 //冒泡排序 <?php function bubbleSort1() { $arr = [11, 阅读全文
posted @ 2021-05-25 16:36 17601621550 阅读(94) 评论(0) 推荐(0)
摘要: 如下: select username,phone from user where username like CONCAT('%', phone ,'%'); 查询username字段中与phone字段值相似的记录 阅读全文
posted @ 2021-03-11 16:45 17601621550 阅读(261) 评论(0) 推荐(0)
摘要: 安装perf yum install perf perf几个常用命令 # 统计全局性能 perf record -g # 查看记录 perf report 查看某个进程的异常问题 # 查看进程ID ps aux|grep index.php # 查看记录 perf record -p 276 一段时 阅读全文
posted @ 2021-03-10 09:33 17601621550 阅读(71) 评论(0) 推荐(0)
摘要: 在服务器上创建一个新的Nginx配置文件nginx.conf,将上边两个文件与配置文件放在同一目录中。在配置文件中写入如下配置(部分代码): # nginx.conf # 设置用户权限 user root; events { worker_connections 1024; } http { # 配 阅读全文
posted @ 2021-03-09 15:06 17601621550 阅读(24) 评论(0) 推荐(0)
摘要: 在php开发过程中,你是否会遇到这样问题,在循环当中,去get或者set缓存redis的key,大家知道这样做效率会很低,那我们应该这么做呢? 可以使用redis 中pipline,mset, mget,都可以提高我们程序的性能,下面对比一下他们的性能。 先看下管道 $redis = new Red 阅读全文
posted @ 2021-03-08 11:46 17601621550 阅读(19) 评论(0) 推荐(0)