Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4f33af2

Browse files
committed
Doc: improve documentation about ORDER BY in matviews.
Remove the confusing use of ORDER BY in an example materializedview. It adds nothing to the example, but might encouragepeople to follow bad practice. Clarify REFRESH MATERIALIZEDVIEW's note about whether view ordering is retained (it isn't).Maciek SakrejdaDiscussion:https://postgr.es/m/CAOtHd0D-OvrUU0C=4hX28p4BaSE1XL78BAQ0VcDaLLt8tdUzsg@mail.gmail.com
1 parente04a805 commit4f33af2

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

‎doc/src/sgml/ref/refresh_materialized_view.sgml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,10 @@ REFRESH MATERIALIZED VIEW [ CONCURRENTLY ] <replaceable class="parameter">name</
9393
<title>Notes</title>
9494

9595
<para>
96-
While the default index for future
97-
<link linkend="sql-cluster"><command>CLUSTER</command></link>
98-
operations is retained, <command>REFRESH MATERIALIZED VIEW</command> does not
99-
order the generated rows based on this property. If you want the data
100-
to be ordered upon generation, you must use an <literal>ORDER BY</literal>
101-
clause in the backing query.
96+
If there is an <literal>ORDER BY</literal> clause in the materialized
97+
view's defining query, the original contents of the materialized view
98+
will be ordered that way; but <command>REFRESH MATERIALIZED
99+
VIEW</command> does not guarantee to preserve that ordering.
102100
</para>
103101
</refsect1>
104102

‎doc/src/sgml/rules.sgml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -961,9 +961,6 @@ CREATE MATERIALIZED VIEW sales_summary AS
961961
FROM invoice
962962
WHERE invoice_date &lt; CURRENT_DATE
963963
GROUP BY
964-
seller_no,
965-
invoice_date
966-
ORDER BY
967964
seller_no,
968965
invoice_date;
969966

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp