UUIDs are stored in a binary form, but not byte-swapped like in MySQL's uuid_to_bin https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_uuid-to-bin
The order provided by UUID_TO_BIN() is not really friendly to index prefix compression:
it only reorders the timestamp segments, while the clock-seq and the node-ID segments are still at the end. This ruins the whole idea of prefix compression.
Let's sort UUID in a really index-friendly order, by moving the constant part to the left and the variable part to the right.
So for comparison purposes we'll reorder segments, but keep the byte order inside the segments (i.e. in big endian order):