my $statement = 'select a.foo, b.bar from local a, remote@my_database_link b where a.baz = b.baz (+) and a.parm1 = 1 and b.parm2 = 2'; my $ary_ref = $dbhandle->selectall_arrayref($statement); # this executes in less than a second $statement = 'select a.foo, b.bar from local a, remote@my_database_link b where a.baz = b.baz (+) and a.parm1 = ? and b.parm2 = ?'; my $sth = $dbhandle->prepare($statement); my $rv = $sth->execute(1,2); # this takes 25+ seconds to execute $ary_ref = $sth->fetchall_arrayref(); # this takes milliseconds