Not Getting Output of select query still having data in couchbase server

Hi All,

I am using the couchbase 6.0 server with gocb.v1 SDK. I am executing N1QL queries in the code for fetching the data stored in CM based on some certain query parameters.
Sometimes when I am restarting the application I am not getting the output of my query still having data in the CB server.
Same query is returning the empty result set even on CB query terminal.
This problem gets resolved automatically when I restart/redeploy the CB server.
Please provide your inputs. Your response will be highly appreciated.

Execute the query in Query Workbench. Goto Plan Text Tab.
Look #itemsIn, #itemOut each operator and findout where it is 0

https://docs.couchbase.com/server/current/manage/monitor/monitoring-n1ql-query.html#monitor-profile-details

Its returning the below output.

cbq> \set -profile “phases”;

cbq> select * from NFManagementInfo;

{

"requestID": "82ed9557-4672-4ae5-a318-6493ba6e3abc",

"signature": {

    "*": "*"

},

"results": [

],

"status": "success",

"metrics": {

    "elapsedTime": "4.328572ms",

    "executionTime": "4.182692ms",

    "resultCount": 0,

    "resultSize": 0

}

}

Can you please help with this.

set this and post query output

\set -profile “timings”;

cbq> \set -profile “timings”;

cbq> select * from NFManagementInfo;

{

"requestID": "32bf9497-8f01-4509-8e63-6888b94690ef",

"signature": {

    "*": "*"

},

"results": [

],

"status": "success",

"metrics": {

    "elapsedTime": "2.536899ms",

    "executionTime": "2.37351ms",

    "resultCount": 0,

    "resultSize": 0

}

}

These are not right. Did u post whole output.
Your query might used primary index. Which may not have any entries. drop and re-create primary index.

Yes. Can you share your emailId so that we can debug this faster