Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1312

.count().is(0) is not properly optimized

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.0-incubating, 3.1.2-incubating
    • Fix Version/s: 3.1.3, 3.2.1
    • Component/s: process
    • Labels:
      None

      Description

      bla.count().is(0) gets optimized by RangeByIsCountStrategy, which replaces it with bla.limit(1).count().is(0). That's good, but we can do even better by replacing it with __.not(bla), which is a simple .hasNext() instead of a RangeStep followed by a ReducingBarrierStep (count()).

      Question is: should we do the replacement in RangeByIsCountStrategy? The strategy will recognize the pattern, no matter if we use it for the replacement or not; it's just that the strategy name is then no longer in line with the the actual replacement (for this particular .count().is(0) case) as it won't inject a RangeStep.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dkuppitz Daniel Kuppitz
                Reporter:
                dkuppitz Daniel Kuppitz
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: