On 5/14/07, Hongli Lai <[EMAIL PROTECTED]> wrote:
>
>
> The use of prepared statements in MySQL/PostgreSQL will
> completely replace the argument escaping stuff.


So, every query ever issued will become a prepared statement. Isn't this
going to lead to unnecessary overhead? I mean, there are *a lot* of various
SELECT statements generated by even a simple Rails application. Does it
really make sense to prepare every one of them? Having backends cache the
execution plan for rare SELECTs can possibly have undesirable overhead.

Also, how will ActiveRecord know how to reuse these statements? For example:

  a = Author.find(1)
  post = Author.posts.first
  post.author

The first and the last query are different to AR, yet they take a same shape
("SELECT * FROM authors WHERE authors.id = ?") and can both be represented
by a single prepared statement. With your solution, will AR know how to
reuse the prepared statement in different places, or will it try to prepare
it twice?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to