Closed georghas closed 1 month ago
Excellent idea! Thanks for the PR.
I fixed the problem that some EntityTypes (Datastreams) use projections in their select
list, which were not in the returning
list, causing all tests to fail: https://github.com/FraunhoferIOSB/FROST-Server/commit/da0fc6a678b9c3be4e3a4d5f3a29893d27c2d2ab.
I've merged the PR manually, so we can close this. Thanks again!
Awesome. Thank you!
For insertion, AbstractPersistenceManager first inserts data with "INSERT INTO … RETURNING table.ID;", returns the generated \<ID> and then queries the same row using \<ID> with "SELECT * FROM table WHERE table.ID = \<ID>;".
This requests merges these two operations into one single operation: "INSERT INTO … RETURNING table.*;" Hereby data is inserted, altered by rules or before-triggers (not after-triggers!), should there be any, and then immediately returned. It eliminates the need for another SELECT statement.
(Background: For the default implementation of FROST, this is not noticeable. However when trying to extend the database with TimescaleDB, this small detail speeds up writes significantly.)