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

support a faster unique id implement #4701

Merged
merged 4 commits into from
Apr 6, 2022

Conversation

stdpain
Copy link
Contributor

@stdpain stdpain commented Apr 1, 2022

What type of PR is this:

  • bug
  • feature
  • enhancement
  • others

Which issues of this PR fixes :

Fixes #

Problem Summary(Required) :

uniq_id generate rule: timestamp, backendId, rand, tid, inc

input :[]
output: TYPE_LARGEINT

mysql> select uniq_id();
+-----------------------------------+
| uniq_id() |
+-----------------------------------+
| 232491522003429759764239072851311 |
+-----------------------------------+
1 row in set (0.01 sec)

performace 1FE 1BE

baseline:

mysql> select count(*) from lineorder;
+-----------+
| count(*)  |
+-----------+
| 606039117 |
+-----------+
1 row in set (2.47 sec)

parallel=1

mysql> select count(uniq_id()) from lineorder;
+------------------+
| count(uniq_id()) |
+------------------+
|        606039117 |
+------------------+
1 row in set (4.53 sec)

parallel=6;

mysql> select count(uniq_id()) from lineorder;
+------------------+
| count(uniq_id()) |
+------------------+
|        606039117 |
+------------------+
1 row in set (2.62 sec)

@stdpain stdpain force-pushed the support_uniq_id_func branch 3 times, most recently from 641d971 to 0340e5c Compare April 1, 2022 12:46
input :[]
output: TYPE_LARGEINT

mysql> select uuid_numeric();
+-----------------------------------+
| uniq_id()                         |
+-----------------------------------+
| 232491522003429759764239072851311 |
+-----------------------------------+
1 row in set (0.01 sec)

performace 1FE 1BE

baseline:
```
mysql> select count(*) from lineorder;
+-----------+
| count(*)  |
+-----------+
| 606039117 |
+-----------+
1 row in set (2.47 sec)
```

parallel=1
```
mysql> select count(uuid_numeric()) from lineorder;
+------------------+
| count(uniq_id()) |
+------------------+
|        606039117 |
+------------------+
1 row in set (4.53 sec)
```
parallel=6;

```
mysql> select count(uuid_numeric()) from lineorder;
+------------------+
| count(uniq_id()) |
+------------------+
|        606039117 |
+------------------+
1 row in set (2.62 sec)
```
```
mysql> select count(*) from lineorder;
+-----------+
| count(*)  |
+-----------+
| 606039117 |
+-----------+
1 row in set (2.51 sec)
```
@stdpain stdpain force-pushed the support_uniq_id_func branch from 0340e5c to 3baea96 Compare April 1, 2022 12:51
@stdpain
Copy link
Contributor Author

stdpain commented Apr 2, 2022

run starrocks_be_unittest

@stdpain
Copy link
Contributor Author

stdpain commented Apr 2, 2022

run starrocks_fe_unittest

@stdpain stdpain merged commit 1b4c54a into StarRocks:main Apr 6, 2022
@stdpain
Copy link
Contributor Author

stdpain commented Apr 6, 2022

@Mergifyio backport branch-2.2

mergify bot pushed a commit that referenced this pull request Apr 6, 2022
@mergify
Copy link
Contributor

mergify bot commented Apr 6, 2022

backport branch-2.2

✅ Backports have been created

@wanpengfei-git
Copy link
Collaborator

[FE PR Coverage check]

😍 pass : 0 / 0 (0%)

@stdpain
Copy link
Contributor Author

stdpain commented Apr 6, 2022

@Mergifyio backport branch-2.1

mergify bot pushed a commit that referenced this pull request Apr 6, 2022
@mergify
Copy link
Contributor

mergify bot commented Apr 6, 2022

backport branch-2.1

✅ Backports have been created

stdpain added a commit that referenced this pull request Apr 6, 2022
stdpain added a commit that referenced this pull request Apr 7, 2022
blackstar-baba pushed a commit to blackstar-baba/starrocks that referenced this pull request Apr 18, 2022
blackstar-baba pushed a commit to blackstar-baba/starrocks that referenced this pull request Apr 28, 2022
jaogoy pushed a commit to jaogoy/starrocks that referenced this pull request Nov 15, 2023
(cherry picked from commit fa59954)

Co-authored-by: Kaiwei Wang <fieldsfarmer@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants