List:General Discussion« Previous MessageNext Message »
From:Tonu Samuel Date:August 22 2000 6:34am
Subject:Re: Fastest way to select sets
View as plain text  
Christopher Thompson wrote:
> 
> If I have a set with 10 items in it and I want to select a record if one or
> more of the items are found, what is the fastest way to do this?
> 
> Is it better to create 10 TINYINT (or CHAR(0)?) fields and do "WHERE
> field1=1 OR field3=1".
> 
> Or, is it faster to use the SET field type?
> 
> Or, some other way?

Haven't played with SET myself but about other possibilities:

If you have to choose between char or tinyint, use first one. Handling
numbers is much faster than some strings. Using OR clause is slow. Use
spearate table as suggested before or maybe SET.

-- 
+----------------------------------------------------------------+
| TcX  ____  __     _____   _____  ___                           |
|     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Tõnu Samuel           |
|    /*/ /*/ /*/   \*\_   |*|   |*||*|     tonu@stripped        |
|   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Tallinn, Estonia      |
|  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____                       |
|  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^                      |
|             /*/             \*\                Developers Team |
+----------------------------------------------------------------+
Thread
CHAR vs VARCHARClaude Cormier21 Aug
  • Re: CHAR vs VARCHARRob McMillin21 Aug
  • Re: CHAR vs VARCHARClaude Cormier21 Aug
    • RE: CHAR vs VARCHARSander Pilon21 Aug
  • Re: CHAR vs VARCHARKris Dahl21 Aug
    • Re: CHAR vs VARCHARJan Dvorak21 Aug
      • Re: CHAR vs VARCHARKris Dahl22 Aug
  • Re: CHAR vs VARCHAREd Wang21 Aug
Re: CHAR vs VARCHARKris Dahl21 Aug
  • RE: CHAR vs VARCHARChristopher Thompson21 Aug
    • RE: CHAR vs VARCHARDana Powers21 Aug
    • Re: CHAR vs VARCHARSteve Ruby21 Aug
  • Fastest way to select setsChristopher Thompson21 Aug
    • Re: Fastest way to select setsSteve Ruby22 Aug
    • Re: Fastest way to select setsTonu Samuel22 Aug
      • Re: Fastest way to select setsTino Hendricks28 Aug
        • Re: Fastest way to select setsTonu Samuel2 Sep
Re: CHAR vs VARCHARPaul Schmidt22 Aug