In case anyone was curious, I am ... surprised ......
# general
r
In case anyone was curious, I am ... surprised ... that this works, but it does. (Shard by XOR of local_port and remote_port, 7 shards.)
Copy code
SELECT
    pid,
    family,
    protocol,
    local_address,
    local_port,
    remote_address,
    remote_port,
    state
FROM process_open_sockets
WHERE
    (((~(local_port&remote_port))&(local_port|remote_port)) % 7) == 0 AND
    state != 'TIME_WAIT' AND
    family != 1
;