I do not know the specifics of Pentaho MDX, but in general, I would use the following approach, assuming the 50000 records are in hierarchy [DimA].[Record]
:
WITH SET [Selected Records] AS
SubSet([DimA].[Record].[Record].Members,
ParamRef('start') - 1,
ParamRef('end') - ParamRef('start') + 1
)
SELECT { [Measures].[Count] }
ON COLUMNS,
[Selected Records]
ON ROWS
FROM [MyCube]
I am a bit guessing about the use of ParamRef
in Mondrian MDX here. The SubSet
function is described for Analysis Services here: http://msdn.microsoft.com/en-us/library/ms144767.aspx