Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: DBI with ORDER BY

by YoungPups (Beadle)
on Mar 10, 2005 at 21:25 UTC ( [id://438426]=note: print w/replies, xml ) Need Help??


in reply to Re: DBI with ORDER BY
in thread DBI with ORDER BY

I just got my code review, and it sounds like it was more of a philosophical objection on his part. He's of the opinion that you should handle sorting in your program rather than make the DB do it. I disagree (pretty strongly), but that is at least a reasonable objection.

Most places I've worked, the machines that hosted our DBs were much beefier than the machines we did processing on, so I always made the database do as much of the work as I could. Plus, it seems to me to be a bit like reinventing the wheel to sort the results of a query in your script when the DB can do it for you, and is specifically set up to optimize such a sort.

Anyway, it sounds like I had just misheard why he was asking other coders to avoid ORDER BY statements.

Replies are listed 'Best First'.
Re^3: DBI with ORDER BY
by punkish (Priest) on Mar 10, 2005 at 22:16 UTC
    I agree with you. In fact, I would say, get the db to do as much of set-based text processing as you can. It not the beefiness of the db servers that I think of -- it is the decades of heavy-duty, focused research on working with sets. Databases are just super at performing those tasks. Just check the query plan for any query -- it is pretty amazing.

    Otoh, dbs are a royal pain in the derierre working with arrays and hashes kinda datasets. Once you get your data, nicely stuffed in an array, Perl can whip through it at close to machine speed (well, pretty much) searching for arbit. patterns and repurposing it as desired.

    Maybe it is time for your code-reviewer to get a code review. ;-)

    --
    when small people start casting long shadows, it is time to go to bed

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-20 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found