[Proposal] Schema cache dump - #5162
Conversation
|
I like this idea, but can we change a few things? First, can we just implement schema_cache.connection.tables.each do |table|
schema_cache.populate(table)
endMaybe not a I have another idea that is related to this: can we enable schema caching by default? We can use the migration version to determine if the cache should be expired. Maybe add a Anyway, I really like this feature. |
|
Thank you for comment ! I'll improve the implement :) |
|
Hi @tenderlove Done! |
[Proposal] Schema cache dump
|
Can you provide some benchmarks for this optimization? How much does it actually speed things up? |
|
I'll provide it, but I've many works during this week. Please, just wait a moment a few days. |
|
Sorry for keeping you waiting for this reply. I tested about this performance. ・building environment steps In my experience on Oracle, the queries to data dictionary were very slow when having many data. I'll try to research a little more. |
In my experience, if we had many models (ex. one hundred), Rails boot was slowly.
According to production log, it seems that AR's schema data loading is slowly especially.
Thus I've implemented
schema cache dumping. Please review it.I guess this implementation has many fixing point ;)
Usage: