> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_CoversCC

Computes spatial connected components across the entire dataframe using the `ST_Covers` predicate. Two geometries are in the same component if the first geometry covers the second (every point of the second geometry lies in the first). Returns a component ID for each row.

<img src="https://mintcdn.com/wherobots/fqh3gPDE0J25Lra_/images/sql-functions/ST_CoversCC/ST_CoversCC.svg?fit=max&auto=format&n=fqh3gPDE0J25Lra_&q=85&s=62344bd6c39ee5aa9c1b07c13c7ec8b7" alt="ST_CoversCC" width="400" height="300" data-path="images/sql-functions/ST_CoversCC/ST_CoversCC.svg" />

* `geometry` is the geometry column to analyze.
* `partitionBy` is an optional column to partition the data before computing connected components. When provided, the spatial predicate is only evaluated between rows that share the same partition value. This can significantly improve performance on large datasets.

## Signatures

```sql theme={"system"}
ST_CoversCC(geometry: Geometry)
```

```sql theme={"system"}
ST_CoversCC(geometry: Geometry, partitionBy: Column)
```

## Parameters

<ParamField body="geometry" type="Geometry" required>
  The input geometry.
</ParamField>

<ParamField body="partitionBy" type="Column">
  The partition by value.
</ParamField>

## Return type

<ResponseField type="Long">
  The connected component ID for each row.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_CoversCC(geom) FROM my_table
```

```
85899345920
```
