This is quite a more technical question than it is a MODX question, so bare that in mind when you read it.
Hey guys,
For now, I can’t go into the specifics of the project but I guarantee that it’ll be released to the public in a short while. So, the question! Here it comes.
I’ve got a dynamic table which hold a e-mail, which needs to always be unique and a credentials row which contains a JSON encoded string with (assoc array keys), among many, firstname, lastname, website, twitter and other. Now, you could easily understand that this table is pretty hard to search with a query since the credentials is a TEXT type row with an insane amount of data with is unreadable/unqueryable by any database engine. You can’t simply query "... AND `credentials` LIKE "%query%"..." since if "query" would contain "firstname" instead of the real first name, it would return EACH row. This is very, very undesirable.
Now, imagine each credentials row holds a JSON encoded array with, when decoded, 20 associative keys and values. My idea was, to make it better searchable, is to create a separate table which contains the ID of the user (in this case), the associative key and the value with a total of 4 columns (id, userid, key, value). So, if one "list" (for the lack of a better word) hold 1000 users (which it will!) with a configured credential database of 20 keys, for only ONE "list", it’ll contain 20000 rows of data, simply to make it searchable!
So the question is, is it preferred to make it -that- much more searchable (and if so, is my example a valid method to use this? Imagine this database to grow to about 200.000 to 500.000 rows after 1 year or use.) or is this giant use of overhead total bull when it comes down to searching (I reckon there will be more maintenance than real searching for specific users, as you can already search on the e-mail address)?
Please help me out!