Indexing strategy in 2.0

17 views
Skip to first unread message

Martin Rybak

unread,
May 2, 2018, 5:17:57 PM5/2/18
to Couchbase Mobile
In 2.0, can you tell me if indexes are updated when documents are queried (lazily) or when they are updated (eagerly)? The 1.x approach was to do it at query time which, unless you wanted stale data, resulted in a poor user experience.

Priya Rajagopal

unread,
May 3, 2018, 9:55:44 AM5/3/18
to Couchbase Mobile
Pretty sure it's done eagerly in 2.0. Jens?

Jens Alfke

unread,
May 3, 2018, 7:42:17 PM5/3/18
to Couchbase Mobile


On May 2, 2018, at 2:17 PM, Martin Rybak <martin...@gmail.com> wrote:

In 2.0, can you tell me if indexes are updated when documents are queried (lazily) or when they are updated (eagerly)?

It’s eager in 2.0.

 The 1.x approach was to do it at query time which, unless you wanted stale data, resulted in a poor user experience.

Yes, but it was nice that you could have a lot of indexes and not pay the price for ones you weren’t using. In 2.0, be aware that creating a lot of indexes will slow down all document updates. (If you’re doing a big batch update, it can sometimes actually be cheaper to drop indexes and then recreate them afterwards.)

—Jens

Jens Alfke — Mobile Architect — Couchbase, Inc.

Martin Rybak

unread,
May 4, 2018, 7:03:31 AM5/4/18
to Couchbase Mobile
Thanks for clarifying! Good to know.
Reply all
Reply to author
Forward
0 new messages