Hi @matthew.groves! Thanks for the answer
The query that is giving me issues was implemented almost a year ago, and took around 1 - 2 seconds in retrieving data. Suddenly from a week past it is taking around 13 to 17 seconds. Could the indexes not be working? I will take your advice on this and go to the N1QL forums.
There has not been any significant spike in users or documents creation, wich is why I dont get where the slowness might come. A few things I noticed that might be the problem:
- Server is using swap memory, since it is slower, should I remove the swap?
- Getting a lot of “Operation over threshold” warnings when running queries on the server.
- I have a warning in another bucket, “Metadata overhead” about deleted documents taking too much space (around 50%), could it affect?
Edit: Adding query for clarity - simplified the select but the rest is the same
select ds.DataControl as dataCtrl, ds.channels as dsChannels, ds2.channels as ds2Channels
from DataStorage ds
inner join DataStorage ds2 on keys (ds.DataControl.couchbaseId)
where ds.type="control" and ds.DataControl.clientNumber = 1234
I have indexes created for clientNumber, type and couchbaseId