From: David Vallner Date: 2006-10-08T23:35:34+09:00 Subject: Re: binding parameters in ruby/postres queries --------------enig1887BB0C02500093A30A44B9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable larry wrote: > I'm using the postgres library and trying to improve the performance of= > a database query that gets repeated many (~1 million) times. >=20 A prepared statement might be a better optimisation than using bind params. Of course, prepared statements do require the use of argument placeholders, so you still have to do that code conversion. Also, you should use bind parameters irregardless of performance to avoid SQL injection. The DB driver author probably took care of escaping dangerous characters in his code, no point in doing it twice. David Vallner --------------enig1887BB0C02500093A30A44B9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFKQy0y6MhrS8astoRAhREAJ9/+LbWWi+EFF49yHd5PeUVS4eziACfTrH6 AWiIdWDBXKQpepy+lfkF/Yw= =IkvC -----END PGP SIGNATURE----- --------------enig1887BB0C02500093A30A44B9--