Menu

idea: Optimizations for PaginatedList

2003-07-02
2003-07-02
  • Nobody/Anonymous

    Hi Clinton

    The constructor of the paginatedList calls the:
    pageTo(0);

    that will execute two queries:
    - one for the current list
    - one for the next list

        currentPageList = getList (index);
        nextPageList = getList (index + 1);

    that calls the getList method that actually executes the SQL.

          list = mappedStatement.executeQueryForList(connection, parameterObject, (idx) * pageSize, pageSize);

    What if you could optimize these two calls into one SQL call. You could manually split the resultlist into two lists and put the sublist into: currentlist and nextlist.

    Also the nextPage() and previousPage() could be changed to always one execute one SQL call as the constructor.

    /Claus

     
    • Clinton Begin

      Clinton Begin - 2003-07-02

      Hey, that's a very cool idea!  I went with the most direct approach, but this almost seems more obvious....guess I should limit my late-night programming... ;-)

      Thanks for sharing your great ideas Claus.

      Cheers,
      Clinton

       

Log in to post a comment.