mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-27 20:28:54 +02:00
Use a much faster query to retrieve the total number of rows in datatables
This should increase performance on part tables
This commit is contained in:
parent
2b65926865
commit
b176cb1ae1
1 changed files with 3 additions and 0 deletions
|
@ -208,6 +208,9 @@ final class PartsDataTable implements DataTableTypeInterface
|
||||||
'detail_query' => $this->getDetailQuery(...),
|
'detail_query' => $this->getDetailQuery(...),
|
||||||
'entity' => Part::class,
|
'entity' => Part::class,
|
||||||
'hydrate' => Query::HYDRATE_OBJECT,
|
'hydrate' => Query::HYDRATE_OBJECT,
|
||||||
|
//Use the simple total query, as we just want to get the total number of parts without any conditions
|
||||||
|
//For this the normal query would be pretty slow
|
||||||
|
'simple_total_query' => true,
|
||||||
'criteria' => [
|
'criteria' => [
|
||||||
function (QueryBuilder $builder) use ($options): void {
|
function (QueryBuilder $builder) use ($options): void {
|
||||||
$this->buildCriteria($builder, $options);
|
$this->buildCriteria($builder, $options);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue