rails-pg-extras 3.2.3 → 3.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -0
- data/lib/rails-pg-extras/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e031e302ba7d1d37ee90ac720128a69fb39c75d83b98bf2f7163e6689019b71
|
4
|
+
data.tar.gz: 5dc53d1aa42831aaa4b208efb60ea0757e2703e47260b63c886d5b242577a216
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: febe02de1484d4b29d444bdba8b74b731a6516c93ece6d3f798a39022a93c9447eb14b39edcaa5a6685c39da8d02e107fda3e5760a02922ef2172fbf08bb82a2
|
7
|
+
data.tar.gz: 863595f41a38414e4f8e2fc18cddea442b5f90f9ba2ebc2e906a8db704ef3a9a39c9fc7ad504ba332e8c780018fe1ebbd590d98914e5edadb664afae29b3ad49
|
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
|
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.
|
4
|
+
version: 3.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-21 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.
|
19
|
+
version: 3.2.4
|
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.
|
26
|
+
version: 3.2.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|