home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / database / 6128 < prev    next >
Encoding:
Internet Message Format  |  1992-08-14  |  4.5 KB

  1. Xref: sparky comp.databases:6128 comp.databases.theory:362
  2. Newsgroups: comp.databases,comp.databases.theory
  3. Path: sparky!uunet!gatech!darwin.sura.net!mips!sdd.hp.com!ux1.cso.uiuc.edu!mp.cs.niu.edu!higgins
  4. From: higgins@mp.cs.niu.edu (Greg Higgins)
  5. Subject: Re: Relational Queues
  6. Message-ID: <1992Aug14.202406.17593@mp.cs.niu.edu>
  7. Organization: Northern Illinois University
  8. References: <1992Aug7.200632.22867@oracle.us.oracle.com> <1992Aug12.113531.4654@mp.cs.niu.edu> <1992Aug13.195729.19884@oracle.us.oracle.com>
  9. Date: Fri, 14 Aug 1992 20:24:06 GMT
  10. Lines: 86
  11.  
  12. In article <1992Aug13.195729.19884@oracle.us.oracle.com> mfriedma@uucp (Michael Friedman) writes:
  13. >In article <1992Aug12.113531.4654@mp.cs.niu.edu> higgins@mp.cs.niu.edu (Greg Higgins) writes:
  14. >>In article <1992Aug7.200632.22867@oracle.us.oracle.com> mfriedma@uucp (Michael Friedman) writes:
  15. >>>In article <BsKzHw.9sy@world.std.com> edwards@world.std.com (Jonathan Edwards) writes:
  16. >>>>How do you implement a standard FIFO queue in the relational model?
  17. >
  18. >>>>Here's the rules: multiple producers, multiple consumers. No possibility of
  19. >>>>two consumers getting the same record. Ability for consumer to wait if the
  20. >>>>queue is empty (no polling allowed!). Strict FIFO, but to make it a little
  21. >>>>easier, I only ask that a record enqueued by one transaction come before all
  22. >>>>records enqueued by other transactions that START after the first one COMMITS.
  23. >
  24. >>>>I believe that this can only be done by setting up a central server program,
  25. >>>>called from the producers and consumers (perhaps via RPC), which serializes
  26. >>>>access to the relation representing the queue. If this is true, doesn't anyone
  27. >>>>else find this a rather glaring weakness?
  28. >
  29. >>>The SQL standard supports sequences.  Just create an increasing
  30. >>>sequence and use it to number each item you add to the table.  Then
  31. >>>when you pop items off, just select where SEQ_NUMBER = MAX(select
  32. >>>seq_number from table).  
  33. >
  34. >>Hardly. This implements a LIFO queue.
  35. >
  36. >Sorry.  Momentary attack of braindeadness.  Just replace MAX with MIN.
  37.  
  38. The guy next to me is working on MIN; I want MIN + 1, but then so 
  39. do the other 20 people in the room.
  40.  
  41. >
  42. >>>In general, however, this wouldn't even be a weakness if we didn't
  43. >>>have a solution.
  44. >
  45. >>>SQL is intended to solve real world problems, not comp sci questions.
  46. >>>If you don't have the information in your database to know which item
  47. >>>in your list should be dealt with next then either you didn't design
  48. >>>your database right or it doesn't matter which comes next.
  49. >
  50. >>Wanting a FIFO queue is not just a comp sci problem. It is a real world
  51. >>problem, and one which application developers need to deal with frequently.
  52. >
  53. >>Consider a help desk situation where you have a first line tech support
  54. >>screening calls, entering them into the database, and then putting the
  55. >>folks who need more help on hold for second level support. 
  56. >
  57. >>You want second level support to pick up those call in the correct order.
  58. >
  59. >>Note that the correct order may not be the serial number, since presumably
  60. >>that would be the initial entry into the database by the first line support.
  61. >
  62. >So what is the correct order?  Probably it's the order in which they
  63. >were put on hold for second level support.  So how would I handle that
  64. >if I didn't have sequences?  Hmm.  Well, would a timestamp do?  Yup.
  65. >And if you don't have a time stamp you didn't design the database
  66. >right.
  67. >
  68. >SQL has its limitations (explosion of parts, for one) but this isn't
  69. >one of them.
  70. >
  71. >>>I am not an official Oracle spokesman.  I speak for myself and no one else.
  72. >
  73. >>I'll bet Oracle Corp. is glad of that. You should consider  
  74. >>solving the problem instead of criticizing the presenter
  75. >>and maybe that will change.
  76. >
  77. >Yow!!!!  Actually, even reading over my original post, I didn't think
  78. >it was in any way mean.  As far as criticizing the presenter goes, I
  79. >think that for posts like this, where someone is debating an issue, as
  80. >opposed to asking "I need help" it is acceptable to post
  81. >counterarguments.  I guess some people consider that to be criticizing
  82. >the presenter.  I don't.
  83.  
  84. "comp sci questions" is vendorese for "Shut up, buy my product, and we'll
  85. figure out later if it can actually do the job." I've heard it a lot,
  86. especially from representatives of a large, well known database
  87. vendor. If put to me when I'm in the right mood, as I apparently was
  88. the other day, it gets my dander up. 
  89.  
  90. >
  91. >Mike
  92. >
  93. >-- 
  94. >-------------------------------------------------------------------------------
  95. >I am not an official Oracle spokesman.  I speak for myself and no one else.
  96.  
  97.  
  98.