[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



So you can't just pull the data out of the database whenever you want?

And when you do, you want to move this data into perl as quickly as 
possible and worry about access speed later?

If using DBI, I'd be tempted to just dump the results into a file with 
something like:

	$rows = $sth->dump_results($maxlen, $lsep, $fsep, $fh);

But I don't know how efficient that is, and the man page doesn't 
recommend it for data transfer applications.  Hrmph.

fetchrow_arrayref is supposed to be the fastest access method, but you 
can't keep the reference so I don't see what it buys over 
fetchrow_array.  If you want to store everything as delimited strings:

	while ( @results = $sth->fetchrow_array ) {
		$userid = pop @results;
		$email = pop @results;
		push @{ $user_data{$userid} }, join("|", at results);
		if (! defined $user_email{$userid}) {
			$user_email{$userid} = $email;
		}
	}

Probably faster just to keep pushing arrays rather than concatenate into 
strings.

		push @{ $users{$userid} }, @results;

But then retrieval is a little more complicated.

Is this the type of stuff you're looking for?  I don't know perl's 
object oriented stuff yet.

-- Jason


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="01213" href="msg01213.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="01209" href="msg01209.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg01211.html">[ale] Organizing data</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg01213.html">[ale] Organizing data</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg01211.html">[ale] Organizing data</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg01213.html">[ale] Organizing data</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#01212"><strong>Date</strong></a></li>
<li><a href="threads.html#01212"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>