Package org.intermine.sql.precompute
Class OptimiserCacheLine
- java.lang.Object
-
- org.intermine.sql.precompute.OptimiserCacheLine
-
public class OptimiserCacheLine extends java.lang.Object
A class that provides an implementation of a cache line, encapsulating several pieces of data.- Author:
- Matthew Wakeling
-
-
Constructor Summary
Constructors Constructor Description OptimiserCacheLine(java.lang.String optimised, int limit, java.lang.String original)
Constructor for this object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getOptimised()
Gets the optimised query (minus the LIMIT and OFFSET) from this cache line.java.lang.String
getOriginal()
Returns the original SQL string.double
score(int limit)
Scores this cache line according to how far away the required limit is from the limit used to create the line.
-
-
-
Constructor Detail
-
OptimiserCacheLine
public OptimiserCacheLine(java.lang.String optimised, int limit, java.lang.String original)
Constructor for this object.- Parameters:
optimised
- the optimised SQL String, minus the LIMIT and OFFSETlimit
- the limit that was used to generate optimisedoriginal
- the original sql query
-
-
Method Detail
-
score
public double score(int limit)
Scores this cache line according to how far away the required limit is from the limit used to create the line.- Parameters:
limit
- the required limit- Returns:
- a double according to how close the match is. Less is better, with 1.0 as a reasonable cut-off point to ignore the line
-
getOptimised
public java.lang.String getOptimised()
Gets the optimised query (minus the LIMIT and OFFSET) from this cache line.- Returns:
- the optimised query
-
getOriginal
public java.lang.String getOriginal()
Returns the original SQL string.- Returns:
- the original SQL string
-
-