Re: Abstract Data Types
Date: Mon, 30 Apr 2001 17:41:18 -0700
Message-ID: <3AEE062E.31525036_at_informix.com>
Mikito Harakiri (nospam_at_newsranger.com) wrote:
> Paul G. Brown wrote:
> >
> > SELECT M.Title, M.Release_Date
> > FROM Movies M, Stars S
> > WHERE S.Name new PersonName ("Bergman", "Ingrid")
> > AND Face_In_Video ( M.Clip, S.Mug_Shot)
> > AND new Circle ( M.Cinema, "10 Miles").Contains( new ST_Point (:X, :Y))
> > AND M.Showing_For::Overlaps ( CURRENT )
> > ORDER BY 2, 1;
> >
> > +--------------+--------+
> > | 'Casablanca' | 1941 |
> > +--------------+--------+
> >
>
> Cool. Is it real Informix sql shell output?
Not quite:
SELECT M.Title, M.Release_Date
FROM Movies M, Stars S
WHERE S.Name = PersonName ("Bergman", "Ingrid")
AND Contains ( ST_Circle ( M.Cinema, Miles_to_Degrees ( 10 ) ),
ST_Point (:X, :Y))
AND Overlaps ( M.Showing_For, CURRENT )
ORDER BY 2, 1;
Runs just fine. (I know of a couple of "face recognition" extenders, more notably
the "Face It!" technology, but as it does not support an indexing method at this
time it would be kind of crummy for this. The query would run, but it would take
it's sweet time. Watch this space. . .)
Note also the use of the functional notation, rather than the object dot notation. I refuse to enter into discussions about which one is "better" and refer all interested readers to comp.lang.lisp for a good thrashing.
> Are you requiring application developer to write custom indexes for Contains and
> Overlaps operators, or you reuse R-tree? How about Face_In_Video, is there
> some well known technique that you can reuse as well?
> In general, is writing custom indexes for abstract datatypes covered by
> SQL-J standard?
No - you use the R-Tree for spatial and temporal overlaps operations.
Indexing Face_In_Video() is an interesting research problem. Note also that in the original query, this is a *join* predicate. Nested looping ain't gonna cut it. There are a number of open ideas in this space. I will get back to you (in a year or two. . .)
Yes and no. You can use Java to implement extensions (read: ADTs). And the methods in your Java classes can be used to specialize a B-Tree (you add a compare()) or an R-Tree (set of support functions). For example, in the second I take a PersonName() Java class and create a SQL ADT that maps to the one in this query. The ST_FooBar() functions are taken from the ESRI SQL DataBlade (which is set up to use the R-Tree) and this language reflects the SQL-3 standard.
In theory, you could implement a complete access method using Java, but I really would not recommend it. A GiST interface will be available in the 9.3 release (Hi Joe!).
For more information, you might consult either (shameless plug alert) my books, Jacque Roy's book, or the forthcoming "Open-Source" book several INFORMIX folk are collaborating on. Look 'em up on http://www.fatbrain.com Received on Tue May 01 2001 - 02:41:18 CEST
