"code":5000, backfill exceeded limit

I was running a Retrieve Docs query in the couchbase UI in teh Documents tab and received this error which ive never seen before: [{“code”:5000,“msg”:"“ed6714f2-7b69-4bbe-9959-2dd12322b82a” backfill exceeded limit 5120, 5351 - cause: “ed6714f2-7b69-4bbe-9959-2dd12322b82a” backfill exceeded limit 5120, 5351"},{“code”:5000,“msg”:" “ed6714f2-7b69-4bbe-9959-2dd12322b82a” backfill exceeded limit 5120, 5351 - cause: “ed6714f2-7b69-4bbe-9959-2dd12322b82a” backfill exceeded limit 5120, 5351"}]

the bucket i am querying has 1.5 billion documents but i have an index which is covering 5 million items.
the query i ran has a LIMIT 10 set on it as i was just looking to see if a document existed with a couple of specific key value pairs.
does anyone know what this query relates to? i already seen the post about code:5000 and this does not seem to relate to the index from what i can tell

Increase the backfill size. Also provide explain of query and index definition. Checkout backfill directory for old files.

unfortunately i dont have admin privileges so have no access to backfill, also i cant find material on what exactly the backfill is!
as this is only within the Documents tab and searching documents i have no explain to give and i have no way to see what index the search might be using. if it was the in the query tab i could give you those details.

Check out https://docs.couchbase.com/server/6.0/n1ql/n1ql-language-reference/backfill.html

If you need further assistance post query, EXPLAIN of query and index definition it is used.

@vsr1, you missed that the poster is using the Documents part of the UI, which can use N1QL queries in the background. In this situation, you need to look carefully to see the query that is being used.

See the screenshot below. I used the Documents tab to show a list of beers where type = ‘beer’ and abv > 8. The N1QL query being used in the background is circled in red. To generate an explain plan for that query, select and copy it, and paste it in the Query Workbench and click “Explain”.

1 Like

If the query generated ORDER BY META().id , We need to produce all qualified documents to satisfy query. Such high qualification may required lot of disk space and may take long time.

1 Like

thanks Eben,
sadly i generated no results as the error occurred before results were given and unfortunately i do not have admin privileges so i cannot see within the settings tab for this bucket the options you sent in that link … it does give me the information i require to pass onto those that have admin privileges and i can request for them to make the appropriate changes for added disk storage.
thank you

@DGrey, one more thing: as noted above by @vsr1, my code in the Documents view is not efficient when you have a very large data set, and a WHERE clause that is not very selective (meaning that it matches many documents). Do you need to use the WHERE clause? If so, can you make it more selective, so it returns a smaller set of documents?

Another possibility would be to run the same query, in the query workbench, without the “ORDER BY” clause, which is causing the performance issue.

thanks for your feedback. unfortunately our document structure is very flat so the where clause only helps me to an extent. the indexes i am creating have to be very specific for each query that is being used and i agree ORDER BY would have unnecessary performance overheads that i cannot afford with a data set this big. When using the UI for testing i use LIMIT to avoid issues when possible.