Hi,
this function module is too complex to deliver on the fly results for the millions of documents.
Options:
1. Background processing
2. Parallel processing - n threads with single cost center
3. Use BW/BI for reporting
4. Use custom selections - own functions
5. HANA
6. SAT analysis and new DB indexes
7. Say your BASIS to extend timeout for dialog sessions
choose one or combine them.
Regards,
Konstantin