I'm curious as to what the differences/consequences/benefits are between storing delimited data as a single field item in a row or having all that data as individual rows in a separate table.
For example, say I had a user named "Steve" and he voted on items 1,2, and 5. Would having a single field in Steve's user data row with 1,2,5 be any more or less efficient than having three rows with those values in another table for the SOLE purpose of determining that Steve voted on those items? This delimited data would not be joined to another table in any way, nor attached to what the vote was, but merely determining if the item was voted on or not.
In this situation, lets say all voting items are being listed. The delimited data would be a single variable and matched in a loop consisting of each voting item. No queries within queries, no subqueries, no joins. Just a single while loop of one query and a string match between the voting item ID and the delimited data of Steve's voting record (so to speak).
This would be by no means a common method for matching data throughout an entire site, but for the purposes of recording more or less the activity of users. It seems easier on the server to hit the database less by having this data in a field, but it may tax the server more to run through a massive string. I'm curious to other thoughts and opinions on the subject. Thanks!
For example, say I had a user named "Steve" and he voted on items 1,2, and 5. Would having a single field in Steve's user data row with 1,2,5 be any more or less efficient than having three rows with those values in another table for the SOLE purpose of determining that Steve voted on those items? This delimited data would not be joined to another table in any way, nor attached to what the vote was, but merely determining if the item was voted on or not.
In this situation, lets say all voting items are being listed. The delimited data would be a single variable and matched in a loop consisting of each voting item. No queries within queries, no subqueries, no joins. Just a single while loop of one query and a string match between the voting item ID and the delimited data of Steve's voting record (so to speak).
This would be by no means a common method for matching data throughout an entire site, but for the purposes of recording more or less the activity of users. It seems easier on the server to hit the database less by having this data in a field, but it may tax the server more to run through a massive string. I'm curious to other thoughts and opinions on the subject. Thanks!