in reply to Re: Query takes 895ms in TOAD but 42s in DBI
in thread Query takes 895ms in TOAD but 42s in DBI

ok, the actual execute() method takes 1 second, it is the fetchrow_array() that is taking the time. How would i go about changing the default DBD::Oracle settings?

TIA - Joe

  • Comment on Re^2: Query takes 895ms in TOAD but 42s in DBI

Replies are listed 'Best First'.
Re^3: Query takes 895ms in TOAD but 42s in DBI
by marto (Cardinal) on Dec 03, 2008 at 10:56 UTC
Re^3: Query takes 895ms in TOAD but 42s in DBI
by kubrat (Scribe) on Dec 03, 2008 at 15:14 UTC
    I don't know what settings the DBD::Oracle module provides but I have seen a mention of RowCache in DBI that you could give a go. Also it would be interesting to test the speed of the different forms of fetch like the bind_columns variant for example :
    $sth_dipp = $dbh_ideas->prepare(q{DECLARE dipp PacProject.dipp_project +_cur; BEGIN pacproject.get_dipp_projects(:dipp); END;}); $sth_dipp->bind_param_inout(":dipp",\$s_dipp_proj,0,{ora_type => ORA_R +SET}); $sth_dipp->execute; my ($name, $code, $RA, $manager); $sth_dipp->bind_columns(\($name, $code, $RA, $manager)); while ( $sth_dipp->fetch ){ $name ||= 'Unknown'; $code ||= 'Unknown'; $RA ||= 'Unknown'; $manager ||= 'Unknown'; print qq|$name,$code,$RA,"$manager"\n|; }
      The bind_columns approach is the fastest. You can see benchmarks on some of this here.
        Hi

        When i try to implement the above code (bind_columns), i get a "DBD::Oracle::st bind_columns failed: Statement has no result columns to bind (perhaps you need to successfully call execute first) [for Statement "DECLARE dipp PacProject.dipp_project_cur; BEGIN pacproject.get_dipp_projects(:dipp); END;" with ParamValues: :dipp=DBI::st=HASH(0x945129c)]".

        I am returning a cursor from my PLSQL. Is it possible to bind columns to a cursor?

        TIA - Joe.