-
Book Overview & Buying
-
Table Of Contents
AI-Ready PostgreSQL 18
By :
Postgres provides a rich set of analytics functions that help users perform advanced data analysis directly within the database. They can quickly extract insights, create reports, and perform advanced calculations, such as running totals, rankings, moving averages, and complex summaries.
Ideally, the analytics functions are applied to an analytics-optimized data model, such as a star schema, that was replicated from one or more transactional systems and denormalized to support efficient querying.
Analytics functions usually do not modify data, except to produce intermediate results, and they follow the same format as simple SELECT queries but offer more powerful grouping, aggregation, subquerying, and windowing capabilities.
In this chapter, we will build on the star schema developed in Chapter 12, Transforming the Data for Analytics and walk you step by step through groups, aggregates, window functions, and common table expressions...