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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d77eb8abd5e212bfd047e51833fb060f70db7025
4
- data.tar.gz: 37615f251c48027095056c84e3d14654fb2a9b57
3
+ metadata.gz: 88bdee267422f250773f1764fb7b7afea03344b1
4
+ data.tar.gz: 378e02b5b0c4e3f59646bada6899a203b22ff111
5
5
  SHA512:
6
- metadata.gz: 773cb04370074357513902e3a707d292e3c67efe2e4b0d2df30cd93d828d1ac104e34f1695cc4a4b63015f9dd8d01c4d0e1264fd32e3f1ebbd3a307e1b900ab9
7
- data.tar.gz: fb72f6b6ccc15dce99eee4a68200ad4b0d7a17dbc470362d1ab0aa2c570a7ec574ad22f8c300b0be251137154274ac0fbe900fee3e453753fcfca108b1834e94
6
+ metadata.gz: 3cac1afe8db164aa87aaa614a2210b7f38b5e6746ab58e3b9931510b1481e579ff03438f1471ac5037379e8123342fc47e526eeb308f94dba9ea6901e7fa53f6
7
+ data.tar.gz: 1675887b2ea3d5ca45dfa5c5964c35c3e30de771171387fd379efc4cf92d1379e7013281274477d5c8717a0549f560857b27e22284d4558d2449083e08bd1217
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.6.2
2
+
3
+ - Suggest GiST over GIN for `LIKE` queries again (seeing better performance)
4
+
1
5
  ## 1.6.1
2
6
 
3
7
  - Suggest GIN over GiST for `LIKE` queries
@@ -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
- # run directly on production database - Rails has trouble with GIN indexes
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]} gin_trgm_ops"], using: "gin"}
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
@@ -1,3 +1,3 @@
1
1
  module PgHero
2
- VERSION = "1.6.1"
2
+ VERSION = "1.6.2"
3
3
  end
@@ -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 gin_trgm_ops"], using: "gin"}), "SELECT * FROM users WHERE email LIKE ?"
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 gin_trgm_ops"], using: "gin"}), "SELECT * FROM users WHERE email LIKE ? AND active = ?"
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 gin_trgm_ops"], using: "gin"}), "SELECT * FROM users WHERE email ILIKE ?"
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.1
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-25 00:00:00.000000000 Z
11
+ date: 2016-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord