Package lupos.optimizations.logical.statistics

Examples of lupos.optimizations.logical.statistics.Entry


      final double bucketSize = (double) size / MaxNumberBuckets;
      final Iterator<Bindings> ib = qr.oneTimeIterator();
      final VarBucket vb = new VarBucket();
      vb.minimum = minima.get(v);
      vb.maximum = maxima.get(v);
      Entry currentEntry = new Entry();
      Literal lastLiteral = null;
      while (ib.hasNext()) {
        final Bindings b = ib.next();
        final Literal next = b.get(v);
        if (lastLiteral == null
            || lastLiteral
                .compareToNotNecessarilySPARQLSpecificationConform(next) != 0) {
          currentEntry.distinctLiterals += 1.0;
          lastLiteral = next;
        }
        currentEntry.selectivity += 1.0;
        if (currentEntry.selectivity >= bucketSize) {
          currentEntry.literal = b.get(v);
          if (ib.hasNext()) {
            Bindings b2 = ib.next();
            while (ib.hasNext()
                && b2
                    .get(v)
                    .compareToNotNecessarilySPARQLSpecificationConform(
                        currentEntry.literal) == 0) {
              currentEntry.selectivity += 1.0;
              b2 = ib.next();
            }
            vb.selectivityOfInterval.add(currentEntry);
            currentEntry = new Entry();
            currentEntry.distinctLiterals = 1.0;
            currentEntry.selectivity = 1.0;
            if (!ib.hasNext()
                && b2
                    .get(v)
View Full Code Here

TOP

Related Classes of lupos.optimizations.logical.statistics.Entry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.