pingcap / pingcap/docs

PARTITION BY RANGE vs PARTITION BY RANGE COLUMNS are not clear

Open
#7,165 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2024-tidb-docs-dash area/sql-infra tracked type/enhancement
Dominant language
Python
Stars
617
Forks
724
Avg merge
2d 10h
Merged PRs (30d)
223

Description

Change Request

Please answer the following questions before submitting your issue. Thanks!

  1. Describe what you find is inappropriate or missing in the existing docs.

I cannot see what the difference between PARTITION BY RANGE (col) and PARTITION BY RANGE COLUMNS (col).

  1. Describe your suggestion or addition.

The difference is that RANGE COLUMNS(col) can take most types of columns, while RANGE (col) only take int columns.
See:

tidb> create table t (a int, b varchar(255)) partition by range (b) (partition p1 values less than (""));
ERROR 1697 (HY000): VALUES value for partition 'p1' must have type INT
tidb> create table t (a int, b varchar(255)) partition by range (b) (partition p1 values less than (1));
ERROR 1659 (HY000): Field 'b' is of a not allowed type for this type of partitioning
tidb> create table t (a int, b varchar(255)) partition by range columns (b) (partition p1 values less than (""));
Query OK, 0 rows affected (0,00 sec)

  1. Provide some reference materials (documents, websites, etc) if you could.

https://dev.mysql.com/doc/refman/8.0/en/partitioning-types.html
https://dev.mysql.com/doc/refman/8.0/en/partitioning-columns.html

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing TiDB partitioning documentation and compare it with the cited MySQL pages on partitioning types and partitioning columns. Clarify the distinction between RANGE and RANGE COLUMNS, including the supported column types and representative examples; the documentation is done when readers can choose the appropriate syntax from the page alone.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.