I'm fairly new to the realm of relational database design, and am trying to store a 9x9 covariance matrix in a table. The rows and columns are x, y, z terms of position, velocity, and acceleration. Like so:
PosX PosY PosZ . . . AccZ
-------------------------
PosX | XX XY XZ . . .
PosY | YX YY YZ . . .
PosZ | ZX ZY ZZ . . .
. | . . .
. | . . .
. | . . .
AccZ |
So for instance, the upper-left most element is PosXPosX (shortened to XX above), to the right is PosXPosY, and so on. The matrix is symmetric along the diagonal (i.e. PosXPosY == PosYPosX). It's also possible that I will want to store a 6x6 matrix that includes only position and velocity in this same table.
From my research, I've found a normalized table design of creating a table with fields for row number, column number, and value (How to represent a 2-D data matrix in a database). I can see that the benefit to this is flexibility, since the number of rows and columns can be variable. Is this the best way to proceed, even though I have a set number of rows and columns (9x9 and/or 6x6)? I could also envision creating a table that has fields for each unique row/col combination (PosXPosX, PosXPosY . . . etc). That seems more intuitive to me, but like I said I'm new at this.
My question is: How would you suggest representing my data in a relational database? I've outlined two possible methods but I don't know if either is the best way. "Best" in my case will mean efficiently stored and retrieved. What I'm creating is really a data repository, so the data in the database will not be changing once it is added, only read into numpy arrays or similar.
Some more background:
I'm analyzing test data. I have multiple test runs with different configurations, each having multiple data points that include a lot of different kinds of data. One of the data points I want to store and analyze is covariance. The amount of data I'm dealing with is quite staggering, so I'm hoping that using a database will help me to keep things organized and accessible. The goal is to store all this data, and then write data analysis and visualization tools that will draw from the data. In the case of covariance, I'm calculating things like Mahalanobis Distance, trace, and time propagated eigenvalues. I have many of these tools already, but they currently pull from a lot of different log files and are generally a mess.