As I understand it, a Macro call doesn't necessarily hit the database (but forgive me I could be wrong as I haven't fully investigated that side of things)... I would have been more inclined to think that there is something in the Macro Partial View that is actually hitting the database so I'd start investigating there.
Macro's have a caching option, which you can enable/disabled I believe. But use that with caution.
It seems to be calling the database for the MacroParameters.
As these are per page where the Macro is used and different Macros could be used with different parameters per page it means that it will still need to hit the database per page.
It could then be cached but if you have, for example 1000 blog pages, thats a lot of database hits and then a lot of additional caching.
Check with SQL Profiler into SQL Management Studio wich is the heavy query or task that SQL execute. Maybe the database need some external index or optimize some query.
Are Macros heavy on SQL server requests?
I haven't used Macros much in the past since Umbraco 4 (maybe 6). But a new site that I have taken on has a heavy dependency on Macros.
It doesn't seem very efficient and when I have been using a profiler it is showing many SQL calls per page for the Macro Parameters.
Would I be best to avoid (write out) Macros altogether if I want to make the site more efficient?
Hi Richard,
It's a hard one to answer I think.
I guess it depends what the Macro's are doing.
As I understand it, a Macro call doesn't necessarily hit the database (but forgive me I could be wrong as I haven't fully investigated that side of things)... I would have been more inclined to think that there is something in the Macro Partial View that is actually hitting the database so I'd start investigating there.
Macro's have a caching option, which you can enable/disabled I believe. But use that with caution.
Nik
It seems to be calling the database for the MacroParameters.
As these are per page where the Macro is used and different Macros could be used with different parameters per page it means that it will still need to hit the database per page.
It could then be cached but if you have, for example 1000 blog pages, thats a lot of database hits and then a lot of additional caching.
Hi Richard
Use MiniProfiler to understand what part of the code is using the database the most. Check out the article how to use Miniprofiler - http://jondjones.com/learn-umbraco-cms/umbraco-developers-guide/umbraco-troubleshooting/how-to-debug-your-umbraco-7-website
Thanks,
Alex
Alex, Tried the MiniProfiler but can't get it to display anything at all.
Check with SQL Profiler into SQL Management Studio wich is the heavy query or task that SQL execute. Maybe the database need some external index or optimize some query.
Its not that it needs optimised (maybe that would help). I just want to eliminate all database calls from my front end site to render a page.
is working on a reply...