<div>hi, some interesting findings done by me...</div>
<div>p.s. i am not an expert, so pls kindly correct me if i am wrong :) </div>
<div> </div>
<div> </div>
<div>//script 1.</div>
<div>use Cache::Memcached;</div>
<div>
<p>$memd = new Cache::Memcached { 'servers' => ['<a href="http://127.0.0.1:11211">127.0.0.1:11211</a>', '<a href="http://127.0.0.1:11212">127.0.0.1:11212</a>'], 'debug' => 0, 'compress_threshold' => 10_000, };</p>
<p>$memd->set("1001001", "sfdjfdjsfsdfu8duf8dhsujsdfjsfdsfhd8sfhsdfd7sfhdsfenwurerefdsfjdnfjdsnfdsuhufsidufhdsuifhuiheu");</p>
<p>my $startTime = time();</p>
<p>for ($count=1; $count<10000; $count++) {<br> my $tmp = $memd->get("1001001");<br>}</p>
<p>my $endTime = time();<br>print $endTime - $startTime;<br>print "\n";</p>
<p>// 13 seconds</p>
<div>//---------------------------------------------------------------------------</div>
<div>//script 2.</div>
<p>use DBI;</p>
<p>my $dsn = 'DBI:mysql:' . "test" . ":" . "<a href="http://127.0.0.1">127.0.0.1</a>";<br>my $dbh = DBI->connect( $dsn, "root", "" );</p>
<p>my $startTime = time();</p>
<p>for ($count=1; $count<10000; $count++) {</p>
<p> my $sth = $dbh->prepare("select lastname from test");<br> $sth->execute();<br> my @data = $sth->fetchrow_array();<br>}</p>
<p>my $endTime = time();<br>print $endTime - $startTime;<br>print "\n";</p>
<p>// 11 seconds<br></p>
<p>//----------------------------------------------------------------------</p>
<p>//MYSQL table</p>
<p>DROP TABLE IF EXISTS `test`;<br>CREATE TABLE `test` (<br> `LastName` varchar(255) default NULL<br>) ENGINE=MyISAM DEFAULT CHARSET=latin1;</p>
<p>INSERT INTO `test` VALUES ('sfdjfdjsfsdfu8duf8dhsujsdfjsfdsfhd8sfhsdfd7sfhdsfenwurerefdsfjdnfjdsnfdsuhufsidufhdsuifhuiheu');<br></p>
<p>//--------------------------------------------------------------------------</p>
<p>seems MySQL is quite efficient in handling simple query? </p>
<p>regards,<br>howa</p>
<p> </p></div>