Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Re: Class::DBI Intro

by salvadors (Pilgrim)
on Aug 01, 2003 at 07:54 UTC ( #279877=note: print w/replies, xml ) Need Help??

in reply to Re: Class::DBI Intro
in thread Class::DBI Intro

The delete method is rather inefficient. When called, Class::DBI will issue one DELETE statement for each row in your table.

Yes. This is a deliberate design decision. The class in question may have explicit behaviours attached to the act of deleting (for example, you can set up triggers at the application level, rather than at the database.) The only way to cause these to be fired is to delete the objects one at a time.

It's fairly trivial to set up your own method to delete from the database in one pass if you're comfortable doing so. Replacing all your SQL is not really Class::DBI's goal. Its job is to remove all the boring trivial repetitive SQL from your application, freeing you up to spend the time writing the more advanced stuff yourself that can't be easily abstracted away.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://279877]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2018-06-20 23:23 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.