# Allocate Tso

+ `TSO = physical time + logical time` 
------------------------------------------------------------
TSO is a global timestamp, which is the cornerstone of TiDB's implement of distributed transaction. So for PD, we first need to ensure that it can allocate a large number of TSO to transaction quickly, and we also need to ensure that the allocated TSO must be monotonically increasing, and there is no possibility of a rollback.

TSO is an int64 integer that consists of two components: physical time plus logical time. Physical time is the millisecond time of the current unix time, and logical time is a counter up to 1 << 18. That is, for 1ms, the PD can allocate up to 262144 TSO, which satisfies the vast majority of cases.