Solved

Using "text tables" to store data - good or bad?

Posted on 2007-04-01
3
170 Views
Last Modified: 2010-03-19
As anyone who has looked into the inner workings of WordPress will have seen, they sometimes use text fields to store tabular data instead of creating an extra SQL table. An example of this is the "recently_edited" row in the "options" table.

For example: {a,b,c}{d,e,f} could be a three column, two row table.

My question: Is this a good or bad idea? Is there a name for this technique?

As far as I know any book on database design would always suggest moving this data into a separate table so that the information can be manipulated with an SQL query. However when you have a large database, it's often tempting to do this to cut down the number of tables and joins.

Thanks in advance for you input. Most useful response will get the points!
0
Comment
Question by:philwilks
3 Comments
 
LVL 27

Expert Comment

by:MikeToole
ID: 18831561
In SQL Server 2005 you can effectively do this with it's ability to store and query XML data
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 18832370
It's indeed a bad idea if this is data you use in your application/database and you use this method as a quick and dirty way of storing data which by nature is relational.

However, several engines offer the option to store an array in one field - InterSystems Caché and the new engine of Access in version 2007 - comes to my mind.
The reason to do this should be that the single elements of the array carry no useful information; the useful information is exactly the _collection_ of data elements.

An example could be RGB colour settings for, say, a background. Usually you create a compound value of the discrete values for R, G, and B respectively. This means that you have to perform a calculation both when storing and when retrieving a colour set to have the three values. Storing a three element array with the three values is much easier.
Of course, if you are able to store an array in an element of another array, this can be expanded, but I would say you should have very good reasons for doing so.

/gustav
0
 
LVL 22

Accepted Solution

by:
NovaDenizen earned 250 total points
ID: 18836196
I think it's ok if it's data you always use as a whole, it's limited in size, and you will never need to use the field in a WHERE clause.  
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now