2 Replies Latest reply on Dec 10, 2012 10:26 AM by 660069

    REST API - paging bug


      I think I've identified a bug in the REST API with regards to paging.

      If I run the the following query
      curl http://lons00xxxx:5050/Trade.xml;start=0;count=1000; > c:\trades.xml
      I get 1000 objects in my XML as desired, however the proxy memory usage goes crazy. There are 600,000 objects in the trade cache, the paging (which I assume turns into a limit filter?) seems to bring all the results into the proxy an then limits the results. This is different to the native limit filter, which seems to filter at the cache node level.

      As a consequence the performance of the paging is much slower than the native LimitFilter. Even more problematic is fact that my proxy JVM has to be big enough to hold all of the data in the distributed cache.

      Can you confirm that you are also seeing this behavior? If so, is there a fix/work around?

        • 1. Re: REST API - paging bug
          It's not a bug, it's just not behave as what you expected.

          The count only strip out extra data AFTER proxy obtained the query result.

          If you want to use limit filter, you will need to use ?q= syntax to add limit filter as part of your query.

          Check section 28.5 of the Coherence client guide.


          Not sure if CoHQL support LimitFilter, though.
          • 2. Re: REST API - paging bug

            Thanks for the reply.

            I have read that paragraph of the documentation, all that is mentioned is that the results can be limited. It doesn't mention at which point in the query cycle the results are limited. Now from experiments both you and I know that the results are limited at the proxy. Coherence has a far superior way of limiting results, via a limit filter. I would argue that by not employing this mechanism when 'start and count' is encountered, could be viewed as a bug. At very least it's a significant optimization that could be made.

            Presently it's all too easy to crash proxies with ill-formed queries. I just wanted to highlight this, and know if there was a workaround?