Error with TooManyTotalIndexes: Number of total indexes cannot exceed 256
Getting an error about too many indexes. Unsure why.
19 Replies
Also, have an issue where convex keeps running in the background, even after quitting it in the terminal
Share your schema please
I don't know of a total index limit, the published limit per table is 32. Do you have more than 256 across all tables?
They support 10k tables though, I'd be surprised if 256 was the cumulative index limit. A team member can chime in once they're online, still early in the Bay.
It does indeed look like we have a 256 total limit on number of indexes across all tables. This is probably a "bug" as that it does seem a very low limit.
Ok. How do I get past this?
Do you need all the indexes you have declared?
@FleetAdmiralJakob 🗕 🗗 🗙 my schema is not something I can copy and paste. I have a routes folder, that has entity folders, which each export a schema.ts that defines all tables for that entity. Then root schema has all schemas imported and constructs a single schema. This is the setup I have across all convex projects, and I doubt there is anything wrong on that side and all others are working, and this was working as at yesterday.
@Michal Srb , I do. And this would be weird if indeed there is this limit.
This was working fine yesterday, and after I added a few indexes, it was still working. However, I deleted some scaffolded data from the dashboard, and when I went to run convex, that's when I started getting this. Tried setting schema validation to false to get back to previous state. Also tried commenting out several indexes. No luck
I see, so you don't actually have more than 256 indexes? My guess would be that some deleted indexes are being incorrectly counted into the limit. I'm sure @lee will be able to resolve this issue.
Interestingly, I did not delete indexes. I just deleted all records from some tables in the dashboard.
@thedevstockgirl just to double check, do you actually have >=256 index / searchIndex / vectorIndex calls in your schema?
I'd have to manually go into each and count. But I don't think so. But then its also possible and would add more, as almost all our tables have a few indexes on them. But actually, in this particular instance, I don't think I do
But in our main health app, this would definitely be a problem and should be clearly stated in the pricing table and limits if it exists, with an option to go past it
Once this all shakes out it would be good to add this cumulative index limit (whatever it ends up being) to the production limits doc.
+1. and somewhere to see the current total, without going into my code to count. And this would help with debugging what convex sees as total vs actual total, if there is ever a difference.
@thedevstockgirl makes sense -- we're chatting about this and we'll follow up
Ok. Thank you
@thedevstockgirl we looked at your deployment and it does look like there are 255 indexes.
however, this limit seems redundant (with the limit on tables and limit on indexes per table) so we're removing it https://github.com/get-convex/convex-backend/commit/a187697b938a8156378b85dd7a5478929ebcfba2. hoping to get this fix deployed today
Ok. Great. Can you let me know when it is deployed?
Thank you
should be deployed now. if you have more concerns, happy to hear them 🙂 we're always trying to improve visibility into limits
Great. It works now. Thanks so much.