Hi, I ran into some issues where Derby was pathologically slow compared to PostgreSQL, which I was able to resolve with the help of the list.
However, I thought it might be interesting for the list to hear about the opposite: - Derby embedded is *MUCH* faster for tiny queries. Only after testing with PostgreSQL did we discover that our application was using thousands of small queries that took 1-2ms on PostgreSQL. On Derby embedded these tiny queries never showed up in our performance numbers. - Derby was 10x faster than PostgreSQL for a complicated query that used DISTINCT (as generated by Apache Cayenne). This was fixed by a modification to Cayenne to use the PostgreSQL DISTINCT ON(primary key1, primary key 2, ...) syntax. However, I thought it was very nice to see that this optimization was handled internally in Derby without polluting the SQL with unnecessary SQL dialects. So, while Apache Cayenne offers database independence from a correctness point of view, that doesn't mean that it is trivial to switch from one database to another. Performance can be just as important as correctness. If it isn't fast enough, customers can walk away because they don't see a difference between an application that doesn't complete the work in a timely fashion and an application that doesn't work. -- Øyvind Harboe - Can Zylin Consulting help on your project? http://www.zylin.com/
