// the false impression that the validation performance bug has
// returned.
return;
}
final long start = System.currentTimeMillis();
Connection connection = getTestContext().getConnection();
final String queryString =
"select {[Measures].[Unit Sales],\n"
+ " [Measures].[Store Cost],\n"
+ " [Measures].[Store Sales]} ON columns,\n"
+ "Hierarchize(Union(Union(Union(Union(Union(Union(Union(Union(Union(Union(Union(Union(Union(Union(Union(Union(Union(Union(Union(Union\n"
+ "({([Gender].[All Gender],\n"
+ " [Marital Status].[All Marital Status],\n"
+ " [Customers].[All Customers],\n"
+ " [Product].[All Products])},\n"
+ " Crossjoin ([Gender].[All Gender].Children,\n"
+ " {([Marital Status].[All Marital Status],\n"
+ " [Customers].[All Customers],\n"
+ " [Product].[All Products])})),\n"
+ " Crossjoin(Crossjoin({[Gender].[All Gender].[F]},\n"
+ " [Marital Status].[All Marital Status].Children),\n"
+ " {([Customers].[All Customers],\n"
+ " [Product].[All Products])})),\n"
+ " Crossjoin(Crossjoin({([Gender].[All Gender].[F],\n"
+ " [Marital Status].[All Marital Status].[M])},\n"
+ " [Customers].[All Customers].Children),\n"
+ " {[Product].[All Products]})),\n"
+ " Crossjoin(Crossjoin({([Gender].[All Gender].[F],\n"
+ " [Marital Status].[All Marital Status].[M])},\n"
+ " [Customers].[All Customers].[USA].Children),\n"
+ " {[Product].[All Products]})),\n"
+ " Crossjoin ({([Gender].[All Gender].[F], [Marital Status].[All Marital Status].[M], [Customers].[All Customers].[USA].[CA])},\n"
+ " [Product].[All Products].Children)),\n"
+ " Crossjoin({([Gender].[All Gender].[F], [Marital Status].[All Marital Status].[M], [Customers].[All Customers].[USA].[OR])},\n"
+ " [Product].[All Products].Children)),\n"
+ " Crossjoin({([Gender].[All Gender].[F], [Marital Status].[All Marital Status].[M], [Customers].[All Customers].[USA].[WA])},\n"
+ " [Product].[All Products].Children)),\n"
+ " Crossjoin ({([Gender].[All Gender].[F], [Marital Status].[All Marital Status].[M], [Customers].[All Customers].[USA])},\n"
+ " [Product].[All Products].Children)),\n"
+ " Crossjoin(\n"
+ " Crossjoin({([Gender].[All Gender].[F], [Marital Status].[All Marital Status].[S])}, [Customers].[All Customers].Children),\n"
+ " {[Product].[All Products]})),\n"
+ " Crossjoin(Crossjoin({([Gender].[All Gender].[F],\n"
+ " [Marital Status].[All Marital Status].[S])},\n"
+ " [Customers].[All Customers].[USA].Children),\n"
+ " {[Product].[All Products]})),\n"
+ " Crossjoin ({([Gender].[All Gender].[F],\n"
+ " [Marital Status].[All Marital Status].[S],\n"
+ " [Customers].[All Customers].[USA].[CA])},\n"
+ " [Product].[All Products].Children)),\n"
+ " Crossjoin({([Gender].[All Gender].[F],\n"
+ " [Marital Status].[All Marital Status].[S],\n"
+ " [Customers].[All Customers].[USA].[OR])},\n"
+ " [Product].[All Products].Children)),\n"
+ " Crossjoin({([Gender].[All Gender].[F],\n"
+ " [Marital Status].[All Marital Status].[S],\n"
+ " [Customers].[All Customers].[USA].[WA])},\n"
+ " [Product].[All Products].Children)),\n"
+ " Crossjoin ({([Gender].[All Gender].[F],\n"
+ " [Marital Status].[All Marital Status].[S],\n"
+ " [Customers].[All Customers].[USA])},\n"
+ " [Product].[All Products].Children)),\n"
+ " Crossjoin(Crossjoin({([Gender].[All Gender].[F],\n"
+ " [Marital Status].[All Marital Status])},\n"
+ " [Customers].[All Customers].Children),\n"
+ " {[Product].[All Products]})),\n"
+ " Crossjoin(Crossjoin({([Gender].[All Gender].[F],\n"
+ " [Marital Status].[All Marital Status])},\n"
+ " [Customers].[All Customers].[USA].Children),\n"
+ " {[Product].[All Products]})),\n"
+ " Crossjoin ({([Gender].[All Gender].[F],\n"
+ " [Marital Status].[All Marital Status],\n"
+ " [Customers].[All Customers].[USA].[CA])},\n"
+ " [Product].[All Products].Children)),\n"
+ " Crossjoin({([Gender].[All Gender].[F],\n"
+ " [Marital Status].[All Marital Status],\n"
+ " [Customers].[All Customers].[USA].[OR])},\n"
+ " [Product].[All Products].Children)),\n"
+ " Crossjoin({([Gender].[All Gender].[F],\n"
+ " [Marital Status].[All Marital Status],\n"
+ " [Customers].[All Customers].[USA].[WA])},\n"
+ " [Product].[All Products].Children)),\n"
+ " Crossjoin ({([Gender].[All Gender].[F],\n"
+ " [Marital Status].[All Marital Status],\n"
+ " [Customers].[All Customers].[USA])},\n"
+ " [Product].[All Products].Children))) ON rows from [Sales] where [Time].[1997]";
Query query = connection.parseQuery(queryString);
// If this call took longer than 10 seconds, the performance bug has
// probably resurfaced again.
final long afterParseMillis = System.currentTimeMillis();
final long afterParseNonDbMillis =
afterParseMillis - Util.dbTimeMillis();
final long parseMillis = afterParseMillis - start;
assertTrue(
"performance problem: parse took " + parseMillis + " milliseconds",
parseMillis <= 10000);
Result result = connection.execute(query);
assertEquals(59, result.getAxes()[1].getPositions().size());
// If this call took longer than 10 seconds,
// or 2 seconds exclusing db access,
// the performance bug has