Workload Units and # of Database Records

Hey all!

Sorry for what I THINK is a very newbie question, but I just want to clarify something given I’ve only recently launched my app (on the Starter plan) and am seeing pretty high WU consumption, even though I’ve got zero users.

Question: Will WU increase based on the sheer number of results /records returned from a database search? (I assume “Yes”). i.e. a single search returning 100 records will consume less WU than the exact same search which returns 200,000 records.

OR

Will the same WU be consumed for the database search itself, regardless of the number of records returned (would love to hear that this is the case, but am skeptical). i.e. 50 WU is consumed regardless of whether a particular search returns 100 records vs 300,000 records

Again, just looking to be 100% on this one. Thanks again!

Hi @greenmerits :wave:

Yes :+1:

You can see more here.

3 Likes

Whenever I see these microscopic numbers we have to worry about I can’t help but quote this

8 Likes

Surely not, it’s perfectly reasonably for an app to have 1 million entries in a table. Does counting them all really use 1 million x 0.015 WU = 15,000 WU = $2.25? If it does that’s crazy but it seems unlikely

1M entries in the database is fine. They are only counting the items returned from the search so if you have constraints it would be much less

If you return 1 million entries to the user with the repeating group set to “Show all items immediately” then the users computer will catch fire

1 Like

:laughing:

I mean that suppose we have a text element that = Do a search for X:count - on the Bubble side does that ‘return’ each result from the database and therefore WU = 1mil x 0.015 WUs, or is it only 0.3 WU for a DB search. I’ve assumed the latter…

That’s an aggregate search @georgecollier so only 0.2WU - manual

3 Likes

Surely yes

Great I thought so!

Great. Thanks for helping clarify this for me. Appreciate the pointer to the documentation as well @rpetribu ! I’m using constraints heavily to limit the number of results returned, but I sense that if this app grows, I could run into some challenges with WU consumption. Will cross that bridge if/when I get there though. Thanks again all!

Yes… each item returned has an additional cost (plus the data itself)… - that said, you really don’t want to be returning 200,000 items to the page, irrespective of the WU costs involved.

1 Like