Crunchy Data
@crunchydata.com
2.1K followers 270 following 96 posts
Just Postgres www.crunchydata.com
Posts Media Videos Starter Packs
crunchydata.com
Today we're announcing the availability of logical replication from Postgres to Iceberg with Crunchy Data Warehouse.

Now you can seamlessly move data and stream changes from your operational database into an analytical system.

www.crunchydata.com/blog/logical...
Logical replication from Postgres to Iceberg | Crunchy Data Blog
We've launched native logical replication from Postgres tables in any Postgres server to Iceberg tables managed by Crunchy Data Warehouse.
www.crunchydata.com
crunchydata.com
Query the cache hit with:

SELECT
sum(heap_blks_read) as heap_read,
sum(heap_blks_hit) as heap_hit,
sum(heap_blks_hit) / (sum(heap_blks_hit) + sum(heap_blks_read)) as ratio
FROM
pg_statio_user_tables;

For Bridge customers, cache hit data is in your clusters insights.
crunchydata.com
How long has it been since you checked your cache hit ratio?

Ideally most of your frequently queried data is in the buffer cache. We recommend 98-99% in the cache for transactional workloads - analytical workloads are lower.
crunchydata.com
Postgres + Iceberg side-by-side next to the same query with a Postgres HEAP table.

Half a millisecond for the optimized 🔥 . 10 seconds for the long method.

www.crunchydata.com/products/war...
crunchydata.com
Parameter | Value
---------------------------------+----------------------------------------------
TimeZone | America/Chicago
application_name | psql
client_encoding | UTF8
lock_timeout | 10s
crunchydata.com
psql tip: find your config parameters that are not default with \dconfig.

List of non-default configuration parameters:
crunchydata.com
Postgres does a good job of keeping internal statistics of your which are used to plan how queries are executed. But Postgres doesn't always know how columns are related. In this deep dive we look at hacking the statistics for improved performance
Hacking the Postgres Statistics Tables for Faster Queries | Crunchy Data Blog
Adding extended statistics can add information about how columns are related. Louise has some real life example queries and tips for working with extended table stats that can dramatically improve…
www.crunchydata.com
crunchydata.com
Miss our webinar on running Crunchy Data Warehouse on-premises? We cover an overview, hands on walk through with live querying our data lake to full Iceberg creation, and highlight of popular use cases for it. If you missed it don't worry we got you covered.

www.youtube.com/watch?v=Vojg...
Crunchy Data Warehouse: Postgres + Iceberg for Your On-premises Data Lake
YouTube video by Crunchy Data
www.youtube.com
crunchydata.com
The command to reset pg_stat_statements is:
SELECT pg_stat_statements_reset();
crunchydata.com
4) After major maintenance operations
Resetting pg_stat_statements after major operations (pg_repack, reindexes, altering table structures, etc) helps to measure how any changes affect performance.
crunchydata.com
3) When benchmarking query performance
If you are running benchmarks and tests to evaluate query improvements, resetting pg_stat_statements makes sure that your results reflect only the queries executed during the benchmark periods.
crunchydata.com
It will also help accuracy of reports (for example, the outliers insight) by preventing old, outdated queries from skewing the results.
crunchydata.com
2) After deploying significant query changes
If you have made significant changes to an app, optimized queries, or modified indexes, resetting pg_stat_statements helps to measure the impact of those changes more accurately.
crunchydata.com
1) At the start of a new monitoring period
If you analyze performance trends daily, weekly, or monthly, resetting pg_stat_statements at the beginning of such a period helps ensure that each period starts with a clean dataset.
crunchydata.com
We all love pg_stat_statements but that data collects forever and can get a little stale. When should you reset it?

Here are some tips from our support team.
crunchydata.com
Excited to announce Crunchy Data Warehouse is now available for Kubernetes and On-premises. Need faster analytics from Postgres? Want a native Postgres data lake experience? Learn more about how it works: www.crunchydata.com/blog/crunchy...
Crunchy Data Warehouse: Postgres with Iceberg Available for Kubernetes and On-premises | Crunchy Data Blog
Crunchy Data brings Postgres-native Apache Iceberg to Kubernetes and on-prem workloads.
www.crunchydata.com
crunchydata.com
Working with psql directly in Postgres? These tips will help turn you into a psql power user -
Postgres Tips from the Experts at Crunchy Data
Advanced ideas and tricks on how to use Postgres to its best.
buff.ly
crunchydata.com
We talk with users every week about whether Citus is a good fit for them. While Citus is a very powerful Postgres extension it has very specific use cases where it does fit, here we break down the cases where Citus is a fit as well as when it's not -
Citus: The Misunderstood Postgres Extension | Crunchy Data Blog
What applications and use cases make the most sense for Citus.
buff.ly
crunchydata.com
When it comes to developer tools everyone has their favorite tips and tricks. And because we love Postgres we worked to capture many of our favorite tips and tricks for Postgres here in this collection -
Postgres Tips from the Experts at Crunchy Data
Advanced ideas and tricks on how to use Postgres to its best.
buff.ly
crunchydata.com
Excited to announce built-in maintenance for Iceberg via Postgres.

Now within Crunchy Data Warehouse we will automatically vacuum and continuously optimize your Iceberg data by compacting and cleaning up files.

Dig into the details of how this works www.crunchydata.com/blog/automat...
Automatic Iceberg Maintenance Within Postgres | Crunchy Data Blog
Iceberg can create orphan files during snapshot changes or transaction rollbacks. Crunchy Data Warehouse automatically cleans up the orphan files using a new autovacuum feature.
www.crunchydata.com
crunchydata.com
Citus is a Postgres extension that turns it into a sharded, distributed, horizontally scalable database. With all these buzzwords, it attracts a lot of people thinking it can solve all their problems. We dig into when it is a good fit and when it isn't - www.crunchydata.com/blog/citus-t...
Citus: The Misunderstood Postgres Extension | Crunchy Data Blog
What applications and use cases make the most sense for Citus.
www.crunchydata.com
crunchydata.com
Happy pi day! 🥧

Postgres has a pi function: pi();

This can be used to calculate circular sizes and areas.

@pwramsey.bsky.social looks at pi in PostGIS today with a blog post on circular forms on PostGIS with a proof for the CIRCLELINESTRING shape.

www.crunchydata.com/blog/postgis...
Pi Day PostGIS Circles | Crunchy Data Blog
For a proper Pi Day celebration in Postgres, Paul shows off a proof for CIRCULARSTRING.
www.crunchydata.com
crunchydata.com
SQL output can be messy. Psql options for formatting output. A handy option is

\pset border 2

This will add top and bottom borders with double lines (╔, ╚, ╤, ╧, etc.). A Header row bordered with a double-line separator . Each row is separated by single lines. Each column is clearly separated.
crunchydata.com
Congratulations to the Postgres community on PostgreSQL once again being named the DBMS of the year in 2024, for the second year in a row. db-engines.com/en/blog_post...
PostgreSQL is the Database Management System of the Year 2024
db-engines.com