On May 14, 9:07 pm, "Mislav Marohnić" <[EMAIL PROTECTED]> wrote: > Doesn't that negate the whole idea of having prepared statements in the > database in the first place? I don't think Rails core team would accept the > patch that slows down ActiveRecord just for the sake of using a database > feature (in a wrong way).
Actually, no. One of the problems with quoting string manually is excessive memory usage in Rails. For example, if you're uploading a 1 MB photo to your database, then Rails has to quote a 1 MB string, which is very slow and results in more than 1 MB memory usage because of string overheads. Using prepared statements will remove this problem. And I'm not sure that using prepared statements (and immediately deleting them) really makes things slower. Why would it be? After all, if you're not using prepared statements then the database will have to reparse each statement every time anyway. This will need more benchmarking. The prepared statement caching that I mentioned should be trivial to implement. It's on my todo list. --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] 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 -~----------~----~----~----~------~----~------~--~---
