G
Glenn
Hello,
I'm looking for advice on a good design for what amounts to a 2
dimensional sparsely populated table (or matrix), considering speed,
storage and ease of use with queries.
the intended use is to simplify and centralize the data of multiple
access control systems.
the first column is a unique id.
the other columns are to hold as value 0(=off) or 1(=on).
the number of columns will typically be about 20; the number of rows
about 5000.
the corresponding table will mostly hold zeroes, about 3/4ths.
There will be several of such tables with varying numbers of columns.
queries would be: "list all rows with actived (on) 4th and 5th fields"
-Using a normal table design (20 odd fields per table) this amounts to
alot of 'wasted' space.
queries however are straight-forward.
-using a 2 column table-design
first column = ID
second column = a string sequence "on-off". "00100010000000000010"
this is more storage efficient. but queries and speed will suffer.
Instead of the string, the corresponding numeric value could be used.
the query would then need bit-level operators. not the most
readable/easy to use
suggestion, advice is most welcome.
best regards
I'm looking for advice on a good design for what amounts to a 2
dimensional sparsely populated table (or matrix), considering speed,
storage and ease of use with queries.
the intended use is to simplify and centralize the data of multiple
access control systems.
the first column is a unique id.
the other columns are to hold as value 0(=off) or 1(=on).
the number of columns will typically be about 20; the number of rows
about 5000.
the corresponding table will mostly hold zeroes, about 3/4ths.
There will be several of such tables with varying numbers of columns.
queries would be: "list all rows with actived (on) 4th and 5th fields"
-Using a normal table design (20 odd fields per table) this amounts to
alot of 'wasted' space.
queries however are straight-forward.
-using a 2 column table-design
first column = ID
second column = a string sequence "on-off". "00100010000000000010"
this is more storage efficient. but queries and speed will suffer.
Instead of the string, the corresponding numeric value could be used.
the query would then need bit-level operators. not the most
readable/easy to use
suggestion, advice is most welcome.
best regards