Re: Opinons/Philosophy on adding flags to table to reduce queries?

From: Rolf Czedzak <520040398192-0001_at_t-online.de>
Date: Sat, 21 Jul 2001 21:18:32 GMT
Message-ID: <9hso8q$r67$04$1_at_news.t-online.com>


Hi Hans,
putting an index on a column which has such poor selectivity (80% pass) does not look like a good idea to me.

Rolf

Hans Wiezorke <c.und.h_at_t-online.de> schrieb in im Newsbeitrag: 861fd37d.0107030034.6b3b5b6b_at_posting.google.com...
> Hi Jeff,
>
> "Jeff Wilson" <jwilson2000_at_home.com> wrote in message
 news:<Xgc07.288435$p33.5772965_at_news1.sttls1.wa.home.com>...
> > What is the conventional wisdom regarding adding a boolean column to a
 table
> > that is simply the result of a test on the values in about 6 other
 columns?
>
> There certainly is no convention on this. In some cases it can be a
> very good idea.
>
> The big advantage of such a flag is, that you can use a nonunique
> index on the flag to speed up your query.
>
> > The data in this table is fixed so I don't have to worry about an update
> > affecting theboolean.
>
> Even if it weren't fixed, you could put a trigger on that table, that
> sets the flag after each insert or update.
>
> > Would only a purist avoid something like this? Are there considerations
> > here I'm missing?
>
> Nope, good idea :-)
>
> Ciao,
> Hans
>
> --
> Hans B. Wiezorke
> - Dipl.-Inform. -
>
> ISB AG Tel: +49 (0)721/82800-0
> KarlstraĆŸe 52-54 Fax: +49 (0)721/82800-82
> 76133 Karlsruhe mailto:hans.wiezorke_at_isb-ag.de
> Germany http://www.isb-ag.de
Received on Sat Jul 21 2001 - 23:18:32 CEST

Original text of this message