Imaginary Weight Calculation Rules:
Long: 8 bytesUUID: 16 bytesString(for@Columnwithout explicit length, or unannotated): 255 bytesForeign Key (FK) references to other entities (e.g.,
AreaType<?>): 8 bytes (assuming aLongID)Newline character (
\n): 1 byte (per instance)Listtype fields (representing relationships like@OneToMany,@ManyToMany): 0 bytes (as they are typically stored in join tables or separate rows, not directly in the current class's row size).
Imaginary Weight Report (Lighter to Heavier)
AreaType
1 Fields (inferred from
BaseTypeconstructors):typeId(Long),gid(UUID),name(String)Calculation: 8 (Long) + 16 (UUID) + 255 (String) + 1 (newline) = 280 bytes
ArtistType
2 Fields (inferred from
BaseTypeconstructors):typeId(Long),gid(UUID),name(String)Calculation: 8 (Long) + 16 (UUID) + 255 (String) + 1 (newline) = 280 bytes
Gender
3 Fields (inferred from
BaseTypeconstructors):typeId(Long),gid(UUID),name(String)Calculation: 8 (Long) + 16 (UUID) + 255 (String) + 1 (newline) = 280 bytes
Note: AreaType, ArtistType, and Gender have the same calculated imaginary weight based on their shared BaseType structure.
Area
4 areaId: Long = 8 bytesgid: UUID = 16 bytesareaType: FK = 8 bytesareaBeginDate: FK = 8 bytesareaEndDate: FK = 8 bytesareaComment: FK = 8 bytesareaName: String (VARCHAR NOT NULL) = 255 bytesCalculation: 8 + 16 + 8 + 8 + 8 + 8 + 255 + 1 (newline) = 312 bytes
Artist
5 artistId: Long = 8 bytesgid: UUID = 16 bytesartistName: String (VARCHAR NOT NULL) = 255 bytesartistSortName: FK = 8 bytesartistComment: FK = 8 bytesartistBeginDate: FK = 8 bytesartistEndDate: FK = 8 bytesartistType: FK = 8 bytesgender: FK = 8 bytesarea: FK = 8 bytesbeginArea: FK = 8 bytesendArea: FK = 8 bytesartistCredits: List (excluded) = 0 bytesartistAlias: List (excluded) = 0 bytesCalculation: 8 + 16 + 255 + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 1 (newline) = 350 bytes
Comments
Post a Comment