| ▲ | Learning a few things about running SQLite(jvns.ca) | ||||||||||||||||||||||
| 65 points by surprisetalk 2 hours ago | 10 comments | |||||||||||||||||||||||
| ▲ | striking an hour ago | parent | next [-] | ||||||||||||||||||||||
> Maybe one day I’ll learn to read a query plan. With SQLite's `.expert` mode you can delay that day a little longer: https://www.sqlite.org/cli.html#index_recommendations_sqlite...
Also wrt> My approach so far has been to just do these cleanup operations in small batches so that I don’t need to do database queries that take more than 5 seconds to run. This whole experience has given me more of an appreciation for why someone might want to use a “real” database like Postgres which can have more than one writer at the same time though. The advice for those " “real” " databases is generally to also do cleanup operations in small batches, they just tend to make it less obvious you're doing something unperformant in the smaller case. You're more right than you thought! | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | simonw an hour ago | parent | prev | next [-] | ||||||||||||||||||||||
> I’ve been backing up to AWS, which is always a pain because it’s annoying to navigate the AWS console to generate credentials. I got so annoyed with that a few years ago that I ended up building a whole tool just to solve that one problem:
This spits out read-write credentials that are scoped JUST for that bucket. You can add --read-only or --write-only to have credentials that are further locked down, or even add --prefix foo/bar for credentials that can only read/write keys that start with that prefix within the bucket.> Maybe one day I’ll move away to some other S3-compatible alternative. I've used Restic with Cloudflare R2 and it worked great. | |||||||||||||||||||||||
| ▲ | andrewaylett 5 minutes ago | parent | prev | next [-] | ||||||||||||||||||||||
I run my backups like this:
That doesn't block writers (when the writer uses WAL), and gives me a dump that's compressed well while also being easy to sync. My Home Assistant DB is 1.8GB, my dump is 286MB compressed, and I'd guess 90% of that is consistent from one day to the next. | |||||||||||||||||||||||
| ▲ | masklinn 26 minutes ago | parent | prev | next [-] | ||||||||||||||||||||||
> and presumably other things? Various statistical views over the value distributions of the indexes, so that the planner can estimate how useful (selective) the index should be. sqlite_stat1 just gives an average (number of records in the index, and average number of records per value), and if enabled sqlite_stat4 stores histogram data. | |||||||||||||||||||||||
| ▲ | ryan42 20 minutes ago | parent | prev | next [-] | ||||||||||||||||||||||
If you're not using them, adding in silk and/or debug toolbar to your django app will be able to get some good automatic reporting and guidance on performance issues. | |||||||||||||||||||||||
| ▲ | m0ose 23 minutes ago | parent | prev | next [-] | ||||||||||||||||||||||
What does he mean by "I do usually try to monitor them with a dead man’s switch.", when talking about backups? | |||||||||||||||||||||||
| ▲ | datadrivenangel an hour ago | parent | prev [-] | ||||||||||||||||||||||
"Maybe one day I’ll learn to read a query plan." Query plans aren't that hard to read! [0] | |||||||||||||||||||||||