Le mardi 3 janvier 2012 à 15:27, Olek Poplavsky a écrit :
> Still, this query seems to create lots of strings and hashes in > memory. It turned out that postgres driver returns back rows as hashes > (sure this is not a surprise to you, Jeremy). Therefore, for each row > it creates new Hash object (waste in this degenerate case of one > column per row), and this Hash object contains key-value pairs as > field-name-to-field-value. Field name is a string, and therefore is > repeated for each and every row, generating more wasted memory. > If your query has only a single column, you can use select_map(:column) to return an Array of values, rather than an Array of Hash instances. Hope that helps! François Beausoleil http://blog.teksol.info/ -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
