Why databases make the distinction between basic logical operations and functions It just occurred to me that things like "greater than or equal to" and other "logical operators" are also just simple functions, such as gte(a, b) == a &gt;= b. This makes me wonder why these are treated as "special" in databases and why they are not just functions like SQL functions. Wondering if there is some advantage to treating them differently like they do.
Database indices are typically binary search trees, meaning you can do range queries on them very efficiently.  If you handed the database the >= relation as a black box, on the other hand, it would have to iterate over every single record in the table performing the check.