Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Realistic performance comparison of MySQL vs PostgreSQL

We are in the process of designing a new system that will either use MySQL or Postgres depending upon the performance.But there are several problems in doing a realistic comparison.I have summed up some of them,it would be helpful if some experts threw some wisdom in here.

Using a neutral performance testing tool

There is something for postgres called explain analyze which basically gives all the details necessary to optimize on the database side.But MySQL does not have something which is as detailed as this one.

Of course these commands give info about a single query, real time performance involves bigger workloads on how the application is going to receive.

How much of this is true ? If a query is slower in postgres and faster in MySQL will it be faster in postgres over heavier workloads, of course only real time tests can tell,but is it worth going in this direction?

I am familiar with Jmeter, but are there any other better tools to do such tasks.

Optimization of both the databases

Postgres is said to be slower for simple reads, but scales well as the data grows and for more complex workloads.Taken from here and here.

With that said,how much optimisation is necessary so that the tests are fair to both database systems.

Any additional points are also welcome.

like image 525
Greedy Coder Avatar asked Sep 26 '22 20:09

Greedy Coder


1 Answers

size of data will have more significance than workload, resource (memory) tuning can have a big effect too.

"With that said,how much optimisation is necessary so that the tests are fair to both database systems."

Is seems to me that the only way to be fair is to do real-world optimisation. Optimise your test systems to as close to production as you can justify. if you're not going to be writing SQL both are going to perform about the same. (+/- $1000 worth of server hardware)

if you're writing SQL you want to keep the programmers happy. ($10000 of programmers won't get you much more performance)

like image 150
Jasen Avatar answered Sep 30 '22 07:09

Jasen