Major
#27189
Performance: Many requests to FLEX_DATA when deleting large numbers of subject objects
When deleting a subject object, the corresponding entries must also be deleted from the FLEX_DATA table. If many data objects have to be deleted in one 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).
There is a bulk API deleteAll(List<DBKnowledgeItem) in the FlexDataManager interface, but the implementation in 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 the deletion and reduce the amount of SQL statements to be executed, the objects could be partitioned appropriately (e.g. by branch and type) and combined by 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 the attributes of several objects can be stored.
Test
test.com.top_logic.knowledge.service.db2.FlexManagerPerformanceTest