智能刊登Gaussdb 优化点 :
1.确定是查询的语句,可以通过hint语句指定在读节点上查询,避免因代理长连接到主节点查询;
用法:/*force SLAVE*/ SELECT COUNT(1) as success FROM tb WHERE id=1
2.针对in 子查询(元素大于30的),可以参考昨天育贵的推荐的方法,测试比较快;
用法:子元素拼接表和实体表inner join连接查询
select T1.* from tb as T1 inner join
(select '123456' as id
union all
select '456' as id
union all
select '789' as Sku)as T2 on T1.id=T2.id