User can compose database schema for DB cache themselves. But you need to observe rules as followed.
- Contain RottUUID, OwnerUUID, UUID field.
- Search by indexing could be negatively influenced if setting RootUUID, OwnerUUID and UUID as Combination PK. Therefore, you should create each index for better performance.
- Among above fields, you need to set RootUUID and OwnerUUID as Non-Unique Index. And set UUID as Primary Key.
- Above fields must be varchar(38) at MySQL and uniqueidentifier type at MSSQL
- Name of Root table and Child table must be different
- Stored procedure automatically adds to game database schema that DB cache client and server use. Do not modify or remove it.
Example of data schema for saving gamer data in MMORPG
< An example Script for adding three essential fields >
ALTER TABLE dbo.Gamer ADD CONSTRAINT
PK_Gamer PRIMARY KEY CLUSTERED
(
UUID
) WITH( IGNORE_DUP_KEY = OFF) ON [PRIMARY]
CREATE INDEX IX_Gamer_OwnerUUID ON dbo.Gamer
(
OwnerUUID
) WITH( IGNORE_DUP_KEY = OFF) ON [PRIMARY]
CREATE INDEX IX_Gamer_RootUUID ON dbo.Gamer
(
RootUUID
) WITH( IGNORE_DUP_KEY = OFF) ON [PRIMARY]