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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Sql querie caching


Go to End


3 Posts   1375 Views

Avatar
martimiz

Forum Moderator, 1391 Posts

7 November 2008 at 9:27am

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...)

Avatar
martimiz

Forum Moderator, 1391 Posts

7 November 2008 at 11:44pm

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.

Avatar
martimiz

Forum Moderator, 1391 Posts

8 November 2008 at 1:14am

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... :)