

# AWS Glue Schema Registry system tables

AWS services offer system tables: read-only Apache Iceberg tables in your account that hold data about your resources and activity, which you can query with SQL. For an overview, see [Working with system tables](https://docs.aws.amazon.com/AmazonS3/latest/userguide/working-with-system-tables.html) in the *Amazon S3 User Guide*.

With system tables for AWS Glue Schema Registry, an inventory of your registries, schemas, and schema versions is stored in tables that you can query to review your schemas. The tables are stored as fully managed Amazon S3 Tables, in Apache Iceberg format. You can query them with Amazon Athena, Amazon Redshift, or any other engine that is compatible with Apache Iceberg.

With these tables, you can do the following:
+ Count schemas by data format and compatibility mode.
+ Find the schemas with the most versions.

**Topics**
+ [How AWS Glue Schema Registry system tables work](#schema-registry-system-tables-how-it-works)
+ [Supported system tables](#schema-registry-system-tables-supported)
+ [Enabling system tables](#schema-registry-system-tables-enabling)
+ [Schema and example queries](#schema-registry-system-tables-schema-and-queries)
+ [AWS Glue Schema Registry system tables schema and example queries](schema-registry-system-tables-schema.md)

## How AWS Glue Schema Registry system tables work
<a name="schema-registry-system-tables-how-it-works"></a>

AWS Glue Data Catalog writes AWS Glue Schema Registry system tables to the `aws-catalog` table bucket in your account and Region. After you turn on auto-discovery and metadata export in AWS Glue Data Catalog, it writes an inventory of your AWS Glue Schema Registry resources and keeps it up to date as your resources change.

AWS manages the tables for you, including the schemas, partitioning, compaction, and snapshots. The tables are read-only. You control who can read them.

For how system tables work across AWS services, see [Working with system tables](https://docs.aws.amazon.com/AmazonS3/latest/userguide/working-with-system-tables.html) in the *Amazon S3 User Guide*.

### Storage location
<a name="schema-registry-system-tables-storage-location"></a>

The tables are stored in the `aws-catalog` table bucket, in the `glue` namespace. Other AWS services store their resource system tables in the same bucket, each in its own namespace.

```
aws-catalog/                      # S3 Tables bucket (one per account and Region)
  +-- glue/                       # Namespace
      +-- registries/             # Table
      +-- schemas/                # Table
      +-- schema_versions/        # Table
```

The following query returns 10 rows from the `registries` table.

```sql
SELECT * FROM "s3tablescatalog/aws-catalog"."glue"."registries" LIMIT 10;
```

## Supported system tables
<a name="schema-registry-system-tables-supported"></a>

AWS Glue Schema Registry has the following system tables:
+ `registries`: one row for each registry in your account and Region.
+ `schemas`: one row for each schema in your account and Region.
+ `schema_versions`: one row for each schema version in your account and Region.

## Enabling system tables
<a name="schema-registry-system-tables-enabling"></a>

To turn on and query the tables, see *Turning on resource system tables* and *Permissions for querying system tables* in [Working with system tables](https://docs.aws.amazon.com/AmazonS3/latest/userguide/working-with-system-tables.html) in the *Amazon S3 User Guide*.

## Schema and example queries
<a name="schema-registry-system-tables-schema-and-queries"></a>

For the columns and example queries of each table, see [AWS Glue Schema Registry system tables schema and example queries](schema-registry-system-tables-schema.md).