System database views
To obtain system information about the database state, you can refer to system views. They are available from the root of the database tree and use the system path prefix .sys.
Note
Frequent access to system views leads to additional load on the database, especially in the case of a large database size. Exceeding a frequency of 1 query per second is not recommended.
Partitions
The following system view stores detailed information about partitions of database tables:
partition_stats— contains information about instantaneous metrics and cumulative counters of operations. The former include, for example, CPU load data or the number of running transactions. The latter include the total number of rows read.
It is intended, for example, for identifying unevenly loaded partitions or displaying the size of data in them.
Instantaneous metrics (NodeId, AccessTime, CPUCores, etc.) contain instantaneous values.
Cumulative (non-instantaneous) metrics (RowReads, RowUpdates, LocksAcquired, etc.) store accumulated values since the last start of the tablet (StartTime) serving the partition.
View structure:
| Column | Description | Data type | Instantaneous/Cumulative |
|---|---|---|---|
OwnerId |
Table SchemeShard ID. Key: 0. |
Uint64 |
Instant |
PathId |
Path identifier in SchemeShard. Key: 1. |
Uint64 |
Instant |
PartIdx |
Partition sequence number. Key: 2. |
Uint64 |
Instantaneous |
FollowerId |
Identifier of the replica of the partition tablet. A value of 0 means the leader. Key: 3. |
Uint32 |
Instantaneous |
DataSize |
Approximate data size of the partition in bytes. | Uint64 |
Instantaneous |
RowCount |
Approximate number of rows. | Uint64 |
Instant |
IndexSize |
Partition index size in bytes. | Uint64 |
Instantaneous |
CPUCores |
Instantaneous load value on the partition (fraction of CPU core time spent by the partition actor). | Double |
Instant |
TabletId |
Partition tablet identifier. | Uint64 |
Instantaneous |
Path |
Full path to the table. | Utf8 |
Momentary |
NodeId |
Node ID on which the partition is currently served. | Uint32 |
Instantaneous |
StartTime |
Last start time of the partition tablet. | Timestamp |
Instantaneous |
AccessTime |
Last read moment from the partition. | Timestamp |
Instantaneous |
UpdateTime |
Last write moment to the partition. | Timestamp |
Instant |
RowReads |
Number of reads by key. | Uint64 |
Cumulative |
RowUpdates |
Number of written rows. | Uint64 |
Cumulative |
RowDeletes |
Number of deleted rows. | Uint64 |
Cumulative |
RangeReads |
Number of reads by key range. | Uint64 |
Cumulative |
RangeReadRows |
Number of rows read in ranges. | Uint64 |
Cumulative |
InFlightTxCount |
Number of running transactions. | Uint64 |
Instant |
ImmediateTxCompleted |
Number of completed single-shard transactions. | Uint32 |
Cumulative |
CoordinatedTxCompleted |
Number of completed distributed transactions. | Uint64 |
Cumulative |
TxRejectedByOverload |
Number of transactions cancelled due to high load. | Uint64 |
Cumulative |
TxRejectedByOutOfStorage |
Number of transactions cancelled due to insufficient storage space. | Uint64 |
Cumulative |
TxCompleteLag |
Transaction execution delay (how far transactions lag behind the scheduled time). | Interval |
Instantaneous |
LastTtlRunTime |
Last start time of partition cleanup by TTL | Timestamp |
Instant |
LastTtlRowsProcessed |
Number of partition rows checked during the last TTL cleanup | Uint64 |
Instant |
LastTtlRowsErased |
Number of partition rows deleted during the last TTL cleanup | Uint64 |
Instant |
LocksAcquired |
Number of acquired locks. | Uint64 |
Cumulative |
LocksWholeShard |
Number of set whole-shard locks. | Uint64 |
Cumulative |
LocksBroken |
Number of broken locks. | Uint64 |
Cumulative |
Query examples
Top 5 most loaded partitions among all database tables:
SELECT
Path,
PartIdx,
CPUCores
FROM `.sys/partition_stats`
ORDER BY CPUCores DESC
LIMIT 5
List of database tables with sizes and current load:
SELECT
Path,
COUNT(*) as Partitions,
SUM(RowCount) as Rows,
SUM(DataSize) as Size,
SUM(CPUCores) as CPU
FROM `.sys/partition_stats`
GROUP BY Path
List of database tables with the highest number of broken locks:
SELECT
Path,
COUNT(*) as Partitions,
SUM(LocksBroken) as TotalLocksBroken
FROM `.sys/partition_stats`
GROUP BY Path
ORDER BY TotalLocksBroken DESC
Top queries
The following system views store data for analyzing user queries.
Maximum total query execution time:
top_queries_by_duration_one_minute— data is divided into minute intervals, contains data for the last 6 hours.top_queries_by_duration_one_hour: data is split into hourly intervals, contains data for the last 2 weeks.
The largest number of bytes read from the table:
top_queries_by_read_bytes_one_minute— data is split into minute intervals, contains data for the last 6 hours.top_queries_by_read_bytes_one_hour— data is split into hour intervals, contains data for the last 2 weeks.
Maximum CPU time spent:
top_queries_by_cpu_time_one_minute— data is split into minute intervals, contains data for the last 6 hours.top_queries_by_cpu_time_one_hour— data is split into hour intervals, contains data for the last 2 weeks.
Queries with the same text are combined, and the query with the maximum value of the corresponding metric is included in the output.
Each time interval (minute or hour) contains the TOP-5 queries executed in that time interval.
Fields providing information about CPU time spent (...CPUTime) are expressed in microseconds.
Query text is limited to 10 kilobytes.
All views have the same structure:
| Column | Description |
|---|---|
IntervalEnd |
End time of the minute or hour interval for which statistics were collected. Type: Timestamp.Key: 0. |
Rank |
Query rank in the top. Type: Uint32.Key: 1. |
QueryText |
Query text. Type: Utf8. |
Duration |
Total query execution time. Type: Interval. |
EndTime |
End time of query execution. Type: Timestamp. |
Type |
Query type ("data", "scan", "script"). Type: String. |
ReadRows |
Number of rows read. Type: Uint64. |
ReadBytes |
Number of bytes read. Type: Uint64. |
UpdateRows |
Number of rows written. Type: Uint64. |
UpdateBytes |
Number of bytes written. Type: Uint64. |
DeleteRows |
Number of rows deleted. Type: Uint64. |
DeleteBytes |
Number of bytes deleted. Type: Uint64. |
Partitions |
Number of table partitions involved in query execution. Type: Uint64. |
UserSID |
User security ID. Type: String. |
ParametersSize |
Size of query parameters in bytes. Type: Uint64. |
CompileDuration |
Query compilation duration. Type: Interval. |
FromQueryCache |
Whether the prepared query cache was used. Type: Bool. |
CPUTime |
Total CPU time used for query execution (microseconds). Type: Uint64. |
ShardCount |
Number of shards involved in query execution. Type: Uint64. |
SumShardCPUTime |
Total CPU time spent in shards. Type: Uint64. |
MinShardCPUTime |
Minimum CPU time spent in shards. Type: Uint64. |
MaxShardCPUTime |
Maximum CPU time spent in shards. Type: Uint64. |
ComputeNodesCount |
Number of compute nodes involved in query execution. Type: Uint64. |
SumComputeCPUTime |
Total CPU time spent in compute nodes. Type: Uint64. |
MinComputeCPUTime |
Minimum CPU time spent in compute nodes. Type: Uint64. |
MaxComputeCPUTime |
Maximum CPU time spent in compute nodes. Type: Uint64. |
CompileCPUTime |
CPU time spent on query compilation. Type: Uint64. |
ProcessCPUTime |
CPU time spent on general query processing. Type: Uint64. |
Query examples
Top queries by execution time. The query is run against the .sys/top_queries_by_duration_one_minute view:
PRAGMA AnsiInForEmptyOrNullableItemsCollections;
$last = (
SELECT
MAX(IntervalEnd)
FROM `.sys/top_queries_by_duration_one_minute`
);
SELECT
IntervalEnd,
Rank,
QueryText,
Duration
FROM `.sys/top_queries_by_duration_one_minute`
WHERE IntervalEnd IN $last
Queries that read the most bytes. The query is run against the .sys/top_queries_by_read_bytes_one_minute view:
SELECT
IntervalEnd,
QueryText,
ReadBytes,
ReadRows,
Partitions
FROM `.sys/top_queries_by_read_bytes_one_minute`
WHERE Rank = 1
Detailed query information
The following system view contains detailed query information:
query_metrics_one_minute— data is split into minute intervals, contains up to 256 queries for the last 6 hours.
Each row of the view contains information about multiple queries with the same text that occurred during the interval. The view fields contain the minimum, maximum, and total values for each tracked query characteristic. Within the interval, queries are sorted in descending order of total CPU time spent.
Limitations:
- query text is limited to 10 kilobytes.
- statistics may be incomplete if the database is under heavy load.
View structure:
| Column | Description |
|---|---|
IntervalEnd |
End time of the minute interval for which statistics were collected Type: Timestamp.Key: 0. |
Rank |
Query rank within the interval (by SumCPUTime field). Type: Uint32.Key: 1. |
QueryText |
Query text. Type: Utf8. |
Count |
Number of query runs. Type: Uint64. |
SumDuration |
Total query duration. Type: Interval. |
MinDuration |
Minimum query duration. Type: Interval. |
MaxDuration |
Maximum query duration. Type: Interval. |
SumCPUTime |
Total CPU time spent. Type: Uint64. |
MinCPUTime |
Minimum CPU time spent. Type: Uint64. |
MaxCPUTime |
Maximum CPU time spent. Type: Uint64. |
SumReadRows |
Total number of rows read. Type: Uint64. |
MinReadRows |
Minimum number of rows read. Type: Uint64. |
MaxReadRows |
Maximum number of rows read. Type: Uint64. |
SumReadBytes |
Total number of bytes read. Type: Uint64. |
MinReadBytes |
Minimum number of bytes read. Type: Uint64. |
MaxReadBytes |
Maximum number of bytes read. Type: Uint64. |
SumUpdateRows |
Total number of rows written. Type: Uint64. |
MinUpdateRows |
Minimum number of rows written. Type: Uint64. |
MaxUpdateRows |
Maximum number of rows written. Type: Uint64. |
SumUpdateBytes |
Total number of bytes written. Type: Uint64. |
MinUpdateBytes |
Minimum number of bytes written. Type: Uint64. |
MaxUpdateBytes |
Maximum number of bytes written. Type: Uint64. |
SumDeleteRows |
Total number of rows deleted. Type: Uint64. |
MinDeleteRows |
Minimum number of rows deleted. Type: Uint64. |
MaxDeleteRows |
Maximum number of rows deleted. Type: Uint64. |
LocksBrokenAsBreaker |
Number of locks broken by this query. Type: Uint64. |
LocksBrokenAsVictim |
Number of locks of this query that were broken. Type: Uint64. |
Note
This statistic does not include:
- Locks broken due to schema changes, TTL, asynchronous replication
- Locks broken due to partition splitting or merging
- Locks broken during tablet restart
- Locks broken when committing interactive transactions (when COMMIT is executed as a separate query)
Query examples
Top 10 queries over the last 6 hours by total number of rows written in a minute interval:
SELECT
SumUpdateRows,
Count,
QueryText,
IntervalEnd
FROM `.sys/query_metrics_one_minute`
ORDER BY SumUpdateRows DESC LIMIT 10
Recent queries that read the most bytes per minute:
SELECT
IntervalEnd,
SumReadBytes,
MinReadBytes,
SumReadBytes / Count as AvgReadBytes,
MaxReadBytes,
QueryText
FROM `.sys/query_metrics_one_minute`
WHERE SumReadBytes > 0
ORDER BY IntervalEnd DESC, SumReadBytes DESC
LIMIT 100
Detailed information about session queries
The following system view contains detailed information about current sessions and the queries being executed in them.
.sys/query_sessions— contains information about sessions and the queries being executed in them.
| Column | Description |
|---|---|
SessionId |
Unique session identifier. Type: Utf8.Key: 0. |
NodeId |
Identifier of the node where the session is running. Type: Uint32. |
State |
Current session state. Type: Utf8. |
Query |
Text of the last or currently executing query. Type: Utf8. |
QueryCount |
Number of queries executed within this session. Type: Uint32. |
ClientAddress |
Network address of the client that initiated the session. Type: Utf8. |
ClientPID |
Process ID (PID) of the client application. Type: Utf8. |
ClientUserAgent |
Client software information (User-Agent). Type: Utf8. |
ClientSdkBuildInfo |
Client SDK build information. Type: Utf8. |
ApplicationName |
Application name specified by the client when connecting. Type: Utf8. |
SessionStartAt |
Session start (creation) time. Type: Timestamp. |
QueryStartAt |
Start time of the current query execution. Type: Timestamp. |
StateChangeAt |
Time of the last session state change. Type: Timestamp. |
UserSID |
Security ID of the user owning the session. Type: Utf8. |
WmPoolId |
Identifier of the Workload Manager pool in which the session query is executed. Type: Utf8. |
WmState |
Query state in Workload Manager. Type: Utf8. |
WmEnterTime |
Time when the query transitioned to PENDING or DELAYED status. Type: Timestamp. |
WmExitTime |
Time when the query was submitted for execution. Type: Timestamp. |
Possible values of the WmState field:
NONE- Not being processed.PENDING- Being processed (in classification/routing).DELAYED- In queue.EXITED- Submitted for execution.
Possible values of the State field:
IDLE- Session is waiting for a query.EXECUTING- Query is being executed.
Query examples
View all active sessions:
SELECT * FROM `.sys/query_sessions`
Top 20 longest running queries:
SELECT
Query,
SessionId,
NodeId,
QueryStartAt
FROM `.sys/query_sessions`
WHERE State = 'EXECUTING'
ORDER BY QueryStartAt ASC
LIMIT 20
Search for application sessions filtered by Workload Manager pool:
SELECT
SessionId,
Query,
State,
WmState,
ClientAddress
FROM `.sys/query_sessions`
WHERE ApplicationName = 'my_analytics_app'
AND WmPoolId = 'heavy_queries'
Query compilation cache
The following system view contains information about queries stored in the compilation cache on all cluster nodes:
compile_cache_queries— contains information about queries in the compilation cache of all cluster nodes.
Warning
The compile_cache_queries system view is not available in serverless mode.
Each cluster node has its own cache of compiled queries. This cache is used by all sessions running on that node: if during query execution its text is already in the cache, no additional compilation is required.
The system view compile_cache_queries provides data on the cache state on all or selected cluster nodes. When querying this view, requests are sent to each node unless a restriction on NodeId is specified in the WHERE condition. The response returns current information about the cache contents for each node, and the resulting table combines the received data.
View structure:
| Column | Description |
|---|---|
NodeId |
Node ID where the query is stored in the cache. Type: Uint32.Key: 0. |
QueryId |
Unique query ID in the node cache. Type: Utf8.Key: 1. |
Query |
Query text. If the query exceeds 10 KB, it is truncated. Type: Utf8. |
AccessCount |
Number of cache hits for the query text. Type: Uint64. |
CompiledAt |
Query compilation time. Type: Timestamp. |
UserSID |
Security ID of the user on whose behalf the query was compiled. May be empty for system queries. Type: Utf8. |
LastAccessedAt |
Time of the last access to the query compilation result in the cache. Type: Timestamp. |
CompilationDurationMs |
Query compilation duration in milliseconds. Type: Uint64. |
Warnings |
Warnings that occurred during query compilation. Type: Utf8. |
Metadata |
Query parameter types in JSON format. Contains the parameters key with parameter names and their types.Type: Utf8. |
IsTruncated |
Flag indicating whether the query text was truncated due to exceeding the 10 KB limit. Type: Bool. |
QueryType |
Query type, one of:QUERY_TYPE_SQL_DML — Table ServiceQUERY_TYPE_SQL_GENERIC_QUERY — Query ServiceQUERY_TYPE_SQL_GENERIC_CONCURRENT_QUERY — Query Service in concurrent modeMay be empty for old entries. Type: Utf8. |
Syntax |
Query syntax, one of:SYNTAX_YQL_V1 — YQLSYNTAX_UNSPECIFIED — for old entries without syntax informationSYNTAX_PG — deprecated value for entries compiled before the removal of experimental PostgreSQL compatibility; new queries with this syntax are not acceptedType: Utf8. |
Example queries
View all queries in the compilation cache:
SELECT * FROM `.sys/compile_cache_queries`
Top 20 most popular queries by number of accesses from 3 nodes:
SELECT
Query,
SUM(AccessCount) AS Hits
FROM `.sys/compile_cache_queries`
WHERE NodeId IN (50000, 50001, 50003)
GROUP BY Query
ORDER BY Hits DESC
LIMIT 20
Activity statistics by user:
SELECT
UserSID,
COUNT(DISTINCT QueryId) AS Plans,
SUM(AccessCount) AS Hits,
AVG(CompilationDurationMs) AS AvgCompileMs
FROM `.sys/compile_cache_queries`
GROUP BY UserSID
ORDER BY Hits DESC
Search for queries with long compilation:
SELECT
Query,
NodeId,
CompilationDurationMs,
AccessCount
FROM `.sys/compile_cache_queries`
WHERE CompilationDurationMs > 1000
ORDER BY CompilationDurationMs DESC
History of overloaded partitions
The following system views contain a history of high load moments on individual partitions of database tables:
top_partitions_one_minute— data is split into minute intervals, contains history for the last 6 hours.top_partitions_one_hour— data is split into hour intervals, contains history for the last 2 weeks.
Partitions with peak load over 70% (CPUCores > 0.7) are included in the views. Within one interval, partitions are ranked by peak load value.
Both views contain the same set of fields:
The view keys are:
IntervalEnd— interval end time;Rank— partition rank by peak loadCPUCoresin this interval.
For example, if a table has 10 partitions, then top_partitions_one_hour for the hour interval "20.12.2024 10:00-11:00" will return 10 rows sorted in descending order of CPUCores. They will have Rank from 1 to 10 and the same IntervalEnd "20.12.2024 11:00".
| Column | Description |
|---|---|
IntervalEnd |
End time of the minute or hour interval for which statistics are collected. Type: Timestamp.Key: 0. |
Rank |
Partition rank within the interval (by CPUCores).Type: Uint32.Key: 1. |
TabletId |
Tablet ID serving the partition. Type: Uint64. |
FollowerId |
Replica ID of the partition tablet. Replica value 0 means leader. Type: Uint32 |
Path |
Full table path. Type: Utf8. |
PeakTime |
Peak time within the interval. Type: Timestamp. |
CPUCores |
Peak load value on the partition (fraction of CPU core time spent by the partition actor). Type: Double. |
NodeId |
Node ID where the partition was located at the peak. Type: Uint32. |
DataSize |
Approximate partition size in bytes at the peak. Type: Uint64. |
RowCount |
Approximate row count at the peak. Type: Uint64. |
IndexSize |
Partition index size in the tablet at the peak. Type: Uint64. |
InFlightTxCount |
Number of transactions in progress at the peak. Type: Uint32. |
Example queries
The following query outputs partitions with CPU consumption over 70% in the specified time interval, with tablet IDs and their sizes at the time of exceeding. The query is run against the .sys/top_partitions_one_minute view, which contains data for the last 6 hours broken down by minute intervals:
SELECT
IntervalEnd,
CPUCores,
Path,
TabletId,
DataSize
FROM `.sys/top_partitions_one_minute`
WHERE CPUCores > 0.7
AND IntervalEnd BETWEEN Timestamp("2000-01-01T00:00:00Z") AND Timestamp("2099-12-31T00:00:00Z")
ORDER BY IntervalEnd desc, CPUCores desc
The following query outputs partitions with CPU consumption over 90% in the specified time interval, with tablet IDs and their sizes at the time of exceeding. The query is run against the .sys/top_partitions_one_hour view, which contains data for the last 2 weeks broken down by hourly intervals:
SELECT
IntervalEnd,
CPUCores,
Path,
TabletId,
DataSize
FROM `.sys/top_partitions_one_hour`
WHERE CPUCores > 0.9
AND IntervalEnd BETWEEN Timestamp("2000-01-01T00:00:00Z") AND Timestamp("2099-12-31T00:00:00Z")
ORDER BY IntervalEnd desc, CPUCores desc
Partition history with broken locks
The following system views contain the history of moments with a non-zero number of broken locks LocksBroken in individual partitions of database tables:
top_partitions_by_tli_one_minute— data is broken down into minute intervals, contains history for the last 6 hours.top_partitions_by_tli_one_hour— data is broken down into hourly intervals, contains history for the last 2 weeks.
The views output the top 10 partitions with a non-zero number of broken locks LocksBroken. Within a single interval, partitions are ranked by the number of broken locks LocksBroken.
The view keys are:
IntervalEnd- the end time of the interval.Rank- the rank of the partition by the number of broken locksLocksBrokenin this interval.
For example, top_partitions_by_tli_one_hour for an hourly interval "20.12.2024 10:00-11:00" will output 10 rows sorted in descending order of LocksBroken. They will have Rank from 1 to 10 and the same IntervalEnd "20.12.2024 11:00".
Both views contain the same set of fields:
| Column | Description |
|---|---|
IntervalEnd |
The end time of the minute or hour interval for which statistics were collected. Type: Timestamp.Key: 0. |
Rank |
The rank of the partition within the interval (by LocksBroken).Type: Uint32.Key: 1. |
TabletId |
ID of the tablet serving the partition. Type: Uint64. |
FollowerId |
ID of the partition tablet replica. Value 0 means the leader. Type: Uint32 |
Path |
Full path to the table. Type: Utf8. |
LocksAcquired |
Number of locks set "on a key range" in this interval. Type: Uint64. |
LocksWholeShard |
Number of locks set "on the entire partition" in this interval. Type: Uint64. |
LocksBroken |
Number of broken locks in this interval. Type: Uint64. |
NodeId |
ID of the node where the partition was located at the peak time. Type: Uint32. |
DataSize |
Approximate size of the partition in bytes at the peak time. Type: Uint64. |
RowCount |
Approximate number of rows at the peak time. Type: Uint64. |
IndexSize |
Size of the partition index in the tablet at the peak time. Type: Uint64. |
Query examples
The following query outputs partitions in the specified time interval, with tablet IDs and the number of broken locks. The query is run against the .sys/top_partitions_by_tli_one_minute view:
SELECT
IntervalEnd,
LocksBroken,
Path,
TabletId
FROM `.sys/top_partitions_by_tli_one_hour`
WHERE IntervalEnd BETWEEN Timestamp("2000-01-01T00:00:00Z") AND Timestamp("2099-12-31T00:00:00Z")
ORDER BY IntervalEnd desc, LocksBroken desc
Resource pool information
The resource_pools system view contains information about settings of resource pools.
System view structure:
| Column | Description |
|---|---|
Name |
Resource pool name. Type: Utf8.Key: 0. |
ConcurrentQueryLimit |
Maximum number of concurrently executing queries in the resource pool. Type: Int32. |
QueueSize |
Maximum queue size. Type: Int32. |
DatabaseLoadCpuThreshold |
CPU load threshold of the entire database, in percent, after which queries are not sent for execution and remain in the queue. Type: Double. |
ResourceWeight |
Weights for distributing resources among pools. Type: Double. |
TotalCpuLimitPercentPerNode |
Percentage of available CPU that all queries on the node can use in this resource pool. Type: Double. |
QueryCpuLimitPercentPerNode |
Percentage of available CPU on the node for one query in the resource pool. Type: Double. |
QueryMemoryLimitPercentPerNode |
Percentage of available memory on the node that a query can use in this resource pool. Type: Double. |
Example
The following query outputs information about the settings of the resource pool named default:
SELECT
Name,
ConcurrentQueryLimit,
QueueSize,
DatabaseLoadCpuThreshold,
ResourceWeight,
TotalCpuLimitPercentPerNode,
QueryCpuLimitPercentPerNode,
QueryMemoryLimitPercentPerNode
FROM `.sys/resource_pools`
WHERE Name = "default";
Resource pool classifier information
The resource_pools_classifiers system view contains information about settings of resource pool classifiers.
System view structure:
| Column | Description |
|---|---|
Name |
Resource pool classifier name. Type: Utf8.Key: 0. |
Rank |
Priority of selecting the resource pool classifier. Type: Int64. |
MemberName |
User or group of users that will be sent to the specified resource pool. Type: Utf8. |
ResourcePool |
The name of the resource pool to which queries will be sent. Type: Utf8. |
Example
The following query outputs information about the settings of the resource pool classifier named olap:
SELECT
Name,
Rank,
MemberName,
ResourcePool
FROM `.sys/resource_pools_classifiers`
WHERE Name = "olap";
Users, groups, and access rights
The following system views contain information about users, access groups, user membership in groups, and access rights granted to groups or directly to users.
Information about users
The auth_users view contains a list of local users YDB. It does not include users authenticated through external systems such as LDAP.
Administrators have full access to this view. Regular users can only view their own data.
Table structure:
| Column | Description |
|---|---|
Sid |
User SID. Type: Utf8.Key: 0. |
IsEnabled |
Indicates whether login is allowed for this user; used for explicit blocking by an administrator. Independent of IsLockedOut.Type: Bool. |
IsLockedOut |
Indicates that this user is automatically blocked due to exceeding the number of failed authentications. Does not depend on IsEnabled.Type: Bool. |
CreatedAt |
User creation time. Type: Timestamp. |
LastSuccessfulAttemptAt |
Time of last successful authentication. Type: Timestamp. |
LastFailedAttemptAt |
Time of last failed authentication. Type: Timestamp. |
FailedAttemptCount |
Number of failed authentications. Type: Uint32. |
PasswordHash |
JSON string containing the password hash, salt, and hashing algorithm. Type: Utf8. |
Information about groups
The auth_groups view contains a list of access groups.
Only administrators have access to this view.
Table structure:
| Column | Description |
|---|---|
Sid |
Group SID. Type: Utf8.Key: 0. |
Information about group membership
The auth_group_members view contains information about membership in access groups.
Only administrators have access to this view.
Table structure:
| Column | Description |
|---|---|
GroupSid |
Group SID. Type: Utf8.Key: 0. |
MemberSid |
Group member SID. Can be either a user SID or a group SID. Type: Utf8.Key: 1. |
Information about access rights
The views contain a list of granted access rights.
Include two views:
auth_permissions: Explicitly granted access rights.auth_effective_permissions: Effective access rights considering inheritance.
In this view, the user sees only those access objects for which they have the ydb.granular.describe_schema right.
Table structure:
| Column | Description |
|---|---|
Path |
Path to the access object. Type: Utf8.Key: 0. |
Sid |
SID of the access subject. Type: Utf8.Key: 1. |
Permission |
Name of the access right YDB. Type: Utf8.Key: 2. |
Example queries
Getting explicitly granted rights on an access object - the my_table table:
SELECT *
FROM `.sys/auth_permissions`
WHERE Path = "my_table"
Getting effective rights on an access object - the my_table table:
SELECT *
FROM `.sys/auth_effective_permissions`
WHERE Path = "my_table"
Getting rights granted to user user3:
SELECT *
FROM `.sys/auth_permissions`
WHERE Sid = "user3"
Information about owners of access objects
The auth_owners view displays information about owners of access objects.
In this view, the user sees only those access objects for which they have been granted the ydb.granular.describe_schema right.
Table structure:
| Column | Description |
|---|---|
Path |
Path to the access object. Type: Utf8.Key: 0. |
Sid |
SID of the access object owner. Type: Utf8. |
Streaming queries
Viewing information about streaming queries
The system view streaming_queries contains information about all created streaming queries.
In this view, the user sees only those streaming queries for which they have been granted the ydb.granular.describe_schema right.
Table structure:
| Column | Description |
|---|---|
Path |
Full path to the query. Type: Utf8.Key: 0. |
Status |
Query execution status, one of: CREATING - query is being created, CREATED - query created but not started, STARTING - query is starting, RUNNING - query is running, STOPPING - query is stopping, STOPPED - query stopped, SUSPENDED - query completed with error and is waiting for backoff to retry, Type: Utf8 |
Issues |
Query execution errors in JSON format Type: Utf8 |
Plan |
Query plan in JSON format Type: Utf8 |
Ast |
Query AST Type: Utf8 |
Text |
Query text Type: Utf8 |
Run |
Whether the query is currently being run by the user Type: Bool |
ResourcePool |
Name of the resource pool the query was bound to ( see example) Type: Utf8 |
RetryCount |
Number of query restarts Type: Uint64 |
LastFailAt |
Time of the last query execution error Type: Timestamp |
SuspendedUntil |
Time when an attempt will be made to resume a stopped query Type: Timestamp |