?
Solved

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

Posted on 2007-04-01
3
Medium Priority
?
177 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 51

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 750 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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

762 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