Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
Expand all | Collapse all

Does the list view select all records in the query? (instead of just the first page)

  • 1.  Does the list view select all records in the query? (instead of just the first page)

    Posted Wed March 03, 2021 08:15 PM
    Edited by System Admin Wed March 22, 2023 11:47 AM
    As far as I can tell, the list view in Maximo selects all records from the list view query -- even though only the first page of the resultset gets displayed.

    The reasons I say that are:
    1. A count of all records is provided. If it's getting a count of all records, then I suspect that it's selecting all records.
    • I know it's possible to count records with SQL instead of selecting them. But I don't think Maximo is counting; I think it's selecting.
    2. The list view is slow to the point that I think it must be selecting all records in the query. It would be much faster if it was just selecting the first page / first 20 records.

    If the list view does select all records in the query, my question would be: why?

    In other enterprise systems that I'm familiar with, the application just selects the first page of records it comes across (example: rownum <= 20). And if you want to see the total number of records in the query, you can hit a button to see the count (or to navigate to the last page to get the count).

    As a novice, I think I would prefer it if the Maximo list view only selected the first page of records -- and not give me the total count of records in the query (unless I specifically ask for the total count). I think that would make the list view a lot faster.
    • It doesn't make sense to me why I'd want my users selecting (or counting) all 150,000 assets or all 200,000 open WOs (including GIS inspection WOs) -- each time they run the default query in the list view. That seems unnecessary.

    Is there a system setting we can use to disable getting the count of all records -- and just select the first page / the first 20 records?

    Any insight would be appreciated. Thanks.
    #AssetandFacilitiesManagement
    #Maximo


  • 2.  RE: Does the list view select all records in the query? (instead of just the first page)

    Posted Thu March 04, 2021 08:31 AM
    Maximo only selects a page at a time (actually, I think it 1 record more) and does a select count(*) for the total.  There can be a number of reasons why you may see slowness.  Is there a total of 150,000 records on the Asset table or is that just how many are returned for this user.  In the case of the latter, check the where clause being used.  It could be that there is no appropriate indexing (which would hurt the count even more than the fetch).  Also, it is possible that a site or data restriction is in place, also causing an inefficient select (and again, worse for the count).  There is a way to turn off the count, but I don't have the property handy.  Also, make sure nobody has modified the page to show (significantly) more than the out of the box 20.

    In both cases, check the fields on the list page.  Is the column list out of the box or have other columns been added.  Sometimes there is code to do work when a field is requested.  That code will run for each row and can also be the cause for delay.  Any automation scripts or customization on this system which also could be kicking in for each row displayed?

    If you turn on SQL Logging you can get a better picture of what is going on.  In a situation like this, you may want to use custom thread logging to narrow the log down - https://www.ibm.com/support/knowledgecenter/SSLKT6_7.6.0/com.ibm.mam.doc/overview/c_whats_new_troubleshooting_7.6.html

     and https://www.ibm.com/support/knowledgecenter/SSLKT6_7.6.1/com.ibm.mbs.doc/logging/t_enabling_thread_logs.html.

    Ibm remove preview
    View this on Ibm >


    ------------------------------
    Steve Hauptman
    ------------------------------



  • 3.  RE: Does the list view select all records in the query? (instead of just the first page)

    Posted Thu March 04, 2021 08:34 AM
    The answer to this is complicated as the query that gets executed does return the entire result set from the database. So if a user uses the "All Records" in an application, it's executing SELECT * FROM table. Maximo then turns that into a MBO set to process. There are are some settings that limit the number of results retrieved in memory from the database at a time (like SQL Server's mxe.db.sqlserverPrefetchRows) as well as a setting to limit total number of MBO records (mxe.db.fetchResultStopLimit). 

    But also, it's not using this query to determine the count. Maximo actually executes the query twice. Once to get the result and once to execute the count query. On a per app basis you can disable the count (adding showcount="false" on the table) but I'm not aware of a way to disable this globally in all apps. If you don't want the counts in certain apps I would suggest adding this. 

    As for why it doesn't return with just 20 records for example I can only speculate based on things I know. The data in the system could change causing new records to get added to your set and removing others from your set. Another would be there are places in Maximo without an order by defined for the set which wouldn't be reliable. With both of those scenarios you could get the same record multiple times and miss other records as you're paging through the set. We see this with the REST API which is why stablepaging is a thing. 

    While 20 records are displayed on a page, actions can be done against more than the 20 records (such as bulk change status). Sometimes certain processes even bypass the mxe.db.fetchResultStopLimit because obeying it could cause issues (preventing it from getting the records it needs to work with). How you handle these scenarios (should it be 20, should it be 500, should it be the stop limit which defaults to 5,000, etc.) is complicated. And you'd have to handle it everywhere on on every database platform. SQL Server for example has a SELECT TOP X, but doesn't support rownum. So getting the first X number of records is easy but getting the second set is tricky. You can build something but it's pretty ugly to write.

    With the modernization push of Maximo with Work Centers and heavy investment in the REST API, I expect you'll see improvements in this area. I expect it to get closer to how you think it should act. Unfortunately I think it requires the modernization to make any significant improvements in this space.

    ------------------------------
    Steven Shull
    Director of Development
    Projetech Inc
    Cincinnati OH
    ------------------------------