mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Improve the efficiency of some queries (#13974)
* Improve the efficiency of some queries Mostly by switching from whereIn to whereIntegerInRaw. This inserts integers directly into the query instead of using placeholders (also escapes them) also remove extra json_encode/json_decode in PingCheck * Fix return types Probably will result in some missing baseline exceptions. * Update PingCheck.php * whitespace
This commit is contained in:
@@ -210,7 +210,7 @@ class Device extends BaseModel
|
||||
|
||||
if ($this->groups->isNotEmpty()) {
|
||||
$query->orWhereHas('deviceGroups', function (Builder $query) {
|
||||
$query->whereIn('alert_schedulables.alert_schedulable_id', $this->groups->pluck('id'));
|
||||
$query->whereIntegerInRaw('alert_schedulables.alert_schedulable_id', $this->groups->pluck('id'));
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user