最近碰到这样一个SQL引发的性能问题,SQL内容大致如下: 1 2 3 4 5 6 7 SELECT * FROM t1 WHERE id = 999 AND (case $1 WHEN true THEN info = $2 ELSE info = $3 end) limit 1; 开发反应这条SQL加上limit 1之后过了一段时
序列绑定字段与不绑定字段的区别 绑定字段 构造数据 drop sequence if exists test_id_seq;create sequence test_id_seq;drop table if exists test;create table test(id int default nextval(test_id_seq), name text);alter sequence test_id_seq owned b