PostgreSQL Antipatterns: Condition Evaluation in SQL
SQL is not C++, nor is it JavaScript. Therefore, the evaluation of logical expressions is different, and this is not the same thing at all: WHERE fncondX() AND fncondY() = fncondX() && fncondY() In the process of optimizing the execution plan of a query, PostgreSQL can arbitrarily "rearrange" the equivalent conditions, do not calculate any of them for individual records, refer to […]