View Single Post

   
  #1 (permalink)  
Old 02-28-2008, 11:29 AM
omeldoid@gmail.com
 
Posts: n/a
Default performance: many rows vs. long columns

hello. i was wondering what the best approach was: having a table
where each row has a field that holds more items (say 10), so that
each row gives me all the items associated with a certain request, or
a table that returns more rows with exactly one item per row
associated with that request?

an example: a given user may have a list of cities associated with
him; is it better to have a table where each username has exactly one
column that lists all the cities, or exactly one row for each city
associated with that user?

i see the second option's obvious advantages for possible
calculations, but would like to know more about the performance. is
there a general rule for situations like this?

thanks.

Reply With Quote