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: 6fe955faca71da76601e1e7d55ca59608a05ead32482d21bcba4fb86763b2916
4
- data.tar.gz: c3605758915cee4edcc15e12424513acf5ba26b65d36adb52d8af626807513f6
3
+ metadata.gz: c1a8fb671f27484df51d29cc3e1a0be5eec628ae9146be825983b533ab88de05
4
+ data.tar.gz: e5b0857287abe7efd8049d0977f5091f96c73f3dd1684910883c9c3f2f0f3c39
5
5
  SHA512:
6
- metadata.gz: 6414a45110bcd0404f3d36f3f074f65ed86560989c2e25f245c38d2ea694cdac961c94d58790235d3e5d80937ca62f27f0565dc007a0e8a9f32ecdeca1a9a711
7
- data.tar.gz: 1808fb4368882f5727926c8722e018be2d25b98395374df129c8cd9238568d43cec29cc3bfae79aa775ec6100958579818aa158daeb84980c1a478dedaf053f5
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
- Are you riding on Rails? Check out the [Rails version](https://github.com/pawurb/rails-pg-extras).
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
- ### `mandelbrot`
450
+ ### `extensions`
428
451
 
429
452
  ```ruby
430
453
 
431
- RubyPGExtras.mandelbrot
454
+ RubyPGExtras.extensions
432
455
 
433
456
  ```
434
457
 
435
- This command outputs the Mandelbrot set, calculated through SQL.
458
+ This command lists all the currently installed and available PostgreSQL extensions.
436
459
 
437
- ## FAQ
460
+ ### `mandelbrot`
438
461
 
439
- * Does is not violate the Heroku PG Extras license?
462
+ ```ruby
440
463
 
441
- The original plugin is MIT based so it means that copying and redistribution in any format is permitted.
464
+ RubyPGExtras.mandelbrot
465
+
466
+ ```
467
+
468
+ This command outputs the Mandelbrot set, calculated through SQL.
@@ -6,5 +6,5 @@ FROM pg_class c
6
6
  LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace)
7
7
  WHERE n.nspname NOT IN ('pg_catalog', 'information_schema')
8
8
  AND n.nspname !~ '^pg_toast'
9
- AND c.relkind='r'
9
+ AND c.relkind IN ('r', 'm')
10
10
  ORDER BY pg_indexes_size(c.oid) DESC;
@@ -6,5 +6,5 @@ FROM pg_class c
6
6
  LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace)
7
7
  WHERE n.nspname NOT IN ('pg_catalog', 'information_schema')
8
8
  AND n.nspname !~ '^pg_toast'
9
- AND c.relkind='r'
9
+ AND c.relkind IN ('r', 'm')
10
10
  ORDER BY pg_table_size(c.oid) DESC;
@@ -6,5 +6,5 @@ FROM pg_class c
6
6
  LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace)
7
7
  WHERE n.nspname NOT IN ('pg_catalog', 'information_schema')
8
8
  AND n.nspname !~ '^pg_toast'
9
- AND c.relkind='r'
9
+ AND c.relkind IN ('r', 'm')
10
10
  ORDER BY pg_total_relation_size(c.oid) DESC;
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RubyPGExtras
2
- VERSION = "1.1.0"
4
+ VERSION = "1.2.4"
3
5
  end
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.1.0
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-02-23 00:00:00.000000000 Z
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.0.6
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: