pgCenter’s wait events profiler

As you might know, in the last pgCenter release the new tool has been added - wait events profiler. In this post, I'd like to explore this tool and propose some use-cases for it.

First of all, what are “wait events”? PostgreSQL official documentation doesn't give an explanation for wait events (it just provides a list of all wait events). In short, wait events are points in time where backends have to wait until a particular event occurs. This may be waiting for obtaining locks, IO, inter-process communication, interacting with client or something else. Stats about wait events are provided by pg_stat_activity view in wait_event_type and wait_event columns.

Using EXPLAIN we always can understand what query does. But EXPLAIN is aimed to work with query planner and doesn't show time when query got stuck in waitings. For this, you can use pgCenter's wait events profiler.

How does it work? First, you need to know PID of profiled backend. It can be found using pg_stat_activity

pgCenter 0.6.0 released.

Great news for all pgCenter users - a new version 0.6.0 has been released with new features and few minor improvements.

Here are some major changes:
new wait events profiler - a new sub-command which allows to inspect long-running queries and understand what query spends its time on.goreleaser support - goreleaser helps to build binary packages for you, so you can find .rpm and .deb packages on the releases page.Goreport card A+ status - A+ status is the little step to make code better and align it to Golang code styleThis release also includes following minor improvements and fixes:
report tool now has full help list of supported stats, you can, at any time, get a descriptive explanation of stats provided by pgCenter. Check out the “--describe” flag of “pgcenter report”;“pgcenter top” now has been fixed and includes configurable aligning of columns, which make stats viewing more enjoyable (check out builtin help for new hotkeys);wrong handling of group mask has been fixed. It is used fo…

Keeping Postgres tidy with partitioning

If you are in doubt whether partitioning is a useful tool with this one example I'm hoping you won’t wonder any further.

Why avoid long transactions?

The majority of PostgreSQL community clearly understands why long and idle transactions are “bad”. But when you talk about it to the newcomers it’s always a good idea to backup your explanation with some real tests.

While preparing slides for my presentation about vacuum I have made a simple test case with long transaction using pgbench. Here are the results.

Global shortcuts and PostgreSQL queries.

Using your favorite hotkeys on queries in LinuxOne of my colleagues often talks about using hot keys for his favourite SQL queries and commands in iterm2 (e.g. for checking current activity or to view lists of largest tables). 
Usually, I listen to this with only half an ear, because iterm2 is available only for MacOS and I am a strong Linux user. Once this topic came up again I thought perhaps this function could be realised not only through iterm2 but through an alternative tool or settings in desktop environment.

pgCenter - stress free Postgres stats.

pgCenter has seen a new release with several significant changes. If you used pgCenter before, you might have noticed that I stopped issuing updates for a while. This is because I was working on this new release with several new features and overall improvements that will make the use of the tool easier and will allow additional functionality to make your life easier when working with Postgres stats.

Autovacuum slides from PgCon 2018 Ottawa

Slides from our talks at PgCon 2018.
This week was busy for me and my colleague Ilya Kosmodemiansky as we made our way to Ottawa, Canada to attend one of the focal events in Postgres - PGCon. This PostgreSQL conference for users and developers runs annually and gathers PostgreSQL enthusiasts from across the globe. Aside fascinating and inspiring talks it’s a fantastic networking opportunity.

This year’s conference started on 29th May with tutorials, one of which was Ilya’s tutorial Linux IO internals for database administrators which was really well attended. The main conference started on 31st May and on the 1st June I gave my talk about autovacuum.

The aim of my talk was to address some of the key vacuum misconceptions and to make the audience realise that autovacuum is actually an essential tool for making database faster, more efficient and problem free and that disabling it would actually cause more damage than good. Below are my slides and some photos from the conference.

I must …