Same N1QL statement dose not return the consistent results ON CouchBase 4.1 C

n1ql

#1

Hello, I have a query like this “SELECT COUNT(*) FROM login_log WHERE u = 6409676 and t >= 1453132800 ;“
But, it doesn’t return the same results all the time.
The return results is like this:
cbq> SELECT COUNT(*) FROMlogin_logWHEREu= 6409676 andt` >= 1453132800 ;
{
“requestID”: “54f404ec-b9ff-4632-ae02-a62552c38682”,
“signature”: {
”$1”: “number”
},
“results”: [
{
"$1": 81
}
],
“status”: “success”,
“metrics”: {
“elapsedTime”: “37.196982ms”,
“executionTime”: “37.101308ms”,
“resultCount”: 1,
“resultSize”: 32
}
}

cbq> SELECT COUNT(*) FROM login_log WHERE u = 6409676 and t >= 1453132800 ;
{
“requestID”: “0a4d4396-85f2-42dc-98d7-b1c5164cc855”,
“signature”: {
"$1": “number”
},
“results”: [
{
"$1": 71
}
],
“status”: “success”,
“metrics”: {
“elapsedTime”: “42.746721ms”,
“executionTime”: “42.659156ms”,
“resultCount”: 1,
“resultSize”: 32
}
}

cbq> SELECT COUNT(*) FROM login_log WHERE u = 6409676 and t >= 1453132800 ;
{
“requestID”: “5cc6a19b-f129-4b39-ac72-aabe14700c85”,
“signature”: {
"$1": “number”
},
“results”: [
{
"$1": 81
}
],
“status”: “success”,
“metrics”: {
“elapsedTime”: “76.792847ms”,
“executionTime”: “76.699121ms”,
“resultCount”: 1,
“resultSize”: 32
}
}`

So, How can i deal with it ?
Thanks.


#2

It looks weird indeed. I first thought about consistency issues but since you go from 81 to 71 to 81, it’s unlikely. Maybe @geraldss can help us.


#3

Perhaps @keshav_m can help us. Are there mutations going on? Key-value? Is the index scan consistent? BTW, the first query has a typo.