For interoperability with existing data, we run Rails with Oracle.
However, Rails doesn't support bind variables with Oracle, which are
critical for achieving good performance at high scale.
Can anyone say ActiveRecord will support bind variables on Oracle?
In the meanwhile, my coworker Ray Fortna has developed fairly clean
workaround; there is a session setting in Oracle which will cause
Oracle to automatically turn all literals into bind variables. This is
not optimal since it can lead to overbinding, but in the majority of
apps it is a significant improvement, and applying this at the DB level
makes it very low risk in terms of correctness. (For us, it cut the
CPU usage to 1/3 of the previous value.)
The following code updates the Oracle connection class to set cursor
sharing to force in the session, which converts literals to bind