title: most suited search algorithm?
body: <p>I'm now facing a problem and I'm not sure what the right solution is. I'll try to explain it, and I hope someone has some good solutions for me:</p>
  
  <p>I have two big data arrays. One that I'm browsing, with something between 50^3 and 150^3 data samples (usually between 50 and 100, rare worst case scenario 150).
  For every sample, I want to make a query on another structure that is around the same size (so huge number of total combinations, I can't explore them all).</p>
  
  <p>The query can't be predicted exactly but usually, it is something like :
  structure has fields A B C D E F G (EDIT : in total, it's something like 10 to 20 int fields).
  query is something like :
  10 &lt; A &lt; 20 and B > 100 and D > 200.
  Yes, it's really close to SQL.</p>
  
  <p>I thought to put this in a database, but actually it would be a standalone database, and I can work in RAM to make it even faster (speed is an essential criteria).</p>
  
  <p>I thought to try something using GPGPU but it seems it's a terrible idea and despite search can be parallel, it does't seem to be a good idea, searching an unpredictable number of results isn't a good application (if someone can tell me if my understanding has been right it would help me confirm that I should forgive this solution).
  EDIT : the nubmer of results is unpredictable because of the query nature, but the it is quite low, since the purpose is to find a low number of well suited combinations</p>
  
  <p>Then since I could use a DB, why not make a RAM B-Tree? it seems close to the solution, but is it? If it is, how should I build my indexes? Can I really do multidimensional indexes, since multidimensional search will always exist? probably UB-Tree or R-tree could do the job (but in my second data sample, I could have some duplicates, so doesn't it make the R-TREE non applicable?).
  The thing is, I'm not sure I understand properly all those right now, so if one of you knows trees (and gpgpu, and even solutions I didn't think to), perhaps you could let me know which solution I should explore, learn, and implement?</p>