EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB442008: It takes long time or times out to load the element prompt when there are many attribute elements because of the SELECT COUNT DISTINCT query in MicroStrategy 10.x.


Yating (Tiffanie) Zhai

Senior Cloud Support Engineer III • MicroStrategy


It takes long time or times out to load the element prompt when there are many attribute elements because of the SELECT COUNT DISTINCT query in MicroStrategy 10.x.

SYMPTOM
When a report or Document containing an element prompt executed, it takes long time to load all the elements when there are large number of attribute elements, and sometimes it even leads to a timed out error.
The timed out error has been outlined in the KB article as below.
KB10155: When answering a prompt with a large number of elements, a timeout error occurs in MicroStrategy Web
CAUSE
When a user runs a report or document containing an element prompt, the Intelligence Server runs two SQL statements (as below) against the data warehouse to retrieve the elements from the data warehouse. The first one is to retrieve the count of all the elements, and the second one is to retrieve the results as shown in the examples below for the Strategy Tutorial "Item" attribute. This has been outlined in the KB article as below.
 KB30391: How does the MicroStrategy Intelligence Server 9.x determine the number of prompt elements to fetch and whether or not element caching will be used for the result set.


select count(distinct a21.ITEM_ID)  WJXBFS1  from LU_ITEM a21
select a11.ITEM_ID  ITEM_ID,   a11.ITEM_NAME  ITEM_NAME  from LU_ITEM a11  order by  2 asc , 1 asc

The select count distinct is expensive in terms of performance, and currently it doesn't allow to customize SQL to fetch elements for prompts.
ACTION
Change the VLDB setting "Attribute Element Number Count Method" to use ODBC cursor to calculate the total element number (like below):

ka044000000kUHbAAM_0EM44000000Qx3O.png

•Use Count(Attribute@ID) to calculate total element number (uses count distinct if necessary) (default): In this case, the database determines the total number of rows.
•Use ODBC cursor to calculate the total element number: This setting causes Intelligence Server to determine the total number of rows by looping through the table after the initial SELECT pass.
The difference between the two approaches is whether the database or Intelligence Server determines the total number of records. Strategy recommends using the “Use ODBC cursor...” option (having Intelligence Server determine the total number of records) if users have a heavily taxed data warehouse or if the SELECT COUNT DISTINCT query itself introduces contention in the database.


Comment

0 comments

Details

Knowledge Article

Published:

September 29, 2018

Last Updated:

March 28, 2019