From: Robert Klemme Date: 2009-09-15T06:11:45+09:00 Subject: Re: Pre-allocate large amount of memory? On 14.09.2009 19:37, Carsten Gehling wrote: > Robert Klemme wrote: >> Maybe it's not such a good idea to read everything in memory. After >> all, retrieving large volumes of data from disk is where RDBMS's >> shine. > > My reason for doing this is simply to avoid multiple sql-queries in a > recursive self-referencing datastructure. Usually this can be avoided by > querying the entire subset of data needed, and manipulate it in memory. > Unfortunately the data in question does not enable me to just query the > subset of data. Is your structure strictly hierarchical (i.e. a tree) or do you need to query part of a graph with cycles? If it is strictly hierarchical there is a solution that works for all RDBMS and in the latter case there are solutions for some RDBMS. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/