Tips for a healthier Postgres database (2021)
crunchydata.com
crunchydata.com
Most people should probably leave it enabled, but if you have a database with a very defined and understood query pattern, then it might be worth running perf and checking if it is costing you.
[1] https://www.alibabacloud.com/blog/postgresql-v12-how-pg-stat...
Bottom line: enabling this doesn't hurt. It might help, and it doesn't cost anything to check
4X. We were astounded. And so we’re the Heroku folks I talked to, who I’m guessing will want to try to bring performance boosts.
We haven’t done the switch quite yet because we’re waiting on Crunchy to bring out their Heroku Dataclips replacement, which is something we rely on a lot. But once it’s ready, we’re going to switch!
Dataclips equivalent is coming, we're hoping to release sometime in March.
Honestly, as always, I think these managed database services are way too expensive. If I really needed to choose one of them I would go with the AWS service, because you also have to factor in data egress costs in your cloud costs calculation which will vary a lot depending on your workload.
[0]: https://www.crunchydata.com/pricing/calculator?provider=aws&...
edit: i think it’s called performance insights in RDS
We autogenerate many of our own queries which can have significant complexity (regularly over 10 joins, sometimes up to 30!) and our infrastructure isn't quite there yet to be able to recreate the exact query plan a customer saw on their own data without a lot of work. It could all be so much simpler, so if there is a setting to prevent this please tell me!
SHOW track_activity_query_size;I spent years doing index maintenance on a large corporate database. Creating and rebuilding indexes was a hassle. So I set about building a new kind of database engine where every column in a table organizes its data for fast access (e.g. a columnar store with no separate indexing structure).
I expected my system to be substantially faster than a Postgres table without indexes for a broad range of queries. What I didn't expect was for it to also be much faster for tables that were highly indexed in Postgres. I ran tons of queries on both systems and almost all of them were like this video:
Get any moderately sized table (millions of rows and a dozen or more columns) on your 'highly-tuned' postgres database with all the proper indexes in place and load that same data into Didgets (takes a whole 10 minutes to download the software and start using it) and run whatever queries suits your fancy.
I actually tried to find the dataset you used yesterday to run my own benchmark, but the only official "Chicago crime database" I could find had only 300k rows and 19 columns, so I assumed it wasn't the same data you mention in your video.
https://data.cityofchicago.org/Public-Safety/Crimes-2001-to-...
Even though I replied to your post, it was more of a general observation than to you specifically. My video has been viewed over a thousand times. I get comments all the time that say it can't be real or that I must be handicapping the other databases (I also have a video comparing to SQLite) by not configuring them correctly.
I have yet to have a single person who claims to be a database expert try it out on their own favorite data set and tell me that they found Didgets to be slower than their preferred database engine.
It is a completely different architecture (originally designed to be a file system replacement where multiple tags could be attached to each and every file) and the database functionality was almost discovered by accident. The tags I invented to make finding files based on them extremely fast, looked a lot like a columnar store. So I tried building regular relation tables using them. It surprised me when queries against my tables gave other databases (with decades of development behind them) a real run for their money.
Primary keys are always indexed. Does the author really know what he’s talking about?
> I have almost no fruit, just a few apples.
Indicates that I do know that apples are a fruit. Not that I don’t.
I have occasionally seen performance gains by rebuilding a composite index with key compression, for example.
Indexes do tend to return to their natural size in heavy use, so repeatedly shrinking them will just tax performance for a temporary gain in storage.
https://asktom.oracle.com/pls/apex/f?p=100:11:::::P11_QUESTI...
• Your vision for Didget is blurry. Sometimes it's a database (or "general purpose data management system"), sometimes it's a file system. Products that are dessert toppings and floor waxes rarely find purchase. My advice: Decide which problem domain you're playing in, then which problem(s) within that domain this solves.
• The Postgres comparison seems naive. As the Postgres wiki notes, "PostgreSQL ships with a basic configuration tuned for wide compatibility rather than performance. Odds are good the default parameters are very undersized for your system." A comparison with a system-appropriate Postgres configuration would be more interesting.
• Promoting a new closed-source database seems anachronistic when there's a plethora of fine open-source options. If you're wondering why you're not getting many leads from HN, I'd imagine this is the main reason.
¹ https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...
Didgets, as it exists today, is a technology rather than a 'product'. It consists of a set of highly optimized data objects that can be used to build complex systems like hierarchical file systems, relational database tables, logging frameworks, configuration managers, or content indexers. I have implemented enough functionality into the browser application to prove that it can do those things well, but none of them are fully implemented yet. I am trying to find the right product-market fit.
I have not yet open-sourced any of the code, but I probably will once I decide which open source licensing is best for it. I am simply trying to introduce this technology to others to see if there is any interest in it.
Note: While I didn't explore every configuration option in Postgres so I don't have confidence that it ran as fast as it possibly could, I did not just use the default configuration. I tried all the usual tricks to speed it up.
That sounds like a "general-purpose database", unless there's something that disqualifies Didget from being that. If it's a database, you're probably competing with something closer to the free and open-source SQLite than you are the free and open-source Postgres. This can be done (see rqlite), but in any case it seems like being free and open-source would be necessary (although not sufficient) for people to consider it.
> I tried all the usual tricks to speed it up.
I don't know what "usual tricks" means (maybe you have a link?), but I think it would add some credence to performance claims to specify what you're doing.