Schema

David Merrill dmerrill@lupercalia.net
Tue, 12 Dec 2000 22:18:26 -0500


On Wed, Dec 13, 2000 at 01:41:41AM +0000, Al Snell wrote:
> On Tue, 12 Dec 2000, Dave Peticolas wrote:
> 
> > Yes, if possible, we should store numbers as 64-bit ints. It is also
> > possible that in the db we can just dispense with the denominators
> > in splits all together. This is something we need to design carefully,
> > as some engine assumptions may need to be changed (more on that below).
> 
> WARNING: If values are stored as pairs of fields in the database:
> 
> 1) It's messy

Define 'messy'.

> 2) We would need to implement all of the rational arithmetic algorithms in
> SQL, which is far from trivial, if we were to use the database as more
> than a dumb data store and do the maths in our code...

I am thinking in terms of what is most robust and what can be most
effectively constrained and validated at the database level. It does
not have to be presented to the engine in the same form in which it is
physically stored.

We could present the 2 and 3 (integers) as a string in the form of
'2/3' to the engine.

As to whether or not to implement the math at the database layer, it
is way too early in the design of this creature to decide that. I'm
still working out the physical layer of the database. We haven't even
started to work out the interface.

-- 
Dr. David C. Merrill                     http://www.lupercalia.net
Linux Documentation Project                dmerrill@lupercalia.net
Collection Editor & Coordinator            http://www.linuxdoc.org
                                       Finger me for my public key

Skinner's Constant (or Flannagan's Finagling Factor):
	That quantity which, when multiplied by, divided by, added to,
	or subtracted from the answer you got, gives you the answer you
	should have gotten.