Oracle Sorting Patent Expires, Unlocking 5x Performance Gains for Open-Source Databases
A 20-year Oracle patent on a fast sorting algorithm has expired, opening the door for PostgreSQL, MySQL, and other open-source databases to adopt techniques that delivered 5x performance improvements.
A patent that kept a high-performance sorting algorithm locked behind Oracle's walls for two decades has expired, and the open-source database community is already exploring how to implement it. Patent US7680791B2, which covers a method for sorting data using common prefix bytes, expired at the end of 2025, making the technology freely available to projects like PostgreSQL and MySQL.
For developers working with large datasets and complex queries, this could translate directly into faster application performance—particularly for operations involving sorting of data with similar keys, a common pattern in real-world database workloads.
The Algorithm Behind the Patent
The sorting algorithm, which inventor Mark Callaghan suggests calling "Orasort," addresses a fundamental inefficiency in traditional sorting approaches. According to the patent documentation and Callaghan's own blog post on Small Datum, the algorithm combines four key techniques:
Callaghan, who invented the algorithm while working at Oracle between 2000 and 2005, explained the core insight on his blog: "As the algorithm descends into subpartitions of the data, the common prefixes of the keys in each subpartition were likely to grow." By remembering these shared prefixes and skipping redundant comparisons, the algorithm dramatically reduces computational overhead.
Real-World Performance Impact
When Oracle implemented the algorithm in Oracle Database 10gR2, the results were substantial. According to Callaghan's account, "The new sort was often about 5 times faster than the old sort."
The performance gains were significant enough to earn Callaghan a thank-you email from Oracle co-founder Larry Ellison. Oracle documented these improvements in a white paper on sort performance, though as Callaghan notes with characteristic understatement, "A promotion or bonus would have to wait as you had to play the long-game in your career at Oracle."
The algorithm proved particularly effective for database workloads where keys are larger than 8 bytes and adjacent rows share long common prefixes—exactly the patterns found in typical production database systems, rather than the uniform short keys often used in sorting benchmarks.
Why Patents Matter in Open Source
The expiration of this patent highlights how intellectual property restrictions shape the open-source landscape. For 20 years, open-source database projects couldn't implement these optimizations without risking patent infringement, even though the techniques could have improved performance for millions of developers.
As Callaghan wrote in his blog post announcing the expiration, "I hope for an open-source implementation one day. The patent has a good description of the algorithm, it is much easier to read than your typical patent."
This accessibility is notable. Patent US7680791B2 includes detailed functional descriptions that can serve as implementation guides, a rarity in patent documentation. Callaghan credits the IP lawyer who "made good use of the functional and design docs that I wrote."
Community Response and Implementation Plans
The database community responded quickly to news of the patent expiration. According to InfoQ, Hannu Krosing, a database engineer at Google, immediately began experimenting with implementations in Python, C, and C++ using AI coding assistants.
Varun Singh, CTO at Flooid.in and formerly founder at ScaleArc, commented on the detailed nature of the patent documentation: "That is so detailed, you could drop it into an AI agent, along with the patent document, and start implementing."
The interest extends beyond just academic curiosity. PostgreSQL and MySQL, two of the most widely-used open-source databases, could both benefit from these optimizations. Charles Thayer, commenting on the news, noted an aspect of the algorithm he hadn't previously considered: "I've never considered the complexity of when a sort algorithm can ship the first result item, to start the response stream and minimize latency. (Quicksort should be relatively good at this). Interesting work."
What This Means for Developers
If open-source database projects successfully implement this algorithm, developers using PostgreSQL, MySQL, or other databases could see:
ORDER BY clauses, particularly with multi-column sortsThe impact will be most noticeable in data warehousing, analytics workloads, and applications that frequently sort large result sets. However, even routine web applications that sort user-generated content or transaction histories could see measurable improvements.
The Path Forward
While the patent expiration removes legal barriers, implementation still requires substantial engineering work. Database sort routines are foundational components that must be carefully integrated and thoroughly tested. Any bugs or performance regressions could affect millions of production systems.
Callaghan himself, who worked on MySQL after leaving Oracle and spent time at Google and Facebook, has deep experience with open-source database architectures. His blog post serves as both an announcement and an invitation to the community to take up the challenge.
For developers tracking database performance, this patent expiration represents a concrete example of how the open-source ecosystem evolves—not just through new inventions, but through the gradual liberation of techniques that were previously restricted. Oracle still holds over 52,000 patents related to database technology according to InfoQ, but this particular algorithm is now free for anyone to implement and improve upon.
Takeaway
The expiration of Oracle's sorting algorithm patent isn't just a legal milestone—it's a practical opportunity for the open-source database community to adopt battle-tested optimizations that delivered measurable performance gains in production systems. For developers, the message is clear: keep an eye on PostgreSQL and MySQL release notes over the coming months. If these projects successfully integrate the algorithm, your applications could get faster without changing a single line of code.
In the meantime, Callaghan's detailed patent documentation and blog posts provide a roadmap for anyone interested in understanding or implementing advanced sorting techniques in their own systems.