GLOP Types | Global and Persistent Data | Teradata Vantage - GLOP Types - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-03-30
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
qnu1472247494689
lifecycle
latest
Product Category
Teradata Vantage™

The GLOP type determines the persistence boundary of the GLOP data, based on particular database activity.

System GLOP

A system GLOP mapping is mapped by all members of a given set. All external routines that are members of the same named GLOP set share this memory mapping.

The modification attribute (read-only or read/write) that you set for system GLOP data has the following effect.

Modification Attribute Effect
Read-only Every external routine that is a member of the set is mapped with the same data. All external routines see the same context.

If the system GLOP consists of multiple pages, then different external routines can simultaneously map different pages of the system GLOP, enabling each routine with a way to see a part of the data.

Read/write Every external routine that is a member of the set on that one vproc sees the same changes made by any external routine that changes the data.

Different vprocs do not necessarily have the same data changes unless the external routine that changes the data makes the same changes on all vprocs.

See GLOP Modification Attributes.

For system GLOP data with a read/write modification attribute, the mapping attribute (normal or shared) that you set has the following effect.

Mapping Attribute Effect
Normal Different GLOP sets that map the same system data get separate mappings.
Shared Different GLOP sets that map the same system data get the same system GLOP mapping on a vproc.

See GLOP Mapping Attributes.

Role GLOP

A role GLOP mapping is always associated with a particular role that the external routine is running and is based on what was set up for the logged on user for a particular session.

Situation Result
Mapping exists for a given role and the session has its context set up to use the role System maps the GLOP data for the given role.
External routine runs in a context that does not have a role GLOP data mapping specified for the given role in the GLOP set Nothing is mapped for the external routine.
Routine is set to run in a session that has role ALL set up Nothing is mapped, because system cannot determine which role to use.
Session role is NONE or NULL Nothing is mapped.

Role GLOP data mapping for a GLOP set is not session local, but is based on the role. If there are ten sessions and each session uses the same role, those ten sessions share the same role GLOP data mapping in all external routines that are members of the same GLOP set. This is similar to the system GLOP mapping except that there is a separate mapping for each role in the GLOP set.

If other external routines are members of a different GLOP set and the same role is specified in both sets, those role mappings are independent. (This assumes that there is GLOP data that identifies a particular role as having a mapping for a particular GLOP set.)

The effect of the modification attributes of a role GLOP is similar to the effect of the modification attributes of a system GLOP.

Modification Attribute Result
Read-only All vprocs have identical role data for each role that has a GLOP definition. In addition, there is only one physical copy of read-only role GLOP data on a node.
Read/write Data can differ on different vprocs.

If you want multiple roles to map to the same data, use the shared mapping attribute for the roles that map the same data and have the roles reference the same GLOP data.

See GLOP Modification Attributes and GLOP Mapping Attributes.

User GLOP

A user GLOP mapping is associated with a logged-on user—not with a proxy, but with the underlying user for the proxy. Sessions logged onto the same user that specify the same GLOP set share the data for the user mapping (see Role GLOP.) These sessions can share information in the external routines associated with the user GLOP set.

The mapping is associated with the logged on user that runs the external routine, not with the current authorization (which may be different). For example, if Joe creates an external stored procedure and Betty logs on and runs that external DEFINER procedure, the current authorization is Joe. But Betty is the logged-on user, and if there is GLOP data for user Betty, that GLOP data gets mapped, not the GLOP data for user Joe.

Session GLOP

A session GLOP mapping is local to a particular session. Only that session can see the data. The data exists while the session is logged on. The data never survives past the logged on session. When a new session is started a new fresh copy from the specific GLOP data row for the set is obtained and mapped. The data is accessible to all external routines that run within the session and the given GLOP set.

External routines that are members of different GLOP sets get different GLOP session mappings. Mappings are private to the session unless the shared mapping attribute is set.

Mapping Attribute Result
Normal Different GLOP sets that map the same session read/write data get separate mappings.
Shared Different GLOP sets that map the same session read/write data get the same mappings.

GLOP changes made to read/write data are retained and visible for the next external routine using the same GLOP set.

See GLOP Mapping Attributes.

Transaction GLOP

A transaction GLOP mapping is local to a session and transaction. A transaction GLOP mapping survives for the duration of the request. This GLOP type is available only to external routines running on an AMP vproc.

When a transaction terminates, the mapping is lost.

When a transaction starts, a new fresh copy from the specific GLOP data for the set is obtained and mapped.

Request GLOP

A request GLOP mapping is local to a session, transaction, and request combination. This GLOP type is available only to external routines running on an AMP vproc. A request GLOP mapping is created when the mapping so specifies at the beginning of a request and survives for the duration of the request. External routines run within the same request and GLOP membership see the same mapping for the session in question. At the end of the request the mapping is discarded. A new request gets a new mapping from the GLOP data associated with the GLOP membership.

Because requests may be short running, using this GLOP type requires careful thought. If not careful, this mode may substantially increase the running time of a transaction (for example, a set of small requests encountered in TPUMP).

External Routine GLOP

An external routine GLOP mapping is associated with a specific routine. The mapping is local to that routine, but is available to external routines running in other sessions. Multiple instances of the external routine with the same name, running in different sessions, look at the same GLOP data for this GLOP type. Changes made to the GLOP type are seen by future callers. The GLOP data is retained until the next system restart or a forced remove by a change of the GLOP.