Aggregate Functions in Index with IBMDB2
- by Erkan
Is there any way to pre aggregate results of aggregate functionts (f.i. count()) and store it in an index?
The background is: i want to speed up count() queries. So that:
Select count(users) from TE123
where region = 'A';
would be supported by an index like
Region Count(Users)
A 548
E 458
I know that MQTs would also help for this problem. However, in this case it is not possible to use MQT, as we use kind of an ORM and we don't want to define Entities on MQTs.
I just slightly remember - one DBA told me - that there is such a function planned for DB2 V10.