Skip to content

JOINED inheritance strategy

RepositoryFile uses TABLE_PER_CLASS inheritance strategy and that's causing performance problems when querying (e.g. Dataset#files problem described in genesys-server#509 (closed)).

Simple testing (comments in genesys-pgr/genesys-server!535) shows that using JOINED inheritance results in much better performance.

Update code and liquibase-changeLog.yml for use of @Inheritance(strategy = InheritanceType.JOINED) in RepositoryFile class.

Database migration must include:

  1. Copy data from repository_image to repository_file
  2. Drop unnecessary columns.
  3. Copy data from repository_document to repository_file
  4. Drop unnecessary columns.

I hope that primary key id is unique across these tables.

Edited by Matija Obreza