Project

General

Profile

Actions

Feature #17074

open

Use count=none & keyset paging

Added by Peter Amstutz over 3 years ago. Updated 16 days ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
Workbench2
Story points:
-

Description

Calculating "items_available" in list requests is expensive.

For example, on a user cluster, they have a project with over 2 million collections and it takes around 10 seconds to return 50 items.

On another user cluster, they have 600,000 projects and the "shared with me" groups list takes over 5 seconds to return 50 items.

I will have to make some manual API calls to double check but I believe if we use "count=none" then it will skip having to count all rows and results will be returned much faster (a few hundred ms).

Using "offset" for paging is also expensive, because it throws away results. Without knowing the total count, offset paging cannot provide a "navigate to last page" option, as it does not know how many pages there are. Offset paging also produces unexpected results if list order changes during navigation.

We want to make the following changes:

  1. Use count=none when getting populating project contents.
  2. When the navigation action is to first page, last page, next page, or previous page, use keyset paging. This means results are ordered by [sort column, uuid] and instead of offset the query uses something like [sort column >= last seen, uuid > last seen].
  3. We issue a separate query to get the total number of items, with limit=0 and count=exact -- this way, populating the page isn't held up by waiting for the full count. We can also limit the full count to only on an initial load or refresh of the project panel.
  4. When the user wants to navigate ahead or back multiple pages, we can use offset from the last loaded page (which does not rely on count=exact). When navigating backwards, we have to reverse the sort order so the offset skips "backwards" instead of "forwards".
  5. The last seen sort column and uuid should be included in the query part of the URL in the URL bar so that someone can copy and paste a logical link to the page.

NOTE

The "contents" endpoint doesn't completely support keyset paging; it works by concatenating tables (manually in ruby code instead of a UNION query) and the order that tables are queried and returned isn't lexically ordered.

However, we're splitting up the project view into separate tables by type, so maybe this isn't an issue any more?

Old note about contents

    klasses = [Group,
     Job, PipelineInstance, PipelineTemplate, ContainerRequest, Workflow,
     Collection,
     Human, Specimen, Trait]

If we remove the deprecated stuff:

    klasses = [Group,
     ContainerRequest, Workflow,
     Collection]

We get get object ids

  • j7d0g
  • xvhdp
  • 7fd4e
  • 4zz18

Which means Workflow and Collection are out of order. So getting contents ordered by uuid won't be totally ordered.

There's a workaround where the client passes back last_object_class, so we might be able to get away with that.

Actions #1

Updated by Peter Amstutz over 3 years ago

  • Description updated (diff)
Actions #2

Updated by Peter Amstutz about 1 year ago

  • Release changed from 31 to 60
Actions #3

Updated by Peter Amstutz 8 months ago

  • Target version set to Future
Actions #4

Updated by Peter Amstutz 8 months ago

  • Description updated (diff)
Actions #5

Updated by Peter Amstutz 8 months ago

  • Release deleted (60)
Actions #6

Updated by Peter Amstutz 8 months ago

  • Description updated (diff)
Actions #7

Updated by Peter Amstutz 8 months ago

  • Description updated (diff)
Actions #8

Updated by Peter Amstutz 8 months ago

  • Description updated (diff)
Actions #9

Updated by Peter Amstutz 3 months ago

  • Target version changed from Future to Development 2024-02-28 sprint
  • Description updated (diff)
Actions #10

Updated by Peter Amstutz 2 months ago

  • Target version changed from Development 2024-02-28 sprint to Development 2024-03-13 sprint
Actions #11

Updated by Peter Amstutz about 2 months ago

  • Target version changed from Development 2024-03-13 sprint to Development 2024-03-27 sprint
Actions #12

Updated by Peter Amstutz about 2 months ago

  • Target version changed from Development 2024-03-27 sprint to Development 2024-04-10 sprint
Actions #13

Updated by Peter Amstutz about 2 months ago

  • Tracker changed from Bug to Feature
Actions #14

Updated by Peter Amstutz 30 days ago

  • Target version changed from Development 2024-04-10 sprint to Development 2024-04-24 sprint
Actions #15

Updated by Peter Amstutz 16 days ago

  • Target version changed from Development 2024-04-24 sprint to Development 2024-05-08 sprint
Actions #16

Updated by Peter Amstutz 16 days ago

  • Target version changed from Development 2024-05-08 sprint to Development 2024-06-05 sprint
Actions

Also available in: Atom PDF