N1QL not returning results immediately?

17 views
Skip to first unread message

Dump Hole

unread,
Apr 4, 2016, 12:48:47 PM4/4/16
to Couchbase
Hello,

I am observing a small delay around 250ms between the time of document insertion and the result shows up from the N1QL query.  This is CB 4.0 community running locally inside a docker container, single node.  I am wondering if there is a way to tweak this number, to make it faster, or make document insertion a tad bit slower.

I can't do this in my code, for example:

cb.set("key", '{"foo":1}')
result = cb.query("SELECT * FROM `default` WHERE `foo` = 1")

Since the query happens immediately after insertion.

There is already an index for foo.

"CREATE INDEX foo_index ON default(`foo`)"

Thank you!

Dump Hole

unread,
Apr 4, 2016, 12:54:12 PM4/4/16
to Couchbase
Small correction:


cb.set("key", { foo: 1 })

Gerald

unread,
Apr 5, 2016, 11:35:47 AM4/5/16
to Couchbase
Hello,

You need to use a scan consistency of REQUEST_PLUS. Please search the documentation for your Couchbase SDK.

Gerald


On Monday, April 4, 2016 at 9:48:47 AM UTC-7, Dump Hole wrote:
Reply all
Reply to author
Forward
0 new messages