---
title: "PostgREST v10: EXPLAIN and Improved Relationship Detection"
description: "PostgREST v10 adds HTTP-level EXPLAIN support: requests with the `application/vnd.pgrst.plan` media type, or supabase-js's `explain()` transform, return the PostgreSQL execution plan for reads, writes and RPC, which helps verify that RLS policies are applied and gives you the pg_stat_statements query identifier."
url: "https://swe.quest/articles/postgrest-v10-explain-and-improved-relationship-detection-44878c605b0df57d"
canonical: "https://supabase.com/blog/postgrest-v10"
source: "Supabase"
published: "2022-08-19"
difficulty: "medium"
kind: "Release"
reading_minutes: 7
tags: ["postgres","api-design","performance"]
---

# PostgREST v10: EXPLAIN and Improved Relationship Detection

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2022-08-19, 7 min read, Release. Original: [https://supabase.com/blog/postgrest-v10](https://supabase.com/blog/postgrest-v10)

## Summary

PostgREST v10 adds HTTP-level EXPLAIN support: requests with the \`application/vnd.pgrst.plan\` media type, or supabase-js's \`explain()\` transform, return the PostgreSQL execution plan for reads, writes and RPC, which helps verify that RLS policies are applied and gives you the pg\_stat\_statements query identifier. Relationship detection also improves. One-to-one relationships are inferred from unique or primary keys on foreign keys, and "computed relationships" use inlinable SQL functions to define joins on views and materialized views that lack foreign keys. A breaking change now requires a join table's primary key to include both foreign key columns before it is detected as many-to-many. EXPLAIN is gated behind \`db-plan-enabled\` and intended only for development.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- PostgreSQL EXPLAIN ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- foreign keys and joins
- Row Level Security ([easy posts on Security](https://swe.quest/tags/security.md?difficulty=easy))

## Keywords

PostgREST, Supabase, supabase-js, EXPLAIN, Row Level Security, pg\_stat\_statements

## Related posts

- [Cracking PostgreSQL Interview Questions](https://swe.quest/articles/cracking-postgresql-interview-questions-e9efeda89524a92a.md): Supabase · 2021-02-27 · Medium · 6 min read · PostgreSQL, SQL, Databases, Identity & auth, Engineering culture
  Interview preparation for the transactional side of PostgreSQL, organized around five areas: data modeling, indexes, views, roles and functions.
- [Supabase CLI](https://swe.quest/articles/supabase-cli-a62c53c7dbec808f.md): Supabase · 2021-03-31 · Medium · 7 min read · Schema migrations, PostgreSQL, Developer tools
  Supabase's new CLI runs the full Supabase stack locally via Docker Compose, using the same tooling as production, and walks through wiring it to a React app.
- [Declarative Schemas for Simpler Database Management](https://swe.quest/articles/declarative-schemas-for-simpler-database-management-ee2428d0ae8c51e8.md): Supabase · 2025-04-03 · Medium · 4 min read · Schema migrations, PostgreSQL, Developer tools
  Supabase CLI now supports declarative schemas: the desired final state of Postgres tables, views, functions, RLS policies, grants and types lives in versioned .sql files, and a schema diff tool such as migra generates the migration files.
- [pg\_graphql: A GraphQL extension for PostgreSQL](https://swe.quest/articles/pg-graphql-a-graphql-extension-for-postgresql-3a34efbe6d730fc2.md): Supabase · 2021-12-03 · Medium · 4 min read · GraphQL, PostgreSQL, API design
  pg\_graphql is an open-source PostgreSQL extension, written in C and SQL, that reflects a GraphQL schema from existing tables and resolves queries entirely inside the database.
- [Realtime Postgres RLS now available on Supabase](https://swe.quest/articles/realtime-postgres-rls-now-available-on-supabase-037d74a22092b0d5.md): Supabase · 2021-12-01 · Medium · 5 min read · PostgreSQL, Real-time systems, Identity & auth, Replication, Performance engineering
  Supabase Realtime now enforces PostgreSQL Row Level Security on change broadcasts.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
