Examples of IndexPlan


Examples of org.apache.jackrabbit.oak.spi.query.QueryIndex.IndexPlan

        if (LOG.isDebugEnabled()) {
            LOG.debug("cost using filter " + filter);
        }

        double bestCost = Double.POSITIVE_INFINITY;
        IndexPlan bestPlan = null;
        for (QueryIndex index : indexProvider.getQueryIndexes(rootState)) {
            double cost;
            IndexPlan indexPlan = null;
            if (index instanceof AdvancedQueryIndex) {
                AdvancedQueryIndex advIndex = (AdvancedQueryIndex) index;
                List<OrderEntry> sortOrder = null;
                if (orderings != null) {
                    sortOrder = new ArrayList<OrderEntry>();
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.QueryIndex.IndexPlan

        QueryIndex index = plan.getIndex();
        if (index == null) {
            cursor = Cursors.newPathCursor(new ArrayList<String>(), query.getSettings());
            return;
        }
        IndexPlan p = plan.getIndexPlan();
        if (p != null) {
            p.setFilter(createFilter(false));
            AdvancedQueryIndex adv = (AdvancedQueryIndex) index;
            cursor = adv.query(p, rootState);
        } else {
            cursor = index.query(createFilter(false), rootState);
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.QueryIndex.IndexPlan

        buff.append(" /* ");
        QueryIndex index = getIndex();
        if (index != null) {
            if (index instanceof AdvancedQueryIndex) {
                AdvancedQueryIndex adv = (AdvancedQueryIndex) index;
                IndexPlan p = plan.getIndexPlan();
                buff.append(adv.getPlanDescription(p, rootState));
            } else {
                buff.append(index.getPlan(createFilter(true), rootState));
            }
        } else {
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.QueryIndex.IndexPlan

        }
        RowIterator rowIt = new RowIterator(context.getBaseState());
        Comparator<ResultRowImpl> orderBy;
        boolean sortUsingIndex = false;
        if (orderings != null && selectors.size() == 1) {
            IndexPlan plan = selectors.get(0).getExecutionPlan().getIndexPlan();
            if (plan != null) {
                List<OrderEntry> list = plan.getSortOrder();
                if (list != null && list.size() == orderings.length) {
                    sortUsingIndex = true;
                    for (int i = 0; i < list.size(); i++) {
                        OrderEntry e = list.get(i);
                        OrderingImpl o = orderings[i];
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.QueryIndex.IndexPlan

        if (LOG.isDebugEnabled()) {
            LOG.debug("cost using filter " + filter);
        }

        double bestCost = Double.POSITIVE_INFINITY;
        IndexPlan bestPlan = null;
        for (QueryIndex index : indexProvider.getQueryIndexes(rootState)) {
            double cost;
            IndexPlan indexPlan = null;
            if (index instanceof AdvancedQueryIndex) {
                AdvancedQueryIndex advIndex = (AdvancedQueryIndex) index;
                List<OrderEntry> sortOrder = null;
                if (orderings != null) {
                    sortOrder = new ArrayList<OrderEntry>();
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.QueryIndex.IndexPlan

            order));
        List<IndexPlan> plans = index.getPlans(filter, sortOrder, indexed);

        assertNotNull(plans);
        assertEquals(1, plans.size());
        IndexPlan p = plans.get(0);
        assertTrue(p.getEstimatedEntryCount() > 0);
        assertNotNull(p.getSortOrder());
        assertEquals(1, p.getSortOrder().size());
        QueryIndex.OrderEntry oe = p.getSortOrder().get(0);
        assertNotNull(oe);
        assertEquals(ORDERED_PROPERTY, oe.getPropertyName());
        assertEquals(QueryIndex.OrderEntry.Order.ASCENDING, oe.getOrder());
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.QueryIndex.IndexPlan

            ORDERED_PROPERTY, order));

        List<IndexPlan> plans = index.getPlans(filter, sortOrder, indexed);
        assertNotNull(plans);
        assertEquals(1, plans.size());
        IndexPlan p = plans.get(0);
        assertTrue(p.getEstimatedEntryCount() > 0);
        assertNotNull(p.getSortOrder());
        assertEquals(1, p.getSortOrder().size());
        assertEquals(QueryIndex.OrderEntry.Order.ASCENDING, p.getSortOrder()
                .get(0).getOrder());
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.query.QueryIndex.IndexPlan

public class AdvancedIndexTest {

    @Test
    public void builder() {
        IndexPlan.Builder b = new IndexPlan.Builder();
        IndexPlan plan = b.setEstimatedEntryCount(10).build();
        assertEquals(10, plan.getEstimatedEntryCount());
        b.setEstimatedEntryCount(20);
        assertEquals(10, plan.getEstimatedEntryCount());
    }
View Full Code Here

Examples of org.modeshape.jcr.query.engine.IndexPlan

        for (PlanNode source : plan.findAllAtOrBelow(Type.SOURCE)) {
            source.orderChildren(Type.INDEX, new Comparator<PlanNode>() {
                @Override
                public int compare( PlanNode o1,
                                    PlanNode o2 ) {
                    IndexPlan index1 = o1.getProperty(Property.INDEX_SPECIFICATION, IndexPlan.class);
                    IndexPlan index2 = o2.getProperty(Property.INDEX_SPECIFICATION, IndexPlan.class);
                    assert index1 != null;
                    assert index2 != null;
                    return index1.compareTo(index2);
                }
            });
View Full Code Here

Examples of org.modeshape.jcr.query.engine.IndexPlan

                                          String workspaceName,
                                          String providerName,
                                          Collection<JoinCondition> joinConditions,
                                          int costEstimate,
                                          long cardinalityEstimate ) {
                        IndexPlan indexPlan = new IndexPlan(name, workspaceName, providerName, null, joinConditions,
                                                            costEstimate, cardinalityEstimate, 1.0f, null);
                        indexPlans.add(indexPlan);
                    }

                    @Override
                    public void addIndex( String name,
                                          String workspaceName,
                                          String providerName,
                                          Collection<Constraint> constraints,
                                          int costEstimate,
                                          long cardinalityEstimate,
                                          Float selectivityEstimate,
                                          Map<String, Object> parameters ) {
                        // Add a plan node for this index ...
                        IndexPlan indexPlan = new IndexPlan(name, workspaceName, providerName, constraints, null, costEstimate,
                                                            cardinalityEstimate, selectivityEstimate, parameters);
                        indexPlans.add(indexPlan);
                    }

                    @Override
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.