Introducing Crunchy Data Warehouse: A next-generation Postgres-native data warehouse. Crunchy Data Warehouse Learn more

  • Working with Time in Postgres

    Elizabeth Christensen

    Since humans first started recording data, they’ve been keeping track of time. Time management is one of those absolutely crucial database tasks and Postgres does a great job of it. Postgres has a lot of options for storing and querying time so I wanted to provide an overview of some of the most common needs for storing and retrieving time data.

    This blog is also available as a hands on tutorial

    Read More
  • Building Customer-Facing Real-Time Dashboards with Postgres

    Craig Kerstiens

    Over the past few weeks we've had several customers ask how they should architect their analytics pipeline. Common questions are:

    • Should we use some kind of data warehouse or time series database?
    • Is Postgres suitable for that type of workload?
    • What are the pitfalls that I should worry about before I get started?
    Read More
  • 7 min read

    Performance Tips Using Postgres and pgvector

    Christopher Winslett

    Note: pgvector 0.5 released HNSW indexes which improved performance significantly. Read more about it HNSW Indexes with Postgres and pgvector. We have additional articles in this Postgres AI series

    Read More
  • Thinking Fast vs. Slow with Your Data in Postgres

    Craig Kerstiens

    Today, we wanted to address some basic principles for better managing data architecture. Postgres is well regarded as a database for traditional system of record. More recently we've been fielding questions on what else can it do, such as: Can it be good for analytics and metrics? The short answer is "yes". When applications expand outside their standard system of record, they add in new types of data and data stores, which introduces complexity managing multiple types of systems.

    Some common workloads for Postgres are:

    • Primary system of record
    • Metrics / analytics data
    • Log / event data
    Read More
  • 6 min read

    Solving N+1 Postgres queries for Ruby on Rails apps

    Christopher Winslett

    Crunchy Data is getting ready to be at RailsConf 2023 in Atlanta next week and we’ve been thinking about our Rails and ActiveRecord users and customers. One of the easiest ways to improve query performance using an ORM is to lean on as much SQL as you can. I’m going to walk through some of the ActiveRecord basics and how to use some smart SQL to work around N+1 query problems.

    The easy CRUD Basics with ActiveRecord

    Read More
  • Writing Data from Postgres to MongoDB

    Christopher Winslett

    "Last time I had data like this, I stored the data in MongoDB." --Me, last week.

    I told this to a friend while talking through some of their data problems. As Craig likes to say, Crunchy Data is "Just Postgres"

    Read More
  • 22 min read

    Fun with PostgreSQL puzzles: Finding shortest paths and travel costs with functions

    Greg Sabino Mullane

    This article will contain spoilers both on how I solved 2022 Day 16's challenge "Probscidea Volcanium" using SQL, as well as general ideas on how to approach the problem. I recommend trying to solve it yourself first, using your favorite language. This article is delayed from the actual puzzle's release. My solutions may not be the "best" solution, as the goal is to provide a quick solution.

    Hands on Tutorial

    Read More
  • PostgreSQL Unlogged Sequences - Look Mum, no WAL!

    Greg Sabino Mullane

    In an earlier post, I went into a lot of detail about unlogged tables. But tables are not the only thing to get the unlogged treatment - as of version 15 of Postgres, sequences can be unlogged as well! If you want to create your own, it's simply a matter of adding the UNLOGGED

    Read More
  • Easy Mongo from your Postgres

    Christopher Winslett

    MongoDB got an early start as a developer friendly database. Mongo was trivial to get started with and has some good tooling for scaling. Since you didn't have to create a schema, you were off and running in no time. Don't get us wrong, we do firmly believe a well designed schema is important. If you're not managing your schema it's managing you. Because of these capabilities, MongoDB has been used by teams for:

    • the typical, primary application database
    • supporting database for large, sharded JSON datasets
    • rolling log using MongoDB’s capped collections
    • rapidly updating JSON documents using MongoDB’s atomic updates
    Read More
  • Is your Postgres ready for production?

    Craig Kerstiens

    Is your database ready for production?

    You've been building your application for months, you've tested with beta users, you've gotten feedback and iterated. You've gone through your launch checklist, email beta users, publish the blog post, post to hacker news and hope the comments are friendly. But is your database ready for whatever may come on launch day or even 2 months in? Here's a handy checklist to make sure you're not caught flat footed.

    • Backups❓
    • High availability❓
    • Logs properly configured❓
      • Archived and persisted❓
      • Logging slow queries❓
      • Auto explain❓
    Read More