Major
#27189
Performance: Many requests to FLEX_DATA when deleting large numbers of subject objects
When a specialized object is deleted, the corresponding entries must also be deleted from the FLEX_DATA table. If many data objects have to be deleted in a transaction (e.g. complete structures with many elements), this leads to a lot of SQL updates against the database, which greatly delays the execution time (depending on the database connection).
Although there is a bulk API deleteAll(List<DBKnowledgeItem) in the FlexDataManager interface, the implementation in the AbstractFlexDataManager iterates through the set of objects to be deleted and triggers an SQL statement for each entry.
A similar problem exists when updating or creating many objects.
Improvement
To speed up deletion and reduce the number of SQL statements to be executed, the objects could be partitioned appropriately (e.g. by branch and type) and summarized using a WHERE IN (using chunking).
When creating or updating many objects, an SQL batch could be generated in which not only the attributes of one object but also the attributes of several objects can be stored.
Test
test.com.top_logic.knowledge.service.db2.FlexManagerPerformanceTest