This patch relates to the metadata performance issues when using the XMLA driver to connect to SSAS as referred to in this bug:
and this forum post:
This is a pretty basic workaround and there are probably a lot of things I haven't thought about. I'd be interested in any feedback.
At this stage I have implemented it using a couple of system properties that can be used to turn on/off the new functionality, to make it easy to test. They are:
When set to true, measures are not retrieved when the cube is loaded, but rather on the first time they are accessed.
When set to true, members that are not already cached in the metadataReader are not loaded immediately. I created a class XmlaOlap4jLazyMember which has some basic information about the member (uniqueName, caption), and when any further information about the member is requested it loads the member from the cube.
The idea with both of these is that it won't load as much metadata information from the cube unless it is needed by the client application. The lazyMemberLookup property means that all required members will be loaded individually, but that is what's happening anyway in any non-Mondrian data sources.
In my testing, the best case scenario (where none of the members' metadata needs to be retrieved) is a lot faster. The worst case scenario (where all of the members' metadata needs to be retrieved) is the same speed as the original code.
Perhaps you can suggest how to go about determining when to use this strategy - I don't know if it should be something that the client app can switch on/off, or if it should be done automatically based on the data source.
The patch is against the 22.214.171.1240 release tree.