Finding a faster query for USQL
By: Johnathon Wright on: December 17, 2012
"select sum(NOIAMOUNT) FROM NOI WHERE NOIALLOC_DATE = { d '2012-12-05' };" ~ instant
select NOITRNNUMBER, sum(NOIAMOUNT) FROM NOI WHERE NOIALLOCDATE = { d '2012-12-05' } GROUP BY NOI.NOITRN_NUMBER; ~ instant
select TRANTYPES.TRNNAME, NOITRNNUMBER, sum(NOIAMOUNT) FROM NOI, TRANTYPES WHERE NOIALLOCDATE = { d '2012-12-05' } AND TRANTYPES.TRNNUMBER = NOI.NOITRNNUMBER GROUP BY NOI.NOITRNNUMBER, TRANTYPES.TRNNAME;
~125s
select MAX(TRANTYPES.TRNNAME), NOITRNNUMBER, sum(NOIAMOUNT) FROM NOI, TRANTYPES WHERE NOIALLOCDATE = { d '2012-12-05' } AND TRANTYPES.TRNNUMBER = NOI.NOITRNNUMBER GROUP BY NOI.NOITRNNUMBER;
~ 126s