Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddl: the region which presplit at create table, was different on table and partition table #59530

Closed
knull-cn opened this issue Feb 14, 2025 · 1 comment · Fixed by #59547
Closed
Assignees
Labels
component/tablepartition This issue is related to Table Partition of TiDB. severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@knull-cn
Copy link
Contributor

knull-cn commented Feb 14, 2025

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

test case : presplit regions when create partition table

-- create table with partitions ;
CREATE TABLE sbtest0000(
  id bigint,
  k bigint DEFAULT '0' NOT NULL,
  c CHAR(120) DEFAULT '' NOT NULL,
  pad CHAR(60) DEFAULT '' NOT NULL,
  UNIQUE KEY uk(id),
  key idx0(k,c),
  key idx1(c)
)SHARD_ROW_ID_BITS=3 PRE_SPLIT_REGIONS=2
PARTITION BY RANGE(id)(PARTITION p VALUES LESS THAN (MAXVALUE));
-- show regions for table;
show table sbtest0000 regions;

test case : presplit regions when create normal table

-- create table ;
CREATE TABLE sbtest1111(
  id bigint,
  k bigint DEFAULT '0' NOT NULL,
  c CHAR(120) DEFAULT '' NOT NULL,
  pad CHAR(60) DEFAULT '' NOT NULL,
  UNIQUE KEY uk(id),
  key idx0(k,c),
  key idx1(c)
)SHARD_ROW_ID_BITS=3 PRE_SPLIT_REGIONS=2;
-- show regions for table;
show table sbtest1111 regions;

2. What did you expect to see? (Required)

the regions splited same numbers

3. What did you see instead (Required)

normal table, the index was splited ,and record was splited to 4 regions;
partition table, all the data for partition table was splited to 4 regions (index was not splited).

Image

4. What is your TiDB version? (Required)

Image

@knull-cn knull-cn added the type/bug The issue is confirmed as a bug. label Feb 14, 2025
@Defined2014
Copy link
Contributor

Defined2014 commented Feb 14, 2025

Normal tables do not support presplit indexes too. Instead, just let each index has a separate region. Maybe we could change partition table same as normal table.

@Defined2014 Defined2014 added severity/moderate type/enhancement The issue or PR belongs to an enhancement. type/bug The issue is confirmed as a bug. component/tablepartition This issue is related to Table Partition of TiDB. and removed type/bug The issue is confirmed as a bug. severity/moderate type/enhancement The issue or PR belongs to an enhancement. labels Feb 14, 2025
@Defined2014 Defined2014 self-assigned this Feb 14, 2025
@jebter jebter added the sig/sql-infra SIG: SQL Infra label Feb 14, 2025
@ti-chi-bot ti-chi-bot bot closed this as completed in 9971301 Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tablepartition This issue is related to Table Partition of TiDB. severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants