Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: VVP:Faster DBI'ing?

by krazken (Scribe)
on Mar 12, 2002 at 16:07 UTC ( [id://151138]=note: print w/replies, xml ) Need Help??


in reply to VVP:Faster DBI'ing?

I don't think all of your code got in here. Where did the
@old
come from? Also, make sure that you have indexes on your join fields. It looks like you are joining on one thing for one query for the first on and something different for the second one. Is this correct? Just from an efficiency standpoint, your code will run slower during that block of code because you are doing 2 exact comparisons and one date range. You might try creating a view before hand that has the date range already in it, then you can just query the view, and you won't have to rummage through the whole table looking for the information. Another way would be to run the first query as is, then run the second one without the ccode and number check, and then check the results once you get it all in memory against what you are looking for. Also, move your $db->prepare outside of your for loop. Since that query is static, there is no need to redeclare it every time. You will eat up the database SGA in a hurry!!!! Look at bind variables with DBI to get around the SGA/PGA stuff. Hope this helps you get started cheers! krazken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://151138]
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: (2)
As of 2024-05-26 17:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found