home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.ingres
- Path: sparky!uunet!darwin.sura.net!uvaarpa!cv3.cv.nrao.edu!mail-to-news-gateway
- From: sfc%tpghq@uunet.UU.NET (Steve Caswell)
- Subject: Re: one rule or many???
- Message-ID: <9207282056.AA25386@tpghq>
- Sender: daemon@nrao.edu
- Organization: National Radio Astronomy Observatory
- Date: Tue, 28 Jul 1992 20:56:11 GMT
- Lines: 52
-
- >
- > From: horn@schaefer.math.wisc.edu (Jeffrey Horn)
- > Subject: One rule or many???
- >
- > Suppose that you want to use rules to implement two or more foreign-key
- > checks on columns in a table. Say columns a, b, c, ... of table X.
- > Is it better to implement one large rule that checks all the constraints,
- > or many small rules that each check one constraint? That is should one
- > have one rule
- >
- > create rule Xkahuna after update of X execute procedrue Xbigproc;
- >
- > or many rules
- >
- > create rule Xa after update of X(a) execute procedure Xaproc;
- > create rule Xb after update of X(b) execute procedure Xbproc;
- > .
- > .
- > .
- >
- > If there is no "best" method, what are the advantages of each method? What
- > about if one is running on a parallel architechture?
- >
- > Thanks for your input,
- >
- > Jeffrey Horn
- >
- >
- We have done this by implementing one rule and checking within the procedure
- to decide which columns have changed. This requires us to pass in 48 arguments
- to the rule, but this does not seem to be excessive. I don't know if there is
- a limit to the number of arguments that can be passed in.
-
- One factor in your decision making is that INGRES caches rules and procedures
- into the Query Storage Facility cache, so that it doesn't need to go back and
- read the rule/procedure from disk every time it is executed. When INGRES
- first brings in the procedure, it looks for a chunk of QSF memory large enough
- to hold the procedure. If it cannot find a chunk of memory, it kicks out a
- least recently used query (I would guess another procedure or a repeated query).
- Smaller procedures would have a better chance of fitting into the QSF if they
- were being brought in after holes had been created in memory. On the other
- hand, one large procedure would be less likely to be kicked out of the cache
- by another query if were being accessed frequently (calling one procedure many
- times would avoid the least recently used algorithm). If you have lots of
- memory and can allocate it to the QSF then these issues are moot.
-
- I'd be interested to hear from you what method you choose and how it works out
- (either here on the group or in an e-mail).
-
- Steve Caswell | (404) 448-7727 | "The opinions expressed are my
- Principal Consultant | sfc@tpghq.com | own. They may not be perfect,
- The Palmer Group | uunet!tpghq!sfc | but they're all I've got."
-