PhoneGap Couchbase indexing view

That’s slower than I’d expect (although a PhoneGap app will index more slowly because the map function is JS not native code.) Have you tried optimizing the map function? It’s going to be called 12k+ times, so even a tiny speedup will be noticeable.

The indexing is lazy; it happens the first time the view is queried after documents have been added/changed/removed. If you want to just update the index and know when it’s done, do a very small query (like set limit=1), and when the response arrives you know the index is ready.

A SQLite-based database only allows one thread to access it at a time. So during view indexing, the database isn’t accessible by other threads. ForestDB allows threads to read the database while another thread is updating it.