rails-pg-extras 3.2.2 → 3.2.6

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
  SHA256:
3
- metadata.gz: e274fc39b73b8bdaf1b0f0f2a92fed8024e99b2796b208967f87d796ae9edbd2
4
- data.tar.gz: 34cdb4362d0fd7240c4eac857cfd24d342a4e99eed7cda2eb20791bd8bce6c86
3
+ metadata.gz: 61fe79e54e6f5d4625eb9edbc7afce7628d054471cb817c3975abc959d9e081e
4
+ data.tar.gz: e8bf1dd9cf089985eee7c847266bd09daba3c185a14491476b82e2118881f219
5
5
  SHA512:
6
- metadata.gz: d9045c9281c65bb9648898102d534e0cecc05a675949cd394900e8b7c821fb46b69e93e4fbb6243d470a77568858ce3295f61c95ce86737e604f7b687cbf05bd
7
- data.tar.gz: fa66c8f4f06f233a2a2a8288d69c5e4fb257c1c2801f4c7f8c90bac722a4d82cce439759c2fe893986043ba3a30816ccd31e155ed6ab8e1666717d34a549cb5f
6
+ metadata.gz: 9ad4123d71d198410bfb4630578b4e522f7222b8cf770bba13d3948cc448f6745266870216b9df6eb82f17fc712f910b185355cef5ca7a8a3a52a988ca48262e
7
+ data.tar.gz: e46694f09703f848c30ed8862c7a316bfe98c86e45540b88a3b6c4d399440257cef78ce8d4849a6c8d0b852578635331322346137788378ecdecc4f9e7e4a008
data/README.md CHANGED
@@ -113,6 +113,38 @@ Keep reading to learn about methods that `diagnose` uses under the hood.
113
113
 
114
114
  ## Available methods
115
115
 
116
+ ### `table_info`
117
+
118
+ This method displays metadata metrics for all or a selected table. You can use it to check the table's size, its cache hit metrics, and whether it is correctly indexed. Many sequential scans or no index scans are potential indicators of misconfigured indexes. This method aggregates data provided by other methods in an easy to analyze summary format.
119
+
120
+ ```ruby
121
+ RailsPGExtras.table_info(args: { table_name: "users" })
122
+
123
+ | Table name | Table size | Table cache hit | Indexes cache hit | Estimated rows | Sequential scans | Indexes scans |
124
+ +------------+------------+-------------------+--------------------+----------------+------------------+---------------+
125
+ | users | 2432 kB | 0.999966685701511 | 0.9988780464661853 | 16650 | 2128 | 512496 |
126
+
127
+ ```
128
+
129
+ ### `index_info`
130
+
131
+ This method returns summary info about database indexes. You can check index size, how often it is used and what percentage of its total size are NULL values. Like the previous method, it aggregates data from other helper methods in an easy-to-digest format.
132
+
133
+ ```ruby
134
+
135
+ RailsPGExtras.index_info(args: { table_name: "users" })
136
+
137
+ | Index name | Table name | Columns | Index size | Index scans | Null frac |
138
+ +-------------------------------+------------+----------------+------------+-------------+-----------+
139
+ | users_pkey | users | id | 1152 kB | 163007 | 0.00% |
140
+ | index_users_on_slack_id | users | slack_id | 1080 kB | 258870 | 0.00% |
141
+ | index_users_on_team_id | users | team_id | 816 kB | 70962 | 0.00% |
142
+ | index_users_on_uuid | users | uuid | 1032 kB | 0 | 0.00% |
143
+ | index_users_on_block_uuid | users | block_uuid | 776 kB | 19502 | 100.00% |
144
+ | index_users_on_api_auth_token | users | api_auth_token | 1744 kB | 156 | 0.00% |
145
+
146
+ ```
147
+
116
148
  ### `cache_hit`
117
149
 
118
150
  ```ruby
@@ -24,4 +24,14 @@ namespace :pg_extras do
24
24
  task diagnose: :establish_connection do
25
25
  RailsPGExtras.diagnose
26
26
  end
27
+
28
+ desc "Display tables metadata metrics"
29
+ task table_info: :establish_connection do
30
+ RailsPGExtras.table_info
31
+ end
32
+
33
+ desc "Display indexes metadata metrics"
34
+ task index_info: :establish_connection do
35
+ RailsPGExtras.index_info
36
+ end
27
37
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsPGExtras
4
- VERSION = "3.2.2"
4
+ VERSION = "3.2.6"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-pg-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2
4
+ version: 3.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-18 00:00:00.000000000 Z
11
+ date: 2022-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-pg-extras
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.2
19
+ version: 3.2.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.2.2
26
+ version: 3.2.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -101,7 +101,7 @@ homepage: http://github.com/pawurb/rails-pg-extras
101
101
  licenses:
102
102
  - MIT
103
103
  metadata: {}
104
- post_install_message:
104
+ post_install_message:
105
105
  rdoc_options: []
106
106
  require_paths:
107
107
  - lib
@@ -116,8 +116,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  requirements: []
119
- rubygems_version: 3.0.3
120
- signing_key:
119
+ rubygems_version: 3.1.6
120
+ signing_key:
121
121
  specification_version: 4
122
122
  summary: Rails PostgreSQL performance database insights
123
123
  test_files: