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 Alan Little on 05/15/06 12:25

Carved in mystic runes upon the very living rock, the last words of
Colin McKinnon of comp.lang.php make plain:

> Alan Little wrote:
>
>> Carved in mystic runes upon the very living rock, the last words of
>> windandwaves of comp.lang.php make plain:
>>
>>> I have to store up to eight boolean bits of information about an
>>> item in my database.
>>>
>>> There are three ways of storing this information in my mysql
>>> database A. add eight fields (tiny integer)
>>> B. add one tiny integer and create a function in PHP that can
>>> translate
>>
>> I'd go with B, just my personal preference.
>
> Its a BAD idea. SQL has no visibility of it. It's not normalized and
> it doesn't scale. In fairness certain types of search can be done very
> fast, but they're unlikely to be particularly common.

Yeah, you're right. That'll teach me to post quickie answers without
thinking about it. I used such an approach in an application once, and
that was what I was thinking about, but the thing I used it for, there
was never more than 20 - 30 items and never any need to query it.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/

 

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

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