tonysun83 commented on issue #469: Choose index based on fields match
URL: https://github.com/apache/couchdb/pull/469#issuecomment-292090769
 
 
   @garrensmith : @davisp was just saying that if you have the following 
indexes:
   
   Idx1 - [a, b, c, d]
   Idx2 - [a, b, c, e]
   Idx3 - [a, b, c]
   
   and you issued  a query with selectors using a,b,c, then we would choose 
Idx3. 
   
   If Idx3 didn't exist, then you need some sort of tiebreaker. The old way 
used a combination of
   [dbname, ddocid, viewname]. He was just saying you could still use this 
crude method as a tiebreaker, and use the ddocid (not all three elements).
   
   You are right that this won't solve the issue when Idx1 is always chosen, 
and then a new Idx4 [a, b, c, f] which is alphabetically ahead of Idx1is added, 
then the user could possibly get different results. 
   
   Paul did mention:
   
   "In the future we could get fancy and cache selectors and a reduce query 
with the prefix range and prefer the view that has more documents."
   
   so that we could possibly choose the index with more documents and be a 
little more consistent. However, it's still probable that some indexes will 
contain different docs.  I'll think about it some more, but o you think that's 
more of index design on their part?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to