3 ms·
> but mysql is just much faster in most cases What kind of cases. Since PostgreSQL wins in benchmarks I’m curious what’s faster.
by wordofx 2y ago
> but mysql is just much faster in most cases
What kind of cases. Since PostgreSQL wins in benchmarks I’m curious what’s faster.
- sgarland 2y agoHeavy concurrency, for one. MySQL uses threads; Postgres uses forks. You can (and should) help the latter with a connection pooler, but if you then throw one in front of the MySQL instance, it wins again. Also, if you’ve designed your schema and queries around MySQL (InnoDB, specifically), you can get way faster queries. It’s a clustering index RDBMS, so range queries require far fewer reads thanks to linear read ahead, but only if your PK is k-sortable. UUIDv4 will absolutely tank the performance. It will on Postgres too, but under different circumstances, and for different reasons. Benchmarking anything is fraught with peril. There are so many variables, and the benchmark itself can be quietly selected to favor one or the other. I’d encourage you to create identically-sized instances, with your actual schema, and realistic test data.