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

Re: Is there a more efficient way?

by mzedeler (Pilgrim)
on Jul 29, 2009 at 21:08 UTC ( [id://784376]=note: print w/replies, xml ) Need Help??


in reply to Is there a more efficient way?

There is a one-to-many relationship between vials(block_id) and blocks(id), but your code doesn't seem to use it in any way. If there are many rows in vials for each row in blocks, you have the opportunity to optimize away many of the INSERT followed by SELECT on the blocks table. Storing the names (pluralisation is really confusing here) and id pairs in a hash will definately speed things up.

Also, most databases with autonumbering offers a special function for retrieving the number which should perform better than doing a SELECT to find the latest inserted id. This will especially help if the names column isn't indexed.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-03-19 07:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found