storing large graphs in postgres

From: "Taher H(dot) Haveliwala" <taherh24(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: storing large graphs in postgres
Date: 2001-09-06 05:36:05
Message-ID: 20010906053605.96680.qmail@web13007.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I need to store very large graphs structures in
postgres. The graphs are close to 20GB when in
flatfile format. I first tried using an adjacency
list representation, i.e.,

graph (source INT8 PRIMARY KEY, dest INT8[]);

but operating on the array type seems a bit
inflexible. I took a look at the contrib/array stuff
as suggested in a previous post, but it seems like
that only allows for boolean predicates on the array.
I.e., I would like to be able to say 'return all nodes
within distance two from x' using purely sql. Of
course I could use an edge-list format:

graph (source INT8, dest INT8);

but this takes up almost double the space (which is
painful, given that the original input is close to
20GB).

Any way to get richer queries on array types, or some
other efficient way to store large graphs?

I suppose some python glue, making multiple db calls,
would do the trick, but it would be nicer if postgres
could take care of it all.

Thanks
Taher

__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2001-09-06 05:40:43 Re: CREATE USER vs. createuser
Previous Message Tom Lane 2001-09-06 05:07:12 Re: index naming conventions