It depends: the projects make different trade offs and support different points of extension. I find it useful to remember that MySQL has various storage engines (that make different trade offs, and may themselves have different options such as various row formats), when using for instance the default of InnoDB knowing that it uses index organized (meaning stores the data in a btree as opposed to heap) tables can inf…
I think this is a good answer. Our case is weird; millions of tables with billions (not sure how many in total even) of rows and no joins. Mysql handles this far better in our testing.
Ask HN: Is PostgreSQL better than MySQL?
71–80 of 83 posts
Re: Ask HN: Is PostgreSQL better than MySQL?
#72The philosophy of postgresql was to do the best possible job the rightest way. Not necessarily the easiest to use nor fastest. The philosophy of mysql was to do the best it can as fast as it can for as many users as it can. Not necessarily the 'right' or 'best' way. Its not like either philosophy is formally documented or mandatory but "generally" matches up pretty closely to real world behavior. The biggest problem…
Re: Ask HN: Is PostgreSQL better than MySQL?
#73Having managed both in production at decent scale for years, I would not choose MySQL for any projects going forward. Postgres has been more dependable in its performance, more powerful in its features. There’s no “pro” to choosing MySQL that I’m aware of in 2023.
Re: Ask HN: Is PostgreSQL better than MySQL?
#74It depends: the projects make different trade offs and support different points of extension. I find it useful to remember that MySQL has various storage engines (that make different trade offs, and may themselves have different options such as various row formats), when using for instance the default of InnoDB knowing that it uses index organized (meaning stores the data in a btree as opposed to heap) tables can inf…
I think this is a good answer. Our case is weird; millions of tables with billions (not sure how many in total even) of rows and no joins. Mysql handles this far better in our testing.
Re: Ask HN: Is PostgreSQL better than MySQL?
#75While I use MySQL extensively, I don't really know Postgres so I can't really compare the two. In my current project, I opted to use MySQL because Amazon Aurora didn't support Postgres at the time and I wanted replication performance and serverless autoscaling for a low level read workload that could be randomly very spiky. Today, both databases are well supported as a service on major cloud platforms. Postgres does…
Re: Ask HN: Is PostgreSQL better than MySQL?
#76Postgres back then was completely different then what it is now. It was mainly used for PhD and Master's student to hack on for their research. It was a mess internally and was hardly usable for production. I don't think that MySQL went through this style of development.
What eventually happened is that around 1995 SQL was added to Postgres and a bunch of non-Berkeley people started hacking on it. They did a fantastic job, and deserve all the credit for making it what it is today (Stonebraker has publically said this).
Re: Ask HN: Is PostgreSQL better than MySQL?
#77Re: Ask HN: Is PostgreSQL better than MySQL?
#78- Take data types, for example. Seems something simple, right? You can grok all data types in PostgreSQL in an afternoon. Want to grok MySQL data types? You're going to waste an entire week to grok them. There are multiple data types that seem to do the same thing with very small differences and a lot of incompatibilities... and a lot of exceptional behavior (see point below). MySQL data types are LESS powerful, less flexible and 10x more complicated than PostgreSQL data types.
- Enums and sets need to have their possible values defined on a table by table basis. What a nightmare to keep them in sync. PostgreSQL allows you to this once for the whole DB.
- Open MySQL manual and it's full of passages like: feature A does "blah" if X mode is enabled, but does "bar" if mode Y is enabled and will corrupt data if storage engine is used with mode Z enabled.
- SQL strict mode can be disabled by the client. You cannot enforce that your server will work only with SQL strict mode on because a client can simply open a connection with SQL strict mode off. There's no way to enforce that clients will only use SQL strict mode. You have to trust your clients. (This other comment explains strict mode: https://www.reddit.com/r/PostgreSQL/comments/xblooo/comment/...)
- According to the manual, if client A does stuff with strict mode on and client B does stuff with strict mode off, data corruption will occur.
- A lot of surprising and unexpected behavior, even with SQL Strict mode on
- String comparison is case insensitive. There are workarounds but they are still workarounds.
- A lot of behavior is dependent on server configuration. So switching between servers you can't expect them to behave the same.
- Behavior not standardized among versions and installs
- Changing the server SQL mode after creating and inserting data into partitioned tables can cause major changes in the behavior of such tables, and could lead to loss or corruption of data
- Useless error messages (see https://www.reddit.com/r/PostgreSQL/comments/xblooo/comment/...)
- MySQL, at the same time it is less powerful and flexible, has a lot more levers and knobs than PostgreSQL. PostgreSQL, while more powerful and flexible, conceptually is a lot simpler than MySQL.
- PostgreSQL stays out of your way; with MySQL you’re constantly fighting it
PostgreSQL -> simplicity
MySQL -> complexity
Re: Ask HN: Is PostgreSQL better than MySQL?
#79Re: Ask HN: Is PostgreSQL better than MySQL?
#80As a software engineer that worked with a lot of different databases in the last 20 years I have come to believe that PostgreSQL is even better than Oracle (this will certainly spark some fires). I have had shit with a lot of databases but never with PostgreSQL. MySQL has some really nasty documented and undocumented "features" so I rather avoid that database. It has it's place in the universe but it's in on a differ…