activecube 0.1.24 → 0.1.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/activecube/processor/composer.rb +1 -1
- data/lib/activecube/processor/optimizer.rb +4 -4
- data/lib/activecube/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94f1e4575a041108004194789f85b9c030c6f7f94083677dee253de3cc878966
|
4
|
+
data.tar.gz: b182640a584166cefc17b7b26e7add652600b0c937f08b83689a02f819bb2bb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab68fd59fdbffe5e0b3d4b8f0523d351b5a6c2840090328af0e78ed10c7fc23e402335f99f05d114da175c57d0b12f0d4fa02195a89ab52108af451b2dae0445
|
7
|
+
data.tar.gz: ace9d8f215cb59e930cf66249211405408c2bce905166fbe59370708dea17502d40d2416611297a1d6c06d0f6930ee3e73460775cfe1ad32895030db22a49c65
|
data/Gemfile.lock
CHANGED
@@ -41,7 +41,7 @@ module Activecube::Processor
|
|
41
41
|
end
|
42
42
|
after = total_cost measure_tables
|
43
43
|
|
44
|
-
raise "Optimizer made it
|
44
|
+
raise "Optimizer made it worse #{before} -> #{after} for #{cost_matrix}" unless after <= before
|
45
45
|
measure_tables
|
46
46
|
|
47
47
|
end
|
@@ -27,8 +27,8 @@ module Activecube::Processor
|
|
27
27
|
|
28
28
|
private
|
29
29
|
|
30
|
-
|
31
30
|
def do_optimize
|
31
|
+
|
32
32
|
@tables_by_metrics = []
|
33
33
|
|
34
34
|
# sort metrics from low min cost to higher min costs ( by all applicable tables )
|
@@ -91,13 +91,13 @@ module Activecube::Processor
|
|
91
91
|
else
|
92
92
|
# table to unused table if
|
93
93
|
# cost now > new cost + max other cost in table now
|
94
|
-
old_cost > new_cost + ( prev_step.select.with_index{|c,i| c==c_i && i!=m_i }.max || UNLIM_COST )
|
94
|
+
old_cost > new_cost + ( prev_step.select.with_index{|c,i| c==c_i && i!=m_i }.map{|c| cost_matrix[m_i][c]}.max || UNLIM_COST )
|
95
95
|
end
|
96
96
|
else
|
97
97
|
if new_table_included_times>0
|
98
98
|
# unused table to table if
|
99
99
|
# new cost < cost now + max other cost in new table
|
100
|
-
old_cost > new_cost - ( prev_step.select{|c| c==c_n }.max || UNLIM_COST )
|
100
|
+
old_cost > new_cost - ( prev_step.select{|c| c==c_n }.map{|c| cost_matrix[m_i][c]}.max || UNLIM_COST )
|
101
101
|
else
|
102
102
|
# unused to unused
|
103
103
|
# cost now > new cost
|
@@ -107,7 +107,7 @@ module Activecube::Processor
|
|
107
107
|
|
108
108
|
}
|
109
109
|
|
110
|
-
step <<
|
110
|
+
step << (new_c_i || c_i)
|
111
111
|
|
112
112
|
}
|
113
113
|
|
data/lib/activecube/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activecube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksey Studnev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|