PDA

View Full Version : Perl or SQL


revloc02c
09-03-2011, 07:07 PM
I have several quests that are using some SQL stored procedures that I wrote, and that got me to thinking about where the better place is to put code. There is logic that I can just as easily put on the Perl side as the SQL, or vice versa, so which would be better? Which requires less processing overhead Perl or SQL? Anyone know?

Tabasco
09-03-2011, 08:03 PM
SQL is going to perform sorting logic faster than pretty much anything else, provided your query isn't doing anything silly and the tables involved are properly keyed and indexed.

If you're really worried about overhead, you might consider making a c++ function with a perl wrapper. The perl interface is great, but if you need to do any heavy lifting, it should probably be done elsewhere.