top | item 27360312

(no title)

chrisacky | 4 years ago

I've been 99% MySQL user, project reasons.. everytime I see a release announcement I'm amazed and have feature envy. This isn't a troll comment, but what does mysql do better than postgres? Is it just syntax-favour. I actually Googleéd and ask colleague 10-15 days ago if postgres had json support for indexing root attributes...

discuss

order

nknealk|4 years ago

MySQL can handle many more connections per instance than postgres. Often when you have a high-transaction database in prod with postgres, you need something like pgbouncer to handle connection pooling or you'll have a bad time.

I agree though that postgres has some fantastic features.

edit: I think they may have addressed some of this in a recent version? I'm basing my knowledge on postgres 12

mattashii|4 years ago

Connection scaling in postgres works better with the more recent versions. Still, you might indeed want to implement a connection pool for your PG instance if you have large swathes of mostly idle connections due to the single-backend-per-connection constraint of postgresql.

mattashii|4 years ago

mysql notably has index-oriented tables / persistently clustered tables. For some workloads, that is a blessing (it saves you from needing another copy of your data in unique join tables for the unique constraint), but for others its a curse (the PK columns are duplicated in all indexes, so multi-column PK + multiple indexes is quite inefficient).

Other than that, MySQL (since 8.0) has no stable feature releases. As in, after 8.0.0 new features were added in 8.0.x-releases, making it difficult to reason about what you can and cannot do in a given database cluster based on the major version number alone. This too is a blessing and a curse: you get new features faster, but you don't get bugfixes for a database engine with stable and well-defined featureset.

ksec|4 years ago

>but what does mysql do better than postgres

Not MySQL itself but something like Vitess [1]. I believe MySQL 9.0 should be close.

[1] https://vitess.io

etaioinshrdlu|4 years ago

MySQL doesn't need the auto-vacuumer to be tuned, as it doesn't have one. I've had Postgres servers crash due to excessive stale rows...

yarcob|4 years ago

PostgreSQL is vulnerable to certain workloads. For example, if you keep appending something to a text column, you'll use up a lot of disc space since PG will copy the row each time and keep deleted copies around until autovacuum comes along.

Of course, if you are doing this then you are using your database wrong -- but it's still something that's easy to run into.

jamesrr39|4 years ago

I always thought it was cool that MySQL has different table engines. Postgres doesn't have this (unless I missed something). Sure, there are products based on Postgres that have this, but vanilla Postgres itself doesn't have this option.