order by in materialized views

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: eric(at)aquameta(dot)com
Subject: order by in materialized views
Date: 2019-03-18 22:48:20
Message-ID: 155294930002.30378.5515416999171159375@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/11/rules-materializedviews.html
Description:

The examples contain ORDER BY clauses in the definition of a materialized
view. However, ORDER BY clauses do not work on materialized views after
they refresh (at the very least, folks tell me they are never guaranteed at
all because mat views are just tables under the hood). This can be
confusing for users since they're called "materialized views", one might
expect them to behave like views and honor the order by clause they were
defined with unless you're manipulating the results.

I'd suggest a) not using ORDER BY in the examples for mat views, and b)
putting some documentation that clarifies that materialized views disregard
ORDER BY statements.

Thanks,
Eric

Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2019-03-20 04:40:18 ORDER BY LIMIT n does not work as described when using partitioned tables
Previous Message Michael Paquier 2019-03-15 07:10:29 Re: 28.4.1. VACUUM Progress Reporting