Totara Learn Open Discussions

Dynamic Audience - Optimisation

 
Nevin Butcher
Dynamic Audience - Optimisation
by Nevin Butcher - Wednesday, 14 August 2024, 6:17 PM
 

Hello All


Just a random query that I was pondering - We have several hundred dynamic audiences and I'm looking at if/where/how I can optimise the rule sets as our audience update cron has been known to struggle.


One scenario I'm puzzling over is:


If an audience has the rule "Is enrolled in X course" - Does the system search through all the users in the system to see if they're enrolled OR does it just search via the course to see who is enrolled.


Trying to figure out if the most optimal rule would be "User is part of X org, Account suspended is No, User is enrolled in X course" OR just plainly "User is enrolled in X course"


Thanks in advance, hope that makes sense :-)


Cheers


Nevin

Lee Cooper
Re: Dynamic Audience - Optimisation
by Lee Cooper - Thursday, 15 August 2024, 7:45 AM
Group TotaraGroup TXP Site Administrator

Hi Nevin

I had a conversation with one of our developers about this recently, so let me see if I can find it and get back to you. There are certain rules that are performance heavy, so what you are considering makes perfect sense. Leave it with me and I will get back to you

Thanks

Lee

Lee Cooper
Re: Dynamic Audience - Optimisation
by Lee Cooper - Friday, 16 August 2024, 12:59 AM
Group TotaraGroup TXP Site Administrator

Hi Nevin,

I spoke with the team here who have advised the below…

For the enrolment one, it will filter the system, but it does it in a pretty optimal way at the database level so it's probably not the bottleneck.

The most problematic audience rules are the ones that do 'partial matches' e.g. username or email will match "anything@example.com" or if you search for contains"example.com". And in particular, if you pass a comma separated list i.e. username is cooper, jones, smith etc, it will have to repeat the search for each one. So that's where creating set audiences of users and then including them via an audience rule is much better.

I hope this helps a little

Lee

Nevin Butcher
Re: Dynamic Audience - Optimisation
by Nevin Butcher - Sunday, 18 August 2024, 4:15 PM
 

Hey Lee

That's fantastic - appreciate you tracking that info down for me.

Cheers

Nevin