Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
sqlite在哪里短路_Sql_Sqlite - Fatal编程技术网

sqlite在哪里短路

sqlite在哪里短路,sql,sqlite,Sql,Sqlite,例如: select * from A where predicate1 and predicate2 and predicate3; 如果predicate1返回false,程序是否会继续计算其他谓词?干杯 优化器可能会对谓词进行重新排序,在一般情况下,将执行所有谓词: sqlite> .explain on sqlite> explain select 1 where 11=22 and 33=44; addr opcode p1 p2 p3 p4

例如:

select * from A where 
predicate1 and 
predicate2 and 
predicate3;

如果predicate1返回false,程序是否会继续计算其他谓词?干杯

优化器可能会对谓词进行重新排序,在一般情况下,将执行所有谓词:

sqlite> .explain on sqlite> explain select 1 where 11=22 and 33=44; addr opcode p1 p2 p3 p4 p5 comment ---- ------------- ---- ---- ---- ------------- -- ------------- 0 Trace 0 0 0 00 1 Integer 11 3 0 00 2 Integer 22 4 0 00 3 Eq 4 2 3 72 4 Integer 33 3 0 00 5 Integer 44 5 0 00 6 Eq 5 4 3 72 7 And 4 2 1 00 8 IfNot 1 12 1 00 9 Goto 0 13 0 00 10 Integer 1 6 0 00 11 ResultRow 6 1 0 00 12 Halt 0 0 0 00 13 Goto 0 10 0 00 sqlite>。请在上进行解释 sqlite>解释选择1,其中11=22和33=44; 地址操作码p1 p2 p3 p4 p5注释 ---- ------------- ---- ---- ---- ------------- -- ------------- 0跟踪0 0 00 1整数11 300 2整数22 4 0 00 3等式4 2 3 72 4整数33 300 5整数44 500 6等式5 4 3 72 7和4 2 1 00 8如果不是112100 9转0 13 0 00 10整数16000 11结果6 1 0 00 12暂停0 0 00 13转到01000
你的谓词有副作用吗?简短的回答是否定的,或者?因此不允许像“是”或“否”这样简短的评论,所以我必须让你参考答案的第一句话。