Skip to content

Commit

Permalink
Fix typos in partitioned-table.md (pingcap#10905) (pingcap#10922)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Oct 19, 2022
1 parent 8c49bc9 commit db00cca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions partitioned-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ The optimizer can prune partitions through `WHERE` conditions in the following t
create table t (id int) partition by range (id) (
partition p0 values less than (5),
partition p1 values less than (10));
select * from t where t > 6;
select * from t where id > 6;
```

Or the partition expression is in the form of `fn(col)` where `fn` is `to_days`:
Expand All @@ -810,7 +810,7 @@ The optimizer can prune partitions through `WHERE` conditions in the following t
create table t (dt datetime) partition by range (to_days(id)) (
partition p0 values less than (to_days('2020-04-01')),
partition p1 values less than (to_days('2020-05-01')));
select * from t where t > '2020-04-18';
select * from t where dt > '2020-04-18';
```

An exception is `floor(unix_timestamp())` as the partition expression. TiDB does some optimization for that case by case, so it is supported by partition pruning.
Expand All @@ -822,7 +822,7 @@ The optimizer can prune partitions through `WHERE` conditions in the following t
partition by range (floor(unix_timestamp(ts))) (
partition p0 values less than (unix_timestamp('2020-04-01 00:00:00')),
partition p1 values less than (unix_timestamp('2020-05-01 00:00:00')));
select * from t where t > '2020-04-18 02:00:42.123';
select * from t where ts > '2020-04-18 02:00:42.123';
```

## Partition selection
Expand Down

0 comments on commit db00cca

Please sign in to comment.