Posted by webcm123 on 05/23/07 13:52
I'm making some changes in poll module. I don't know which method of
storing options of poll is better. The main data of polls are in POLLS
table.
Speed and efficiency is the most important issue. There are 2 methods:
1. Storing options in ANSWERS table and executing 2 queries to get
poll's data and options. Number of records connected with a poll in
that table is equal to number of poll's options.
Fields in ANSWERS table:
Poll ID | Sequence (optional) | Option | Amount of votes
2. Storing options in another field in POLLS table. They would be
being unserialized after getting data from database. Perhaps, it's
faster method.
Tests of serialize() and unserialize():
Seconds: 0.000138 | 9.5E-005
Miliseconds: 0.122 | 0.095
What do you think about it? Which method should I use?
[Back to original message]
|