DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Top 8 PostgreSQL GUI Software in 2021
  • 5 Key Postgres Advantages Over MySQL
  • Using Envoy Proxy’s PostgreSQL and TCP Filters to Collect Yugabyte SQL Statistics
  • GraphQL With Java Spring Boot and Postgres or MySQL Made Easy!

Trending

  • From Zero to Production: Best Practices for Scaling LLMs in the Enterprise
  • Beyond ChatGPT, AI Reasoning 2.0: Engineering AI Models With Human-Like Reasoning
  • Why High-Performance AI/ML Is Essential in Modern Cybersecurity
  • A Deep Dive Into Firmware Over the Air for IoT Devices
  1. DZone
  2. Data Engineering
  3. Databases
  4. PostgreSQL vs MySQL Performance

PostgreSQL vs MySQL Performance

Sometimes a highly scientific performance test doesn't speak well about the end result you might end up with. Using a "fully-fledged app" is therefore better.

By 
Thomas Hansen user avatar
Thomas Hansen
DZone Core CORE ·
Dec. 14, 21 · Analysis
Likes (1)
Comment
Save
Tweet
Share
31.7K Views

Join the DZone community and get the full member experience.

Join For Free

When you need a database, you typically chose one according to its performance, and/or feature set. However, a "highly scientific performance test" might not speak much about your application's end resulting performance. Due to these reasons, I chose to create a "fully fledged app" using Magic and Hyperlambda, and I chose to create it twice. Once using Oracle's Sakila database and then once more using PostgreSQL's Pagila database.

The reasons why this is interesting, is because the Pagila database is more or less an exact "port" of the Sakila database, including each row in its tables. This allows us to measure the performance differences between these two different databases, and end up with a result resembling the performance difference we might expect in our application.

In the following video I am demonstrating the differences between my two different apps, and my "guesstimate" of the differences here is that MySQL is roughly 25% faster than PostgreSQL. Notice, none of my apps takes advantage of database specific features, such as full text search in PostgreSQL, etc - So depending upon your exact needs, obviously this would seriously change the conclusion. But these two apps basically does the exact same thing, and if you're building a standard CRUD app, the following performance differences between MySQL and PostgreSQL can be expected.


Both databases are installed with all default values, and no configuration changes have been applied after installation. Both databases runs on localhost, and according to the Pagila creator, the database is an "exact port" of the Sakila database. Hence, as an enterprise administration application software developer, the above is roughly what you could expect as of today using the latest version of PostgreSQL and MySQL (December 2021 is the date today). My test also doesn't measure throughput, concurrency, memory usage, etc, etc, etc - Only "raw performance" doing paging, and it does it through the exact same codebase, resulting in the exact same SQL, running towards the exact same database. Both tests are done on the same machine (MacBook Air 2021 version) with Intel chip. And both tests are done simultaneously, implying what software I am running, or other things my computer happens to be doing, should not play a significant role in any ways.

Notice - The first paging I am doing on the "Film_actor" table results in an SQL statement with two joins; One left join towards the "film" table and another towards the "actor" table. The second paging I am doing on the "Actor" table is a simple SQL select statement, without any joins.

Conclusion; MySQL is roughly 25% faster than PostgreSQL

And yes, I realise that a lot of people didn't want to hear the above, but feel free to reproduce my performance test as you see fit, and/or comment with whatever concerns you might have in regards to my test in the comment section of this article. If you want to reproduce my test, watch the video above, and then download everything required to reproduce my test below.

  • Download Magic Cloud

Psst, if somebody wants "the honour" of porting the Sakila database to Microsoft's SQL Server, I would love to run my test again, adding SQL Server to the mix - However, I suspect we all know the answer to that question already ... ;)

Database MySQL PostgreSQL

Opinions expressed by DZone contributors are their own.

Related

  • Top 8 PostgreSQL GUI Software in 2021
  • 5 Key Postgres Advantages Over MySQL
  • Using Envoy Proxy’s PostgreSQL and TCP Filters to Collect Yugabyte SQL Statistics
  • GraphQL With Java Spring Boot and Postgres or MySQL Made Easy!

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: