<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
&gt; Er, to be clearer: my goal is for the preload to load everything into the<br>
&gt; cache that the query mechanism might use.<br>
&gt;<br>
&gt; It seems the bucket approach only takes ~10 seconds on the 350k-sized index<br>
&gt; trees vs. ~60-90 seconds. This seems to indicate that less things end up<br>
&gt; being pre-loaded...<br>
<br>
</div></div>I guess I was too subtle before.<br>
<br>
Preloading is a waste of time.  Just use a persistent ZEO cache<br>
of adequate size and be done with it.<br></blockquote><div><br></div><div>Okay. I did that, and I only tried the preloading because it didn&#39;t seem I was getting what I wanted. </div><div><br></div><div>To wit: I ran a simple query and it took a good few minutes. It&#39;s true, after it took a few minutes, it ran instantly, and even after a server restart it only took a few seconds, but I don&#39;t understand why it took a few minutes in the first place. There are only 750k objects in that database, and I gave it a cache object size of 5 million; the packed database .fs is only 400 megabytes, and I gave it a cache byte size of 3000 megabytes. </div>
<div><br></div><div>Then when I change one parameter of the query (to ask for objects with a month of november instead of october), it takes another few minutes... </div><div><br></div><div>Speaking to your point, preloading didn&#39;t seem to help either (I had &#39;preloaded&#39; dozens of times over the past few days and the queries still took forever), but the fact remains: it does not seem unreasonable to want these queries to run instantly from the get-go, given that is the point of indexing in the first place. As it stands now, for certain queries I could probably do better loading each object and filtering it via python because I wouldn&#39;t have to deal with loading the indices in order to run the &#39;fast&#39; query, but this seems to defeat the point of indices entirely, and I&#39;d like to not have to create custom search routines for every separate query. Again, maybe I&#39;m doing something wrong, but I haven&#39;t been able to figure it out yet.</div>
<div><br></div><div>I made a view to display the output of cacheDetailSize like Jeff suggested and I got something like this:</div><div><br></div><div><font size="1" face="courier new, monospace">    db = ...</font></div>
<div><div><font size="1" face="courier new, monospace">    for conn_d in db.cacheDetailSize():</font></div><div><font size="1" face="courier new, monospace">        writer.write(&quot;%(connection)s, size=%(size)s, non-ghost-size=%(ngsize)s\n&quot; % conn_d)</font></div>
</div><div><br></div><div>output:</div><div><pre style="word-wrap:break-word;white-space:pre-wrap">    &lt;Connection at 0684fe90&gt;, size=635683, non-ghost-size=209039
    &lt;Connection at 146c5ad0&gt;, size=3490, non-ghost-size=113</pre></div><div>That is after having run the &#39;preloading&#39;. It seems that when the query takes forever, the non-ghost-size is slowly increasing (~100 objects/second) while the &#39;size&#39; stays the same. Once the query is done after having taken a few minutes, each subsequent run is instant and the ngsize doesn&#39;t grow. My naive question is: it has plenty of RAM, why does it not just load everything into the RAM? </div>
<div><br></div><div>Any suggestions? There must be a way to effectively use indexing with zodb and what I&#39;m doing isn&#39;t working.</div><div><br></div><div>Thanks,</div><div>- Claudiu</div></div>