Skip to content

Domain exists method cross joining entire table with Hibernate #14334

@scottlollman

Description

@scottlollman

I've been tracing some performance issues and found an issue with the GormEntity.exists when using Hibernate.

In AbstractHibernateGormStaticApi each call to criteriaQuery.from creates a new query root. The resulting HQL looks like this:

select count(generatedAlias0) 
from SomeDomain as generatedAlias1, 
SomeDomain as generatedAlias0 
where generatedAlias1.id=1L 

It looks like it just needs to have one of the calls to criteriaQuery.from eliminated.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions