Example: Preventing Queries that Take Too Long to Run

Teradata® Viewpoint User Guide

brand
Analytical Ecosystem
prodname
Teradata Viewpoint
Teradata Workload Management
vrm_release
16.20
category
User Guide
featnum
B035-2206-107K
Suppose you want to protect your system from bad queries by preventing queries that take five minutes or more to complete.
  1. Select a ruleset to edit.
    1. Open the Workload Designer portlet and the Workload Designer view.
    2. From the For System list, select PROD1.
    3. In the local Working section, click the ruleset name, BadQueries.
  2. Create a filter.
    1. From the ruleset toolbar, click Filters.
    2. Next to Filters, click .
    3. Enter the name of the filter, in this case Processing Time Over 5 min.
    4. Click Save.
  3. Add classification criteria for the filter to apply to queries that are estimated to take five minutes or more to complete.
    1. Click the Classification tab.
    2. From the Add Classification Criteria list, select Query Characteristics.
    3. Click Add. The Edit Query Characteristics Criteria dialog box appears.
    4. Select the Estimated Total Processing Time check box.
    5. Select the Processing Time ≥ check box and enter 300 in the field.
    6. Click OK.
    7. Click Save.
  4. Activate the ruleset.
    1. Go back to the Workload Designer view.
    2. For the BadQueries ruleset, click and select Make Active.
  5. [Optional] Review the queries rejected according to the criteria you specified.
    1. Open the Workload Monitor portlet.
    2. Click in the portlet frame and select Settings.
    3. Click the Systems tab.
    4. From the Systems list, select PROD1.
    5. Click OK.
    6. In the Dynamic Pipes View, click on the number below the request status icon for system filters.

    7. Review the summary table to identify the queries rejected by this filter. The Reason column includes For Rule Name 'Processing Time Over 5 min'.