thedevstockgirl
thedevstockgirl•9mo ago

Error with TooManyTotalIndexes: Number of total indexes cannot exceed 256

Getting an error about too many indexes. Unsure why.
No description
19 Replies
thedevstockgirl
thedevstockgirlOP•9mo ago
Also, have an issue where convex keeps running in the background, even after quitting it in the terminal
FleetAdmiralJakob 🗕 🗗 🗙
Share your schema please
erquhart
erquhart•9mo ago
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.
Michal Srb
Michal Srb•9mo ago
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.
thedevstockgirl
thedevstockgirlOP•9mo ago
Ok. How do I get past this?
Michal Srb
Michal Srb•9mo ago
Do you need all the indexes you have declared?
thedevstockgirl
thedevstockgirlOP•9mo ago
@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
Michal Srb
Michal Srb•9mo ago
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.
thedevstockgirl
thedevstockgirlOP•9mo ago
Interestingly, I did not delete indexes. I just deleted all records from some tables in the dashboard.
Michal Srb
Michal Srb•9mo ago
@thedevstockgirl just to double check, do you actually have >=256 index / searchIndex / vectorIndex calls in your schema?
thedevstockgirl
thedevstockgirlOP•9mo ago
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
erquhart
erquhart•9mo ago
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.
thedevstockgirl
thedevstockgirlOP•9mo ago
+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.
jamwt
jamwt•9mo ago
@thedevstockgirl makes sense -- we're chatting about this and we'll follow up
thedevstockgirl
thedevstockgirlOP•9mo ago
Ok. Thank you
lee
lee•9mo ago
@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
thedevstockgirl
thedevstockgirlOP•9mo ago
Ok. Great. Can you let me know when it is deployed? Thank you
lee
lee•9mo ago
should be deployed now. if you have more concerns, happy to hear them 🙂 we're always trying to improve visibility into limits
thedevstockgirl
thedevstockgirlOP•9mo ago
Great. It works now. Thanks so much.