hpcc-systems/HPCC-Platform — pull request #1988 by ghalliday (2012-03-27 19:27:32+00:00)
Title: Various index count and aggregate fixes

Generate a new activity kind for not exists
Probably not significant, but started generating a few when some
new exists code was being tested.

Remove projects from count(keyed-limit(project(index)))
A missing case from a switch statement meant projects weren't
stripped when there was a keyed limit on the index read.

Reduce the generated code size for an index count/exists
The numValid(size, ptr) member was never called for an index, so default
it to throwing an exception in the base class, and clean up numValid(ptr)
code.

CHOOSEN(LIMIT(index-read))
The choosen was not being combined within the compound indexread if there
was a limit. It is however valid to do so since the choosen is done last.
(A limit cannot be combined when there is an existing choosen.)
This was unfortunate because it was frustrating another optimization.
count(index-read) > n being converted to count(choosen(index-read,n+1)) > n
(This is temporarily retained, but will be removed in a subsequent commit).

Don't generate count(index) if there is a skip limit

Optimize count(x) > 0 to exists(x)

Signed-off-by: Gavin Halliday