I connect to the mysql database using the following code:
my $dbh = DBI->connect("DBI:mysql:test:localhost", $user, $pass)
or die $DBI::errstr;
my $sqlQuery = $dbh->prepare($query)
or die "Can't prepare $query: $dbh->errstr\n";
my $rv = $sqlQuery->execute
or die "can't execute the query: $sqlQuery->errstr";
while (my @row= $sqlQuery->fetchrow_array()) {
}
My doubt is that until the moment of my application it interacts with small databases. But when I move this application to a live environment, where the database size can be 100 with GB, what kind of performance problems can this code cause. In fact, what I ask, on the line -
@row= $sqlQuery->fetchrow_array();
Will Perl copy the entire contents of the table and unload it into a variable. If so, would this cause significant performance issues for my application as well as the database server?
source
share