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