Original Post
Hi all i'm developing a level editor which uses a database (postgres) to store the data. the db runs on separate server, so every level-designer works on the same database. i'll also use th db for my game. now, i have a lot of geometry data. the speed for the editor is not "too" important, but the speed for the game server will be important. for example if i have a 3d vector, i thought that i could store the X,Y,Z components in a string (varchar, comma separated) rather than in three float fields. or a better example is a 4x4 matrix, which would have 16 separated float fields.
db->sql("SELECT matrix FROM GEOMETRY");
String matrix = db->FieldByName("matrix").AsString;
Matrix4 matrix4 = CreateMatrixFromString(matrix);
or
db->sql("SELECT mat_11,mat_12,mat_13,... FROM GEOMETRY");
Matrix4 matrix4;
matrix4._11 = db->FieldByName("mat_11").AsFloat;
matrix4._12 = db->FieldByName("mat_12").AsFloat;
matrix4._13 = db->FieldByName("mat_13").AsFloat;
.
.
The second approach needs access to 16 fields while the first only needs access to one string. My question is would there be a speed difference or are the methods equal in speed. If so, i would tend to implement the first method, to avoid too mutch colums in my table.