> This minimizes the hash beforehand, to make the following filter less expensive.

I don't think hashes work like that.