active_record-postgresql_analyzer 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48346e9b45b296079f47b4f8e6ab72cdfcb0dd22
4
- data.tar.gz: cea9476bc847cd85b0372c2248439d13af34a581
3
+ metadata.gz: ee6e9a0c0ea12fec81e8ae197746efec6dc45629
4
+ data.tar.gz: 89734ff80f31998cee14c22b6a73917f858c573d
5
5
  SHA512:
6
- metadata.gz: fa34f74a917896807b0df17d664402443964671e29aa7ed07b1f238b589cb84fd59ce0da8c4af9c29479bad478d46f4447d810c2a4680eeb1c52aa16903f08aa
7
- data.tar.gz: 01b4c486af1fa7c0e16a205cb06220704c14244faf509730570bac382d2cc739d622c1a3c9cdded3f49101b1b0eda9acb089cacba09b3df3594bfa6427353b3c
6
+ metadata.gz: 699c8126954a4998cea8d9f6d680c7334cfa13b0760c576c971e426fa886e596d6f60194b7e9dfae2fb01e10f66cde316f1ad28066ec487dde2468033b96bcb4
7
+ data.tar.gz: 84188c59aa2d5dd8c35f1867ff29264365b22df1afe7cea96a2bab9d2b5decbe592537c01d44d840ef57dcfc1da7574f5336f91be4ddfda90af2207d8766e9ed
@@ -2,3 +2,11 @@ language: ruby
2
2
  rvm:
3
3
  - 2.1.3
4
4
  before_install: gem install bundler -v 1.10.5
5
+ before_script:
6
+ - psql -c 'create database travis_ci_test;' -U postgres
7
+ env:
8
+ - DB_NAME=travis_ci_test DB_USER=postgres
9
+ gemfile:
10
+ - gemfiles/3.2.gemfile
11
+ - gemfiles/4.1.gemfile
12
+ - gemfiles/4.2.gemfile
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # ActiveRecord::PostgreSQLAnalyzer
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/active_record-postgresql_analyzer.svg)](https://badge.fury.io/rb/active_record-postgresql_analyzer)
4
+ [![Build Status](https://travis-ci.org/m3dev/active_record-postgresql_analyzer.svg)](https://travis-ci.org/m3dev/active_record-postgresql_analyzer)
4
5
 
5
6
  Analyze the execution plan and write log if sequential scan is detected.
6
7
 
@@ -15,11 +15,13 @@ module ActiveRecord
15
15
 
16
16
  return if ignore_payload?(payload)
17
17
 
18
+ connection = ObjectSpace._id2ref(payload[:connection_id])
19
+
18
20
  # disable SeqScan when index exists
19
21
  # SEE ALSO: http://www.postgresql.org/docs/9.4/static/indexes-examine.html
20
- ActiveRecord::Base.connection.execute("SET enable_seqscan TO off", "SCHEMA")
22
+ connection.execute("SET enable_seqscan TO off", "SCHEMA")
21
23
 
22
- explain_result = ActiveRecord::Base.connection.explain(payload[:sql], payload[:binds])
24
+ explain_result = connection.explain(payload[:sql], payload[:binds])
23
25
  if seq_scan?(explain_result)
24
26
  debug '------------ find Seq Scan query ------------'
25
27
  debug payload[:sql]
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module PostgreSQLAnalyzer
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record-postgresql_analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takayuki Matsubara
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-15 00:00:00.000000000 Z
11
+ date: 2017-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.2.2
126
+ rubygems_version: 2.6.13
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Analyze the execution plan and write log if sequential scan is detected