<br><br><div class="gmail_quote">On Fri, Feb 19, 2010 at 11:27 PM, Jonathan Gardner <span dir="ltr"><<a href="mailto:jgardner@jonathangardner.net">jgardner@jonathangardner.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On Fri, Feb 19, 2010 at 10:36 PM, krishna <<a href="mailto:krishna.k.0001@gmail.com">krishna.k.0001@gmail.com</a>> wrote:<br>
> I have to manage a couple of dicts with huge dataset (larger than<br>
> feasible with the memory on my system), it basically has a key which<br>
> is a string (actually a tuple converted to a string) and a two item<br>
> list as value, with one element in the list being a count related to<br>
> the key. I have to at the end sort this dictionary by the count.<br>
><br>
> The platform is linux. I am planning to implement it by setting a<br>
> threshold beyond which I write the data into files (3 columns: 'key<br>
> count some_val' ) and later merge those files (I plan to sort the<br>
> individual files by the key column and walk through the files with one<br>
> pointer per file and merge them; I would add up the counts when<br>
> entries from two files match by key) and sorting using the 'sort'<br>
> command. Thus the bottleneck is the 'sort' command.<br>
><br>
> Any suggestions, comments?<br>
><br>
<br>
</div></div>You should be using BDBs or even something like PostgreSQL. The<br>
indexes there will give you the scalability you need. I doubt you will<br>
be able to write anything that will select, update, insert or delete<br>
data better than what BDBs and PostgreSQL can give you.<br>
<font color="#888888"><br></font></blockquote><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><font color="#888888">
--<br>
Jonathan Gardner<br>
<a href="mailto:jgardner@jonathangardner.net">jgardner@jonathangardner.net</a></font></blockquote><div><br>Thank you. I tried BDB, it seems to get very very slow as you scale.   <br><br></div></div>Thank you,<br>Krishna<br>