17 Oct
2014
17 Oct
'14
9 a.m.
To have a human-readable SQL code, I am used in following code formatting: SELECT a FROM tbl WHERE 1=1 --<<-- absolutely useless, but nice for formatting AND col1 = 1 AND col2 = 2 AND col3 = 3 Instead of "1=1", some other databases accept "TRUE". When I have multiple OR-conditions, I start with "1=0" or "FALSE". Writing statements this way I noticed long execution times in MonetDB. Omitting the logical where-condition "1=1" results in very fast execution time. So I guess, MonetDB is really checking on every row, if 1=1.