Forum Moderators: coopster

Message Too Old, No Replies

Each value taking its own column, or reading variable placement

Deciding which method is the fastest and most efficient

         

Jeremy_H

4:08 pm on Apr 30, 2006 (gmt 0)

10+ Year Member



I'm trying to figure out the benefits and disadvantages of two different approaches.

I'm wondering if I should create a MySQL table that has 100,000 rows and 81 columns, with each column having only one single character, or

Should I create a MySQL table that has 100,000 rows and only 1 column, with each column having 81 characters.

Basically, in the PHP script, I'll be checking the value of certain spots of each row, such as:

The value of column A in row 1 (if I go with the first system), or
The value of the first character in row 1 (if I go with the second system)

In the end, each time the script is run, only one row will be called for in the process, and all the information in the row will be collected.

So I guess it boils down to, which is faster in theory, calling 81 values from a MySQL row, or, calling 1 value from a MySQL row, and using sub-strings to get the values of each character.

Thanks for any input

eelixduppy

11:22 pm on Apr 30, 2006 (gmt 0)



Hello...

I would think that using one column would be more efficient since you need all of the data anyway. I believe it would be much easier to just do a simple string search.

Good luck!

eelix