I’d suggest having a look at the following post as well: Efficient Session Relevance Query for Computer Properties
It goes into a lot of detail, and has some suggested approaches to help with these types of situations, as well as a structure that is very efficient.