Just wondering, but is there any advantage to trying to manually
manage the execution plan cache? I know MSSQL-Server for example
caches the execution-plan of every parameterized Query (anything
executed with the sp_executesql stored-procedure), which means the
majority of ADO and ADO.NET based applications, and no one on that
side of the fence would ever worry about such a thing; the server
manages that cache itself, exactly as it manages what indexes to keep
in memory at any given moment.

So I guess my question is: Is flushing the statements really necessary
or are you just working under an assumption the database (Postgres/
MySQL) will blindly allow it to grow to unreasonable levels?

On May 15, 4:17 am, Hongli Lai <[EMAIL PROTECTED]> wrote:
> Here's an update. I noticed that using prepared statements will indeed
> make MySQL queries a bit slower. The unit tests in an unmodified Rails
> edge source tree took 18 seconds. After adding prepared statements,
> they took 28 seconds. I've been working on optimizing this since
> yesterday evening, and I succeeded.
> Using prepared statements is only advantageous in MySQL if the
> arguments are large (i.e. uploading a large image), so the code will
> now fallback to _not_ using prepared statements if it detects that no
> argument is larger than 32 KB. The unit tests now take 18 seconds
> again, thus eliminating the performance problem entirely. Something
> similar can be implemented in other adapters.
>
> It noticed this comment in activerecord/test/binary_test.rb:
>   # Without using prepared statements, it makes no sense to test
>   # BLOB data with SQL Server, because the length of a statement is
>   # limited to 8KB.
>   #
>   # Without using prepared statements, it makes no sense to test
>   # BLOB data with DB2 or Firebird, because the length of a statement
>   # is limited to 32KB.
> So it does make sense to add support for prepared statements in Rails.


--~--~---------~--~----~------------~-------~--~----~
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