N1ql indexing sequence - Mulitple Keys

Did you able to repro using steps i described earlier.

Create separate bucket
create new index on that bucket
insert one document
see if index has that entry. Change value and check index again.

Yes, i tried that and it’s working that’s way.
created new bucket and inserted 5 records , i have updated 2 records among them , and ran my query with using new index and i got expected result.
But when i do in bulk i am seeing the issue on version 6.0.4. or else mutation might getting some time or index node not functionaly well.

This is out of my expertise. cc @jeelan.poola

Thank you vsr1, your input always helps us to find a better solution. But these are the key concern i have , because my application widley using CB , so if someone can help that would be great.

@mehul, Can you confirm this is partition index or post exact definition that has issue.

yes, this index has partition.

CREATE INDEX ix1 ON Bucket_Order (OrderId, EsOrderTriggerEpoch) WHERE isEsOrdTr = false ) PARTITION BY hash(OrderId`)

Can you try non-partitioned index on 6.0.4

Can you please help me to understand what difference it will make or what 's you thought behind , to create an index without partition.

There might be issue with 6.0.4 when index that has both partitioned and partial will not updated on mutation. Workaround is use either partitioned or partial and see if that resolves. (Right way to create Index with partitioning, looks like indexes are not getting updated)
OR use 6.5.1

how would i know if index has has both partitioned and partial ?

If index definition has PARTITION BY it is called partitioned index,
If index definition has WHERE clause it is called partial index.

As you see above i am not using partial in where clause so not sure if i am getting you correctly .

This has WHERE clause and PARTITION BY

When Index has WHERE clause it is called partial index because it has only indexed subset of the documents based on WHERE clause in the bucket (not all the documents in the bucket)

oh i got it, i understood now

Good morning,
i have tired using 6.0.4 , remove where clause and added that field as a index key and it’s working fine.
return expected result.

It is known issue in 6.0.4 (fixed in 6.5.1) will be addressed in future 6.0.x releases

do you know where i can get list of all version of cb.

https://www.couchbase.com/downloads

Good morning,
do you have an idea why expriation time set to “0” after run the update query eventhough we are not upateing it

  • can we update the metadata data while update the document field if that is happening
  • i have also see that using CB java sdk if fetch the data first and perfomr replace operation it’s faster and have more control to update the fields , instead of N1QL update , looks like updates is little slower.

{
“meta”: {
“Orderid”: “6716”,
“rev”: “526121”,
“expiration”: 0,
“flags”: 33432,
“type”: “json”
},
“xattrs”: {}
}

https://docs.couchbase.com/server/current/release-notes/relnotes.html#improvements-651

Examples 7, 8, 9 https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/update.html