

# 生成分区索引
<a name="crawler-configure-partition-indexes"></a>

Data Catalog 支持创建分区索引，以提供对特定分区的有效查找。有关更多信息，请参阅 [Creating partition indexes](https://docs.aws.amazon.com/glue/latest/dg/partition-indexes.html)。默认情况下，AWS Glue 爬网程序会为 Amazon S3 和 Delta Lake 目标创建分区索引。

------
#### [ AWS 管理控制台 ]

1. 登录 AWS 管理控制台，然后打开 AWS Glue 控制台，网址为：[https://console.aws.amazon.com/glue/](https://console.aws.amazon.com/glue/)。

1. 在**数据目录**下选择**爬网程序**。

1. 定义爬网程序时，在**设置输出和调度**页面中的**高级选项**下，**自动创建分区索引**选项默认处于启用状态。

   要禁用此选项，可以在控制台中取消选择**自动创建分区索引**复选框。

1. 完成爬网程序配置并选择**创建爬网程序**。

------
#### [ AWS CLI ]

 您也可以使用 AWS CLI 禁用此选项，在 `configuration` 参数中设置 `CreatePartitionIndex `。默认值为 true。

```
aws glue update-crawler \
    --name myCrawler \
    --configuration '{"Version": 1.0, "CreatePartitionIndex": false }'
```

------

## 分区索引的使用说明
<a name="crawler-configure-partition-indexes-usage-notes"></a>
+ 默认情况下，由爬网程序创建的表没有变量 `partition_filtering.enabled`。有关更多信息，请参阅 [AWS Glue partition indexing and filtering](https://docs.aws.amazon.com/athena/latest/ug/glue-best-practices.html#glue-best-practices-partition-index)。
+ 不支持为加密分区创建分区索引。