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

Latest posts from Paul Ramsey

  • 6 min read

    Smarter Postgres LLM with Retrieval Augmented Generation

    Paul Ramsey

    "Retrieval Augmented Generation" (RAG) is a useful technique in working with large language models (LLM) to improve accuracy when dealing with facts in a restricted domain of interest.

    Asking an LLM about Shakespeare: works pretty good. The model was probably fed a lot of Shakespeare in training.

    Asking it about holiday time off rules from the company employee manual: works pretty bad. The model may have ingested a few manuals in training, but not yours

    Read More
  • 8 min read

    PostGIS Day 2024 Summary

    Paul Ramsey

    In late November, on the day after GIS Day, we hosted the annual PostGIS day online event. 22 speakers from around the world, in an agenda that ran from mid-afternoon in Europe to mid-afternoon on the Pacific coast.

    We had an amazing collection of speakers, exploring all aspects of PostGIS, from highly technical specifics, to big picture culture and history. A full playlist

    Read More
  • 5 min read

    Accessing Large Language Models from PostgreSQL

    Paul Ramsey

    Large language models (LLM) provide some truly unique capacities that no other software does, but they are notoriously finicky to run, requiring large amounts of RAM and compute.

    That means that mere mortals are reduced to two possible paths for experimenting with LLMs:

    • Use a cloud-hosted service like OpenAI
    Read More
  • 5 min read

    Convert JSON into Columns and Rows with JSON_TABLE

    Paul Ramsey

    JSON_TABLE, new in Postgres 17

    If you missed some of the headlines and release notes, Postgres 17 added another huge JSON feature to its growing repository of strong JSON support with the JSON_TABLE feature. JSON_TABLE lets you query JSON and display and query data like it is native relational SQL. So you can easily take JSON data feeds and work with it like you would any other Postgres data in your database.

    Read More
  • 14 min read

    Vehicle Routing with PostGIS and Overture Data

    Paul Ramsey

    The Overture Maps collection of data is enormous, encompassing over 300 million transportation segments, 2.3 billion building footprints, 53 million points of interest, and a rich collection of cartographic features as well. It is a consistent global data set, but it is intimidatingly large -- what can a person do with such a thing?

    Building cartographic products is the obvious thing, but what about the less obvious. With an analytical engine like PostgreSQL and Crunchy Bridge for Analytics, what is possible? Well turns out, a lot of things.

    Read More
  • 10 min read

    Six Degrees of Kevin Bacon - Postgres Style

    Paul Ramsey

    Back in the 1990s, before anything was cool (or so my children tell me) and at the dawn of the Age of the Meme, a couple of college students invented a game they called the "Six Degrees of Kevin Bacon".

    The conceit behind the Six Degrees of Kevin Bacon

    Read More
  • 5 min read

    Inside PostGIS: Calculating Distance

    Paul Ramsey

    Calculating distance is a core feature of a spatial database, and the central function in many analytical queries.

    • "How many houses are within the evacuation radius?"
    • "Which responder is closest to the call?"
    • "How many more miles until the school bus needs routine maintenance?"

    PostGIS and any other spatial database let you answer these kinds of questions in SQL, using ST_Distance(geom1, geom2)

    Read More
  • 3 min read

    PostGIS Clustering with K-Means

    Paul Ramsey

    Crunchy Bridge for Analytics
    Read More
  • 4 min read

    PostGIS Clustering with DBSCAN

    Paul Ramsey

    Crunchy Bridge for Analytics
    Read More
  • Rolling the Dice with the PostgreSQL Random Functions

    Paul Ramsey

    Generating random numbers is a surprisingly common task in programs, whether it's to create test data or to provide a user with a random entry from a list of items.

    PostgreSQL comes with just a few simple foundational functions that can be used to fulfill most needs for randomness.

    Almost all your random-ness needs will be met with the random()

    Read More