记录几条mysql查询语句
记录几条sql查询语句
use db_hq_price_alarm_gnn; select max(id) as pick_max_id from t_pick_stock; SELECT auto_increment as pick_max_id2 FROM information_schema.tables where table_schema="db_hq_price_alarm_gnn" and table_name="t_pick_stock"; select * from t_pick_stock ORDER BY id desc LIMIT 10; # select count(*) pick_count from t_pick_stock; select max(id) as alarm_rule_maxid from t_user_alarm_rules; select max(user_id) as userinfo_maxid from t_user_info; select count(*) userinfo_count from t_user_info; # SELECT * FROM t_user_info WHERE (hash_uid >= 0); # SELECT * FROM t_user_info WHERE (hash_uid<=0); # SELECT t_user_alarm_rules.uid,market,code,alarmType,threshold,endTime,startTime,t_user_alarm_rules.utime,ext,valid,expire,triggerTime # FROM t_user_alarm_rules INNER JOIN ( SELECT uid FROM t_user_info WHERE ((hash_uid >= 5000 AND hash_uid < 10000))) users USING(uid) # where id>=67000000 and id< 68000000; # SELECT t_user_alarm_rules.uid,market,code,alarmType,threshold,endTime,startTime,t_user_alarm_rules.utime,ext,valid,expire,triggerTime # FROM t_user_alarm_rules # where id>=67000000 and id< 68000000; # SELECT t_user_alarm_rules.uid,market,code,alarmType,threshold,endTime,startTime,t_user_alarm_rules.utime,ext,valid,expire,triggerTime FROM t_user_alarm_rules INNER JOIN # ( SELECT uid FROM t_user_info WHERE ((hash_uid >= 5000 AND hash_uid < 10000))) users USING(uid) # where id>=2000000 and id< 3000000; # SELECT t_user_alarm_rules.uid,market,code,alarmType,threshold,endTime,startTime,t_user_alarm_rules.utime,ext,valid,expire,triggerTime FROM t_user_alarm_rules INNER JOIN ( SELECT uid FROM t_user_info WHERE ((hash_uid >= 5000 AND hash_uid < 10000))) users USING(uid) # where id>=86000000 and id< 86500000; # SELECT t_user_alarm_rules.uid,market,code,alarmType,threshold,endTime,startTime,t_user_alarm_rules.utime,ext,valid,expire,triggerTime FROM t_user_alarm_rules # INNER JOIN ( SELECT uid FROM t_user_info WHERE ((hash_uid >= 5000 AND hash_uid < 10000))) # users USING(uid) where id>=106500000 and id< 107000000;
分页查询 + inner join
2022-12-01 17:55:52|[DbManager.cpp::loadUserAlarmRule::398] DEBUG loadUserAlarmRule cost:42260ms|size::436627|
sql:SELECT t_user_alarm_rules.uid,market,code,alarmType,threshold,endTime,startTime,t_user_alarm_rules.utime,ext,valid,expire,triggerTime
FROM t_user_alarm_rules
INNER JOIN
( SELECT uid FROM t_user_info
WHERE ((hash_uid >= 5000 AND hash_uid < 10000)))
users USING(uid)
where id>=131000000 and id< 132000000; 2022-12-01 17:56:49|[DbManager.cpp::loadUserAlarmRule::398] DEBUG loadUserAlarmRule cost:24051ms|size::457798|sql:SELECT t_user_alarm_rules.uid,market,code,alarmType,threshold,endTime,startTime,t_user_alarm_rules.utime,ext,valid,expire,triggerTime FROM t_user_alarm_rules INNER JOIN ( SELECT uid FROM t_user_info WHERE ((hash_uid >= 5000 AND hash_uid < 10000))) users USING(uid) where id>=132000000 and id< 133000000