rails-pg-extras 1.5.3 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +38 -14
- 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: b44baf89a4349ef720b371a8a83a8397e0e848794b1bf248398cfd19c5f606d5
|
4
|
+
data.tar.gz: ebdabe9d275ed5ef7132ce604f894a42520226db0b1dc5d50acd092a0aed6dd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0b9e1505835974df1959e620385461f7c5c92838efadd18abb57a5656d1b942d8f097f7c70389e815a96a5dcb239b67b16cee430188e0532ccef57eb2a6ff50
|
7
|
+
data.tar.gz: 269a9b8bb29c5114c43885d61f849b3ed73664cb7c5e9e772c85281cacebbce641b224fe0e246bda5a7ab5426210ee3a75a0ac0a36c6555abb64988d7b66b733
|
data/README.md
CHANGED
@@ -165,6 +165,8 @@ $ rake pg_extras:db_settings
|
|
165
165
|
|
166
166
|
This method displays values for selected PostgreSQL settings. You can compare them with settings recommended by [PGTune](https://pgtune.leopard.in.ua/#/) and tweak values to improve performance.
|
167
167
|
|
168
|
+
[More info](https://pawelurbanek.com/postgresql-fix-performance#cache-hit)
|
169
|
+
|
168
170
|
### `index_usage`
|
169
171
|
|
170
172
|
```ruby
|
@@ -219,7 +221,7 @@ This command displays all the current locks, regardless of their type.
|
|
219
221
|
### `outliers`
|
220
222
|
|
221
223
|
```ruby
|
222
|
-
|
224
|
+
RailsPGExtras.outliers(args: { limit: 20 })
|
223
225
|
|
224
226
|
$ rake pg_extras:outliers
|
225
227
|
|
@@ -243,7 +245,7 @@ Typically, an efficient query will have an appropriate ratio of calls to total e
|
|
243
245
|
### `calls`
|
244
246
|
|
245
247
|
```ruby
|
246
|
-
|
248
|
+
RailsPGExtras.calls(args: { limit: 10 })
|
247
249
|
|
248
250
|
$ rake pg_extras:calls
|
249
251
|
|
@@ -264,7 +266,7 @@ This command is much like `pg:outliers`, but ordered by the number of times a st
|
|
264
266
|
### `blocking`
|
265
267
|
|
266
268
|
```ruby
|
267
|
-
|
269
|
+
RailsPGExtras.blocking
|
268
270
|
|
269
271
|
$ rake pg_extras:blocking
|
270
272
|
|
@@ -281,7 +283,7 @@ This command displays statements that are currently holding locks that other sta
|
|
281
283
|
### `total_index_size`
|
282
284
|
|
283
285
|
```ruby
|
284
|
-
|
286
|
+
RailsPGExtras.total_index_size
|
285
287
|
|
286
288
|
$ rake pg_extras:total_index_size
|
287
289
|
|
@@ -296,7 +298,7 @@ This command displays the total size of all indexes on the database, in MB. It i
|
|
296
298
|
### `index_size`
|
297
299
|
|
298
300
|
```ruby
|
299
|
-
|
301
|
+
RailsPGExtras.index_size
|
300
302
|
|
301
303
|
$ rake pg_extras:index_size
|
302
304
|
name | size
|
@@ -319,7 +321,7 @@ This command displays the size of each each index in the database, in MB. It is
|
|
319
321
|
### `table_size`
|
320
322
|
|
321
323
|
```ruby
|
322
|
-
|
324
|
+
RailsPGExtras.table_size
|
323
325
|
|
324
326
|
$ rake pg_extras:table_size
|
325
327
|
|
@@ -338,7 +340,7 @@ This command displays the size of each table and materialized view in the databa
|
|
338
340
|
### `table_indexes_size`
|
339
341
|
|
340
342
|
```ruby
|
341
|
-
|
343
|
+
RailsPGExtras.table_indexes_size
|
342
344
|
|
343
345
|
$ rake pg_extras:table_indexes_size
|
344
346
|
|
@@ -357,7 +359,7 @@ This command displays the total size of indexes for each table and materialized
|
|
357
359
|
### `total_table_size`
|
358
360
|
|
359
361
|
```ruby
|
360
|
-
|
362
|
+
RailsPGExtras.total_table_size
|
361
363
|
|
362
364
|
$ rake pg_extras:total_table_size
|
363
365
|
|
@@ -376,7 +378,7 @@ This command displays the total size of each table and materialized view in the
|
|
376
378
|
### `unused_indexes`
|
377
379
|
|
378
380
|
```ruby
|
379
|
-
|
381
|
+
RailsPGExtras.unused_indexes(args: { min_scans: 20 })
|
380
382
|
|
381
383
|
$ rake pg_extras:unused_indexes
|
382
384
|
|
@@ -415,7 +417,7 @@ This command displays indexes that contain `NULL` values. A high ratio of `NULL`
|
|
415
417
|
### `seq_scans`
|
416
418
|
|
417
419
|
```ruby
|
418
|
-
|
420
|
+
RailsPGExtras.seq_scans
|
419
421
|
|
420
422
|
$ rake pg_extras:seq_scans
|
421
423
|
|
@@ -439,7 +441,7 @@ This command displays the number of sequential scans recorded against all tables
|
|
439
441
|
### `long_running_queries`
|
440
442
|
|
441
443
|
```ruby
|
442
|
-
|
444
|
+
RailsPGExtras.long_running_queries(args: { threshold: "200 milliseconds" })
|
443
445
|
|
444
446
|
$ rake pg_extras:long_running_queries
|
445
447
|
|
@@ -456,7 +458,7 @@ This command displays currently running queries, that have been running for long
|
|
456
458
|
### `records_rank`
|
457
459
|
|
458
460
|
```ruby
|
459
|
-
|
461
|
+
RailsPGExtras.records_rank
|
460
462
|
|
461
463
|
$ rake pg_extras:records_rank
|
462
464
|
|
@@ -476,7 +478,7 @@ This command displays an estimated count of rows per table, descending by estima
|
|
476
478
|
### `bloat`
|
477
479
|
|
478
480
|
```ruby
|
479
|
-
|
481
|
+
RailsPGExtras.bloat
|
480
482
|
|
481
483
|
$ rake pg_extras:bloat
|
482
484
|
|
@@ -497,7 +499,7 @@ This command displays an estimation of table "bloat" – space allocated to a re
|
|
497
499
|
### `vacuum_stats`
|
498
500
|
|
499
501
|
```ruby
|
500
|
-
|
502
|
+
RailsPGExtras.vacuum_stats
|
501
503
|
|
502
504
|
$ rake pg_extras:vacuum_stats
|
503
505
|
|
@@ -522,6 +524,22 @@ RailsPGExtras.kill_all
|
|
522
524
|
|
523
525
|
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.
|
524
526
|
|
527
|
+
### `buffercache_stats`
|
528
|
+
|
529
|
+
This command shows the relations buffered in database share buffer, ordered by percentage taken. It also shows that how much of the whole relation is buffered.
|
530
|
+
|
531
|
+
```ruby
|
532
|
+
RailsPGExtras.buffercache_stats(args: { limit: 10 })
|
533
|
+
```
|
534
|
+
|
535
|
+
### `buffercache_usage`
|
536
|
+
|
537
|
+
This command calculates how many blocks from which table are currently cached.
|
538
|
+
|
539
|
+
```ruby
|
540
|
+
RailsPGExtras.buffercache_usage(args: { limit: 20 })
|
541
|
+
```
|
542
|
+
|
525
543
|
### `extensions`
|
526
544
|
|
527
545
|
```ruby
|
@@ -546,3 +564,9 @@ $ rake pg_extras:mandelbrot
|
|
546
564
|
```
|
547
565
|
|
548
566
|
This command outputs the Mandelbrot set, calculated through SQL.
|
567
|
+
|
568
|
+
## Query sources
|
569
|
+
|
570
|
+
- [https://github.com/heroku/heroku-pg-extras](https://github.com/heroku/heroku-pg-extras)
|
571
|
+
- [https://hakibenita.com/postgresql-unused-index-size](https://hakibenita.com/postgresql-unused-index-size)
|
572
|
+
- [https://sites.google.com/site/itmyshare/database-tips-and-examples/postgres/useful-sqls-to-check-contents-of-postgresql-shared_buffer](https://sites.google.com/site/itmyshare/database-tips-and-examples/postgres/useful-sqls-to-check-contents-of-postgresql-shared_buffer)
|
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: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-05 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: 1.
|
19
|
+
version: 1.6.0
|
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: 1.
|
26
|
+
version: 1.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|