overmindtech / sdp

Protobuf based protocol for describing the state of a system
Other
4 stars 1 forks source link

Create pagination #230

Open dylanratcliffe opened 1 week ago

dylanratcliffe commented 1 week ago

Currently none of our APIs have pagination, the most obvious candidate for adding it is ListHomeChanges since this load every change every time the UI is loaded, and this is where we should start. However it would be good to have a standard way of doing it that will work for everything.

When designing the SDP for this we'll need to consider how the underlying database queries will work (TODO: @dylanratcliffe to ask about the best way to do this) and make sure that the method is appropriate for all (or most) of the other list calls.

DavidS-ovm commented 4 days ago

See also https://github.com/overmindtech/api-server/issues/939

tphoney commented 1 hour ago

All run in debug mode, 500 to 800ms

alll 10000 changes,

changes: 10001
duration: 672.765419ms

page0 with select count. 3-6ms.

page: 0, pageSize: 50
changes: 50
duration: 5.616318ms WITH TOTAL

page 199, with select count. 12 to 14ms

page: 199, pageSize: 50
changes: 50
duration: 12.790171ms

pagination without, select count

changes: 50
duration: 1.464697ms