zhiqiang-hhhh opened a new pull request, #24395:
URL: https://github.com/apache/doris/pull/24395

   A new scale function, returne a uuid-numeric
   ```sql
   mysql [(none)]>select uuid_numeric();
   +----------------------------------------+
   | uuid_numeric()                         |
   +----------------------------------------+
   | 74551070724628249192532344163309205123 |
   +----------------------------------------+
   1 row in set (0.03 sec)
   ```
   and uuid-numeric() is much faster than current uuid() and random() function.
   
   * baseline
   ```sql
   mysql [(none)]>select count(number) from numbers("number"=100000000);
   +---------------+
   | count(number) |
   +---------------+
   |     100000000 |
   +---------------+
   1 row in set (6.52 sec)
   ```
   
   * current uuid() & random()
   ```sql
   mysql [(none)]>select count(uuid()) from numbers("number"=100000000);
   +---------------+
   | count(uuid()) |
   +---------------+
   |     100000000 |
   +---------------+
   1 row in set (3 min 1.03 sec)
   ```
   * uuid_numeric
   ```sql
   mysql [(none)]>select count(uuid_numeric()) from numbers("number"=100000000);
   +-----------------------+
   | count(uuid_numeric()) |
   +-----------------------+
   |             100000000 |
   +-----------------------+
   1 row in set (9.07 sec)
   ```
   
   20x faster
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to