cockroachdb / cockroachdb/docs
Clarify that FROM is inclusive and TO is exclusive in range partitioning
- Langage dominant
- HTML
- Étoiles
- 212
- Forks
- 476
- Merge moyen
- 40 min
- PR mergées (30 j)
- 3
Description
On the "Define a range partition on an index" section, it's not documented whether the `FROM` and `TO` bounds in `PARTITION ... VALUES FROM (...) TO (...)` are inclusive or exclusive.
For example:
```sql
ALTER TABLE mq PARTITION BY RANGE (bucket) (
PARTITION mq_0 VALUES FROM (0) TO (86),
PARTITION mq_1 VALUES FROM (86) TO (173),
PARTITION mq_2 VALUES FROM (173) TO (256)
);
```
Since adjacent partitions share boundary values (e.g. `86` appears as both the `TO` of `mq_0` and the `FROM` of `mq_1`), it's ambiguous from the docs alone which partition a row with `bucket = 86` would land in.
To confirm: `FROM` is inclusive and `TO` is exclusive (i.e. ranges behave like `[FROM, TO)`).
Please add a note clarifying this inclusive/exclusive behavior on this page:
Source: this was discussed in Slack here: https://cockroachlabs.slack.com/archives/C04U1BTF8/p1785869947752589?thread_ts=1785869947.752589&cid=C04U1BTF8
Jira issue: DOC-18294
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.