If you end up persisting data in this hex string format (which would be a bit unusual, but I'm not sure what your use case is), then there's some additional methods you could implement to make your queries such as this one perform better:

    SELECT * FROM t WHERE hex_to_bytes(my_column) < 'foo'