Yo_oY's recent timeline updates
Yo_oY

Yo_oY

I'm here, as always.
V2EX member #8170, joined on 2011-04-21 18:56:09 +08:00
30 S 46 B
Yo_oY's recent replies
Jul 26, 2015
Replied to a topic by caobug 前端开发 如何防止用户模拟提交表单?
验证码?
May 16, 2015
Replied to a topic by xleo 4G 薅联通羊毛, 10 元包 1G。求接力!
帮楼上的都合过了 求帮忙
小手一抖,帮我10元抢1G流量! 我还差4点成长值就能10元抢1G流量,快来帮我合体成长值! http://wap.10010.com/t/wgj/goFit/2f9ff42e5c9b2648d8ab069b4294b4be.htm
@fabregaszy 哈哈哈哈,人手不够,首页都没空改,好像不是第一次有人说了……
@Rorschach
@livelxw
欢迎哈!邮件发下简历吧 luxiang@tbs-info.cn
@Cee 校友握爪
遇到过,是按IP的访问频率屏蔽的,用 headless browser 应该也解决不了问题,要用代理服务器。
@lqs 试了一下,改成不存在的值查询也很快,应该不是你说的这个原因。
@zenliver 懂了,多谢!
感谢楼上诸位。
加了个(site_id, created_at)的联合索引,查询速度也只要几十毫秒了。

不过我还是有点疑问,id 和 site_id 并没有建立联合索引,速度依然很快。
难道 order by id 和 order by created_at 会有本质区别么,id 作为主键,已经不是单纯的索引了?
@jhdxr

explain select * from messages
where site_id = 7
order by id desc
limit 1

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE messages ref index_messages_on_site_id index_messages_on_site_id 5 const 102302 Using where


explain select * from messages
where site_id = 7
order by created_at desc
limit 1

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE messages index index_messages_on_site_id index_messages_on_created_at 9 NULL 21 Using where
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5491 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 28ms · UTC 06:48 · PVG 14:48 · LAX 23:48 · JFK 02:48
♥ Do have faith in what you're doing.