@Test public void testCartesianProductVertices() throws Exception { String query = "MATCH (a),(b)"; QueryHandler queryHandler = new QueryHandler(query); LeafNode aNode = new FilterAndProjectVerticesNode(null, "a", queryHandler.getPredicates().getSubCNF("a"), Sets.newHashSet()); LeafNode bNode = new FilterAndProjectVerticesNode(null, "b", queryHandler.getPredicates().getSubCNF("b"), Sets.newHashSet()); CartesianProductNode crossNode = new CartesianProductNode(aNode, bNode, MatchStrategy .HOMOMORPHISM, MatchStrategy.ISOMORPHISM); QueryPlan queryPlan = new QueryPlan(crossNode); QueryPlanEstimator estimator = new QueryPlanEstimator(queryPlan, queryHandler, STATS); assertThat(estimator.getCardinality(), is(STATS.getVertexCount() * STATS.getVertexCount())); }
public long getCardinality() { traversePlan(queryPlan.getRoot()); long cardinality = joinEstimator.getCardinality(); if (cardinality == 0) { cardinality = filterEstimator.getCardinality(); } double selectivity = filterEstimator.getSelectivity(); return Math.round(cardinality * selectivity); }
QueryPlanEstimator { public long getCardinality() { traversePlan(queryPlan.getRoot()); long cardinality = joinEstimator.getCardinality(); if (cardinality == 0) { cardinality = filterEstimator.getCardinality(); } double selectivity = filterEstimator.getSelectivity(); return Math.round(cardinality * selectivity); } }
QueryPlanEstimator { public long getCardinality() { traversePlan(queryPlan.getRoot()); long cardinality = joinEstimator.getCardinality(); if (cardinality == 0) { cardinality = filterEstimator.getCardinality(); } double selectivity = filterEstimator.getSelectivity(); return Math.round(cardinality * selectivity); } QueryPlanEstimator(QueryPlan queryPlan, QueryHandler queryHandler,
    GraphStatistics graphStatistics); }
QueryPlanEstimator { public long getCardinality() { traversePlan(queryPlan.getRoot()); long cardinality = joinEstimator.getCardinality(); if (cardinality == 0) { cardinality = filterEstimator.getCardinality(); } double selectivity = filterEstimator.getSelectivity(); return Math.round(cardinality * selectivity); } QueryPlanEstimator(QueryPlan queryPlan, QueryHandler queryHandler,
    GraphStatistics graphStatistics); QueryPlan getQueryPlan(); long getCardinality(); }
QueryPlanEstimator { public long getCardinality() { traversePlan(queryPlan.getRoot()); long cardinality = joinEstimator.getCardinality(); if (cardinality == 0) { cardinality = filterEstimator.getCardinality(); } double selectivity = filterEstimator.getSelectivity(); return Math.round(cardinality * selectivity); } QueryPlanEstimator(QueryPlan queryPlan, QueryHandler queryHandler,
    GraphStatistics graphStatistics); QueryPlan getQueryPlan(); long getCardinality();  }