Skip to content
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

Reduce table counts on index page with many databases #649

Closed
simonw opened this issue Dec 8, 2019 · 2 comments · Fixed by #688
Closed

Reduce table counts on index page with many databases #649

simonw opened this issue Dec 8, 2019 · 2 comments · Fixed by #688

Comments

@simonw
Copy link
Owner

simonw commented Dec 8, 2019

Since #467 the index page has attempted to optimistically count times.

My personal Dogsheep has enough connected databases and tables that the page can still take way too long to load - sometimes more than twenty seconds.

@simonw
Copy link
Owner Author

simonw commented Dec 8, 2019

The easiest solution would be to only show counts on the index pages for immutable (-i) databases.

I don't like this, because the most common uses of Datasette don't in my opinion justify it. Most of the time Datasette will be running against a single, small, mutable database. I'd like to show counts in that case.

Some options:

  • disable counts on the index page for mutable databases of more than one is attached
  • disable counts on the index page for databases where the file in disk is larger than a specified threshold (maybe 10MB? I'm making up this number)
  • implement an overall timer which cuts off table counting once the sum of time spent on it has gone beyond a second

Worth prototyping a bit to see what works best.

@simonw
Copy link
Owner Author

simonw commented Feb 29, 2020

I tried this out in 34bc16a with an upper limit of 100MB and it worked an absolute treat against my personal Dogsheep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant