Skip to content
Prev 1507 / 1559 Next

Parameterised queries

On 02/13/2015 02:53 PM, Paul Gilbert wrote:
It's not exactly R specific, though we are discussing the implementation
in R.

If you bulk load generally you want it to be an atomic commit (all
records or none), and you want it to hold of on doing triggers and
indexes until after the data has made it to the db. Different Dbs have
different performance levels.

In postgres you can compare using the psql copy command vs sending a sql
file with INSERT commands.

More background
http://en.wikipedia.org/wiki/Prepared_statement
http://rosettacode.org/wiki/Parametrized_SQL_statement

Not knowing how you wrote your Perl code, you may have been using
prepared statements. In which case both of your runs remote or local
should of had similar performance. What's being discussed is the
introduction of prepared statements which has not existed for most Db
connectors in R previously.

Having done bulk loads in the 10 GB+ range before I can tell you it
matters a lot.

Thanks,
Alex