
Prepared statements, database driver quoting
Reported by senotrusov | April 15th, 2008 @ 11:00 AM
We can gain significant performance boost using prepared statements.
dbconn = SQLite3::Database.new(filename)
insert = dbconn.prepare "INSERT INTO records (foo, bar) VALUES (?, ?)"
insert.execute "foo", "bar"
insert.execute "qux", "oups"
So, the benefits are:
don't parse query on every request,
cache query execution plan,
do string quoting internally by driver or even don't do it at all (depending on database and access protocol).
If you store files in database, ruby's speed of string quoting can be noticeably slow. On some databases like Oracle the parsing and building of query execution plan is an expensive operation.
Any plans to implement this?
Comments and changes to this ticket
-
Dan Kubb (dkubb) April 15th, 2008 @ 10:38 AM
- Milestone cleared.
This is something Sam and I have spoken about, and something I definitely want added too. I don't know for sure if it will be ready in time for 0.9.0, but I'm going to put it into that milestone so it's at least on the radar.
-
-
Dan Kubb (dkubb) December 5th, 2008 @ 02:46 AM
- Tag set to suggestion
-
Dan Kubb (dkubb) December 5th, 2008 @ 03:05 AM
- State changed from hold to not-applicable
Marking this as not-applicable, as per the following:
http://datamapper.lighthouseapp....
In addition to the above reason, this is actually something we are working on, and is part of our Roadmap, so there's no need to have it in LH as a TODO item.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »