ruby-pg-extras 1.1.0 → 1.2.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1a8fb671f27484df51d29cc3e1a0be5eec628ae9146be825983b533ab88de05
|
4
|
+
data.tar.gz: e5b0857287abe7efd8049d0977f5091f96c73f3dd1684910883c9c3f2f0f3c39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c54949bfff9d743bf9024b2b0c9a125cd714e7a1513ca61a3258c2ae5ee28019bbf83c94ceb4f7a0261fdf6ac7c72a720736e6010358d6d110324cd3ca1c2fb5
|
7
|
+
data.tar.gz: 1a7b95e8e1e8b4a38775f3f9b483c6061bcb0d423c42e839c6a78cd398b47b6f692e4b881c99f8644510baa027f3270722573fa6d2c300402ae7a88506fe66c2
|
data/README.md
CHANGED
@@ -4,7 +4,17 @@ Ruby port of [Heroku PG Extras](https://github.com/heroku/heroku-pg-extras) with
|
|
4
4
|
|
5
5
|
Queries can be used to obtain information about a Postgres instance, that may be useful when analyzing performance issues. This includes information about locks, index usage, buffer cache hit ratios and vacuum statistics. Ruby API enables developers to easily integrate the tool into e.g. automatic monitoring tasks.
|
6
6
|
|
7
|
-
|
7
|
+
You can check out this blog post for detailed step by step tutorial on how to [optimize PostgreSQL using PG Extras library](https://pawelurbanek.com/postgresql-fix-performance).
|
8
|
+
|
9
|
+
Alternative versions:
|
10
|
+
|
11
|
+
- [Ruby on Rails](https://github.com/pawurb/rails-pg-extras)
|
12
|
+
|
13
|
+
- [NodeJS](https://github.com/pawurb/node-postgres-extras)
|
14
|
+
|
15
|
+
- [Elixir](https://github.com/pawurb/ecto_psql_extras)
|
16
|
+
|
17
|
+
- [Python](https://github.com/pawurb/python-pg-extras)
|
8
18
|
|
9
19
|
## Installation
|
10
20
|
|
@@ -14,6 +24,19 @@ In your Gemfile
|
|
14
24
|
gem "ruby-pg-extras"
|
15
25
|
```
|
16
26
|
|
27
|
+
Some of the queries (e.g., `calls` and `outliers`) require [pg_stat_statements](https://www.postgresql.org/docs/current/pgstatstatements.html) extension enabled.
|
28
|
+
|
29
|
+
You can check if it is enabled in your database by running:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
RubyPGExtras.extensions
|
33
|
+
```
|
34
|
+
You should see the similar line in the output:
|
35
|
+
|
36
|
+
```bash
|
37
|
+
| pg_stat_statements | 1.7 | 1.7 | track execution statistics of all SQL statements executed |
|
38
|
+
```
|
39
|
+
|
17
40
|
## Usage
|
18
41
|
|
19
42
|
Gem expects the `ENV['DATABASE_URL']` value in the following format:
|
@@ -265,7 +288,7 @@ RubyPGExtras.table_size
|
|
265
288
|
(truncated results for brevity)
|
266
289
|
```
|
267
290
|
|
268
|
-
This command displays the size of each table in the database, in MB. It is calculated by using the system administration function `pg_table_size()`, which includes the size of the main data fork, free space map, visibility map and TOAST data.
|
291
|
+
This command displays the size of each table and materialized view in the database, in MB. It is calculated by using the system administration function `pg_table_size()`, which includes the size of the main data fork, free space map, visibility map and TOAST data.
|
269
292
|
|
270
293
|
### `table_indexes_size`
|
271
294
|
|
@@ -283,7 +306,7 @@ RubyPGExtras.table_indexes_size
|
|
283
306
|
(truncated results for brevity)
|
284
307
|
```
|
285
308
|
|
286
|
-
This command displays the total size of indexes for each table, in MB. It is calcualtes by using the system administration function `pg_indexes_size()`.
|
309
|
+
This command displays the total size of indexes for each table and materialized view, in MB. It is calcualtes by using the system administration function `pg_indexes_size()`.
|
287
310
|
|
288
311
|
### `total_table_size`
|
289
312
|
|
@@ -301,7 +324,7 @@ RubyPGExtras.total_table_size
|
|
301
324
|
(truncated results for brevity)
|
302
325
|
```
|
303
326
|
|
304
|
-
This command displays the total size of each table in the database, in MB. It is calculated by using the system administration function `pg_total_relation_size()`, which includes table size, total index size and TOAST data.
|
327
|
+
This command displays the total size of each table and materialized view in the database, in MB. It is calculated by using the system administration function `pg_total_relation_size()`, which includes table size, total index size and TOAST data.
|
305
328
|
|
306
329
|
### `unused_indexes`
|
307
330
|
|
@@ -424,18 +447,22 @@ RubyPGExtras.kill_all
|
|
424
447
|
|
425
448
|
This commands kills all the currently active connections to the database. It can be useful as a last resort when your database is stuck in a deadlock.
|
426
449
|
|
427
|
-
### `
|
450
|
+
### `extensions`
|
428
451
|
|
429
452
|
```ruby
|
430
453
|
|
431
|
-
RubyPGExtras.
|
454
|
+
RubyPGExtras.extensions
|
432
455
|
|
433
456
|
```
|
434
457
|
|
435
|
-
This command
|
458
|
+
This command lists all the currently installed and available PostgreSQL extensions.
|
436
459
|
|
437
|
-
|
460
|
+
### `mandelbrot`
|
438
461
|
|
439
|
-
|
462
|
+
```ruby
|
440
463
|
|
441
|
-
|
464
|
+
RubyPGExtras.mandelbrot
|
465
|
+
|
466
|
+
```
|
467
|
+
|
468
|
+
This command outputs the Mandelbrot set, calculated through SQL.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-pg-extras
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -114,7 +114,7 @@ homepage: http://github.com/pawurb/ruby-pg-extras
|
|
114
114
|
licenses:
|
115
115
|
- MIT
|
116
116
|
metadata: {}
|
117
|
-
post_install_message:
|
117
|
+
post_install_message:
|
118
118
|
rdoc_options: []
|
119
119
|
require_paths:
|
120
120
|
- lib
|
@@ -129,8 +129,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
133
|
-
signing_key:
|
132
|
+
rubygems_version: 3.1.2
|
133
|
+
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Ruby PostgreSQL performance database insights
|
136
136
|
test_files:
|