Bug 781092 (SOA-3582) - RFE/possible optimization: push down parts of some aggregate expressions
Summary: RFE/possible optimization: push down parts of some aggregate expressions
Keywords:
Status: CLOSED DEFERRED
Alias: SOA-3582
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: EDS
Version: 5.1.0 GA
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Van Halbert
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-14 15:29 UTC by dsteigne
Modified: 2011-11-30 18:45 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-14 20:12:05 UTC
Type: Feature Request


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-3582 0 None None None Never
Red Hat Issue Tracker TEIID-1826 0 None None None Never

Description dsteigne 2011-11-14 15:29:10 UTC
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A0000008ULPj
project_key: SOA

suggestion for a potential optimization: It concerns federated queries which do expressions. This is an extremely common requirement in the banking business, the main example being when monetary amounts need to be converted into a reporting currency using a rate in another database.

With the query below, it makes sense that despite the group by, EDS will pull back all the rows so it can multiply one by the other. Unfortunately this is often many millions of records.

Would it be feasible to have an optimization which push-down most of the aggregation to the source, then do a further aggregation in EDS? 

 * sum the tsl.func_amount, grouped by tsl.currency
 * next: get the conversion rates for all the currency codes which have been returned, then sum(total * rate)

Of course, this can only be done for certain kinds of expressions.

select sum(tsl.func_amount * ccy.EuroConversionLegacyRate)
  from TSL_FINANCIAL_ACCOUNT_ITEMS_T2 tsl
  join t_sdm_currency ccy on tsl.currency = ccy.currencycode
 where tsl.business_date = '2011-06-29'
 group by ccy.EuroConversionLegacyRate

Comment 1 Van Halbert 2011-11-14 15:44:27 UTC
Link: Added: This issue Cloned to SOA-3583



Note You need to log in before you can comment on or make changes to this bug.