Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: Object Oriented Pattern help

by arturo (Vicar)
on May 14, 2001 at 01:08 UTC ( [id://80102]=note: print w/replies, xml ) Need Help??


in reply to Re: Object Oriented Pattern help
in thread Object Oriented Pattern help

I have never, ever benchmarked this, but prepare_cached1 should get you increased performance, especially if you're using your queries a lot.

In other words, what repson said =)

1"the statement handle returned will be stored in a hash associated with the `$dbh'. If another call is made to `prepare_cached' with the same `$statement' and `%attr' values, then the corresponding cached `$sth' will be returned without contacting the database server" from the DBI documentation.

perl -e 'print "How sweet does a rose smell? "; chomp $n = <STDIN>; $r +ose = "smells sweet to degree $n"; *other_name = *rose; print "$other +_name\n"'

Replies are listed 'Best First'.
Re: Re: Re: Object Oriented Pattern help
by blue_cowdawg (Monsignor) on May 15, 2001 at 00:10 UTC

    As I said in my write up there is a lot more that can be done with the code that I presented. For instance, how about having just one DBH for the module as a whole? This way the first instantiation of an object declared in the .PM would make a connection and that connection would be used until nobody cared any more.

    I am not always convinced that fetchrow_hashref is all that efficient. In fact in the DBI man page it says that it isn't.

    One cat. Many ways to skin it and only that cat objects to how it is skinned...

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Peter L. Berghold --- Peter@Berghold.Net "Those who fail to learn from history are condemned to repeat it."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://80102]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-16 13:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found