pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Wray <mwray@hecomm.org>
To: pgsql-admin@postgresql.org
Subject: R-Trees.
Date: Thu, 10 Feb 2005 23:35:25 -0600
Message-ID: <200502102335.25262.mwray@hecomm.org> (raw)

(Please CC me, if you reply as I am out of pocket now and not able to be on 
mailing lists at this time...);

I'm not sure which list I was reading, but I've been looking for info about 
R-Trees, and stumbled across my favourite DB backend's mailing lists...

I've used RTREE based db engines before (Informix) but was unaware of PostGres 
and MySQL implementing RTREE capability until tonight.

While I understand the basic concept of an RTREE. I would like to be pointed 
someplace to get more info on the algorithms of RTREES and how they work, as 
I'd like to implement  something that uses RTREE algorithms, and be able to 
represent a whole record w/ items with values,subvalues,subsubvalues, 
etc...in an object type format. 

(Something that can get a whole record for a customer and break it out into 
all the pieces automagically.. as an example.)


I'm used to doing code like this for parsing data for a customer from an 
RTREE:
(Mixed Pseudocode and perl):
$customer=GETDATA;
$MultivalueMarker="~";
$SubvalueMarker=0007;
$valuemarker=0008;

foreach $customer (@recordlist) {
     @carray=split ($ValueMarker,$customer,10);
	@phonearray=split($SubValueMarker,@carray[7]);
	  foreach $phoneitem (@phonearray) {
		my ($phone,$number)= split($MultiValueMarker,$phoneitem);
		$phonehash{$phone}=$number;
           }
	  @domainarray=split ($SubValueMarker,@carray[8]);
	   @emailarray=split ($MultiValueMarker,@domainarray[2]);

}

And at some point the data is packed and unpacked....
I'd like to hide all that using objects and make it so one could say read in a 
template, and then make access to the data based on names defined in the 
template.

As for an SQL database using Rtrees:
This doesn't seem like good practice for use if one is using SQL to do queries 
with as it isn't structured around this kind of datatype, is there black 
magic going on here that autoguesses joins, etc based on relationship of data 
in the tree?

(When PG first announced Multidimensional support for the db, I didn't believe 
it to be an rtree because of the slowness at which queries occurred, when 
using multivalued data, even in a small database.)  I would hope that pgsql 
would have other ways of handling queries on an rtree. And it may well do 
that now.)






view thread (2+ messages)  latest in thread

Message-ID: <200502102335.25262.mwray@hecomm.org>
Permalink:  ../200502102335.25262.mwray@hecomm.org/
Also on:    postgresql.org/message-id/200502102335.25262.mwray@hecomm.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mwray@hecomm.org
  Subject: Re: R-Trees.
  In-Reply-To: <200502102335.25262.mwray@hecomm.org>
  References: <200502102335.25262.mwray@hecomm.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox