One Big Rule or Many Small Rules

One Big Rule or Many Small Rules

Post by Jeffrey Ho » Thu, 08 Jul 1993 02:12:11



Is it generally better to have one large rule that fires a procedure
with many "if" statements in it.  Or to have many rules with "where"
conditions that each fire smaller procedures?  I would guess that if
some of the "where" conditions only occur rarely while other "where"
conditions occur frequently using a large procedure would tend to waste
space in the QSF pool.  However, I think there is some overhead involved
when Ingres decides which rules need to be fired.  Has anyone done any
benchmarks?  If not, is there any interest in any results I might obtain
in this area?

-- Jeff Horn

 
 
 

One Big Rule or Many Small Rules

Post by James J. Murawsk » Sat, 10 Jul 1993 04:47:51


On 06-Jul-93 in One Big Rule or Many Small ..


>Is it generally better to have one large rule that fires a procedure
>with many "if" statements in it.  Or to have many rules with "where"
>conditions that each fire smaller procedures?  I would guess that if
>some of the "where" conditions only occur rarely while other "where"
>conditions occur frequently using a large procedure would tend to waste
>space in the QSF pool.  However, I think there is some overhead involved
>when Ingres decides which rules need to be fired.  Has anyone done any
>benchmarks?  If not, is there any interest in any results I might obtain
>in this area?

I can't comment on which is method is better from practice - I've basically
used the one-procedure-with-many-ifs approach.  A large example is a rule in
a database of mine that fires upon insert or update.  The procedure invoked
by the firing of this rule tests 20+ conditions.  I have not noticed any
overhead problems at all.  From a maintainer's standpoint, I'd much rather
have one rule that invokes a procedure that tests many conditions then to have
many rules with conditions in them invoking a number of procedures.  I would
be interested, though, in any results anyone might come up with.

====================================================================
    Jim Murawski
    Sr. Software Engineer               (412) 268-2650  [office]
    Administrative Computing and        (412) 268-6868  [fax]

    Carnegie Mellon University          Office: UCC 155
    4910 Forbes Avenue
    Pittsburgh, PA 15213-3890

    "Le Mieux!  Le Magnifique!  Soixante Six!  Claude...NON!"

There are 1292 days until Clinton (Clinocchio) leaves office (1291 too many).

 
 
 

One Big Rule or Many Small Rules

Post by ste.. » Sat, 10 Jul 1993 23:53:55


A drawback to one big rule...  it takes up more room in the QSF pool.  Which means
you may need to allocate more memory to the QSF.  And if you are running multiple
servers, the additional memory could add up (each server has its own QSF pool).

Yeah, it's a small point...

steve

 
 
 

One Big Rule or Many Small Rules

Post by Steve Caswe » Wed, 14 Jul 1993 06:53:04



>A drawback to one big rule...  it takes up more room in the QSF pool.  Which means
>you may need to allocate more memory to the QSF.  And if you are running multiple
>servers, the additional memory could add up (each server has its own QSF pool).

>Yeah, it's a small point...

On the other hand, one large rule/procedure would probably be executed more
frequently than any one of the smaller procedures, which would mean chances of
the one large procedure being kicked out of cache would be less than any one of
the small procedures being kicked out (being least recently used).

Quote:

>steve

--

Steve Caswell           |   (404) 448-7727    |  "The opinions expressed are my

The Palmer Group        |   uunet!tpghq!sfc   |   but they're all I've got."

 
 
 

1. Does SQL 2000 offer Server based Rules similar to the Rules Wizard

We are having trouble keeping people from turning off the
Rules in Outlook and I have been researching SQL 2000 to
see if it has the capability to forward messages at the
Server level. I know SQL 2000 has policies and uses Active
Directory but it doesn't go into detail on what these are
capable of as far as my situation. If anybody could send
me any info on SQL 2000 I would appreciate it.
Thank You.

2. For one login,i want one computer to log

3. Rules triggered by rules

4. Clarification: size of Managed by database tablespaces?

5. why there is cost when I am running with RULE hint or optimizer_goal=RULE

6. 16 Bit Tutility DLL

7. Soft Rules Rule System Beta

8. Unicode file

9. Performance Advice - one big database or several small ones

10. One big table or lots of smaller ones ?

11. QuickBasic to VB5 one small step for some one big step for me

12. One Big 4ge or Many Small Ones?

13. One Third Rule