-
-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop counting at 10,000 on table view as well #2408
Comments
The big problem with this is that asking "how many rows, exactly are in this table" is a completely legitimate question! But I'm beginning to think Datasette should have a policy that we NEVER scan more than 10,000 rows. Those kind of scans are the root of all of our performance issues against big databases. There may be a third option: cache the table count so we can show that number, but implement the 10,000 limit for any time we run a filtered query against that page. That way we can still show the total number of rows but we don't get stuck running expensive counts the moment someone applies a large filter. |
Related: I built this with Datasette in mind but never completely integrated it. Integrating that now would give us accurate table counts for databases that enabled that feature. |
One more option: show that 10,000 but offer a button the user can click to calculate that full count: It could link to Should this work even if they don't have Could also have progressive enhancement JavaScript that runs that query via |
Decision: for the moment I'm going to implement that 10,000 cap along with an enhanced "calculate full total" button which is only visible to Any caching tricks will happen in another issue. |
Datasette now stops counting at 10,000 rows (actually 10,001 so it can tell if there are more than 10,000 or 10,000 exactly) every time it displays a list of tables:
This feels so much less sluggish! As such, I'm thinking about applying the same trick to the row count at the top of the table page itself:
The text was updated successfully, but these errors were encountered: