Autovacuum was added LONG time ago (in 7.4, as pg_autovacuum). Since then, there were many changes related to it.
These days, hopefully, we no longer see someone saying that they have to disable autovacuum due to performance issues.
But I still see people that say that they have to run daily/weekly vacuum because “autovacuum is not enough". Is it really?
Continue reading Is my autovacuum configured properly?
As of now, explain.depesz.com will provide hints for seq scans with multiple equality conditions joined with AND.
select * from table where proj_type = 'GR14' AND week = 2000 AND pop_flag = '1'
You can see it in action in this plan.
Hope you'll find it useful.
Someone asked recently on Slack, whether one should build tsvector data in a field, and index it, or make index on expression.
We talked about it for a while, and I thought I'll reformat my thoughts into blogpost to avoid retyping it next time.
Continue reading How to index data with tsearch?
Following is text provided by organizers. On my end I can say that I'll be there, and I'm on “Talk selection team" 🙂
The first ever Polish PostgreSQL conference is approaching faster than we think.
On April 22, 2022, we invite you to spend the whole day gaining top technical knowledge and broadening your horizons. PGDayPL 2022 is a great gaining opportunity to talk to the amazing speakers and spend time in the accompaniment of what we are most passionate about.
The conference is held at the POLIN Conference Center in Warsaw's Muranów.
What can you expect?
- fantastic lectures where you will gain technical knowledge – in both Polish and English!
- panels led by people with a passion for PostgreSQL and IT
- gifts for all conference attendees and additional bonuses for our speakers
- delicious catering for guests
- integration meeting after a successful conference
Learn more: https://pgday.pl/.
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.
Lately there have been couple of discussions on IRC, Slack, and Reddit that showed that people assume that by using int4/integer they use 4 bytes less than they would in case of int8/bigint. This is not really the case. Let me explain why.
Continue reading How much disk space you can save by using INT4/INT instead of INT8/BIGINT?
On 3rd of February 2022, Robert Haas committed patch:
Allow archiving via loadable modules.
Running a shell command for each file to be archived has a lot of
overhead and may not offer as much error checking as you want, or the
exact semantics that you want. So, offer the option to call a loadable
module for each file to be archived, rather than running a shell command.
Also, add a 'basic_archive' contrib module as an example implementation
that archives to a local directory.
Nathan Bossart, with a little bit of kibitzing by me.
Continue reading Waiting for PostgreSQL 15 – Allow archiving via loadable modules.
On 3rd of February 2022, Peter Eisentraut committed patch:
Add UNIQUE null treatment option
The SQL standard has been ambiguous about whether null values in
unique constraints should be considered equal or not. Different
implementations have different behaviors. In the SQL:202x draft, this
has been formalized by making this implementation-defined and adding
an option on unique constraint definitions UNIQUE [ NULLS [NOT]
DISTINCT ] to choose a behavior explicitly.
This patch adds this option to PostgreSQL. The default behavior
remains UNIQUE NULLS DISTINCT. Making this happen in the btree code
is pretty easy; most of the patch is just to carry the flag around to
all the places that need it.
The CREATE UNIQUE INDEX syntax extension is not from the standard,
it's my own invention.
I named all the internal flags, catalog columns, etc. in the negative
("nulls not distinct") so that the default PostgreSQL behavior is the
default if the flag is false.
Reviewed-by: Maxim Orlov <firstname.lastname@example.org>
Reviewed-by: Pavel Borisov <email@example.com>
Continue reading Waiting for PostgreSQL 15 – Add UNIQUE null treatment option
On 28th of January 2022, Peter Eisentraut committed patch:
Add HEADER support to COPY text format
The COPY CSV format supports the HEADER option to output a header
line. This patch adds the same option to the default text format. On
input, the HEADER option causes the first line to be skipped, same as
Author: Rémi Lapeyre <firstname.lastname@example.org>
Continue reading Waiting for PostgreSQL 15 – Add HEADER support to COPY text format
On 17th of January 2022, Michael Paquier committed patch:
"jsonlog" is a new value that can be added to log_destination to provide
logs in the JSON format, with its output written to a file, making it
the third type of destination of this kind, after "stderr" and
"csvlog". The format is convenient to feed logs to other applications.
There is also a plugin external to core that provided this feature using
the hook in elog.c, but this had to overwrite the output of "stderr" to
work, so being able to do both at the same time was not possible. The
files generated by this log format are suffixed with ".json", and use
the same rotation policies as the other two formats depending on the
This takes advantage of the refactoring work done previously in ac7c807,
bed6ed3, 8b76f89 and 2d77d83 for the backend parts, and 72b76f7 for the
TAP tests, making the addition of any new file-based format rather
The documentation is updated to list all the keys and the values that
can exist in this new format. pg_current_logfile() also required a
refresh for the new option.
Author: Sehrope Sarkuni, Michael Paquier
Reviewed-by: Nathan Bossart, Justin Pryzby
Continue reading Waiting for PostgreSQL 15 – Introduce log_destination=jsonlog