Whenever people look for help with queries, one of the first things that I ask is: what is \d of the table.
Which works great, with the caveat, that the person on the other end must be somewhat familiar with psql. And quite often it's not the case.
So I figured, I can try to fix it.
Continue reading Now you can \d table not only in psql 🙂
Relatively often I have to run some command every n seconds, to see what is happening.
To do this I generally resort to writing simple one liner in shell:
=$ while true; do some command; sleep 5; done
But it gets tedious. So I fixed it, by writing run_every.
Continue reading Run a command every “x seconds"
I just pushed change to explain.depesz.com that allows for processing and displaying hints for plans.
For example, take a look at this plan, and check if you'll notice subtle “HINTS" tab.
In there you will see example hints – one about sort and memory, and the other about missing index.
It is not much, but it's a step in (hopefully) right direction, when the explain tool will also provide, automatically, some ideas on what to do to make the thing faster.
Hope you'll find it useful.
I am doing quite a lot of work inside tmux. I especially love that I can start multiple windows/panes and use them to run the same thing across multiple servers, while still having normal shell access between steps.
This thing was greatly improved when I wrote tmux_send_to_many, but one thing was missing – waiting for the thing, running in tmux window to end.
Generally, I had to look at all the windows, and decide when to launch next step on my own.
Continue reading Wait for program(s) in tmux panes to end…
I wrote previously about tmux_send_to_many and group_by shell tools that I authored.
Since then I got some more ideas for changes, and for new tool, so figured I'll make an honest git repo for it. Repo is on GitLab, and all the tools inside can be freely used.
While I was doing it, I fixed some things in tmux_send_to_many.
And then – I remembered that for long time I was missing “visual-sleep" type of tool. One that will show some progress information while it's working.
Continue reading visual sleep in shell, and shell_utils repo information
Otto Bretz reported bug in OmniPITR.
The bug was that when using -dr (remote destinations for backups) – you couldn't use –skip-xlogs. Obvious overlook on my side.
Fix was trivial, and so 1.3.2 version was born.
I just now committed new version of OmniPITR.
You can download it from:
The important change about 1.3.0 is that there is new tool – omnipitr-backup-cleanup. What is it for?
Continue reading OmniPITR 1.3.0
Yesterday, I did release new version of OmniPITR – 1.1.0.
You can get it from github or from PgXN.
What's new? Couple of things:
Continue reading New OmniPITR release
Some time ago I was looking (warning: post in polish) for someone to teach me proper parsing.
One of really great polish Perl programmers – Dozzie – reached out, and helped me. By the way – thanks a lot, Dozzie.
Based on what he taught me, I started writing module for parsing SQL queries. By that I mean proper parsing, with grammar (using Parse::Eyapp), and not set of regular expressions.
My parser is not ready. To say it lightly. Very lightly.
For now, it just knows how to parse the simplest queries like:
- select 1;
- select ‘a' as b;
I am working very slowly on it, so don't expect any usable version in any defined future. I will get there, eventually, but it is a project that I work on in my free time, after I finish everything else that I could work on in given moment.
This post is intended to announce that I'm working on it (so I will have kind of obligation to do it). And, if anyone is interested – I more than welcome all contributors/reviewers, and perhaps even critics 🙂
Final note – if you'll review the code, and want to comment on ugly list of regexps in Lexer – I know. It will be eventually replaced by one regular expression, but since it will be regular expression built by Regexp::Optimizer – it will not really be readable (though it will be faster than current approach).