Commit d3e81f5e authored by catch's avatar catch

Issue #2388765 by alexpott: Improve performance of...

Issue #2388765 by alexpott: Improve performance of SqlContentEntityStorage::countFieldData() for large datasets when getting the result as a boolean
parent 82989783
......@@ -1759,7 +1759,11 @@ public function countFieldData($storage_definition, $as_bool = FALSE) {
if ($as_bool) {
$query->range(0, 1);
}
$count = $query->countQuery()->execute()->fetchField();
else {
// Otherwise count the number of rows.
$query = $query->countQuery();
}
$count = $query->execute()->fetchField();
}
return $as_bool ? (bool) $count : (int) $count;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment