Skip to content
Developer Edition runs on one host and does not require a product license file. Need multi-host deployment or performance testing at scale? Explore Enterprise Edition

ALTER TTL statement

The ALTER TTL statement modifies the time-to-live (TTL) duration set on edges of a specific graph by edge type.

To specify the graph, use either of the following methods:

  • Add a USE clause before this statement to set the working graph.
  • Use SESSION SET to set the graph for the current session in advance.

If both methods are used, the one specified in the USE clause takes precedence. If neither is used, an error occurs.

Note

An operation involving a non-default schema or an object in it requires access to the schema, either implicitly or through an explicit USAGE grant, as well as the privilege required for the operation. The schema access check and the privilege check for the requested operation are independent; satisfying one does not satisfy the other. Schema access control does not apply to temporary graphs or built-in procedures and functions. For more information, see Schema access control.

Prerequisites

  • A TTL duration must be set on edges. For more information, see CREATE TTL.
  • To modify a TTL duration, you must either be the owner of the graph, be granted to perform the action ALTER on the graph, or be granted to perform the action ALTER ANY GRAPH on the used schema. For more information, see Roles and privileges.

Syntax

alter_ttl_statement
ALTER TTL ON EDGE edge_type_name ( property_name ) ttl_duration

alter_ttl_statement ::=
    'ALTER' 'TTL' 'ON' 'EDGE' edge_type_name '(' property_name ')'  ttl_duration

Parameters

edge_type_name

The name of the edge type for which you want to modify the TTL duration.

property_name

The name of the property of the edge type on which the existing TTL duration is set.

ttl_duration

A duration value that specifies the new TTL duration. The duration value must be larger than 0 and specified by using the function duration() in days, hours, minutes, seconds, milliseconds, or microseconds.

Examples

The following examples are based on the example dataset.

Modify the TTL duration of an edge type

USE movie ALTER TTL ON EDGE Watch(ttl_test) duration({seconds:4, milliseconds:5, microseconds:6})

The preceding example modifies the TTL duration that is set in CREATE TTL.