Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Opinons/Philosophy on adding flags to table to reduce queries?
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.deReceived on Sat Jul 21 2001 - 16:18:27 CDT