Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
SELECT * FROM fragment WHERE anchor_id = ? AND xpath IN (?,?,?,?,?,?...,?)
SELECT * FROM fragment WHERE anchor_id = ? AND xpath IN (?,?,?,?,?,?...,?)
SELECT * FROM fragment WHERE anchor_id = ? AND xpath IN (?,?,?,?)

Observations

Disadvantage:

...

Lists.partition only supports Lists

If a public method takes in a Collection (and not a List), then either an ArrayList copy of the Collection is needed, or the public API method needs to be changes to List, as Lists.partition requires a List to partition.

To Do: measure performance impact of this, if any.

Batching on repository methods versus API methods

...

It is unclear if this has better performance in practice (limited testing shows both solutions have similar performance, but the test scenarios may be unrealistic).

Observations

Disadvantage: extra dependency

Extra dependencies could add possible risks of dependency issues, security issues, etc. in future.

Disadvantage of arrays: Limited array type support

...

Code Block
languagejava
void deleteByAnchorIndeleteByAnchorIdIn(int[] anchorIds);

Advantage of arrays: Code already using Postgres arrays can

...

be simplified

The current FragmentRepository has code already using Postgres arrays to support "LIKE ANY" logic (using LIKE with a collection). However, it currently uses query parameters, and is thus limited to 32K parameters.

...