pgdexter 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -24
- data/lib/dexter/indexer.rb +11 -5
- data/lib/dexter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c68746f6134f6603c5549b561886b45ee3432df5d1e07e65a5907559901d333a
|
4
|
+
data.tar.gz: 699c2744f3e2c9a79f8fa9ca6ae7a77586421243cbf7a1f92642f76724cc0cb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 343bc52539ef09541fd0774667034ea02fb88b0e4f820e52c86d77df46d059c253576c22272b91a407b764965f66c554278154da6ab923249ce9979ab3a5aed0
|
7
|
+
data.tar.gz: a9b86931b4fc58d2b89c87f46f5008dfd47274cc39f096ec2b5143bea8858e29a786e387f9ccc29fe74475b5b0317e9d348d36f2a686cb19457ee79179a270f5
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -12,8 +12,8 @@ First, install [HypoPG](https://github.com/HypoPG/hypopg) on your database serve
|
|
12
12
|
|
13
13
|
```sh
|
14
14
|
cd /tmp
|
15
|
-
curl -L https://github.com/HypoPG/hypopg/archive/1.
|
16
|
-
cd hypopg-1.
|
15
|
+
curl -L https://github.com/HypoPG/hypopg/archive/1.4.0.tar.gz | tar xz
|
16
|
+
cd hypopg-1.4.0
|
17
17
|
make
|
18
18
|
make install # may need sudo
|
19
19
|
```
|
@@ -174,26 +174,6 @@ When streaming logs, specify the time to wait between processing queries
|
|
174
174
|
dexter --interval 60 # seconds
|
175
175
|
```
|
176
176
|
|
177
|
-
## Examples
|
178
|
-
|
179
|
-
Postgres package on Ubuntu 22.04
|
180
|
-
|
181
|
-
```sh
|
182
|
-
sudo -u postgres dexter -d dbname /var/log/postgresql/postgresql-14-main.log
|
183
|
-
```
|
184
|
-
|
185
|
-
Homebrew Postgres on Mac ARM
|
186
|
-
|
187
|
-
```sh
|
188
|
-
dexter -d dbname /opt/homebrew/var/log/postgresql@14.log
|
189
|
-
```
|
190
|
-
|
191
|
-
Homebrew Postgres on Mac x86-64
|
192
|
-
|
193
|
-
```sh
|
194
|
-
dexter -d dbname /usr/local/var/log/postgresql@14.log
|
195
|
-
```
|
196
|
-
|
197
177
|
## Analyze
|
198
178
|
|
199
179
|
For best results, make sure your tables have been recently analyzed so statistics are up-to-date. You can ask Dexter to analyze tables it comes across that haven’t been analyzed in the past hour with:
|
@@ -230,9 +210,8 @@ The `hypopg` extension, which Dexter needs to run, is available on [these provid
|
|
230
210
|
|
231
211
|
For other providers, see [this guide](guides/Hosted-Postgres.md). To request a new extension:
|
232
212
|
|
233
|
-
- Amazon RDS - follow the instructions on [this page](https://aws.amazon.com/rds/postgresql/faqs/)
|
234
213
|
- Google Cloud SQL - vote or comment on [this page](https://issuetracker.google.com/issues/69250435)
|
235
|
-
- DigitalOcean Managed Databases - vote or comment on [this page](https://ideas.digitalocean.com/
|
214
|
+
- DigitalOcean Managed Databases - vote or comment on [this page](https://ideas.digitalocean.com/managed-database/p/support-hypopg-for-postgres)
|
236
215
|
|
237
216
|
## HypoPG Installation Notes
|
238
217
|
|
data/lib/dexter/indexer.rb
CHANGED
@@ -197,10 +197,16 @@ module Dexter
|
|
197
197
|
possible_columns = Set.new
|
198
198
|
explainable_queries.each do |query|
|
199
199
|
log "Finding columns: #{query.statement}" if @log_level == "debug3"
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
200
|
+
begin
|
201
|
+
find_columns(query.tree).each do |col|
|
202
|
+
last_col = col["fields"].last
|
203
|
+
if last_col["String"]
|
204
|
+
possible_columns << last_col["String"]["sval"]
|
205
|
+
end
|
206
|
+
end
|
207
|
+
rescue JSON::NestingError
|
208
|
+
if @log_level.start_with?("debug")
|
209
|
+
log colorize("ERROR: Cannot get columns", :red)
|
204
210
|
end
|
205
211
|
end
|
206
212
|
end
|
@@ -226,7 +232,7 @@ module Dexter
|
|
226
232
|
end
|
227
233
|
|
228
234
|
def find_columns(plan)
|
229
|
-
plan = JSON.parse(plan.to_json)
|
235
|
+
plan = JSON.parse(plan.to_json, max_nesting: 1000)
|
230
236
|
find_by_key(plan, "ColumnRef")
|
231
237
|
end
|
232
238
|
|
data/lib/dexter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgdexter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|