Can someone tell me how to do the following in MySQL, or if it is even
possible? Bear in mind that I know nothing about databases! If it
can't be done with MySQL, can it be done with other databases?
I want to create a table that is very sparse (in the sense of a sparse
matrix). Entries should be either 1 or 0, and the vast majority will
be zero. I'm wondering if there is a way to make such a table, so as
to avoid the cost various operations (adding a column is my primary
concern), without losing simplicity of access via a single SELECT.
I know I can say 'default NULL' for a column. Does this actually
allocate storage when a column or row is added? In other words, Does
it do what I want? If so, can I say SELECT ... WHERE col = 'NULL' or
something like that?
Is this a standard problem that database packages address? If not, how
would people solve it? If there's not an already-supported method, do
I have any options other than:
- Choosing a different table design using multiple tables and break
my single SELECT statement into something more complicated that
joins up the appropriate tables as needed.
- Implement sparse tables within MySQL.
Thanks for any help.