On Aug 19, 2015, at 5:36 AM, PRASANNA KUMAR <[email protected]<mailto:[email protected]>> wrote:
I would to know about how we can do the sorting technique using one view and query. Right now i'm having 3 types sorting technique(LastModifiedDate,DueDate,ResponsibleEmailID) i do not like write three view and queries. I want to finish in one view and query itself all three sorting techniques. I will share here how is did till the time, That was too much code for me to read through! But I think the summary is that you have three different fields you need to sort by and you want to do it using one view. The short answer is that you can’t. A view defines an index, and an index is always sorted by its key, so if you have different sort criteria, you need multiple indexes that are sorted by each key you want to sort on. (The same is true for a SQL database: you’ll need to create multiple indexes. The difference is that SQL will allow you to order by anything you want, but if you want it to be fast you’ll need indexes.) But those are causing the performance because of lot other thinks are there to write view and query, so that inmy project contains more view and query i would to reduce those many thinks. What sort of performance problems are you having? (Note: I don’t work on Android, so I don’t know details of its performance. Hopefully Hideki can answer.) One thing I notice is that your map functions could be faster. Each of them does a bunch of work getting properties from the document before it decides whether or not to emit anything. If you put the “if” test at the start of the function, it’ll be faster to skip over the documents that aren’t tickets. —Jens -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/8388EC23-0633-4DCE-B2CA-41CE9F91106E%40couchbase.com. For more options, visit https://groups.google.com/d/optout.
