Count how many rows/records are in an Anvil database table

Also:

len(app_tables.table_name.search())

You would think this would take forever, but both the default len() from python, and the len operation as handled by the app tables service written by anvil are super optimized, so it shouldn’t take more than a second with millions of rows.

Also I made this for people who are starting out trying to upload data to anvil to test it out, it leans into how to optimize it yourself without worrying about getting it working first:

2 Likes