mirror of
https://github.com/postgres/postgres.git
synced 2025-05-18 17:41:14 +03:00
Doc: improve documentation about ORDER BY in matviews.
Remove the confusing use of ORDER BY in an example materialized view. It adds nothing to the example, but might encourage people to follow bad practice. Clarify REFRESH MATERIALIZED VIEW's note about whether view ordering is retained (it isn't). Maciek Sakrejda Discussion: https://postgr.es/m/CAOtHd0D-OvrUU0C=4hX28p4BaSE1XL78BAQ0VcDaLLt8tdUzsg@mail.gmail.com
This commit is contained in:
parent
f76fd05bae
commit
a7359913a1
@ -93,12 +93,10 @@ REFRESH MATERIALIZED VIEW [ CONCURRENTLY ] <replaceable class="parameter">name</
|
||||
<title>Notes</title>
|
||||
|
||||
<para>
|
||||
While the default index for future
|
||||
<xref linkend="sql-cluster"/>
|
||||
operations is retained, <command>REFRESH MATERIALIZED VIEW</command> does not
|
||||
order the generated rows based on this property. If you want the data
|
||||
to be ordered upon generation, you must use an <literal>ORDER BY</literal>
|
||||
clause in the backing query.
|
||||
If there is an <literal>ORDER BY</literal> clause in the materialized
|
||||
view's defining query, the original contents of the materialized view
|
||||
will be ordered that way; but <command>REFRESH MATERIALIZED
|
||||
VIEW</command> does not guarantee to preserve that ordering.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -956,9 +956,6 @@ CREATE MATERIALIZED VIEW sales_summary AS
|
||||
FROM invoice
|
||||
WHERE invoice_date < CURRENT_DATE
|
||||
GROUP BY
|
||||
seller_no,
|
||||
invoice_date
|
||||
ORDER BY
|
||||
seller_no,
|
||||
invoice_date;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user