Live data from Hacker News

Things I hate about PostgreSQL (2020)

rbranson.medium.com

191–200 of 255 posts

Re: Things I hate about PostgreSQL (2020)

#191
post #87

One thing I hate about such articles is this "((use)) a managed database service" hint. Many if not most readers' data are confidential and storing them on a machine managed by unknown people seems foolish to me. Am I paranoid?

You are, unless you have a very good reason to treat your cloud provider as a likely malicious actor, in which case good luck setting up your own data center.

Re: Things I hate about PostgreSQL (2020)

#193
post #83
post #8

I think it’s worth mentioning that most of these problems only occur at a scale that only top 1% of companies will reach. I’ve been using PostgreSQL for over a decade without reaching any of the mentioned scaling-related problems. PostgreSQL is still the best general purpose database in my opinion, and you can then consider using something else for parts of your application if you have special needs. I’ve used Cassan…

I don't think this is necessarily true. Say you have 100 sensors sampling at 1kHz for a year, you'd have ~3 trillion rows in your database and plenty of potential for scaling issues at a very reasonable price.

Most of the time, people just decide on the aggregates they want from those sensors in advance, and discard the raw data.

I worked at a company that had some IOT devices logging "still alive and working fine" every couple of minutes. There was no point to holding onto that data. You only needed to know when the status changed or it stopped reporting in, as that's all anyone cared about.

Re: Things I hate about PostgreSQL (2020)

#194
post #189

Earlier quoted context omitted.

Does anyone know of a quality, comprehensive book that enumerates all the things to watch out for and problems to proactively prevent when operating Postgres at scale?

It's not a book, but Christophe Pettus' blog ( https://thebuild.com/blog ) has a lot of really good information. In particular, his talk "Breaking PostgreSQL at Scale" goes through the problems you run into as you hit different levels of scale ( https://thebuild.com/presentations/2019-fosdem-broken.pdf )

Thanks! Very helpful, that talk looks like a (very) condensed version of what I was looking for.

It looks like the video for that talk is here: https://www.youtube.com/watch?v=XUkTUMZRBE8

Re: Things I hate about PostgreSQL (2020)

#195
post #51

My single biggest beef about PG is the lack of query planner hints. Unplanned query plan changes as data distribution shifts can and does cause queries to perform orders of magnitude worse. Queries that used to execute in milliseconds can start taking minutes without warning. Even the ability to freeze query plans would be useful, independent of query hints. In practice, I've used CTEs to force query evaluation order…

ClickHouse is the opposite: it has no optimizer, so your SQL must be structured the way you want it to run: deeply nested subqueries with one JOIN per SELECT. But at least you can be sure your query runs the way you intended.

PostgreSQL offers a config where you can control join order to match the query text:

https://www.postgresql.org/docs/13/runtime-config-query.html...

Re: Things I hate about PostgreSQL (2020)

#196
post #51

My single biggest beef about PG is the lack of query planner hints. Unplanned query plan changes as data distribution shifts can and does cause queries to perform orders of magnitude worse. Queries that used to execute in milliseconds can start taking minutes without warning. Even the ability to freeze query plans would be useful, independent of query hints. In practice, I've used CTEs to force query evaluation order…

Can you enumerate some use cases you've run into? Sometimes looking at the individual use cases leads to better features than trying to generalize too quickly. For instance, controlling join order might suggest a different solution than a cardinality misestimate or a costing problem.

Query plan freezing seems like an independently useful feature.

Re: Things I hate about PostgreSQL (2020)

#197
post #51

My single biggest beef about PG is the lack of query planner hints. Unplanned query plan changes as data distribution shifts can and does cause queries to perform orders of magnitude worse. Queries that used to execute in milliseconds can start taking minutes without warning. Even the ability to freeze query plans would be useful, independent of query hints. In practice, I've used CTEs to force query evaluation order…

> My single biggest beef about PG is the lack of query planner hints. Same here. I did evaluate if to use PG for my stuff, but not having any hint available at all makes dealing with problems super-hard and potential bad situations become super-risky (esp. for PROD environments where you'll need an immediate fix if things go wrong for any reason, and especially involving 3rd party software which might not allow you t…

"many times I as a human just knew better than the DB about how many rows would be accessed/why/how/when/etc..."

Would you say the primary problem that you have with the planner is a misestimate of the number of rows input/output from a subplan? Or are you encountering other problems, too?

Re: Things I hate about PostgreSQL (2020)

#199
post #181
post #106

Earlier quoted context omitted.

As long as mysql can't run ddl statements in a transaction it's worthless as far as I'm concerned. Also the thing where they (used to?) silently truncate your data when it wouldn't fit a column is absolutely insane. I'll take operational footguns over losing half my data every damn time.

Till v8.0.16 mysql used to accept and then just ignore check constraints I've never been so offended by a technology as the day I discovered that; it's not a misfeature and its not a bug -- only pure malice could have driven such a decision

Don't forget the 3-byte encoding they invented and call it 'utf8'.
Post reply on HN