Re: Prefetching and paginated queries

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Oct 27 2004 - 21:21:40 EDT

  • Next message: Andrus Adamchik: "Re: AUTO_INCREMENT pk generation in MySQL"

    On Oct 26, 2004, at 10:23 PM, Derek Rendall wrote:
    > I noticed that prefetching doesnt work for paginated queries. I guess
    > this makes sense - I cant think how to get it going nicely.

    It supposed to work actually. What exactly happens in your case when
    you are trying to do the prefetch?

    > (e.g. our db2 is set up to have a limit of 250 parameters). This
    > could be achieved by putting a "max prefetching capable limit" on the
    > page size of 200 (may be too restrictive?), or split the select into
    > batches of queries based on a maximum number of parameters to the in
    > statement (say 200, or configurable as a parameter in modeler?) - we
    > use the second option in our (to be replaced) custom data layer and it
    > seems to work reasonably well.

    IncrementalFaultList (a List implementation that is returned by Cayenne
    for the paginated query result) has a property called "maxFetchSize"
    that allows to control this behavior (the original idea and a patch was
    submitted some time back by Scott Finnerty -
    http://www.objectstyle.org/cayenne/lists/cayenne-devel/2003/09/
    0085.html). This is not documented in the user guide, but here is the
    class I am talking about:

    http://objectstyle.org/cayenne/api/cayenne/org/objectstyle/cayenne/
    access/IncrementalFaultList.html

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed Oct 27 2004 - 21:21:44 EDT