home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / database / ingres / 1016 < prev    next >
Encoding:
Text File  |  1992-07-28  |  2.7 KB  |  63 lines

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