Crunchy Data joins Snowflake.  Read the announcement

  • Tags and Postgres Arrays, a Purrrfect Combination

    Paul Ramsey

    In a previous life, I worked on a CRM system that really loved the idea of tags. Everything could be tagged, users could create new tags, tags were a key organizing principle of searching and filtering. The trouble was, modeled traditionally, tags can really make for some ugly tables and equally ugly queries. Fortunately, and as usual, Postgres has an answer. Today I’m going to walk through working with tags in Postgres with a sample database of 🐈 cats and their attributes • First, I’ll look at...

    Read More
  • 5 Ways to Get Table Creation Information in Postgres

    Greg Sabino Mullane

    A question I hear from time to time with Crunchy Data clients and the Postgres community is: When was my Postgres database table created? Postgres does not store the creation date of tables, or any other database object. But fear not, there are a plethora of direct and indirect ways to find out when your table creation happened. Let's go through some ways to do this, ranging from easy to somewhat hard. All these solutions apply to indexes and other database objects, but tables are by far the mos...

    Read More
  • Practical AI with Postgres

    Craig Kerstiens

    There's a lot of excitement around AI, and even more discussion than excitement. The question of Postgres and AI isn't a single question, there are a ton of paths you can take under that heading... • Can I use Postgres for building AI related apps? Absolutely . • Can Postgres become an autonomous database with AI? Maybe. • Should you use AI to help you troubleshoot issues? Perhaps, but better left to experts. • Should I avoid AI when working with my database? Not at all! Can I use Postgres for...

    Read 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 running in your local browser via our Postgres playground. If you ask Postgres what time it is, You...

    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? 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 sta...

    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 . As we've been helping people get started with AI in Postgres with , there have been few questions around performance. At a basic level, pgvector performance relies on 3 things: 1. Are your queries using indexes? 2. Are you setting your size appropriately for your data set? 3. Do you have enoug...

    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 wo...

    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. What do I mean by " CRUD "? It's short-hand for create-read-update-delete . For instance, ORMs make it so nice to do an...

    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" , but we also know there are some clear cut use cases where Postgres isn’t the perfect tool for the job. Don’t get us wrong, Postgres is an amazing database and we strongly believe what you should start with for most applications, but that doesn’t mean you can’t benefit from more tha...

    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. We've also loaded a tutorial for Day 16's challenge if you want to try it with a pre-loaded data set....

    Read More