Skip to content

Optimize JdbcBasePersistenceImpl.listEntities #2352

@XN137

Description

@XN137

Is your feature request related to a problem? Please describe.

in #2317 a TODO got added to the jdbc persistence implementation:

@Nonnull
@Override
public Page<EntityNameLookupRecord> listEntities(
@Nonnull PolarisCallContext callCtx,
long catalogId,
long parentId,
@Nonnull PolarisEntityType entityType,
@Nonnull PolarisEntitySubType entitySubType,
@Nonnull PageToken pageToken) {
// TODO: only fetch the properties required for creating an EntityNameLookupRecord
return listEntities(
callCtx,
catalogId,
parentId,
entityType,
entitySubType,
entity -> true,
EntityNameLookupRecord::new,
pageToken);
}

currently the method is simply forwarding to the non-optimized listEntities variant.

Describe the solution you'd like

the idea is that in the JDBC query we should only load the columns/properties needed for creating a EntityNameLookupRecord instance.
the more general listEntities variant can be used as a starting point and trimmed down to just the necessary parts.

also according to this review comment we should make sure that the query in the optimized case can be served efficiently from the database by only having to read a single index (that contains all necessary columns) without having to access the main table/row storage (see also this explanation).

this may require a new or updated schema for the jdbc backend.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions