ORDER BY in materialized view example?

From: Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: ORDER BY in materialized view example?
Date: 2021-11-23 06:18:46
Message-ID: CAOtHd0D-OvrUU0C=4hX28p4BaSE1XL78BAQ0VcDaLLt8tdUzsg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

An example in the materialized view documentation [1] includes an ORDER BY
clause without a clear reason. Does it help build the index more
efficiently? I suppose it's also sort of like a CLUSTER?

But it seems like the ORDER BY should either be explained or dropped: as
is, this gives the impression that the ORDER BY can be "embedded" into the
resulting relation and persist to other queries that do not include an
explicit ORDER BY. (I recently ran across this belief, though not sure if
this was due to this example.)

Thoughts?

[1]: https://www.postgresql.org/docs/current/rules-materializedviews.html

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Laurenz Albe 2021-11-23 10:28:11 Re: Triggers on underlying tables of updatable views
Previous Message Laurenz Albe 2021-11-22 20:02:16 Re: Triggers on underlying tables of updatable views