Subject: Re: POSTGRES Append Performance

From: Mike Olson <[email-masked]>
Date: Fri, 13 Jan 95 07:48:12 -0800

[email-masked] (Kai Petzke) writes:

> > 	I am evaluating version 4.2 of POSTGRES as a database tool to
> > provide persistent storage of directed graphs.  The test program adds
> > one node which requires 17 append operations against an empty database.
> > Each instance has less than 100 bytes.  The program takes 10 seconds
> > elapsed time to execute.  Adding ten nodes takes 20 seconds.  Is this
> > "normal" performance for POSTGRES?  Does anyone have any suggestions to
> > improve performance? Is anyone using POSTGRES to support interactive
> > applications.
> 
> If you want better update performance for multiple tuples, use the 
> "copy in" function.  Here, the parsing is done only once for the
> complete set, not once for every datum.

more to the point, if you're representing a digraph as a set of rows,
you're not really using the full power of postgres.  that's the way
to do it in oracle or sybase, since those system don't let you define
new types or operations on them.

in postgres, you can create a new data type, digraph_t, that manages
an arbitrarily large graph stored in a large object.  you can write
recursive traversal functions on that data type to compute shortest
path, reachability, and anything else you want.

if you do this, you will get wildly better performance -- first, because
the representation of a graph is compact and can be optimized for
traversal, and second because the server can run recursive traversal
functions itself -- it doesn't need to ship graphs over the network
to the client for consideration.
					mike

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "[email-masked]".
   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/