On Sun, Apr 12, 2009 at 8:00 AM, rogerdpack <[email protected]> wrote: > >> > 3) don't regenerate query plans every time [cache them if possible]. >> >> > 5) Avoid re-generating sql escaped copies of each column name for >> > tables. Cache the sql escaped column names. >> >> > 6) LRU cache all sql-escaped data [?] >> >> I attempted this 2-3 years ago with my work on prepared statements for >> ActiveRecord. I did not measure any performance gains. > > I wonder if tying it in with "real" prepared statements would help. > Did they?
The difference here depends on the database and how its optimiser works. I believe the last time we looked at it there was no difference on mysql, slightly negative impact on postgres (the optimiser didn't know the types of the variables so couldn't use indexes) and *major* improvements to oracle. So it's not a straight up and down win, however if you wanted to spend some time tidying up the query generation to make this possible, that'd be neat. > Hmm...perhaps what I was remembering was that it was recalculating the > filters per action once per request [?] Sorry it's been awhile :) Filters are constant time as far as I know too. I'd be surprised if something's slipped in to change that as people would probably have noticed :) > -=r > > > -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
