One thing that I see, is it seems you're running a search over the current timeframe multiple times. It might be more efficient if you only iterated over each timeframe once... You'll want to play with the job inspector to evaluate if these options would be more efficient or not.
These are three options I came up with that you may want to look into:
index=queues sourcetype="jms:queues" "Queues.name"="road.sa*" ((earliest=-5m latest=now) OR (earliest=-1h-5m latest=-1h) OR (earliest=-7d-5m latest=-7d))
| eval timeframe=case(_time>=relative_time(now(),"-5m"),"c", _time>=relative_time(now(),"-1h-5m"),"p1h",1=1,"p7d")
| chart max("Queues.pendingMessageCount") over "Queues.name" by timeframe
| eval onehr_growth=round((c-p1h)/p1h*100,2),sevenday_growth=round((c-p7d)/p7d*100,2)
| where onehr_growth>300 AND sevenday_growth>300
| table "Queues.name",c,p1h,onehr_growth,p7d,sevenday_growth
The above would run a search across the time range of [-7d-5m, now] , and filters based on _time...
| multisearch
[search index=queues sourcetype="jms:queues" "Queues.name"="road.sa*" (earliest=-5m latest=now) | eval timeframe="c" | fields "Queues.pendingMessageCount","Queues.name",timeframe ]
[search index=queues sourcetype="jms:queues" "Queues.name"="road.sa*" (earliest=-1h-5m latest=-1h) | eval timeframe="p1h" | fields "Queues.pendingMessageCount","Queues.name",timeframe]
[search index=queues sourcetype="jms:queues" "Queues.name"="road.sa*" (earliest=-7d-5m latest=-7d) | eval timeframe="p7d" | fields "Queues.pendingMessageCount","Queues.name",timeframe]
| chart max("Queues.pendingMessageCount") over "Queues.name" by timeframe
| eval onehr_growth=round((c-p1h)/p1h*100,2),sevenday_growth=round((c-p7d)/p7d*100,2)
| where onehr_growth>300 AND sevenday_growth>300
| table "Queues.name",c,p1h,onehr_growth,p7d,sevenday_growth
This one is similar to the previous one, but instead of searching the entire timeframe, uses multisearch to limit the timeranges being searched.
index=queues sourcetype="jms:queues" "Queues.name"="road.sa*" (earliest=-5m latest=now) | eval timeframe="c" | stats max("Queues.pendingMessageCount") as mc by "Queues.name", timeframe
| append [search index=queues sourcetype="jms:queues" "Queues.name"="road.sa*" (earliest=-1h-5m latest=-1h) | eval timeframe="p1h" | stats max("Queues.pendingMessageCount") as mc by "Queues.name", timeframe]
| append [search index=queues sourcetype="jms:queues" "Queues.name"="road.sa*" (earliest=-7d-5m latest=-7d) | eval timeframe="p7d" | stats max("Queues.pendingMessageCount") as mc by "Queues.name", timeframe]
| xyseries "Queues.name" timeframe mc
| eval onehr_growth=round((c-p1h)/p1h*100,2),sevenday_growth=round((c-p7d)/p7d*100,2)
| where onehr_growth>300 AND sevenday_growth>300
| table "Queues.name",c,p1h,onehr_growth,p7d,sevenday_growth
This one is the closest to yours, instead of using join, using append to gather the independent sets of data, and then using xyseries to combine the statistics from all three.
... View more