Re: deductive databases

From: Christopher Browne <cbbrowne_at_acm.org>
Date: Thu, 12 May 2005 03:31:04 GMT
Message-ID: <Y5Age.33690$B82.990538_at_news20.bellglobal.com>


In the last exciting episode, alex goldman <hello_at_spamm.er> wrote:
> Nilsson's book [1] talks about using first-order logic (and its subsets) as
> the language for deductive databases. The book is 10 years old, and yet,
> AFAIK the expressive power of modern state-of-art database software like
> Oracle and PostgreSQL still falls far behind first-order logic: it
> essentially doesn't have functors or recursion. Does anyone know why?
>
> [1] http://www.ida.liu.se/~ulfni/lpp/

Well, SQL:2003 does define a "WITH" syntax that does allow recursion in a manner that pretty much parallels the LET macro in Lisp. DB2 implements it, and there is a preliminary implementation for PostgreSQL.

Oracle has a "CONNECT BY" construct that allows a rather more limited form of recursion.

None of that even so much as scratches the difference between these systems and Prolog.

The point is more that people don't generally understand logic, and _especially_ the folk for whom it the move from COBOL-based ISAM to the uncertainty of the degree of declarativeness of SQL.

If the fact that cost-based optimizers makes it somewhat uncertain how an SQL processor will evaluate a particular query is disturbing (and, to many, it is), the leap to the greatly less certainty of backtracking is too scary for words.

One genuine problem with "the Prolog way" is that the order in which rules are established will affect outcomes. That's a bit disturbing for all of us...

Let me step back to the ISAM-versus-SQL thing, for a moment; it comes back in the matter of "relationalness."

The people using SQL to store data often don't grasp that there's a difference between expressing various facts as a set of relations and stuffing data into a database like you stuff material into a file.

There is quite a big difference between "relational fact processing" and "stuffing data into a vaguely structured file system."

Oracle Corporation gets more licensing fees out of adding in wacky features that step away from the "orthogonal power" of relational processing in favor of highly attuned extensions that help them tie people to the expensive add-ons.

Parallelling this, MySQL AB has been eminently successful at much the same sort of "vendor lock-in" with low end web applications where they have been able to convince plenty of makers of such applications to write their applications to be specifically attuned to the behaviours of version 3.23 to the point that upgrading to different versions might well be implausible even though it's an ancient six-year old product "outdated" by two *major* subsequent releases (4.0 and 4.1).

This misses, of course, _another_ perspective on things, namely the array perspective. Consider APL... It represents a mathematical notation for describing relationships, and allows some pretty stunning opportunities for speedups when operations can act efficiently on vectors. Kx Systems' kdb+ system particularly provides a mapping between SQL and a form of APL which is evidently astonishingly fast for timeseries databases.

-- 
"cbbrowne","_at_","gmail.com"
http://linuxfinances.info/info/postgresql.html 
Users should cultivate an ability to make the simplest molehill into a
mountain by finding controversial interpretations of innocuous
sounding statements that the sender never intended or imagined.  
-- from the Symbolics Guidelines for Sending Mail
Received on Thu May 12 2005 - 05:31:04 CEST

Original text of this message