pghero 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pghero might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/views/pg_hero/home/index.html.erb +1 -2
- data/lib/pghero/methods/suggested_indexes.rb +1 -1
- data/lib/pghero/version.rb +1 -1
- data/test/best_index_test.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88bdee267422f250773f1764fb7b7afea03344b1
|
4
|
+
data.tar.gz: 378e02b5b0c4e3f59646bada6899a203b22ff111
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cac1afe8db164aa87aaa614a2210b7f38b5e6746ab58e3b9931510b1481e579ff03438f1471ac5037379e8123342fc47e526eeb308f94dba9ea6901e7fa53f6
|
7
|
+
data.tar.gz: 1675887b2ea3d5ca45dfa5c5964c35c3e30de771171387fd379efc4cf92d1379e7013281274477d5c8717a0549f560857b27e22284d4558d2449083e08bd1217
|
data/CHANGELOG.md
CHANGED
@@ -267,8 +267,7 @@ remove_index <%= query["unneeded_index"]["table"].to_sym.inspect %>, name: <%= q
|
|
267
267
|
<pre style="overflow: scroll; white-space: pre; word-break: normal;">commit_db_transaction
|
268
268
|
<% @suggested_indexes.each do |index| %>
|
269
269
|
<% if index[:using] && index[:using] != "btree" %>
|
270
|
-
|
271
|
-
# connection.execute("CREATE INDEX CONCURRENTLY ON <%= index[:table] %><% if index[:using] %> USING <%= index[:using] %><% end %> (<%= index[:columns].join(", ") %>)")
|
270
|
+
connection.execute("CREATE INDEX CONCURRENTLY ON <%= index[:table] %><% if index[:using] %> USING <%= index[:using] %><% end %> (<%= index[:columns].join(", ") %>)")
|
272
271
|
<% else %>
|
273
272
|
add_index <%= index[:table].to_sym.inspect %>, [<%= index[:columns].map(&:to_sym).map(&:inspect).join(", ") %>], algorithm: :concurrently<% end %>
|
274
273
|
<% end %></pre>
|
@@ -134,7 +134,7 @@ module PgHero
|
|
134
134
|
if ["~~", "~~*"].include?(where.first[:op])
|
135
135
|
index[:found] = true
|
136
136
|
index[:row_progression] = [total_rows, index[:row_estimates].values.first]
|
137
|
-
index[:index] = {table: table, columns: ["#{where.first[:column]}
|
137
|
+
index[:index] = {table: table, columns: ["#{where.first[:column]} gist_trgm_ops"], using: "gist"}
|
138
138
|
else
|
139
139
|
# if most values are unique, no need to index others
|
140
140
|
rows_left = total_rows
|
data/lib/pghero/version.rb
CHANGED
data/test/best_index_test.rb
CHANGED
@@ -59,7 +59,7 @@ class BestIndexTest < Minitest::Test
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def test_like
|
62
|
-
assert_best_index ({table: "users", columns: ["email
|
62
|
+
assert_best_index ({table: "users", columns: ["email gist_trgm_ops"], using: "gist"}), "SELECT * FROM users WHERE email LIKE ?"
|
63
63
|
end
|
64
64
|
|
65
65
|
def test_like_where
|
@@ -67,11 +67,11 @@ class BestIndexTest < Minitest::Test
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def test_like_where2
|
70
|
-
assert_best_index ({table: "users", columns: ["email
|
70
|
+
assert_best_index ({table: "users", columns: ["email gist_trgm_ops"], using: "gist"}), "SELECT * FROM users WHERE email LIKE ? AND active = ?"
|
71
71
|
end
|
72
72
|
|
73
73
|
def test_ilike
|
74
|
-
assert_best_index ({table: "users", columns: ["email
|
74
|
+
assert_best_index ({table: "users", columns: ["email gist_trgm_ops"], using: "gist"}), "SELECT * FROM users WHERE email ILIKE ?"
|
75
75
|
end
|
76
76
|
|
77
77
|
def test_not_equals
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pghero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|