Couchbase JAVA SDK 2.2.5 Order by showing sortCount is 0

Query

Select name from default where name is not missing and CONTAINS(name,‘for’) order by name LIMIT 30 OFFSET 0

N1qlMetrics{, resultCount=30, errorCount=0, warningCount=0, mutationCount=0, sortCount=0, resultSize=1658, elapsedTime=‘7.0034ms’, executionTime=‘7.0034ms’}

Even if i use order by sortCount is showing 0

Hi @krishnasahu2016

Please post the EXPLAIN output for this query.

Please find explain

[
{
“plan”: {
"#operator": “Sequence”,
"~children": [
{
"#operator": “Sequence”,
"~children": [
{
"#operator": “IndexScan”,
“covers”: [
“cover ((default.name))”,
“cover ((meta(default).id))”
],
“index”: “index_name_array”,
“index_id”: “c0b57eaa81c4e3d”,
“keyspace”: “default”,
“limit”: “(0 + 30)”,
“namespace”: “default”,
“spans”: [
{
“Range”: {
“Inclusion”: 0,
“Low”: [
“null”
]
}
}
],
“using”: “gsi”
},
{
"#operator": “Parallel”,
“maxParallelism”: 1,
"~child": {
"#operator": “Sequence”,
"~children": [
{
"#operator": “Filter”,
“condition”: “((cover ((default.name)) is not missing) and contains(cover ((default.name)), “for”))”
},
{
"#operator": “InitialProject”,
“result_terms”: [
{
“expr”: “cover ((meta(default).id))”
}
]
}
]
}
}
]
},
{
"#operator": “Offset”,
“expr”: “0”
},
{
"#operator": “Limit”,
“expr”: “30”
},
{
"#operator": “FinalProject”
}
]
},
“text”: “Select META().id from default where name is not missing and CONTAINS(name,‘for’) order by name LIMIT 30 OFFSET 0”
}
]

Hi @geraldss

Can you please look into the issue sortCount is returned as 0 in N1QlMetrics

Yes, our PM team are looking at this.

@geraldss

Can u pls confirm is this a Bug and status

Hi @geraldss

Can you please confirm is this issue related CB4.5

Hi Krishna, what is the exact version/build your are using? thanks.

@krishnasahu2016 can you please enable TRACE logging on the application server and return us the log messages? This will include the actual raw response that arrives from the server. That will help us troubleshoot more quickly, Thanks!

Hi @prasad & @daschl

I dont understand your query

using CB4.5 Beta & JAVA SDK 2.2.5

Why you need trace log from me you can reproduce with your test environment its straight as explained above

Hi @krishnasahu2016,

They are trying to help you. Please provide the trace log.

@krishnasahu2016 the client TRACE logs are needed so we can pinpoint an issue to either the client or the server side, so we can help you out more quickly.

hi @daschl

Please help on which are logs required and config file changes required for enabling trace.

@krishnasahu2016 please have a look at the documentation here to activate logging: http://developer.couchbase.com/documentation/server/4.0/sdks/java-2.2/logging.html