ruby-pg-extras 1.5.0 → 1.5.1

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: 741b8ec49ba2e7b4933ddbe085bd3c4f90ab1640e951fdec1dfa1178c4bf8ab0
4
- data.tar.gz: d1b7d405ef8da4bcd450e461a6ff4411b760128bd22e660c1dc102aaa1cf9453
3
+ metadata.gz: 869687fea5c3e1c4c00ddd705bd3446413529164b8d628368daff0fe7161ee94
4
+ data.tar.gz: 074a7847ca0e36fad4059a5650d2a02806d01da92deeabb19bf1a93ae490366f
5
5
  SHA512:
6
- metadata.gz: ce5011d3e926a7b1a246b6268d7d58a8f05f26bbab22bd665209daec81f4d03867b78c8306f6d3ebd4661acc1ae96640427ea33486d3ab6f91b1716c20b11cc1
7
- data.tar.gz: 1cee23d5f7e171bdd13eeea76102a59ff1ad6774a9b1c80b614e76e9d4a60d4b76b098403fd69e7e5913c001d98e0b4792fc1f58762234d0b10af7cbd6a1ef6e
6
+ metadata.gz: 4d51fd8809cda4c5d167a352ab6a0c1dbd09e043474a5a763e4ca1853a35d0f4fda8788d7f603bd89238823ddf1cb1a9014eec97674ea039b367d3b449f6ab96
7
+ data.tar.gz: d1fcf3c26a1ff72ae8b2cff877c650d38e5ebc03b4ef139c62a9f7be04582882e1f18f9b24ac1bfcb2fc746492ac5e28fe63009afa77413a1cf3a0d4f626a65c
data/README.md CHANGED
@@ -359,9 +359,9 @@ RubyPGExtras.null_indexes
359
359
 
360
360
  oid | index | index_size | unique | indexed_column | null_frac | expected_saving
361
361
  ---------+--------------------+------------+--------+----------------+-----------+-----------------
362
- 183764 | users_reset_token | 1418 MB | t | reset_token | 96.15% | 1363 MB
363
- 88732 | plan_cancelled_at | 1651 MB | f | cancelled_at | 6.11% | 101 MB
364
- 9827345 | users_email | 22 MB | t | email | 11.21% | 2494 kB
362
+ 183764 | users_reset_token | 1445 MB | t | reset_token | 97.00% | 1401 MB
363
+ 88732 | plan_cancelled_at | 539 MB | f | cancelled_at | 8.30% | 44 MB
364
+ 9827345 | users_email | 18 MB | t | email | 28.67% | 5160 kB
365
365
 
366
366
  ```
367
367
 
@@ -21,7 +21,8 @@ module RubyPGExtras
21
21
  calls: { limit: 10 },
22
22
  long_running_queries: { threshold: "500 milliseconds" },
23
23
  outliers: { limit: 10 },
24
- unused_indexes: { min_scans: 50 }
24
+ unused_indexes: { min_scans: 50 },
25
+ null_indexes: { min_relation_size_mb: 10 }
25
26
  })
26
27
 
27
28
  QUERIES.each do |query_name|
@@ -1,4 +1,4 @@
1
- /* Find indexed columns with high null_frac */
1
+ /* Find indexes with a high ratio of NULL values */
2
2
  SELECT
3
3
  c.oid,
4
4
  c.relname AS index,
@@ -26,7 +26,7 @@ WHERE
26
26
  AND array_length(i.indkey, 1) = 1
27
27
  -- Exclude indexes without null_frac ratio
28
28
  AND coalesce(s.null_frac, 0) != 0
29
- -- Larger than 10MB
30
- AND pg_relation_size(c.oid) > 10 * 1024 ^ 2
29
+ -- Larger than threshold
30
+ AND pg_relation_size(c.oid) > %{min_relation_size_mb} * 1024 ^ 2
31
31
  ORDER BY
32
32
  pg_relation_size(c.oid) * s.null_frac DESC;
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyPGExtras
4
- VERSION = "1.5.0"
4
+ VERSION = "1.5.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-pg-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb