diff --git a/src/DataTables/AttachmentDataTable.php b/src/DataTables/AttachmentDataTable.php index 1ac542f7..91439a2d 100644 --- a/src/DataTables/AttachmentDataTable.php +++ b/src/DataTables/AttachmentDataTable.php @@ -226,7 +226,7 @@ final class AttachmentDataTable implements DataTableTypeInterface private function getQuery(QueryBuilder $builder): void { - $builder->distinct()->select('attachment') + $builder->select('attachment') ->addSelect('attachment_type') //->addSelect('element') ->from(Attachment::class, 'attachment') diff --git a/src/DataTables/LogDataTable.php b/src/DataTables/LogDataTable.php index 37c0ba13..8842ac3a 100644 --- a/src/DataTables/LogDataTable.php +++ b/src/DataTables/LogDataTable.php @@ -297,7 +297,7 @@ class LogDataTable implements DataTableTypeInterface protected function getQuery(QueryBuilder $builder, array $options): void { - $builder->distinct()->select('log') + $builder->select('log') ->addSelect('user') ->from(AbstractLogEntry::class, 'log') ->leftJoin('log.user', 'user'); diff --git a/src/DataTables/PartsDataTable.php b/src/DataTables/PartsDataTable.php index eae7cb6b..16f530dd 100644 --- a/src/DataTables/PartsDataTable.php +++ b/src/DataTables/PartsDataTable.php @@ -292,8 +292,8 @@ final class PartsDataTable implements DataTableTypeInterface private function getQuery(QueryBuilder $builder): void { - - $builder->distinct()->select('part') + //Distinct is very slow here, do not add this here (also I think this is not needed here, as the id column is always distinct) + $builder->select('part') ->addSelect('category') ->addSelect('footprint') ->addSelect('manufacturer')