Posted by gosha bine on 05/23/07 15:17
On 23.05.2007 15:52 webcm123@gmail.com wrote:
> 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.
Nope. Clean code and maintainability is always more important (unless
you're making software for ballistic missile navigation). ;)
From this point of view, database solution looks better.
>
> 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?
>
--
gosha bine
extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
Navigation:
[Reply to this message]
|