Aggregate Functions in Index with IBMDB2
Posted
by
Erkan
on Stack Overflow
See other posts from Stack Overflow
or by Erkan
Published on 2012-11-29T16:39:18Z
Indexed on
2012/11/29
17:04 UTC
Read the original article
Hit count: 198
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.
© Stack Overflow or respective owner