mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-22 09:53:35 +02:00
Do not use distinct on table queries.
This should speed up table loading a lot.
This commit is contained in:
parent
9179ea4559
commit
c5d7f0a5b1
3 changed files with 4 additions and 4 deletions
|
@ -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')
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue