tables icon indicating copy to clipboard operation
tables copied to clipboard

Update rows counter

Open datenangebot opened this issue 2 years ago • 1 comments

  • Update if table row count is changed
  • Update if views were adjusted (filtering changed, new/edited/deleted rows, ...) Nearly everything could trigger the rows count. 🙄

datenangebot avatar Aug 11 '23 10:08 datenangebot

The main problem here is that we trigger N+1 selects in almost all operations like listing tables which tends to end up in rather complex queries depending on the table or filtering on views

https://github.com/nextcloud/tables/blob/main/lib/Service/TableService.php#L197 https://github.com/nextcloud/tables/blob/main/lib/Service/ViewService.php#L413

I'm not entirely sure what the better approach would be, either store a counter directly next to the view or rather a caching layer, but we should be able to properly update the row count in cases rows are added/removed. For views this would be more tricky as the number of rows on a view could change if either the view filters are updated or if any value of a row changes.

juliusknorr avatar May 02 '24 20:05 juliusknorr