Live data from Hacker News

PostgreSQL's Imperfections

medium.com

11–20 of 139 posts

Re: PostgreSQL's Imperfections

#11
Ok, I have mine:

When declare a custom type with a check, the error not show the row/table that cause the problem, only that something happen:

    CREATE DOMAIN TEXTN AS TEXT
    CONSTRAINT non_empty CHECK (length(VALUE) > 0);
However, doing the check inline show the error in full.

This cause me to rewrite all the tables, twice (one adding the new type thinking will help, once again inlining everything).

Re: PostgreSQL's Imperfections

#12
If I could have one thing on that list fixed it would be #9 - no planner hints.

I used Oracle (6 through 11) for both bespoke applications and to back large third party systems. I never saw widespread abuse of hints. Yet they were immensely helpful during development and troubleshooting. I put perhaps two queries into production with hints over 10+ years. No one ever had a reason to complain about either.

There are no perfect query planners. There is no perfect analysis. The notion that one must submit entirely to the mercy of PostgreSQL's no-hints dogma causes me to harbor some resentment. Fortunately you can frequently abuse CTEs to achieve a desired access pattern because (until recently) CTEs were an "optimization fence." But I've also resorted to creating functions and other hacks.

So I conclude the policy is simply wrong headed; there is no legitimate reason to fear hint abuse and the premise that hints aren't necessary is false.

Re: PostgreSQL's Imperfections

#13
post #6
post #2

Not sure if this makes sense, however, I've always preferred MariaDB to Postgres because it feels lighter . And I haven't really come up against any significant limitations in MariaDB that would make me want to switch to Postgres.

Heavy writes, mulitstep transactions is where PG has always won for me vs Maria and MySQL - it was even more pronounced when I decided I'm all in on PG c2003

1) 2003 was 17 years ago.

2) PG has a write amplification problem with multiple indexes that MySQL Innodb doesn't have.

Re: PostgreSQL's Imperfections

#17
post #12

If I could have one thing on that list fixed it would be #9 - no planner hints. I used Oracle (6 through 11) for both bespoke applications and to back large third party systems. I never saw widespread abuse of hints. Yet they were immensely helpful during development and troubleshooting. I put perhaps two queries into production with hints over 10+ years. No one ever had a reason to complain about either. There are n…

While I won't say that the Postgres ideosyncrasies are correct here, I can tell you that your experience is not necessarily typical. In my career, hint abuse has always been rampant. From telcos to biotech companies, a high percentage of complex queries I had to interact with had hints in them. In one extremely egregious case, the company decided to purchase an Exadata server, and since its performance characteristics had little to do with the previous servers, a vast majority of hinted queries were very wrong, leading to months of developers rebuilding every query, despite having no schema changes.

So yes, a lot of people in the industry have been burned by hints to make the Postgres perspective understandable. At the same time, this doesn't make it good: Postgres' default settings over the years have lead to specific kinds of tables requiring extra love and care to make the query planner not do silly things. The most traditional failure case being a transaction table with an always increasing timestamp, where a vast majority of queries only care about today: The traditional thing to do was to convince Postgres that yes, this table needs very frequent stats recalculation, as to make it learn that there are more than 3 rows today, so nested loops will not do. Whether the Postgres quirks are better or worse than hint hell, I am still not sure of: A competent engineer can handle things either way.

Re: PostgreSQL's Imperfections

#18
Its scary that my company is replacing old Oracle DBs and teams of specialist DBAs with developers running their own PostSQL instances. Sure it saves money but its gonna blow one day soon...

Re: PostgreSQL's Imperfections

#19
post #2

Not sure if this makes sense, however, I've always preferred MariaDB to Postgres because it feels lighter . And I haven't really come up against any significant limitations in MariaDB that would make me want to switch to Postgres.

Transactional DDL. I for the life of me cannot understand how anyone survives in production without this. Half-applied migrations will prevent you from both deploying new code and rolling back to the old. Expect significant downtime.

Re: PostgreSQL's Imperfections

#20
post #12

If I could have one thing on that list fixed it would be #9 - no planner hints. I used Oracle (6 through 11) for both bespoke applications and to back large third party systems. I never saw widespread abuse of hints. Yet they were immensely helpful during development and troubleshooting. I put perhaps two queries into production with hints over 10+ years. No one ever had a reason to complain about either. There are n…

Related, after a major version upgrade it doesn't automatically run an ANALYZE on every table. Without this the query planner can't properly plan. It treats a billion row table the same as a 20 row table until you think to manually kick off the magic command.
Post reply on HN