WebCuratorTool / webcurator

The root of the webcurator tool project, containing all modules needed to run a fully functional webcurator tool.
Apache License 2.0
4 stars 1 forks source link

Speed up the rest api of target summary querying #149

Open leefrank9527 opened 2 months ago

leefrank9527 commented 2 months ago

Added a view to speed up the rest api of target summary querying. Please note that the Oracle is not supported now.

hannakoppelaar commented 1 month ago

I'm not sure I understand the mechanics of this performance enhancement. The newly introduced view in and of itself is not faster than the original query. I've compared the EXPLAIN ANALYZE of both with different conditions and they come out more or less equal.

I did notice that the original query starts to lag behind the view if there have been a lot of updates since the last VACUUM, so that could explain a performance discrepancy between the view and the original query.

Another explanation could be that the view selects only a fraction of the attributes of the original query, leading to less data being transferred and processed on the Java side. Maybe that was the actual idea behind this change? (This would probably be easier to implement using a JPA query.)