Jump to content


Photo

best table scheme for polls?


  • Please log in to reply
1 reply to this topic

#1 Atealtha

Atealtha
  • Members
  • Pip
  • Newbie
  • 1 posts

Posted 29 December 2003 - 01:45 AM

I took a look at the vBulletin source code and noticed that they seperate the questions and votes in only 2 columns.

Here is a visualization of the table in phpmyadmin:

question
q1|||q2|||q3...

and to the right of it there is:

votes
13|||2|||77...

they seperate their options with pipes. now, is this a good way to do polls? or is it better for me to go and put one poll option per row (with a seperate index which I\'ll organize myself)?

Or is there a way to put tables within tables to make this all easier that jelsoft and I don\'t know of?

#2 gizmola

gizmola
  • Administrators
  • Advanced Member
  • 4,667 posts
  • LocationLos Angeles, CA USA

Posted 29 December 2003 - 07:51 AM

All design decisions like this involve tradeoffs. BBS polls are very simple because they can ask only one question, and then have a fixed set of answers that are always an enumerated list. Since they wanted to KISS, they used a compressed non-database centric structure. If your application was focused on polls, then this might be a bad decision, but since polls are essentially fluff in the context of a forum, it really doesn\'t matter. In their case they opted for a structure that is storage friendly but computationally taxing. This however allows them to focus on the forum code and be database agnostic which was probably one of their design goals.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users