Suppose I have two tables in an RDBMS that try to model storage and retrieval of same data based on different key specification. Table1 stores the entire key in a single char column, Table2 stores the key in multiple columns, like so:
Table1: key=String, value=Data
Table2: col1=String, col2=String, value=Data
Table1 key holds the same information as the combination of col1 and col2, plus potentially delimiters, ex. key="NASDAQ/SUNW", col1="NASDAQ", col2="SUNW"
I am interested in efficient data retrieval. Would using Table1 be more efficient than Table2?
If your key contains multiple values, you should separate them into separate columns. That way you could potentially index them separately if the need arises, e.g. if you need to be able to filter a resultset by the second value (in your example, imagine if you needed to find all records with SUNW).
As a rule of thumb, if you find yourself putting comma-delimited values into a single database column, you are probaly doing something wrong.