Home > Articles > Data > SQL Server

Like this article? We recommend

Location of Query Processing

Control of the location of processing can be managed from the Large Level Threshold property setpoint. Although the large level value is a critical influencer of which location is selected for query processing, we can also control the location using other means—chief of which is the Execution Location parameter.

Execution Location Parameter

We have learned that large levels, as defined by the threshold, are processed solely at the server level, not sent to the client unless a specific request is made. Small levels, in contrast, are sent to the client to be processed, even if the associated level is not requested in its entirety. Before we undertake to control the location of processing, we should understand the benefits and costs associated with the client/server processing options from which we can select. Some of the more important of these are summarized in Table 1.

Table 1 Advantages and Disadvantages of Processing Location Options

Client versus Server Processing

Costs and Benefits

Processing Location

Disadvantages

Advantages

Server

Consumes more CPU and memory resources.

Takes longer to process.

Results can be cached on the server, so that requests for the same result sets by other client applications are quickly available.

Client

Potentially much greater network traffic because large amounts of data are being dispatched from the server.

Client-based processing means client-based caching. This results in a loss of rapid fulfillment of recurring requests by multiple clients for the same information.

Placing processing burden on the client relieves the server of virtually all resource requirements.


The Execution Location connection parameter provides another more direct means of controlling location of processing of our MDX queries. To build a query that will be executed on the server, we need only use the OLE DB property ExecutionLocation, which specifies where the query is to be resolved. The setpoint options for ExecutionLocation are displayed in Table 2.

Table 2

Setpoint

Meaning

0

Default. For compatibility with earlier versions, this means the same as Value 1. (Subject to change in future versions.)

1

The PivotTable Service selects the query processing location (server or client application) that it predicts will provide the best performance.

2

Queries are processed on the client application.

3

Queries are executed on the server. (Queries that contain session-scoped calculated members, user-defined sets, or user-defined functions are exceptions.)


The location of query processing can be forced to our choice of server or client by using the Execution Location property. The default setting, Automatic, allows the PivotTable Service to determine where the query should be processed, based upon its prediction of which option will mean better performance. When using the default option (where the processing location is determined internally), a critical factor in the determination of the execution location is the Large Level Threshold property we have already discussed. Suppose the level is set at 1,000. The PivotTable Service forces "large level" treatment if it determines that the query will require the aggregation of 1000 or more members in a given dimension level. If the query does not involve a large level, the evaluation of the query occurs at the client. If a large level is apparent, the query is evaluated at the server.

Other Means of Influencing Execution Location

At the individual query level, no way is readily available for a client application to direct execution location. We can, however, mandate that large level operations execute at the client through the use of an indirect means: The specification of a named set for use within the query will force processing at the client level. We can, therefore, create a named set (using either of the CREATE SET or WITH SET clauses) containing members of a large level, at the client; then use the same named set in a query to force client-based execution.

Other considerations with regard to control of the processing location include calculated members and calculated cells. The manner of creation of a calculated member is important for determining its location-fixing effects. Using the CREATE MEMBER or WITH MEMBER clauses with a query to define a calculated member at the server will produce a calculated member that can be processed at the server or client equally successfully. By contrast, using CREATE MEMBER to produce a calculated member within a session will result in forced client-based execution of the query that houses it. Cell calculations may also cause forced client-based processing. Again, the manner in which the cell calculations are defined is important for determining their location-fixing effects. A cell calculation that is created with the CREATE CELL CALCULATION clause at either the client or the server can be processed at the server. By contrast, the use of the WITH CELL CALCULATION clause at the client will result in a query whose processing will be client-based.

The existence of two conditions can force a query to process on the server: a reference to a filter operation within the query and (consistent with our discussion regarding large levels earlier) a large dimension level. Let's take a look at the mechanics behind this in a little more detail. We will first fire up the MDX sample application, having seen in past articles that it provides an excellent platform from which to learn about MDX and about the data and the metadata in our cube. Many of the MDX operations that might be performed from a client application can be simulated here or elsewhere, and we can thus often gain another perspective of the interplay of the OLAP data source and MDX through the sample application.

NOTE

Keep in mind that client applications differ in many ways; and individual setpoints, design characteristics, capabilities, and other considerations likely mean differences in operation and performance using the techniques we describe.

  1. Go to the Start button on the PC; navigate to Microsoft SQL Server, Analysis Services; then navigate to the MDX sample application.

    We are initially greeted by the Connect dialog box, as shown in Figure 4.

    Figure 4Figure 4 The Connect dialog box for the MDX sample application.

    Figure 4 depicts the name of my server, MOTHER, and properly indicates that we will be connecting via the MSOLAP provider (the default).

  2. Click OK.

    NOTE

    We might also choose to cancel the dialog box and connect later by clicking Connect on the File menu.

    The MDX sample application window appears.

  3. Clear the top area (the query pane) of any remnants of queries that might appear.

  4. Ensure that FoodMart 2000 is selected as the database name in the DB box of the toolbar.

  5. Select the Warehouse cube in the Cube drop-down list box.

The MDX sample application window should resemble that shown in Figure 5, complete with the information from the Warehouse cube displaying in the Metadata tree (the left section of the Metadata pane).

Figure 5Figure 5 The MDX sample application window (compressed view).

We will create an MDX query that helps us to "qualify" a query as coming within the two conditions that force a query to process on the server.

  1. Type the following query into the query pane of the sample application:

    -- Step 1-1: Qualification Through Count
    WITH
      MEMBER[Measures].[Count] AS 
      'COUNT({ [Product].[Product Name].Members})'
    SELECT
    {[Measures].[Count]}ON COLUMNs
    FROM Warehouse

    Our intent is to ascertain that an upcoming example expression will "qualify" as meeting conditions that would force it to process on the server. We are simply obtaining a count of the members of a given level.

  2. Execute the query using the Run Query button.

    The results set appears, as shown in Figure 6.

    Figure 6Figure 6 Results set, count query.

  3. Save the query as Step1-1.

We see that [Product].[Product Name].Members refers to a genuine large level because the number of members in the Product Name level (1,560) of the Product dimension exceeds the large level threshold we set earlier (750). For that matter, it exceeds even the default threshold that existed before our modifications (1000). (The number of members is also verifiable at the RDBMS level in the FoodMart2000.mdb sample that is installed with MSSQL Server 2000 Analysis Services.)

Let's use the level whose population we have just quantified in the COUNT query to illustrate. The inclusion of a filter within our query will also be a driver for server-based processing.

  1. Create the following new query:

    -- Step 1-2: Qualification Through Count & Filter
    SELECT
    {[Measures].[Units Shipped]} ON COLUMNS,
    TopCount ([Product].[Product Name].Members, 9
    7, [Measures].[Units Shipped]) ON ROWS
    FROM Warehouse

    The use of TopCount provides an instance in which server-based execution is likely to be appropriate for yet another reason: Most of the large level will be pruned away by the filter action before returning the result. The existence of a filter operation within the query is another driver for server processing.

  2. Execute the query using the Run Query button.

    The results set appears, as shown in Figure 7.

    Figure 7Figure 7 Results set, topcount query.

  3. Save the query as Step1-2.

Although level-size and filter requirements are good criteria to use in most cases for determining the likelihood of forced server-based processing, there are scenarios in which even meeting or exceeding the parameters of these two criteria will not force a query to execute on the server. Examples of these situations include the presence of a function or functions within the query (say a user-defined function that is registered solely on the client) that cannot execute on the server. Also, as is somewhat obvious, a query that is executed against a local cube will not process on a remote server.

The execution location can be set at the query level (and can thus be specified for individual queries) or at the connection level (as the default execution location for all queries run via the respective connection). A connection string example is as follows:

Execution Location=3;

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020