↓ Skip to main content
A low-poly illustration of an orange wooden table with a tall stack of teal paper sheets. Beside it a hand lifts a small stack of sheets, with an orange sheet on top.

Pagination and Performance

Our test site has 1,483 work orders, and a list shows twenty of them. The rest arrives in pages, and two decisions in the markup set what each page costs: how many rows a page has, and how many attributes a row has. We measured both, from 10 to 500 rows and from 4 to 40 attributes.

MAS 9.2 series guide

We ran every step on our test system, on the MAS 9.2 series, on a page of our Components Explorer, and read the requests in the browser. The numbers belong to our system and our network. The shape behind them is what you can take along.

The page size you declare, and the one that is sent
#

<maximo-datasource id="fs_d_page_narrow" object-structure="mxapiwodetail"
    where="siteid=&quot;BEDFORD&quot;" order-by="wonum" page-size="20" selection-mode="none">
  <schema id="fs_d_page_narrow_s">
    <attribute name="wonum" unique-id="true" id="fs_d_page_narrow_a_wonum"/>
    <attribute name="description" id="fs_d_page_narrow_a_description"/>
    <attribute name="status" id="fs_d_page_narrow_a_status"/>
    <attribute name="wopriority" id="fs_d_page_narrow_a_wopriority"/>
  </schema>
</maximo-datasource>

When the page opened, this datasource sent one request. It asked for 40 rows:

oslc.select=wonum,description,status,wopriority
oslc.where=siteid="BEDFORD"
oslc.orderBy=+wonum
oslc.pageSize=40
collectioncount=1

The list showed 20 rows, as declared. The datasource held 20 more in reserve. We saw the same on every small page size of our pages:

page-size in the markuposlc.pageSize in the request
11
36
510
1020
2040
100100
500500

So a small page is fetched two at a time. Remember this when you read a request in the browser and the number looks wrong.

Four phone frames of the page “Data: pages and what a request costs”. First, after the page opened: 20 rows of 1483 and pageSize 20. Second, after page size 100: the line “pageSize(100) on fs_d_page_narrow: 100 rows of 1483, 173 ms”. Third, after page size 500: 500 rows of 1483 in 507 ms. Fourth, the list with its count “1483 records” above the first work orders.
One datasource at page size 20, 100 and 500, and the list with its count

When a list asks for the next page
#

A data-list loads more rows when the user scrolls to its end. We scrolled the list of this page to its end again and again and read the rows and the requests:

Rows in the datasourceRequest
20, when the page opens1, for the first 40 rows
40none, the rows were in reserve
601, with pageno=2, for the next 40 rows
80none

One request serves two screens of rows. The user sees no pause on every second page, and the server gets half as many calls.

Code can ask for the next rows too. loadRange takes the position of the first row and a number of rows:

const ds = this.page.findDatasource('fs_d_page_narrow');
await ds.loadRange(ds.items.length, 20);

The first call sent nothing and brought the datasource from 20 to 40 rows. The second call sent the request with pageno=2.

The count of records
#

Every request of the datasource carried collectioncount=1. Maximo then counts the records that match and returns the number with the page. It arrives in the state of the datasource as totalCount, and a list shows it with show-count="true": “1483 records”.

The attribute include-counts="false" on a datasource removes the parameter from the request. We compared both forms of the request, three times each, for every page size of the next section. On our system the answer carried the total in both forms, and the times were the same. With 1,483 records the count costs nothing we could measure.

What a request costs
#

We took the request of the datasource and sent it with four page sizes, three times each. Then we did the same with a second datasource that has 40 attributes of the same work orders in its schema. The table shows the size of the answer as JSON text and the middle one of the three times:

Rows4 attributes40 attributes
103,157 characters · 85 ms7,698 characters · 88 ms
4010,342 characters · 85 ms24,959 characters · 114 ms
10024,913 characters · 117 ms59,824 characters · 219 ms
500122,104 characters · 416 ms326,827 characters · 1,308 ms

Three things stand out.

Up to 40 rows the time stays flat. Ten rows and forty rows of the narrow schema both took 85 milliseconds. A request has a fixed cost, and at this size the fixed cost is all there is. A page of 5 is therefore no faster than a page of 40. It only sends more requests.

Large pages grow faster than their rows. 500 narrow rows took 416 milliseconds, five times the 85 of a small page. 500 wide rows took 1,308 milliseconds, fifteen times as long.

The schema counts as much as the page size. The wide answer is about two and a half times as large as the narrow one at every page size. From 100 rows on it also takes about two to three times as long. The schema is the select list of the request, as the cookbook recipe Add a Field shows, so every attribute you leave out makes every page smaller.

The app adds its own work on top of the request. The line on our page times the whole call in the app, so it reads higher than the table: 173 milliseconds for 100 narrow rows and 507 for 500. In the development preview, the datasource with 40 attributes stayed in the state loading for more than eight seconds after we asked for 500 rows. The bare request took 1.3 seconds.

Changing the page size at runtime
#

The page size of the markup is a start value. Code can change it:

ds.updatePageSize(100);
await ds.forceReload();

After these two lines the request asked for 100 rows, and the state of the datasource read pageSize = 100 with 100 rows of 1,483.

What we take from the numbers
#

DecisionOur rule
The page size of a listabout what two screens show, 20 to 40
A page size below 10no gain, the request costs the same
A page size of several hundredonly with a narrow schema, and only when the code needs all rows at once
The schema of a listthe attributes the list item shows, and the key
The schema of a detail pageits own datasource with page-size="1", as wide as the page needs
The countleave it on, the list can show it

The last two rows work together. A list with four attributes and a detail datasource with forty load forty attributes for one record. A list with forty attributes loads them for every row the user scrolls past.

What to read next#

Loading and Displaying Data shows when a datasource sends its first request. Search and Filtering shows how to narrow 1,483 records to the few a user wants, which is the larger gain in most lists.


IBM documents page-size, include-counts and the other attributes of <maximo-datasource> in the product itself. In the Application Configuration application, open the ? menu and choose Component Documentation.