Couchbase server reads per seconds

Hi,
I’m using couchbase-server-community 5.0
during a test where I’m making 20/reads per second using nodejs, I can see stats on my bucket saying ~~2000 operations/secs in a bucket where I’m quering using key/value
while I see 20/30 ops/sec in a bucket where I’m quering using N1QL + GSI
why this big difference? I suppose key/value q

Looks like you are only using the primary index on your n1ql query. So every query you do get all the keys.

Below is an example on the beer-sample bucket.

30 AM

You need to create an Index like below.

08 AM

So now when you do the same query it uses the index and only gets the key it needs.

55 AM

If you already know the key(s) and you want to use N1QL to get the data you can use USE KEYS