Reply to Poll's options - two queries to MySQL or Unserialize()?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация