You are here: Re: what is better - one field or eight - mysql bit testing « PHP Programming Language « IT news, forums, messages
Re: what is better - one field or eight - mysql bit testing

Posted by Tim Van Wassenhove on 05/14/06 19:15

On 2006-05-14, windandwaves <nfrancken@gmail.com> wrote:
> There are three ways of storing this information in my mysql database
> A. add eight fields (tiny integer)

If those eight fields are 'properties' that belong to each item, then
this seems like a good approach.

> B. add one tiny integer and create a function in PHP that can translate
> the number stored into a eight boolean values (the bits)

I don't believe in such 'fields'. They only 'seem' to be the most
efficient, but only when there are as much possible options as there are
bits. (Eg: 9 options would require 2 x 8 bits (and 7 are left unused))

Anyway, mysql seems to have special 'field' functions these days, check
out the manual ;)

> C. create a table which list
> ItemID
> Associated characteristics

This seems like the right approach for n-m relationships.

> Option B is the most efficient in MySql.

Define efficient.


--
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be>

 

Navigation:

[Reply to this 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

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