Skip to content

Slow query due to subquery wrapping #450

@eywalker

Description

@eywalker

When performing something like the following:

(rel & 'val = x').fetch('KEY')

where val is an attribute not in the primary key, then under the hood, DJ will have to wrap the relation into a subquery because you cannot restrict by a field that is not "selected" (as far I know). However, when the query contains large blob fields, this wrapping with a subquery proves to be extremely slow. Interestingly, it would be much faster if we would simply fetch all non blob attributes and then throw away undesired attributes because there is no subquery wrapping. This is precisely what the preview and repr does and prove to be an efficient query such that often preview works with no issue but doing fetch(dj.key) hangs up.

Metadata

Metadata

Labels

enhancementIndicates new improvements

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions