Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Basic Perl trumps DBI? Or my poor DB design?

by radiantmatrix (Parson)
on Oct 24, 2004 at 23:27 UTC ( [id://402101]=note: print w/replies, xml ) Need Help??


in reply to Basic Perl trumps DBI? Or my poor DB design?

It's entirely possible that for a given application file access is faster than DBI -- after all, an RDMBS stores its data in files anyway. The real strength of an RDBMS is in the 'R': Relational.

While linear selects are probably faster if you can hand-optimize your file access with a Perl script, an RDBMS shines with non-linear data. With proper indexes, an RDBMS can return results for fairly complicated relationship queries incredibly quickly.

Of course, you could code that functionality for your specific queries yourself; indexing and optimizing for a specific set of queries isn't terribly difficult. But, the RDBMS can be maintained much more easily -- it's optimizations won't fall apart when you add a new query or change an existing one.

If speed truly is everything, then you probably are best off hand-coding a select routine; but if anything else is a consideration, you're probably best to see what optimization you can do with your RDBMS.

radiantmatrix
require General::Disclaimer;
"Users are evil. All users are evil. Do not trust them. Perl specifically offers the -T switch because it knows users are evil." - japhy
  • Comment on Re: Basic Perl trumps DBI? Or my poor DB design?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-18 02:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found