Use generated columns to perform queries with formulas in a scalable way
Supabase Supabase
33.3K subscribers
2,883 views
160

 Published On Jun 17, 2024

Generated columns allow us to calculate a column based on other columns to create a new column for a table. They also allow us to index based on the column, which allows us to scale any query involving the column.

Often, queries involving complex formulas do not scale, but generated columns allow us to do so by allowing us to index the column. This can be used for financial analysis, sorting by profit margins, and many other applications. It also allows us to display latitude and longitude from PostGIS types, which works great in combination with Supabase realtime.

In this video,   / dshukertjr   explains how to create a generated column, how to use the generated column to run queries with complex mathematical formulas efficiently, and how to use the generated column in combination with Supabase realtime to display PostGIS data in the app.

Chapters
00:00 Intro
00:21 Explaining the scalability issue with formulas in a query
01:16 Using generated columns to solve the scalability issue
04:09 Using Supabase realtime and PostGIS with generated columns
06:30 Outro

💻 Videos to watch next:
▶    • Make your queries 43,240x faster  
▶    • Getting started with PostGIS  
▶    • How to store and query JSON data in P...  

👇 Learn more about Supabase 👇

🕸 Website: https://supabase.com/
🏁 Get started: https://app.supabase.com/
📄 Docs: https://supabase.com/docs

🔔 Subscribe for more tutorials and feature updates from Supabase:    / @supabase  

📱 Connect with Us:
🐙 Github: https://www.github.com/supabase
💬 Discord: https://discord.supabase.com/
🐦 Twitter:   / supabase  
▶ Instagram (follow for memes):   / supabasecom  


ABOUT SUPABASE:
Supabase is the open source Firebase alternative. Supabase provides a full Postgres database for every project with pgvector, backups, realtime, and more. Add and manage email and password, passwordless, OAuth, and mobile logins to your project through a suite of identity providers and APIs.

Build in a weekend, scale to millions.

#Supabase #AppDevelopment #RealtimeApps #DeveloperTools

show more

Share/Embed