org.openanzo.glitter.query.planning
Class SimpleCostModel

java.lang.Object
  extended by org.openanzo.glitter.query.planning.SimpleCostModel
All Implemented Interfaces:
NodeCostModel

public class SimpleCostModel
extends java.lang.Object
implements NodeCostModel

The SimpleCostModel is a very simple model of costs for a SPARQL query. It penalizes triple patterns with variables and GRAPH clauses with variables. As such, it prioritizes ground triple patterns and GRAPH clauses that target specific named graphs. All other node costs simply sum the costs of their children. The values used are purely arbitrary. TODO - tweak values to get reasonable results. This simple mode could also be supplemented with base costs for the various node types, such that, e.g., a FILTER might be cheaper (because more selective?) than an unfiltered GROUP.

Author:
Lee

Constructor Summary
SimpleCostModel()
          Default constructor.
 
Method Summary
 double computeCost(TreeNode node)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleCostModel

public SimpleCostModel()
Default constructor.

Method Detail

computeCost

public double computeCost(TreeNode node)
Specified by:
computeCost in interface NodeCostModel
Parameters:
node - A node in the SPARQL query
Returns:
The cost (an arbitrary numeric) of generating bindings for the given node


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.