CYBERTEC PostgreSQL blog. Written by experts in PostgreSQL administration, performance tuning and development. Fix slow queries and speed up your database with the most relevant knowledge for your pressing needs, fast and free.
In case you need further assistance, reach out to us, we’re happy to help.
Citus: 7 commonly used advanced SQL tools
When you run advanced SQL in Citus, what’s possible? Which SQL statements work, and which ones don’t? Citus is a PostgreSQL extension that adds powerful sharding capabilities to PostgreSQL. However, every solution does have limitations. Therefore, it makes sense to take a look at the latest version of Citus and learn how to properly use […]
Citus: Row store vs. column store in PostgreSQL
Row store vs. column store – a lot has been written about this topic in the context of PostgreSQL and Citus. What does it really mean and what are the implications? Are column stores “always cool” and “always beneficial”? No, there’s more to it – which requires a closer look. When trying to understand the […]
“hired” vs. “fired” – fuzzy search in PostgreSQL
When dealing with data (and life in general) small things can have a major impact. The difference between “hired” and “fired” is just one simple character, but in many cases it does have real world implications. The question is: How can we use good old community Open Source PostgreSQL to do a fuzzy search, in […]
Data locality: Scaling PostgreSQL with Citus intelligently
While sharding is often advertised as “THE solution to PostgreSQL scalability”, it is necessary to keep some technical aspects in consideration in terms of performance. The rule is: Sharding should not be used without a deeper awareness of what it is you are actually doing to the data. It’s important to keep in mind that […]
Monitoring PostgreSQL replication
PostgreSQL replication is not just a way to scale your database to run ever larger workloads: it’s also a way to make your database infrastructure redundant, more reliable and resilient. There is, however, a potential for replication lag, which needs to be monitored. How can you monitor replication lag in PostgreSQL? What is replication lag? […]
Citus: Sharding your first table
Citus is a capable sharding solution for PostgreSQL. It solves a ton of scalability issues: these can be addressed using a sharding approach. We at CYBERTEC have used Citus for some time and can wholeheartedly recommend it (check out our services to find out more). Since the need for PostgreSQL sharding is constantly growing, we […]
Exclusion constraints in PostgreSQL and a tricky problem
Exclusion constraints are a feature that is not very well known, but can be used to implement highly sophisticated constraints. A few years ago, Hans wrote his blog post about EXCLUDE USING GIST… WITH. Recently we received a note from someone dealing with a very tricky problem concerning exclusion constraints: (many thanks to @necrotikS at […]
Conditional foreign keys and polymorphism in SQL: 4 Methods
© Laurenz Albe 2023 This article is about the notoriously difficult problem of “conditional foreign keys”. In object-oriented programming languages, polymorphism is a natural concept. However, it does not translate well to SQL. As a consequence, many people whose data models are driven by an object-oriented application design end up trying to implement conditional foreign […]
Postgres v16: 14 Cool New Features
PostgreSQL v16 contains many new features and enhancements. Here are PG v16’s 14 best new features: Everybody's favorite: You no longer need an alias for subqueries in FROM This in an extension to the standard, but makes porting queries from Oracle easier. Improve performance of vacuum freezing Have you ever suffered from massive anti-wraparound autovacuum […]
Indexing “LIKE” in PostgreSQL and Oracle
© Laurenz Albe 2023 Unless you use the binary collation, creating a b-tree index to support a LIKE condition in PostgreSQL is not straightforward. This keeps surprising Oracle users, who claim that a regular b-tree index will of course always support LIKE. I decided to explore the differences between Oracle and PostgreSQL when it comes […]
Why does my pg_wal keep growing?
© Laurenz Albe 2023 “Why does my pg_wal keep growing?” That’s a question I keep hearing again and again. It is an urgent question, since the PostgreSQL server will crash if pg_wal runs out of disk space. I decided to answer the question once and for all. What is pg_wal and why is it growing? […]
Bulk load performance in PostgreSQL
© Laurenz Albe 2023 There are several techniques to bulk load data into PostgreSQL. I decided to compare their performance in a simple test case. I’ll add some recommendations for parameter settings to improve the performance even more. An example table to bulk load data The table is simple enough: It is a narrow table […]