Array or Row(s)
Posted: Tue May 26, 2009 3:43 pm
I have categories and documents that fall under these categories. Is it better for me to:
1) have a table with a field for each category id and a field for an array containing all associated document id's.
example: table - cat_doc, fields - cat_id, doc_array
2) have a table with the field category id and the field document id. That would mean each row would have one document associated with one category.
example: table - cat_doc, fields - cat_id, doc_id
The difference is example 1 would have a large array and example 2 would have many rows. Which is better as it gets larger?
1) have a table with a field for each category id and a field for an array containing all associated document id's.
example: table - cat_doc, fields - cat_id, doc_array
2) have a table with the field category id and the field document id. That would mean each row would have one document associated with one category.
example: table - cat_doc, fields - cat_id, doc_id
The difference is example 1 would have a large array and example 2 would have many rows. Which is better as it gets larger?