Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.


Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Sql querie caching


3 Posts   995 Views


7 November 2008 at 9:27am Forum Moderator, 1091 Posts

Looking for an error in one of my scripts I made SiverStripe print out all its querys while loading the CMS. That's how I stumbled upon the fact that The CMS fires large groups of queries, that are in fact equal.

It says in the documentation that sql queries are cached. I was wondering - does this mean that SilverStripe itself stores the results somewhere, or does it depend on the MySQL Server cache? (I'm sorry - I don't really know if this is the right place for this question...)


7 November 2008 at 11:44pm Forum Moderator, 1091 Posts

First of all we want you to know that we really appreciate SilverStripe, we like the straight OO setup, the friendlyness of the userinterface and the ease with which you can customize and adapt :-) But for us this is still a serious topic.

After finishing part 2 of the tutorial, we found that the cms seems to be calling Member::currentUser() 99 times on login, each call resulting in three sql queries, that are the same for each call. A smaller amount of repeated calls occurs on the Live site. We fear this might slow down the application as well as increase the server load. So please inform if we've got this all wrong - in which case we apologize. We'll gladly provide any info needed.


8 November 2008 at 1:14am Forum Moderator, 1091 Posts

OK, found your note in the Permissions class stating that this is a low priority issue since it happens only once every session. The number of calls get fewer after that. Guess we'll have to wait a bit... :)