Has anyone looked into having ActiveRecord use Oracle bind vars? I don''t know if the same concept is supported in other dbs, but Oracle''s OCI driver supports late binding with dramatically improved performance. I did a quick test to confirm that I could expect the same performance improvement through the Ruby OCI8 driver, and in a simple test it looks to be a 5x improvement. $ ruby oci_test.rb user system total real dynamic sql: 8.000000 0.870000 8.870000 (429.277514) bind vars: 12.530000 0.930000 13.460000 ( 82.228332) Not likely to be noticed in a small scale app that''s just got a handful of queries or DML per request. But our site provides an API through which folks manage hundreds of thousands of database rows, so this adds up quickly. Looks like I''d need to replace the call to AR::Base#sanitize_sql, which currently does the condition substitution, and let the OCI connection handle that instead. So, has anyone looked at this idea? Does a similar concept apply with other dbs? ----- MY TEST APP ------ require ''oci8'' require ''benchmark'' conn = OCI8.new "user", "pass", "db" n = 100000 Benchmark.bm do |x| x.report("dynamic sql:") do for i in 1..n sql = "insert into test_temp values (#{i})" conn.exec sql end conn.commit end x.report("bind vars:") do sql = "insert into test_temp values (:i)" for i in 1..n conn.exec sql, i end conn.commit end end