Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: dbi: moving big data among databases (prepared statements)

by Anonymous Monk
on Jun 16, 2018 at 19:00 UTC ( [id://1216791]=note: print w/replies, xml ) Need Help??


in reply to Re: dbi: moving big data among databases (prepared statements)
in thread dbi: moving big data among databases (prepared statements)

Following up: Every time your 'select *' gets compiled, the DB has to query the metadata to expand the '*'. A smart database will cache this information, but the work still has to be done. If it's a lot of data and a slow link, a colleague and I found that using prepared statements (prepare_cached(), actually) reduced a database query that took more than a day (to move 24 hours' data) to one that took an hour or so.

There is another reason to use prepared queries: they are resistant to SQL injection attacks. I would post a link, but Perl Monks censored it. Google "Bobby Tables" for what I mean.

  • Comment on Re^2: dbi: moving big data among databases (prepared statements)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-25 13:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found