Hi Yuxia,

Thanks for your comments.


1. We simply adhere to the common practice used in traditional databases such 
as TiDB [1] and StarRocks [2], which allows users to either implicitly assign 
or explicitly specify values for the auto-increment column.
2. In our initial implementation, we will support only one AUTO_INCREMENT 
column per table. We'll extend this to support multiple AUTO_INCREMENT columns 
in the future. I have removed the limit that "each table can have only one 
AUTO_INCREMENT column" in the FIP.
3. The prefetch operation of AutoIncIDBuffer involves submitting an 
asynchronous task to a threadpool and this task just invokes the add [3] method 
of the ZooKeeper DistributedAtomicLong. I have added pseudo code in the FIP to 
illustrate this algorithm.


[1] https://docs.pingcap.com/tidb/stable/auto-increment/
[2] 
https://docs.starrocks.io/docs/sql-reference/sql-statements/table_bucket_part_index/auto_increment/#basic-operations
[3] 
https://curator.apache.org/apidocs/org/apache/curator/framework/recipes/atomic/DistributedAtomicLong.html#add(java.lang.Long)



Regards,
Cheng



 




------------------ Original ------------------
From:                                                                           
                                             "dev"                              
                                                      
<[email protected]&gt;;
Date:&nbsp;Fri, Sep 19, 2025 03:58 PM
To:&nbsp;"dev"<[email protected]&gt;;

Subject:&nbsp;[DISCUSS] FIP-16: auto-increment column



Hi, Cheng. Thanks for driving this FIP. The design looks good to me overall. 
But still few comments below:

1. About "Users can also explicitly specify the values for the AUTO_INCREMENT 
column and insert them into the table."

Why allow users to explicitly specify the values? It'll break the uniqueness 
and may bring unexpected behavior. It feels a bit counterintuitive. If allow 
this, we should better to make sure 
it won't break uniquenes. Just as a reference, it seems many database vendor 
also ensure uniqueness for auto increment column


2. In "Specify AUTO_INCREMENT column at table creation" part, it seems 
auto-increment.fields be multiple columns, but in "Limits" part, it said "Each 
table can have only one AUTO_INCREMENT column."
It does make me confused. What's the truth?


3. About "Implementation", it said " AutoIncIDBuffer also launches an 
asynchronous task to prefetch IDs from ZooKeeper." 
I'm wondering how to prefetch IDs from ZooKeeper? Can you explain it more? 
Maybe some piece of code can help explain. 


Best regards,
Yuxia

----- ???????? -----
??????: "Wang Cheng" <[email protected]&gt;
??????: "dev" <[email protected]&gt;
????????: ??????, 2025?? 9 ?? 18?? ???? 10:49:11
????: [SPAM][DISCUSS] FIP-16: auto-increment column

Hi all,


Auto-increment column is a bread-and-butter feature for improving data 
management efficiency. It is the bedrock of many features in analytical 
workloads??such as those in real-time unique visitor (UV) counting scenarios.


To implement this capability, I'd like to propose FIP-16: auto-increment column 
[1].


Any feedback and suggestions on this proposal are welcome!


[1]: 
https://cwiki.apache.org/confluence/display/FLUSS/FIP-16%3A+Auto-Increment+Column




Regards,
Cheng



&amp;nbsp;

Reply via email to