Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-15063

AppMetadataStore inefficiently uses a filter that is always true

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 6.0.0
    • Fix Version/s: None
    • Component/s: App Fabric, Datasets
    • Labels:
    • Rank:
      1|i00m2n:

      Description

      AppMetaStore uses, in quite a few places, a predicate that is always true:

      Predicate<RunRecordMeta> timePredicate = getTimeRangePredicate(0, Long.MAX_VALUE);

      Since timestamps are always positive (and so are inverted timestamps), this must always be true - unless there is some special case where we use negative timestamps. However, I doubt that, because the inverse of a negative timestamp would be Long.MAX_VALUE - (-ts), which is ts - 1, and such timestamp would therefore be out of order.

      This predicate could cost a performance penalty, because in the presence of a predicate, the scan ignores the limit and scans MAX_VALUE rows. 

        Attachments

          Activity

            People

            • Assignee:
              andreas Andreas Neumann
              Reporter:
              andreas Andreas Neumann
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: