On Wed, Sep 12, 2001 at 07:55:05PM +0200, Sander Pilon wrote:
> Dear List,
> 
> I need to store a set of flags in SQL, as in 20 true or false
> values.  The logical choice seems to be the SET type, but does it
> use an index?

I don't think so...  It is implemented as a bitmask behind the scenes.

It *could* use an index (not exactly in the normal way), but my gut
feel is that it doesn't.

> The manual gives an examle where a set is queried with LIKE
> '%flag%'. That scares me a bit, because the table is going to
> contain hundredthousands of rows - and I need to be able to filter
> on these flags effeciently.
> 
> I could make 20 separate rows as tinyint, but that seems like a lot
> of overhead.

What sort of overhead?  The relational model suggests that you might
want to use multiple rows in a separate table that you can join with
the main table.

MySQL is rather fast, even with a lot of data thrown at it.  Might be
worth a try.

Jeremy
-- 
Jeremy D. Zawodny, <[EMAIL PROTECTED]>
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878   Fax: (408) 349-5454   Cell: (408) 685-5936

MySQL 3.23.41-max: up 10 days, processed 184,514,329 queries (213/sec. avg)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to