in reply to Re: Re: DBI prepare_cached VS self cached
in thread DBI prepare_cached VS self cached

Right, the cached statement handle will be returned. Creating a statement handle for an Oracle database normally requires contacting the database server to have it prepare (basically compile and determine an execution plan for) the query. Note that it doesn't say anything about $sth->execute() or fetch() being cached.
  • Comment on Re: Re: Re: DBI prepare_cached VS self cached

Replies are listed 'Best First'.
Re: Re: Re: Re: DBI prepare_cached VS self cached
by inspire22 (Initiate) on Oct 25, 2003 at 05:07 UTC
    Are you sure he wasn't talking about caching the actual prepared statement, versus using the prepare_cached method? I.E. while not caching the data, he can actually store

    $queries{"SELECT .."} = $dbh->prepare("SELECT ..");

    Which is talked about here: http://perl.apache.org/docs/1.0/guide/performance.html#Eliminating_SQL_Statement_Parsing

      Yes, quite sure.

      I created a %CACHE with the select statement as the Key and a Hash representing the columns returned as the %CACHE value.