Scrivio Interview library
LeadershipPrincipal6 min read · updated 12 November 2026

MySQL lacked hash joins until 8.0.18, and optimizer capabilities still differ widely between PostgreSQL, MySQL, Oracle and SQL Server. When your company chooses which relational databases to standardise on for the next decade, how much weight should optimizer and join capabilities get against operations, skills and cost?

Optimizer and join capabilities deserve real weight, but not the most, and how much depends on the workload: a weak planner pushes teams to denormalise or join in Java, which costs engineering time for years, while services doing simple key lookups barely use advanced joins. I would weigh it alongside operational maturity, the hiring pool, licence cost and vendor risk, test the candidates with our own query shapes and data volumes rather than vendor benchmarks, and plan to review the standard every few years because engines improve with each release.

Why this question is asked

Choosing which relational databases a company standardises on is one of the longest-lived decisions a technical leader makes. It shapes how hundreds of engineers write code, which skills we hire for, what we pay in licences, and what our on-call teams know how to fix at 3 a.m. Optimizer quality is easy to argue about from anecdotes, such as MySQL lacking hash joins until 8.0.18, and hard to weigh against everything else. Interviewers ask this to see whether we can structure the decision, use evidence, and keep it revisable. In this answer, we will look at what optimizer quality actually changes for a company, how the workload decides its weight, the other factors, how to test with our own queries, and how to keep the decision fresh.

1What Optimizer Quality Changes for a Company

The optimizer decides how a query runs: which indexes, which join algorithms, in which order. A strong optimizer, with good statistics, hash and merge joins, subquery decorrelation, parallel execution and good estimates for correlated data, lets engineers write the natural SQL for a question and get a good plan. A weaker one forces workarounds, and those workarounds are where the real cost lives.

The workarounds follow a familiar pattern. Teams avoid joins because they were slow, so they denormalise data into wide tables and keep the copies in sync in application code. Or they fetch rows from several tables into Java and join them in memory, moving far more data over the network and duplicating logic the database could do. Or they add hints and query rewrites that freeze a plan and break on the next upgrade. Each of these is reasonable once and expensive across hundreds of services for a decade. The historic absence of hash joins in MySQL is a good example: many teams built habits of 'never join large tables' that persist even after 8.0.18 removed the original reason.

2Letting the Workload Set the Weight

How much optimizer quality matters depends on what our services actually do. A service doing primary key lookups, small indexed range scans and simple inserts barely exercises the optimizer: every mainstream engine plans those well. Complex OLTP, such as order management with many joins per screen, and in-database reporting rely heavily on it. Pure analytics may not belong in the OLTP standard at all if we run a warehouse.

So the first step is evidence about our own workload: sample pg_stat_statements, MySQL's performance schema or the equivalent across services, classify queries by shape, and weigh them by time spent. If 85 percent of database time is key lookups and the remaining 15 percent is complex joins concentrated in a few domains, the optimizer gets moderate weight. If complex queries dominate, it gets more.

A sample weighting for a mixed OLTP company
FactorWeightWhat we measure
Operational maturity25%Backups, replication, upgrades, managed offerings, tooling
Optimizer and SQL features20%Our query shapes: plans, latency, regressions
Skills and hiring pool20%Current team knowledge, market availability
Cost20%Licences, support, infrastructure, managed service pricing
Vendor and ecosystem risk15%Licence changes, community, drivers, cloud support
Weights are an example for a workload dominated by OLTP with some complex queries; they should come from our own data.

3The Other Factors

Operational maturity often matters most in daily life: how backups and point-in-time recovery work, how replication and failover behave under load, how painful major upgrades are, what monitoring exists, and whether solid managed offerings exist on our cloud providers. An engine with a brilliant optimizer that our team cannot operate safely is a worse choice than a slightly weaker one we run well.

Skills and hiring matter because a standard is only useful if people can work with it. If 200 engineers know PostgreSQL and five know SQL Server, switching has a training and productivity cost that no benchmark shows. Cost includes licences, which differ enormously between open-source and commercial engines, support contracts, and how pricing scales with cores. Vendor risk covers licence changes, the health of the community, the quality of JDBC drivers and frameworks such as Hibernate and Flyway, and lock-in to proprietary features. Each of these can outweigh a gap in join planning, and none of them should be ignored because the optimizer is impressive.

4Testing With Our Own Query Shapes

Vendor benchmarks measure what the vendor chose to measure. The only evidence that predicts our experience is our own queries on our own data volumes. So I would run a short, structured evaluation: pick 30 to 50 representative queries, the most frequent ones and the slowest complex ones, load a production-sized anonymised copy of the relevant schemas into each candidate engine, and compare plans, latency at realistic concurrency, and behaviour under data skew. We should also include operations tests: a failover, a major-version upgrade rehearsal, a restore from backup.

The evaluation should involve engineers from the teams with the heaviest database use, which also builds trust in the result. It need not take long; a few weeks with clear criteria is enough. The outcome is not a single score but a written decision record that states the weights, the evidence and the trade-offs we accepted.

Step throughMaking the standardisation decision
  1. Profile our workloadquery shapes weighted by time spent
  2. Set weights from the profileoptimizer, operations, skills, cost, risk
  3. Test candidates on our queries and dataplans, latency, failover, upgrades
  4. Write the decision recordevidence, trade-offs, exceptions process
  5. Review every 2 to 3 yearsengines and workloads change

5 steps in order. Play them, or step through them one at a time.

5Planning for Change

Database engines change faster than standards do. MySQL gained hash joins, window functions and CTEs in the 8.0 series; PostgreSQL improves its planner, parallelism and partitioning in almost every release. A decision based on capabilities from five years ago may now be wrong in either direction. So the standard should have a review date, every two or three years, with a lighter version of the same evaluation.

It should also allow exceptions with a process: a team with a genuine need, such as a time-series or graph workload, can propose another engine with evidence, and accepts the extra operational burden. Standardising on one or two relational engines is valuable because it concentrates expertise, but a standard that cannot adapt becomes a source of the very workarounds it was meant to prevent.

6Follow-up questions

Would you standardise on a single database or allow two?

Often two works well: for example PostgreSQL as the default and MySQL where there is a large existing estate or strong team expertise. Supporting both doubles some operational work, but forcing a migration of a large, healthy MySQL estate costs far more than it saves. The key is that each supported engine has tooling, runbooks and experts, and that new services default to one.

How do you stop the decision from becoming a popularity contest?

By agreeing on the criteria and weights before looking at results, and by using our own measurements. People still have preferences, but a written evaluation with numbers on our queries, failover tests and costs makes the trade-offs visible and the decision defensible to teams that preferred another engine.

What if the chosen engine's optimizer struggles with a few critical queries?

Then we deal with those specifically: query rewrites, extended statistics, a denormalised read model for that domain, or moving the analytical part to a warehouse. A handful of hard queries rarely justifies a different standard for everyone, but if the evaluation shows the struggle is common across our workload, the optimizer weight was too low and we should revisit it.

7Conclusion

In this answer, we saw that optimizer and join capabilities matter because weak planning pushes teams into denormalisation, joins in Java and fragile hints, but that their weight depends on how much of our workload uses complex joins. We weighed them against operational maturity, skills, cost and vendor risk, tested candidates with our own queries and data rather than vendor benchmarks, recorded the decision with its evidence, and planned to review it every few years as engines improve.

What to say in the interviewAbout 90 seconds aloud

Open with

I would give the optimizer real weight, but let our workload decide how much. A strong optimizer means engineers can write natural SQL and get good plans. A weak one creates workarounds that last a decade: denormalised tables kept in sync by hand, joins done in Java after pulling too much data, hints that break on upgrades.

Then, if they want more

MySQL's late hash joins are a good example of a gap that shaped habits for years. But if most of our database time is key lookups and simple ranges, every mainstream engine handles that, and the optimizer matters less. So I would first profile our workload from query statistics, by shape and time spent, and set weights from that.

For a typical OLTP-heavy company I might give operations around a quarter, the optimizer around a fifth, and similar weight to skills and cost, with vendor risk after that. Operations means backups, replication, failover, upgrades and good managed offerings. Skills means who we have and can hire. Cost includes licences and support.

Then I would test the candidates with 30 to 50 of our own queries on production-sized anonymised data, plus failover and upgrade rehearsals, rather than trusting vendor benchmarks, with engineers from the heaviest teams involved.

The result is a written decision record with evidence and an exception process, and a review every two to three years, because engines improve every release and our workload changes too.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "MySQL lacked hash joins until 8.0.18, and optimizer capabilities still differ widely...": https://scrivio-interview-library.netlify.app/databases/sql-joins-and-subqueries/c7b0acbca4/