home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / database / theory / 436 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  1.3 KB

  1. Path: sparky!uunet!ogicse!usenet.coe.montana.edu!decwrl!bu.edu!Shiva.COM!world!edwards
  2. From: edwards@world.std.com (Jonathan Edwards)
  3. Newsgroups: comp.databases.theory
  4. Subject: Re: ordered collections
  5. Message-ID: <Btwxq5.MBC@world.std.com>
  6. Date: 1 Sep 92 18:51:41 GMT
  7. Article-I.D.: world.Btwxq5.MBC
  8. References: <cdk.715362552@neptune>
  9. Organization: IntraNet, Inc.
  10. Lines: 24
  11.  
  12. In article <cdk.715362552@neptune> cdk@neptune.dsc.com (Colin Kelley) writes:
  13. >Recently someone posted a question about implementing FIFO queues in a
  14. >relational database.  I'm interested in something even more basic:  ordered
  15. >collections.
  16.  
  17. HAH! I'm glad you asked that - this is my personal favorite reason why
  18. the relational model is a toy (i.e., unhelpful for my real-world needs).
  19.  
  20. The simplest solution is to have an integer ordinal field, and re-order after
  21. every insert. An optimization is to use a rational field to order, and re-order
  22. when one of them runs out of precision.
  23.  
  24. A general solution that doesn't require large-scale reorganization ever is to
  25. assign some unique key to every row and use that as an 'address' to build a 
  26. doubly-linked list via forward and backward 'link' fields. But then you lose
  27. the ability to have the ordering 'visible' to relational operators.
  28.  
  29.  
  30.  
  31.  
  32.  
  33. -- 
  34. Jonathan Edwards                edwards@intranet.com
  35. IntraNet, Inc                    617-527-7020
  36.