Return-Path: postarch
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA00718; Mon, 2 Dec 91 15:02:45 -0800
Message-Id: <9112022302.AA00718@postgres.Berkeley.EDU>
From: postarch (Postgres Mailing Archive)
Subject: Re: rectangle intersection
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
In-Reply-To: Your message of "Fri, 29 Nov 91 06:35:20 PST."
             <9111291435.AA07276@postgres.Berkeley.EDU> 
Date: Mon, 02 Dec 91 14:28:18 PST

In message <9111291435.AA07276@postgres.Berkeley.EDU> you write:
> Can I perform the following operation in Postgres using any possible 
> mechanism (e.g., using ADTs, etc) or any equivalent syntax?
> 
> 	attr1 intersects attr2 
> 
> where attr1 represents boxes indexed by an R-tree, and attr2 represents 
> another set of boxes, also indexed by another R-tree?

Some potentially interesting box operators are as follows:

 operator       function        description
 --------       --------        -----------
 box1 << box2	box_left      - box1 is entirely to the left of box2
 box1 &< box2	box_overleft  - box1 is to the left of or overlaps box2
 box1 &> box2	box_overright - box1 is to the right of or overlaps box2
 box1 >> box2	box_right     - box1 is entirely to the right of box2
 box1 @  box2	box_contained - box1 is contained by box2
 box1 ~  box2	box_contain   - box1 contains box2
 box1 ~= box2	box_same      - box1 is exactly the same as box2
 box1 && box2	box_overlap   - box1 and box2 overlap


These comprise the operator class for boxes in rtree indices. An example
of the overlap operator with rtree indices is given in the video demo.


Jeff Meredith
mer@postgres.berkeley.edu
