Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-109

Optimise ORDER BY + OFFSET + LIMIT queries

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Done
    • None
    • Jena 2.11.0
    • ARQ

    Description

      The benefits of JENA-89 gets lost as soon as someone uses OFFSET, even for low values.

      Maybe we can assume users will not hit 'next page' too many times.
      We can increase the TOPN_LIMIT_THRESHOLD in TransformTopN to 100000 and apply the same TopN optimization we discussed in JENA-89 even when we have OFFSET (when OFFSET + LIMIT < TOPN_LIMIT_THRESHOLD).
      In QueryIterTopN we simply return IteratorArray.create(y, offset, offset+limit) instead of IteratorArray.create.

      This way we can avoid total sort for a few number of small pages (all within the 100000 threshold).

      Attachments

        1. JENA-109_ARQ_r1164652.patch
          18 kB
          Paolo Castagna

        Issue Links

          Activity

            People

              castagna Paolo Castagna
              castagna Paolo Castagna
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: