Re: theory and practice: ying and yang

From: DBMS_Plumber <paul_geoffrey_brown_at_yahoo.com>
Date: 27 May 2005 11:04:13 -0700
Message-ID: <1117217053.299526.38970_at_z14g2000cwz.googlegroups.com>


Which is a big difference between the MS Yukon of 2005 and Postgres of 1995.

In Postgres (and Illustra / Informix IDS and Oracle (IIRC)) you define a 'comparison' operator. In Yukon (and DB2) you define casts from the domain to a bit-ordered, serialized representation.

The advantage of the cast-to-bit-ordered approach is efficiency. The engine calls the cast once, and then the rest of its machinery takes over. Plus the bit-ordering lets you use a number of 'slick tricks' like radix sorts and the like.

The advantage of the implement-the-function(s) approach is completeness. Consider a rational number. You can approximate rationals with double precision representations, but successive operations using doubles leads to numerical instability. You can order and index rational numbers in Postgres, but not in Yukon.

In addition there are domains which do not lend themselves to ordering at all. Graphs, for example. Or spatial domains like polygons. Being unorderable such domains can't be indexed particularly efficiently using B-Trees, but certain predicates can be accellerated with other access methods. Received on Fri May 27 2005 - 20:04:13 CEST

Original text of this message