Skip to content

Commit c2b3c97

Browse files
committed
Small README improvements
1 parent 0f58f66 commit c2b3c97

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ Zo_hpnDxkOsAWLk1tIS6DA
7373
## Sequential Guids 🔥
7474
`guid` includes two special types `GuidPG` and `GuidSS` optimized for use as database primary keys (PostgreSQL and SQL Server). Their time-ordered composition helps prevent index fragmentation and improves `INSERT` performance compared to fully random Guids. Note that sequential sorting is only across `time.Now()` timestamp precision.
7575

76-
* **`guid.NewPG()`**: Generates a `GuidPG`, which is sortable in **PostgreSQL**. It is structured as `[8-byte timestamp][8 random bytes]`.
77-
* **`guid.NewSS()`**: Generates a `GuidSS`, which is sortable in **SQL Server**. It is structured as `[8 random bytes][8-byte SQL Server-ordered timestamp]`.
76+
* **`guid.NewPG()`**: Generates a `GuidPG`, which is sortable in **PostgreSQL**.
77+
- It is structured as `[8-byte timestamp][8 random bytes]`.
78+
* **`guid.NewSS()`**: Generates a `GuidSS`, which is sortable in **SQL Server**.
79+
- It is structured as `[8 random bytes][8-byte SQL Server-ordered timestamp]`.
7880
* `.Timestamp()` on `GuidPG`/`GuidSS` returns Guid creation time as UTC `time.Time`.
7981

8082
Both `GuidPG` and `GuidSS` are nearly as fast as `guid.New()`. They can be used as a standard `Guid` and support the same interfaces.
@@ -117,7 +119,7 @@ GFEU88w5PqTsYX0kcZzL6Q 185114f3cc393ea4ec617d24719ccbe9 yFIlRwKZJNo-pBhRFPPMOQ c
117119
* If you must keep using `google/uuid`, use `guid` to increase performance by **2~4x**:
118120
```go
119121
// do this before using google/uuid
120-
uuid.SetRand(guid.Reader);
122+
uuid.SetRand(guid.Reader)
121123
```
122124

123125
## uuid Benchmarks with and without `guid.Reader`

0 commit comments

Comments
 (0)