Comparison functions compare values and assert the equality of a statement.
LT If both arguments are numbers, returns true if the first provided value is less than the second. If both arguments are strings, returns true if the first provided value falls lexicographically before the second. Always false if either argument is empty, or if the types of the columns do not match.
# Infix operator usage: left < right
# Examples
$roundtrip_us < 500
$mysql_read_ms < $mysql_write_ms
# Function usage: LT(left, right)
# Examples
LT($roundtrip_us, 500)
LT($mysql_read_ms, $mysql_write_ms)
LTE If both arguments are numbers, returns true if the first provided value is less than or equal to the second. If both arguments are strings, returns true if the first provided value is the same as, or falls lexicographically before, the second. Always false if either argument is empty, or if the types of the columns do not match.
# Infix operator usage: left <= right
# Examples
$roundtrip_ms <= 0.5
$get_schema_ms <= $persist_schema_ms
# Function usage: LTE(left, right)
# Examples
LTE($roundtrip_ms, 0.5)
LTE($get_schema_ms, $persist_schema_ms)
GT If both arguments are numbers, returns true if the first provided value is greater than the second. If both arguments are strings, returns true if the first provided value falls lexicographically after the second. Always false if either argument is empty, or if the types of the columns do not match.
# Infix operator usage: left > right
# Examples
$payload_size_kb > 300
$num_invalid_columns > $num_valid_columns
# Function usage: GT(left, right)
# Examples
GT($payload_size_kb, 300)
GT($num_invalid_columns, $num_valid_columns)
GTE If both arguments are numbers, returns true if the first provided value is greater than or equal to the second. If both arguments are strings, returns true if the first provided value is the same as, or falls lexicographically after, the second. Always false if either argument is empty, or if the types of the columns do not match.
# Infix operator usage: left >= right
# Examples
$payload_size_mb >= 0.3
$memory_inuse >= ($max_memory_process * 0.75)
# Function usage: GTE(left, right)
# Examples
GTE($payload_size_mb, 0.3)
GTE($memory_inuse, MUL($max_memory_process, 0.75))
EQUALS Returns true if the two provided arguments are equal.
Arguments of different types, such as the integer 200 and the string "200", are not considered equal.
# Infix operator usage: left = right
# Examples
$remote_addr = "216.3.123.12"
$gzipped = true
$oversize_num_columns = 0
# Function usage: EQUALS(arg1, arg2)
# Examples
EQUALS($remote_addr, "216.3.123.12")
EQUALS($gzipped, true)
EQUALS($oversize_num_columns, 0)
NOT(EQUALS) NOT() with EQUALS() as an argument returns true if the two provided arguments are not equal. This is equivalent to the not equal operator (!=).
# These are equivalent
$method != "POST"
!EQUALS($method, "POST")
NOT(EQUALS($method, "POST"))