Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

[svn:dbd-oracle] r2426 - dbd-oracle/trunk/t
Author: timbo
Date: Wed Jan 18 02:30:46 2006
New Revision: 2426

Modified:
dbd-oracle/trunk/t/55nested.t
Log:
Add (modified version of) nested cursor timing comparison from Biswa Chowdhu
ry.


Modified: dbd-oracle/trunk/t/55nested.t
 ====================
 ====================
 ====================
================
==
--- dbd-oracle/trunk/t/55nested.t	(original)
+++ dbd-oracle/trunk/t/55nested.t	Wed Jan 18 02:30:46 2006
@@ -48,7 +48,6 @@ ok( 1,
FROM all_objects WHERE rownum <= 5
})
);
-#$outer->{TraceLevel} = 3;
ok( 2, $outer->{ora_types}[1] == ORA_RSET);
ok( 3, $outer->execute);
ok( 4, my @row1 = $outer->fetchrow_array);
@@ -66,7 +65,46 @@ ok(14, $dbh->errstr =~ / defunct /);
ok(15, $outer->finish);
ok(16, $dbh->{ActiveKids} == 0);

-$dbh->disconnect;
+
 +###################
 ####################
 ####################
##############
+# Fetch speed test: START
 +###################
 ####################
 ####################
##############
+
+$dbh->{RaiseError} = 1;
+
+sub timed_fetch {
+  my ($rs,$caption) = @_;
+  my $row_count = 0;
+  my $tm_start = DBI::dbi_time();
+  $row_count++ while $rs->fetch;
+  my $elapsed = DBI::dbi_time() - $tm_start;
+  print "Fetched $row_count rows ($caption): $elapsed secs.\n";
+  return $elapsed;
+}
+
 +###################
 ####################
###########
+# regular select
 +###################
 ####################
###########
+my $sql1 = q{
+    SELECT object_name
+    FROM (SELECT object_name FROM all_objects WHERE ROWNUM<=70),
+	 (SELECT           1 FROM all_objects WHERE ROWNUM<=70)
+};
+$outer = $dbh->prepare($sql1);
+$outer->execute();
+my $dur_std =  timed_fetch($outer,'
select');
+
 +###################
 ####################
###########
+# nested cursor
 +###################
 ####################
###########
+$outer = $dbh->prepare("SELECT CURSOR($sql1) FROM DUAL");
+$outer->execute();
+my $ref_csr = $outer->fetchrow_arrayref->[0];
+my $dur_ref =  timed_fetch($ref_csr
,'nested cursor');
+
 +###################
 ####################
 ####################
##############
+# Fetch speed test: END
 +###################
 ####################
 ####################
##############

exit 0;


Report this thread to moderator Post Follow-up to this message
Old Post
timbo@cvs.perl.org
01-18-06 12:24 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

Oracle PERL DBD archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 04:05 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006