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

  1. Path: sparky!uunet!cimshop!davidm
  2. From: davidm@consilium.com (David S. Masterson)
  3. Newsgroups: comp.databases.theory
  4. Subject: Re: ordered collections
  5. Message-ID: <DAVIDM.92Sep2112813@consilium.com>
  6. Date: 2 Sep 92 18:28:13 GMT
  7. References: <cdk.715362552@neptune>
  8. Sender: root@cimshop.UUCP
  9. Organization: Consilium Inc., Mountain View, California
  10. Lines: 25
  11. In-reply-to: cdk@neptune.dsc.com's message of 1 Sep 92 15:49:12 GMT
  12. X-Posting-Software: GNUS 3.13  [ NNTP-based News Reader for GNU Emacs ]
  13.  
  14. >>>>> On 1 Sep 92 15:49:12 GMT, cdk@neptune.dsc.com (Colin Kelley) said:
  15.  
  16. > Is there a standard way to implement ordered collections in a relational
  17. > database that would allow for random insertion?  You could always have a
  18. > sequence number field to remember the ordering, but if you want random
  19. > insertion, you may run out of bits in this sequence number and not be able
  20. > to insert a new entry between two others.
  21.  
  22. Well, I don't think there is a standard, but here's one way.
  23.  
  24. 1. Make the primary key be (sequence_number, current_date).
  25. 2. Generate a new sequence_number for additions to the end of the collection.
  26. 3. Insertion anywhere else uses the sequence_number of preceding item.
  27.  
  28. --
  29. ====================================================================
  30. David Masterson                    Consilium, Inc.
  31. (415) 691-6311                    640 Clyde Ct.
  32. davidm@consilium.com                Mtn. View, CA  94043
  33. ====================================================================
  34. Trying to shoot yourself in the foot in:
  35. CLIPPER:  You grab a bullet, get ready to insert it in the gun so that you 
  36.         can shoot yourself in the foot, and discover that the gun that the 
  37.         bullet fits has not yet been built, but should be arriving in the mail
  38.         _REAL_SOON_NOW_.  <rboatright>
  39.