title: tree map with several keys and range search support
body: <p>I need an efficient data structure which holds mapping of pairs to values</p>
  
  <pre><code>(x,y) =&gt; v
  </code></pre>
  
  <p>and allows to find key-value pairs matching 2d range expression:</p>
  
  <pre><code>x1 &lt; x &lt; x2 &amp;&amp; y1 &lt; y &lt; y2
  </code></pre>
  
  <p>faster then full search. I have some solution, though it is heavy to implement. Is there any standard algorithm/approach for such task? I believe DB developers had to solve this problem while addressing compound indexes problem.</p>