-
Notifications
You must be signed in to change notification settings - Fork 158
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
Include table stats in DatabaseStats
#398
Comments
Also, perhaps |
Would a separate method on Ya, a leak check makes sense. I've been planning to add a |
Sort of! The issue is then, I don't have a way of getting information on all tables in the database. I know what tables I think are in the database, and I can open them one by one and get stats about them, but I also want to see if there are any tables in the database I don't know about, and get information on those.
That would be rad. A fsck that reported any problems/leaks it encountered would be sweet. |
Hmm, ya I see. How would you end up with a table that you didn't know about? It's not exactly pretty, but to find out the type of a table you can just open it with two random types and you'll get an error message telling you the types: redb/src/tree_store/table_tree.rs Line 344 in 754e361
|
I think it could actually happen pretty easily. For example, we release a version which changes the name of a table, but forget to remove the table with the old name from the database. One idea is to have a separate |
Hmm, ok lemme think this over. Perhaps I can change Alternately, what if I change |
That sounds good.
That would be useful for cleaning up unexpected tables, but if we have unexpected tables, I'd also like to have stats (type, size, etc) to try figure out what they are and what they contain, instead of just blindly deleting them. |
@casey I'm finally getting around to this issue. Do you still need this API? I fixed the second issue (#542), and I could add an API like |
Documenting my proposed API, but am going to close this for now.
|
Sorry for not following up on this! Yah, this would be great. I just updated Also, the |
Np! Can you give the linked PR a try? |
I'm auditing space usage in the
ord
index, and having information about individual tables would be super useful. In particular, the total size of each table in bytes, and how many keys it holds.The text was updated successfully, but these errors were encountered: