4 ms·
> Sorry, no. The original schema was correct, and the new one is a mistake. Well, you also save a space by doing this (though presumably you only need to index
by omegalulw 5y ago
> Sorry, no. The original schema was correct, and the new one is a mistake.
Well, you also save a space by doing this (though presumably you only need to index the emails as IPs are already 128 bits).
But other than that, I'm also not sure why the original schema was bad.
If you were to build individual indexes on all four rows, you would essentially build the four id tables implicitly.
You can calculate the intersection of hits on all four indexs that match your query to get your result. This is linear in the number of hits across all four indexes in the worst case but if you are careful about which index you look at first, you will probably be a lot more efficient, e.g. (from, ip, to, helo).
Even with a multi index on the new schema, how do you search faster than this?