forked from dkubb/axiom
/
TODO
59 lines (52 loc) · 2.55 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
* Add Relation#first, #last and #at to return slices of tuples as relations
* Uses Relation#limit and Relation#offset underneath
* #last is especially interesting, since it reverses the sort order,
performs a #first operatin, then reversed the sort order again.
This will need to be seamless for it to work properly.
* Add Relation#group and Relation#ungroup to nest/unnest the relations
* Add benchmarks for each Relation operation
* Will allow git bisect to gather results for each iteration, and
plot performance over time
* Make sure the memory usage for each method is measured, as well
as object allocation, and GC.
* Make sure they can be run with each system rvm supports
* Output the results in a machine readable format
* Output the Ruby version/patch number with each result
* Output the Engine name, which is currently named just "naive",
referring to the in-memory naive processing approach I am
using now.
* Measurements will always be taken using every available engine.
* Look at memory and speed profiling tools
* Look at optimizing the Tuple as a Struct
* Add #optimize method to each Relation subclass
* Relation#optimize should just return self
* See if "attr = ? OR attr = ?" can be optimized to "attr IN(..)"
* If an OR branch always returns true, then the whole operation
returns true, so return an object that represents a true match.
* If the Restriction ends up containing only a single "true"
object, then it should factor itself out since it can match
everything.
* For Equality, if left and right are constants, evaluate the predicate
and return the true/false value.
* For Equality, if left and right are the same attribute, return true
* After optimizing a relation, set @optimized to whatever the return
value is, and use @optimized ||= in #optimize to prevent duplicate
effort.
* In the optimized relation, use "relation.optimized = self" to prevent
an already optimized relation from performing any redundant
optimizations.
* Should optimize the "contained" Relation objects first, and then
compare them:
def optimize
relation = relation.optimize
case relation
when Join
# ...
end
end
* Move logic from Join#combine_bodies and Product#combine_bodies into Body
* should pass enough information that the Body method could either
perform the operation in-memory OR generate a native query to
carry it out.
* review other classes to see if methods could be pushed down to
Body or Header.