How to Speed Up Apache Xalan’s XPath Processor by Factor 10x

There has been a bit of an awkward bug in Apache Xalan for a while now, and that bug is XALANJ-2540. The effect of this bug is that an internal SPI configuration file is loaded by Xalan thousands of times per XPath expression evaluation, which can be measured easily as such: this: Element e = (Element) … Continue reading How to Speed Up Apache Xalan’s XPath Processor by Factor 10x →

The Myth About Slow SQL JOIN Operations

In my recent SQL work for a large Swiss bank, I have maintained nested database view monsters whose unnested SQL code amounted up to 5k lines of code, joining the same table over and over again in separate subselects combined via UNION operations. This monster performed in way under 50ms, no matter how we queried … Continue reading The Myth About Slow SQL JOIN Operations →

Strategy: Stop Using Linked-Lists

While using java.util.LinkedHashMap every now and then, when I feel that the insertion order is relevant to subsequent entrySet iterations, I do not recall having used a LinkedList any time, recently. Of course, I understand its purpose and since Java 6, I apreciate the notion of a Deque type. But the LinkedList implementation of the List type … Continue reading Strategy: Stop Using Linked-Lists →

Hibernate, and Querying 50k Records. Too Much?

An interesting read, showing that Hibernate can quickly get to its limits when it comes to querying 50k records - a relatively small number of records for a sophisticated database: http://koenserneels.blogspot.ch/2013/03/bulk-fetching-with-hibernate.html Of course, Hibernate can generally deal with such situations, but you have to start tuning Hibernate, digging into its more advanced features. Makes one … Continue reading Hibernate, and Querying 50k Records. Too Much? →

JDBC batch operations with jOOQ

So this was requested again, by another jOOQ user - support for an ancient JDBC feature - java.sql.Statement.addBatch(); With JDBC, you can easily execute several statements at once using the addBatch() method. Essentially, there are two modes in JDBC Execute several queries without bind values Execute one query several times with bind values With code, … Continue reading JDBC batch operations with jOOQ →

Oracle scalar subquery caching

The importance of being able to fully control executed SQL (using jOOQ, or plain JDBC) on large-scale systems becomes obvious every time you need to fine-tune your SQL queries for a specific RDBMS. In this case, we're looking at Oracle and its miraculous scalar subquery caching mechanisms: Usually, the context switch from SQL to PL/SQL … Continue reading Oracle scalar subquery caching →