>SET ORDER TO code
>SUM FOR date >= {12/19/1999} AND etc.
>
>is faster than
>
>SUM FOR code = 'I' AND date >= {12/19/199} AND etc.
>
But not setting an order and using a SQL SELECT is lower cost than building the index on the fly (you'd have to either do that, or carry a whole lot of filtered tags) - SUM/CALCULATE are order independent. YMMV.