rails-pg-extras 1.5.2 → 1.5.3

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: ec78b739d900e56a89e3a2afd0f714538175d7ea7a816cd00115982ead78f0ed
4
- data.tar.gz: ee936f6c5b7d6f48643d1dbe9a3e8245d36cb2369ec8675b3018b5ea9dad8c2a
3
+ metadata.gz: '039398a75ef2c3ce82ef8760784fc14d4d05496f590d64374a6863a4eb200b08'
4
+ data.tar.gz: 82d2d82c66aed09fff9276cf76a28ecb994175257ce9c0857cc5b3fd59d4b81e
5
5
  SHA512:
6
- metadata.gz: 98dae06049bf799eca77dfa53b7eb93ce9393c8fdd57e33bf70f993aba6067a507e3e6bb87b8cefee17868453337ca377ad315d9ef356b8980ecf14c4314f1a5
7
- data.tar.gz: c34522f7495a1782e215fe07ccfcb0d8bdad630f1ba456e2e8609398137f2dd8cf869c64f0a823a689c814a84eec87bae8dda280150ce1260f4ae2213dd49520
6
+ metadata.gz: 25305f71d527acb17f81b8e9e9f8c2b1420f7e07d8a43924eb69043f9be63ea578482e63c68a2800f6adf8b00d53472895ee8a0897a26a7ec0ec750b5250b94e
7
+ data.tar.gz: 4d6f3706e52305a885da9351b5e752cffadef0a074bf1139d362622adb37baa0409e103f59458141811e875a01581560fdce6702884cfbffeda88da70f98ec35
data/README.md CHANGED
@@ -89,7 +89,7 @@ RailsPGExtras.long_running_queries(args: { threshold: "200 milliseconds" })
89
89
 
90
90
  ### `cache_hit`
91
91
 
92
- ```
92
+ ```ruby
93
93
  RailsPGExtras.cache_hit
94
94
 
95
95
  $ rake pg_extras:cache_hit
@@ -103,9 +103,11 @@ $ rake pg_extras:cache_hit
103
103
 
104
104
  This command provides information on the efficiency of the buffer cache, for both index reads (`index hit rate`) as well as table reads (`table hit rate`). A low buffer cache hit ratio can be a sign that the Postgres instance is too small for the workload.
105
105
 
106
+ [More info](https://pawelurbanek.com/postgresql-fix-performance#cache-hit)
107
+
106
108
  ### `index_cache_hit`
107
109
 
108
- ```
110
+ ```ruby
109
111
 
110
112
  RailsPGExtras.index_cache_hit
111
113
 
@@ -121,9 +123,11 @@ $ rake pg_extras:index_cache_hit
121
123
 
122
124
  The same as `cache_hit` with each table's indexes cache hit info displayed separately.
123
125
 
126
+ [More info](https://pawelurbanek.com/postgresql-fix-performance#cache-hit)
127
+
124
128
  ### `table_cache_hit`
125
129
 
126
- ```
130
+ ```ruby
127
131
 
128
132
  RailsPGExtras.table_cache_hit
129
133
 
@@ -139,9 +143,31 @@ $ rake pg_extras:table_cache_hit
139
143
 
140
144
  The same as `cache_hit` with each table's cache hit info displayed seperately.
141
145
 
142
- ### `index_usage`
146
+ [More info](https://pawelurbanek.com/postgresql-fix-performance#cache-hit)
147
+
148
+ ### `db_settings`
149
+
150
+ ```ruby
151
+
152
+ RailsPGExtras.db_settings
153
+
154
+ $ rake pg_extras:db_settings
155
+
156
+ name | setting | unit |
157
+ ------------------------------+---------+------+
158
+ checkpoint_completion_target | 0.7 | |
159
+ default_statistics_target | 100 | |
160
+ effective_cache_size | 1350000 | 8kB |
161
+ effective_io_concurrency | 1 | |
162
+ (truncated results for brevity)
143
163
 
144
164
  ```
165
+
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
+
168
+ ### `index_usage`
169
+
170
+ ```ruby
145
171
  RailsPGExtras.index_usage
146
172
 
147
173
  $ rake pg_extras:index_usage
@@ -160,7 +186,7 @@ This command provides information on the efficiency of indexes, represented as w
160
186
 
161
187
  ### `locks`
162
188
 
163
- ```
189
+ ```ruby
164
190
  RailsPGExtras.locks
165
191
 
166
192
  $ rake pg_extras:locks
@@ -178,9 +204,11 @@ $ rake pg_extras:locks
178
204
 
179
205
  This command displays queries that have taken out an exclusive lock on a relation. Exclusive locks typically prevent other operations on that relation from taking place, and can be a cause of "hung" queries that are waiting for a lock to be granted.
180
206
 
207
+ [More info](https://pawelurbanek.com/postgresql-fix-performance#deadlocks)
208
+
181
209
  ### `all_locks`
182
210
 
183
- ```
211
+ ```ruby
184
212
  RailsPGExtras.all_locks
185
213
 
186
214
  $ rake pg_extras:all_locks
@@ -190,7 +218,7 @@ This command displays all the current locks, regardless of their type.
190
218
 
191
219
  ### `outliers`
192
220
 
193
- ```
221
+ ```ruby
194
222
  RubyPGExtras.outliers(args: { limit: 20 })
195
223
 
196
224
  $ rake pg_extras:outliers
@@ -210,9 +238,11 @@ This command displays statements, obtained from `pg_stat_statements`, ordered by
210
238
 
211
239
  Typically, an efficient query will have an appropriate ratio of calls to total execution time, with as little time spent on I/O as possible. Queries that have a high total execution time but low call count should be investigated to improve their performance. Queries that have a high proportion of execution time being spent on synchronous I/O should also be investigated.
212
240
 
241
+ [More info](https://pawelurbanek.com/postgresql-fix-performance#missing-indexes)
242
+
213
243
  ### `calls`
214
244
 
215
- ```
245
+ ```ruby
216
246
  RubyPGExtras.calls(args: { limit: 10 })
217
247
 
218
248
  $ rake pg_extras:calls
@@ -229,9 +259,11 @@ $ rake pg_extras:calls
229
259
 
230
260
  This command is much like `pg:outliers`, but ordered by the number of times a statement has been called.
231
261
 
262
+ [More info](https://pawelurbanek.com/postgresql-fix-performance#missing-indexes)
263
+
232
264
  ### `blocking`
233
265
 
234
- ```
266
+ ```ruby
235
267
  RubyPGExtras.blocking
236
268
 
237
269
  $ rake pg_extras:blocking
@@ -244,9 +276,11 @@ $ rake pg_extras:blocking
244
276
 
245
277
  This command displays statements that are currently holding locks that other statements are waiting to be released. This can be used in conjunction with `pg:locks` to determine which statements need to be terminated in order to resolve lock contention.
246
278
 
247
- #### `total_index_size`
279
+ [More info](https://pawelurbanek.com/postgresql-fix-performance#deadlocks)
248
280
 
249
- ```
281
+ ### `total_index_size`
282
+
283
+ ```ruby
250
284
  RubyPGExtras.total_index_size
251
285
 
252
286
  $ rake pg_extras:total_index_size
@@ -261,7 +295,7 @@ This command displays the total size of all indexes on the database, in MB. It i
261
295
 
262
296
  ### `index_size`
263
297
 
264
- ```
298
+ ```ruby
265
299
  RubyPGExtras.index_size
266
300
 
267
301
  $ rake pg_extras:index_size
@@ -284,7 +318,7 @@ This command displays the size of each each index in the database, in MB. It is
284
318
 
285
319
  ### `table_size`
286
320
 
287
- ```
321
+ ```ruby
288
322
  RubyPGExtras.table_size
289
323
 
290
324
  $ rake pg_extras:table_size
@@ -303,7 +337,7 @@ This command displays the size of each table and materialized view in the databa
303
337
 
304
338
  ### `table_indexes_size`
305
339
 
306
- ```
340
+ ```ruby
307
341
  RubyPGExtras.table_indexes_size
308
342
 
309
343
  $ rake pg_extras:table_indexes_size
@@ -322,7 +356,7 @@ This command displays the total size of indexes for each table and materialized
322
356
 
323
357
  ### `total_table_size`
324
358
 
325
- ```
359
+ ```ruby
326
360
  RubyPGExtras.total_table_size
327
361
 
328
362
  $ rake pg_extras:total_table_size
@@ -341,7 +375,7 @@ This command displays the total size of each table and materialized view in the
341
375
 
342
376
  ### `unused_indexes`
343
377
 
344
- ```
378
+ ```ruby
345
379
  RubyPGExtras.unused_indexes(args: { min_scans: 20 })
346
380
 
347
381
  $ rake pg_extras:unused_indexes
@@ -356,6 +390,8 @@ $ rake pg_extras:unused_indexes
356
390
 
357
391
  This command displays indexes that have < 50 scans recorded against them, and are greater than 5 pages in size, ordered by size relative to the number of index scans. This command is generally useful for eliminating indexes that are unused, which can impact write performance, as well as read performance should they occupy space in memory.
358
392
 
393
+ [More info](https://pawelurbanek.com/postgresql-fix-performance#unused-indexes)
394
+
359
395
  ### `null_indexes`
360
396
 
361
397
  ```ruby
@@ -372,11 +408,13 @@ $ rake pg_extras:null_indexes
372
408
 
373
409
  ```
374
410
 
375
- This commands displays indexes that contain `NULL` values. A high ratio of `NULL` values means that using a partial index excluding them will be beneficial in case they are not used for searching. [Source and more info](https://hakibenita.com/postgresql-unused-index-size).
411
+ This command displays indexes that contain `NULL` values. A high ratio of `NULL` values means that using a partial index excluding them will be beneficial in case they are not used for searching.
412
+
413
+ [More info](https://pawelurbanek.com/postgresql-fix-performance#null-indexes)
376
414
 
377
415
  ### `seq_scans`
378
416
 
379
- ```
417
+ ```ruby
380
418
  RubyPGExtras.seq_scans
381
419
 
382
420
  $ rake pg_extras:seq_scans
@@ -391,22 +429,16 @@ $ rake pg_extras:seq_scans
391
429
  messages | 3922247
392
430
  contests_customers | 2915972
393
431
  classroom_goals | 2142014
394
- contests | 1370267
395
- goals | 1112659
396
- districts | 158995
397
- rollup_reports | 115942
398
- customers | 93847
399
- schools | 92984
400
- classrooms | 92982
401
- customer_settings | 91226
402
432
  (truncated results for brevity)
403
433
  ```
404
434
 
405
435
  This command displays the number of sequential scans recorded against all tables, descending by count of sequential scans. Tables that have very high numbers of sequential scans may be under-indexed, and it may be worth investigating queries that read from these tables.
406
436
 
437
+ [More info](https://pawelurbanek.com/postgresql-fix-performance#missing-indexes)
438
+
407
439
  ### `long_running_queries`
408
440
 
409
- ```
441
+ ```ruby
410
442
  RubyPGExtras.long_running_queries(args: { threshold: "200 milliseconds" })
411
443
 
412
444
  $ rake pg_extras:long_running_queries
@@ -423,7 +455,7 @@ This command displays currently running queries, that have been running for long
423
455
 
424
456
  ### `records_rank`
425
457
 
426
- ```
458
+ ```ruby
427
459
  RubyPGExtras.records_rank
428
460
 
429
461
  $ rake pg_extras:records_rank
@@ -443,7 +475,7 @@ This command displays an estimated count of rows per table, descending by estima
443
475
 
444
476
  ### `bloat`
445
477
 
446
- ```
478
+ ```ruby
447
479
  RubyPGExtras.bloat
448
480
 
449
481
  $ rake pg_extras:bloat
@@ -460,9 +492,11 @@ $ rake pg_extras:bloat
460
492
 
461
493
  This command displays an estimation of table "bloat" – space allocated to a relation that is full of dead tuples, that has yet to be reclaimed. Tables that have a high bloat ratio, typically 10 or greater, should be investigated to see if vacuuming is aggressive enough, and can be a sign of high table churn.
462
494
 
495
+ [More info](https://pawelurbanek.com/postgresql-fix-performance#bloat)
496
+
463
497
  ### `vacuum_stats`
464
498
 
465
- ```
499
+ ```ruby
466
500
  RubyPGExtras.vacuum_stats
467
501
 
468
502
  $ rake pg_extras:vacuum_stats
@@ -490,7 +524,7 @@ This commands kills all the currently active connections to the database. It can
490
524
 
491
525
  ### `extensions`
492
526
 
493
- ```
527
+ ```ruby
494
528
 
495
529
  RailsPGExtras.extensions
496
530
 
@@ -505,7 +539,7 @@ This command lists all the currently installed and available PostgreSQL extensio
505
539
 
506
540
  ### mandelbrot
507
541
 
508
- ```
542
+ ```ruby
509
543
  RailsPGExtras.mandelbrot
510
544
 
511
545
  $ rake pg_extras:mandelbrot
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsPGExtras
4
- VERSION = "1.5.2"
4
+ VERSION = "1.5.3"
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: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-13 00:00:00.000000000 Z
11
+ date: 2021-02-16 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.5.2
19
+ version: 1.5.3
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.5.2
26
+ version: 1.5.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord
29
29
  requirement: !ruby/object:Gem::Requirement