

# Amazon S3 system tables schema and example queries

Amazon S3 has the following system tables. This page lists the columns for the tables in the aws-catalog table bucket. For the other tables, see the linked page.


| Table | Table bucket / namespace | Columns | 
| --- | --- | --- | 
| buckets | aws-catalog / s3 | [s3.buckets](#s3-system-table-s3-buckets) (below) | 
| buckets | aws-catalog / s3tables | [s3tables.buckets](#s3-system-table-s3tables-buckets) (below) | 
| namespaces | aws-catalog / s3tables | [s3tables.namespaces](#s3-system-table-s3tables-namespaces) (below) | 
| tables | aws-catalog / s3tables | [s3tables.tables](#s3-system-table-s3tables-tables) (below) | 
| table\_columns | aws-catalog / s3tables | [s3tables.table\_columns](#s3-system-table-s3tables-table-columns) (below) | 
| buckets | aws-catalog / s3vectors | [s3vectors.buckets](#s3-system-table-s3vectors-buckets) (below) | 
| indexes | aws-catalog / s3vectors | [s3vectors.indexes](#s3-system-table-s3vectors-indexes) (below) | 
| journal | aws-s3 / b\_<bucket-name> | [S3 Metadata journal tables schema](metadata-tables-schema.md) | 
| inventory | aws-s3 / b\_<bucket-name> | [S3 Metadata live inventory tables schema](metadata-tables-inventory-schema.md) | 
| annotation | aws-s3 / b\_<bucket-name> | [S3 Metadata annotation table schema](metadata-tables-annotation-schema.md) | 
| default\_storage\_metrics | aws-s3 / lens\_<config-id>\_exp[\_<hash>] | [Understanding S3 Storage Lens table schemas](storage-lens-s3-tables-schemas.md) | 
| default\_activity\_metrics | aws-s3 / lens\_<config-id>\_exp[\_<hash>] | [Understanding S3 Storage Lens table schemas](storage-lens-s3-tables-schemas.md) | 
| expanded\_prefixes\_storage\_metrics | aws-s3 / lens\_<config-id>\_exp[\_<hash>] | [Understanding S3 Storage Lens table schemas](storage-lens-s3-tables-schemas.md) | 
| expanded\_prefixes\_activity\_metrics | aws-s3 / lens\_<config-id>\_exp[\_<hash>] | [Understanding S3 Storage Lens table schemas](storage-lens-s3-tables-schemas.md) | 
| bucket\_property\_metrics | aws-s3 / lens\_<config-id>\_exp[\_<hash>] | [Understanding S3 Storage Lens table schemas](storage-lens-s3-tables-schemas.md) | 
| amazon\_s3\_\_server\_access | aws-cloudwatch / logs | [Querying access logs in S3 Tables](sal-cw-querying-s3tables.md) | 

## Table schemas
<a name="s3-system-tables-schemas"></a>

### s3.buckets
<a name="s3-system-table-s3-buckets"></a>

Full name: `"s3tablescatalog/aws-catalog"."s3"."buckets"`. Partitioned by `bucket(32, id)`.

Contains your general purpose buckets (asset type `amazon.s3::Bucket`).


| Column | Type | Required | Description | 
| --- | --- | --- | --- | 
| id | string | Yes | Unique identifier of the asset. | 
| ingestion\_time | timestamptz | Yes | Time this asset record was ingested into the system table, in UTC. | 
| update\_time | timestamptz | No | Time the asset was last updated in the AWS Glue Data Catalog, in UTC. | 
| schema\_version | string | Yes | Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped. | 
| created\_time | timestamptz | No | Time the resource was created, in UTC. | 
| name | string | No | The user-provided business name for the asset. | 
| description | string | No | The user-provided business description for the asset. | 
| resource\_name | string | Yes | The resource's technical name. | 
| resource\_description | string | No | The resource's technical description. | 
| bucket\_namespace\_enum | string | No | The naming namespace of the bucket. Valid values: Global, AccountRegional. | 

### s3tables.buckets
<a name="s3-system-table-s3tables-buckets"></a>

Full name: `"s3tablescatalog/aws-catalog"."s3tables"."buckets"`. Partitioned by `bucket(32, id)`.

Contains your table buckets, both customer managed and AWS managed (`amazon.s3tables::Bucket`).


| Column | Type | Required | Description | 
| --- | --- | --- | --- | 
| id | string | Yes | Unique identifier of the asset. | 
| ingestion\_time | timestamptz | Yes | Time this asset record was ingested into the system table, in UTC. | 
| update\_time | timestamptz | No | Time the asset was last updated in the AWS Glue Data Catalog, in UTC. | 
| schema\_version | string | Yes | Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped. | 
| created\_time | timestamptz | No | Time the resource was created, in UTC. | 
| name | string | No | The user-provided business name for the asset. | 
| description | string | No | The user-provided business description for the asset. | 
| resource\_name | string | Yes | The resource's technical name. | 
| resource\_description | string | No | The resource's technical description. | 
| s3\_table\_bucket\_encryption\_type\_enum | string | No | The default server-side encryption type for new tables in the table bucket. Valid values: AES256, aws:kms. | 
| s3\_table\_bucket\_storage\_class\_enum | string | No | The default S3 storage class for new tables in the table bucket. Valid values: STANDARD, INTELLIGENT\_TIERING. | 
| s3\_table\_bucket\_id | string | Yes | The unique identifier of the table bucket. | 
| s3\_table\_bucket\_type\_enum | string | No | Indicates whether the table bucket is created and managed by the customer or by AWS (for example, the aws-s3 table bucket that holds S3 Metadata tables). Valid values: customer, aws. | 
| kms\_key\_id | string | No | The identifier of the AWS Key Management Service (AWS KMS) key that encrypts the resource at rest, as the source service reports it: a key ID, key ARN, alias name, or alias ARN. | 

### s3tables.namespaces
<a name="s3-system-table-s3tables-namespaces"></a>

Full name: `"s3tablescatalog/aws-catalog"."s3tables"."namespaces"`. Partitioned by `bucket(32, id)`.

Contains the namespaces in your table buckets (`amazon.s3tables::Namespace`).


| Column | Type | Required | Description | 
| --- | --- | --- | --- | 
| id | string | Yes | Unique identifier of the asset. | 
| ingestion\_time | timestamptz | Yes | Time this asset record was ingested into the system table, in UTC. | 
| update\_time | timestamptz | No | Time the asset was last updated in the AWS Glue Data Catalog, in UTC. | 
| schema\_version | string | Yes | Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped. | 
| created\_time | timestamptz | No | Time the resource was created, in UTC. | 
| name | string | No | The user-provided business name for the asset. | 
| description | string | No | The user-provided business description for the asset. | 
| resource\_name | string | Yes | The resource's technical name. | 
| resource\_description | string | No | The resource's technical description. | 
| s3\_table\_namespace\_id | string | Yes | The unique identifier of the namespace. Unlike the name, it differs between a deleted namespace and one created later with the same name. | 
| belongs\_to | string | No | Fully qualified identifier of the container asset this asset is a member of. | 

### s3tables.tables
<a name="s3-system-table-s3tables-tables"></a>

Full name: `"s3tablescatalog/aws-catalog"."s3tables"."tables"`. Partitioned by `bucket(32, id)`.

Contains the tables in your table buckets, including S3 Metadata tables and other tables that AWS manages (`amazon.s3tables::Table`).


| Column | Type | Required | Description | 
| --- | --- | --- | --- | 
| id | string | Yes | Unique identifier of the asset. | 
| ingestion\_time | timestamptz | Yes | Time this asset record was ingested into the system table, in UTC. | 
| update\_time | timestamptz | No | Time the asset was last updated in the AWS Glue Data Catalog, in UTC. | 
| schema\_version | string | Yes | Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped. | 
| name | string | No | The user-provided business name for the asset. | 
| description | string | No | The user-provided business description for the asset. | 
| resource\_name | string | No | The resource's technical name. | 
| resource\_description | string | No | The resource's technical description. | 
| created\_time | timestamptz | No | Time the resource was created, in UTC. | 
| region\_name | string | No | The AWS Region of the table. | 
| data\_format | string | No | The data format, such as CSV, JSON, or Parquet. | 
| data\_location | string | No | The storage location of the table data. | 
| format | string | No | The table format, such as Iceberg, Hudi, or Delta. | 
| type | string | No | The table type, such as EXTERNAL\_TABLE or VIRTUAL\_VIEW. | 
| s3\_table\_column\_count | int | No | The number of top-level columns in the table's current schema, including any that are not in the columns collection. | 
| s3\_table\_columns\_status\_enum | string | No | Whether the columns collection holds every column of the table's current schema. Valid values: Complete, Truncated, Unavailable. | 
| s3\_table\_compaction\_status\_enum | string | No | Indicates whether automatic Iceberg compaction maintenance is enabled for the table. Valid values: Enabled, Disabled. | 
| s3\_table\_encryption\_type\_enum | string | No | The server-side encryption type configured for the table. Valid values: SseS3, SseKms. | 
| s3\_table\_format\_version | int | No | The Apache Iceberg table format version. | 
| s3\_table\_last\_sequence\_number | long | No | The Apache Iceberg last sequence number of the table. It increases only when a snapshot is added, and is 0 for format version 1. | 
| s3\_table\_managed\_by\_enum | string | No | Indicates whether the table is created and managed by the customer or by AWS (for example, S3 Metadata tables). Valid values: Customer, Aws. | 
| s3\_table\_managed\_by\_service | string | No | The AWS service principal of the service that manages the table, for example, s3.amazonaws.com or sagemaker.amazonaws.com. Populated only when s3\_table\_managed\_by\_enum is Aws. | 
| s3\_table\_metadata\_location | string | No | The S3 URI of the current Iceberg metadata file for this table. | 
| s3\_table\_owner\_account\_id | string | No | The 12-digit AWS account ID that owns the parent S3 table bucket. | 
| s3\_table\_primary\_key\_columns | list<string> | No | The names of the table's primary key columns (the Apache Iceberg identifier fields), in schema order. | 
| s3\_table\_row\_count | long | No | The total number of records in the table's current snapshot. | 
| s3\_table\_size\_in\_bytes | long | No | The total size in bytes of the data files in the table's current snapshot. | 
| s3\_table\_snapshot\_management\_status\_enum | string | No | Indicates whether automatic Iceberg snapshot management maintenance is enabled for the table. Valid values: Enabled, Disabled. | 
| s3\_table\_source\_table\_arn | string | No | The ARN of the source table when this table is a replica; absent for tables that are not replication targets. | 
| s3\_table\_storage\_class\_enum | string | No | The S3 storage class for the table's data; overrides the parent table bucket's storage class. Valid values: Standard, IntelligentTiering. | 
| s3\_table\_bucket\_arn | string | Yes | The ARN of the parent S3 table bucket that contains this table. | 
| s3\_table\_bucket\_name | string | Yes | The name of the parent S3 table bucket that contains this table. | 
| s3\_table\_id | string | Yes | The unique identifier of the table within the S3 table bucket. | 
| s3\_table\_namespace | string | Yes | The namespace that contains this table. A namespace is a logical grouping of tables, analogous to a database. | 
| s3\_table\_version | long | No | A version that increases with every commit to the table: the number of the table's current metadata file. | 
| s3\_table\_warehouse\_location | string | No | The S3 URI of the warehouse location where this table's data and metadata are stored. | 
| kms\_key\_id | string | No | The identifier of the AWS KMS key that encrypts the resource at rest, as the source service reports it: a key ID, key ARN, alias name, or alias ARN. | 
| s3\_table\_kms\_key\_arn | string | No | The ARN of the AWS KMS key that encrypts the table. Populated only when s3\_table\_encryption\_type\_enum is SseKms. | 
| belongs\_to | string | No | Fully qualified identifier of the container asset this asset is a member of. | 

### s3tables.table\_columns
<a name="s3-system-table-s3tables-table-columns"></a>

Full name: `"s3tablescatalog/aws-catalog"."s3tables"."table_columns"`. Partitioned by `bucket(32, asset_id)`.

Contains the columns of each table in `s3tables.tables`. The `asset_id` column matches `s3tables.tables.id`.


| Column | Type | Required | Description | 
| --- | --- | --- | --- | 
| ingestion\_time | timestamptz | Yes | Time this column record was ingested into the system table, in UTC. | 
| schema\_version | string | Yes | Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped. | 
| asset\_id | string | Yes | Identifier of the table asset this column belongs to, matching s3tables.tables.id. | 
| column\_name | string | Yes | Name of this column within the parent table. | 
| description | string | No | Description of the column. | 
| data\_type | string | No | The Apache Iceberg type of the column. A struct, list, or map column carries the full type string, for example struct<city:string>. | 
| field\_id | int | No | The Apache Iceberg field ID of the column, which stays the same when the column is renamed. | 
| nullability\_enum | string | No | Whether the column accepts null values. Valid values: Nullable, NotNullable. | 
| ordinal | int | No | The one-based position of the column in the table's current schema. | 
| partition\_status\_enum | string | No | Whether the column is a source of the table's default partition spec. Valid values: PartitionKey, NotPartitionKey. | 
| partition\_transform | string | No | The Apache Iceberg partition transform applied to the column, for example identity, day, or bucket[16]. Absent when the column is not a partition source. | 
| primary\_key\_status\_enum | string | No | Whether the column is one of the table's primary key columns (the Apache Iceberg identifier fields). Valid values: PrimaryKey, NotPrimaryKey. | 

### s3vectors.buckets
<a name="s3-system-table-s3vectors-buckets"></a>

Full name: `"s3tablescatalog/aws-catalog"."s3vectors"."buckets"`. Partitioned by `bucket(32, id)`.

Contains your vector buckets (`amazon.s3vectors::Bucket`).


| Column | Type | Required | Description | 
| --- | --- | --- | --- | 
| id | string | Yes | Unique identifier of the asset. | 
| ingestion\_time | timestamptz | Yes | Time this asset record was ingested into the system table, in UTC. | 
| update\_time | timestamptz | No | Time the asset was last updated in the AWS Glue Data Catalog, in UTC. | 
| schema\_version | string | Yes | Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped. | 
| created\_time | timestamptz | No | Time the vector bucket was created, in UTC. | 
| bucket\_name | string | Yes | The name of the vector bucket. | 
| resource\_description | string | No | The resource's technical description. | 
| description | string | No | The user-provided business description for the asset. | 
| name | string | No | The user-provided business name for the asset. | 

### s3vectors.indexes
<a name="s3-system-table-s3vectors-indexes"></a>

Full name: `"s3tablescatalog/aws-catalog"."s3vectors"."indexes"`. Partitioned by `bucket(32, id)`.

Contains the vector indexes in your vector buckets (`amazon.s3vectors::Index`).


| Column | Type | Required | Description | 
| --- | --- | --- | --- | 
| id | string | Yes | Unique identifier of the asset. | 
| ingestion\_time | timestamptz | Yes | Time this asset record was ingested into the system table, in UTC. | 
| update\_time | timestamptz | No | Time the asset was last updated in the AWS Glue Data Catalog, in UTC. | 
| schema\_version | string | Yes | Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped. | 
| bucket\_name | string | Yes | The name of the vector bucket that contains the index. | 
| bucket\_arn | string | Yes | The ARN of the vector bucket that contains the index. | 
| index\_name | string | Yes | The name of the vector index. | 
| created\_time | timestamptz | No | Time the index was created, in UTC. | 
| dimension\_count | int | Yes | The number of dimensions in each vector stored in the index. | 
| distance\_metric\_enum | string | Yes | The distance metric used for vector similarity search. Valid values: Cosine, Euclidean. | 
| vector\_data\_type\_enum | string | Yes | The numeric data type of each vector component. Valid values: Float32. | 
| index\_mode\_enum | string | No | The operating mode of the vector index. Absent when the index mode has not been determined. Valid values: Classic, Typed, Enhanced. | 
| description | string | No | The user-provided business description for the asset. | 
| name | string | No | The user-provided business name for the asset. | 
| resource\_description | string | No | The resource's technical description. | 
| belongs\_to | string | No | Fully qualified identifier of the container asset this asset is a member of. | 

## Example queries
<a name="s3-system-tables-example-queries"></a>

**Example General purpose buckets created in the last 30 days**  

```sql
SELECT resource_name, created_time
FROM "s3tablescatalog/aws-catalog"."s3"."buckets"
WHERE created_time >= current_timestamp - interval '30' day
ORDER BY created_time DESC;
```

**Example General purpose buckets by namespace type**  

```sql
SELECT bucket_namespace_enum, count(*) AS buckets
FROM "s3tablescatalog/aws-catalog"."s3"."buckets"
GROUP BY 1;
```

**Example Largest S3 tables by size**  

```sql
SELECT s3_table_bucket_name, s3_table_namespace, resource_name,
       s3_table_row_count, s3_table_size_in_bytes
FROM "s3tablescatalog/aws-catalog"."s3tables"."tables"
ORDER BY s3_table_size_in_bytes DESC
LIMIT 20;
```

**Example S3 tables with automatic compaction turned off**  

```sql
SELECT s3_table_bucket_name, s3_table_namespace, resource_name
FROM "s3tablescatalog/aws-catalog"."s3tables"."tables"
WHERE s3_table_compaction_status_enum = 'Disabled';
```

**Example Indexes created in the last 30 days**  

```sql
SELECT index_name, bucket_name, created_time
FROM "s3tablescatalog/aws-catalog"."s3vectors"."indexes"
WHERE created_time >= current_timestamp - interval '30' day
ORDER BY created_time DESC;
```

**Example Indexes by dimension count, distance metric, and vector data type**  

```sql
SELECT dimension_count, distance_metric_enum, vector_data_type_enum, count(*) AS index_count
FROM "s3tablescatalog/aws-catalog"."s3vectors"."indexes"
GROUP BY 1, 2, 3
ORDER BY index_count DESC;
```

**Example Number of indexes in each vector bucket**  

```sql
SELECT b.bucket_name, count(i.index_name) AS index_count
FROM "s3tablescatalog/aws-catalog"."s3vectors"."buckets" b
LEFT JOIN "s3tablescatalog/aws-catalog"."s3vectors"."indexes" i
  ON i.bucket_name = b.bucket_name
GROUP BY b.bucket_name
ORDER BY index_count DESC;
```