SetSessionRate Function | Application Programming Reference | Teradata Vantage - SetSessionRate - Advanced SQL Engine - Teradata Database

Application Programming Reference

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
cpn1571792172880.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1090
lifecycle
previous
Product Category
Teradata Vantageā„¢

Purpose

Sets the global rates for updating session-level statistics in memory.

Definition

REPLACE FUNCTION SetSessionRate
  (SampleRate  INTEGER
  )
RETURNS INTEGER
          .
          .
          .
;

Input Parameter

Parameter Description
SampleRate Sets the global rate. The value ranges from 1 to 3600 seconds. If the rate is set to zero an error is reported.
The collection rate applies to global queries.

Usage Notes - SetSessionRate

There is no option equivalent to the PMPC SET SESSION RATE request Local_Change = Y option because when using the SetSessionRate function, there is no local MONITOR PARTITION in which to apply the rate to.

You can set the SetSessionRate function to a global (SesMonitorSys) rate. That is, a collection rate at which session-level statistics are collected in memory. This rate is returned in the SesMonitorSys data value by the MonitorVirtualSummary function.

The SetSessionRate function provides similar functionality to the PMPC SET SESSION RATE request. For information about this interface, see SET SESSION RATE.

Return Value

This function returns the previous collection rate value in seconds.

Example: Using SetSessionRate

SELECT SetSessionRate(600);
 *** Query completed. One row found. One column returned.
 *** Total elapsed time was 1 second.
SetSessionRate(600)
-----------------------
                     60