On Thu, Mar 31, 2005 at 05:21:00PM +0200, Andy Pieters wrote:
> In a record there is a field category.
> Categories can be added/changed/removed
> Example data
> 
> id                    type                    
> Page 1                category1,category2
> Page 2                category3
> Page 3                category2,category4
From a Normal Form perspective, this is supposed to be
implented as 
Page 1  category 1
Page 1  category 2
Page 2  category 3
Page 3  category 2
Page 3  category 4

at which point adding / removing categories is just a simple
insert or delete.
> I currenlty do my selects with
> SELECT `id` FROM `thetable` WHERE `type` LIKE '%category3%';
That query will not be able to use indexes and will be too slow
to use in any sizable database.  

-Jason Martin
-- 
Nobody home but the lights, and they're out too.
This message is PGP/MIME signed.

Attachment: pgpJnyYA6U07B.pgp
Description: PGP signature

Reply via email to