title: Want to shard my data, and still be able to return paged results
body: <p>I am creating an auction site.  Like most people who create a website I hope that someday I will have the problem of having too many users for one database server to handle.  Asp.net mvc is my front end.  I am using ravendb as my backend.  So far I have done quite a bit to implement my site.  I have the pages to allow users to post new items for sale, and I am getting into searching.  Really happy with the way ravendb makes query, "search", and paging capability so easy.  Really great!  </p>
  
  <p>Next. Time to plan for scaling.  The obvious solution that the ravendb documentation seems to present is to use the really great, easy, intuitive <a href="http://ravendb.net/docs/2.5/server/scaling-out/sharding" rel="nofollow">sharding</a> functionally built into Raven.  So I started down the path of sharding my dataset based on user zipcode.  This is the obvious shard key for me because I am planning for my users to only care about items in their near proximity.  Great!  Done!  So easy!  Even seems like I will be able to adjust my shading strategy later on when I need to add more servers by adjusting my custom ShardResolutionStrategy.</p>
  
  <p>Now we arrive at my question/problem.  I obviously want to be able to return a paged result set of items from across my shards.  So I have been researching focusing on that without thinking of sorting yet.  In reading I have basically come up with nothing beyond a few short sentences on <a href="https://groups.google.com/forum/#!searchin/ravendb/ravendb%2420sharding%2420and%2420paging/ravendb/jm8T4MpgXEk/R-2XvtOtIbsJ" rel="nofollow">MergeQueryResults</a>.  I understand that this is a really advanced/complex problem, but this is such a common case I have to believe that someone out there has done sharding and paging.  Can any point me at some example or documentation on how to use MergeQueryResults in a smart way?</p>
  
  <hr>
  
  <p>Edit</p>
  
  <p>To narrow my questions, I am really just looking for an example or some documentation of how to do paging on a sharded data set with raven db.  I don't care what the example is, just something.  Either that or an acknowledgement that Ravendb is not a good tool for solving this kind of problem.  Stop teasing with "This is hard".  I am well aware of that.</p>
  
  <hr>
  
  <p>Second Edit</p>
  
  <p>I'll also further clarify my issue that I am trying to get around with paging and sharding on Ravendb.  Here is my understanding from reading google group posts, comments and responses.  It could certainly be wrong but I can't seems to find anything on the subject. Lets say my page size is 50.  If I want to return page 5 from a collection sharded across 3 servers, the default behavior of raven db is to return all 5 pages (not just the results on page 5) from each 3 servers. i.e. 50 * 5 pages * 3 servers = 750 results which are all returned to the client for further processing to figure out which results are actually for page 5.  Obviously higher page numbers, more servers means that this is really impractical if you are trying to horizontally scale using sharding.  Is my understanding correct?  Is there any way using an index or X feature that I am not aware of to limit the result set?</p>