Delete checkpoint ID's using Keys - Number of Keys limit in a query


Wanted to know is there a limit on the number of keys i can use to query / delete.
I am creating a list of which may contain 400K ID’s(KEYS) , can i use that number of Keys while deleting it.

checkpoint_ids = [
“400K ID’s in this list”

cb_query_construct = N1QLQuery(‘delete from bucket use keys $1’, checkpoint_ids)

There is no limit.
400K items needs memory process as part of statement. Instead you should split into reasonable size and call multiple times.

1 Like

Thank you …will try as mentioned

If you have the keys, it will probably be more efficient to delete directly using one of the SDKs.

If you need to query first to find the matching keys, you can query for the meta().id and then do a delete directly from the bucket using an SDK. That will probably be more efficient, if you need the last mile of performance. On many platforms, this will use a streaming parser from the N1QL response, so you can efficiently fire off async deletes.

1 Like