pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: awad@zyper.com
Subject: REFRESH MATERIALIZED VIEW CONCURRENTLY interaction with ORDER BY
Date: Thu, 04 Apr 2019 14:54:29 +0000
Message-ID: <155438966988.726.7863901426737518005@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/sql-refreshmaterializedview.html
Description:

On 10.7 we hit a case where the backing query had an order by clause and a
concurrent refresh updated it differently than a normal refresh. This is a
bit of an odd corner case given that up till that point, views would respect
the ordering.

It's not explicit that CONCURRENTLY populates the data any differently than
normal, specifically, in a way that means the ordering in the backing query
is not always maintained, depending on the order of updates. 

Reading through the comment at
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/commands/matview.c;h=2aac63...
I can see the logic in that, but it could use an explicit mention in the
CONCURRENTLY section. Not sure if there's any plan for changing the
behaviour either.

Also the existing sentence "If you want the data to be ordered upon
generation, you must use an ORDER BY clause in the backing query." sort of
implies that the ORDER BY will be respected.


view thread (4+ messages)  latest in thread

Message-ID: <155438966988.726.7863901426737518005@wrigleys.postgresql.org>
Permalink:  ../155438966988.726.7863901426737518005@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/155438966988.726.7863901426737518005@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, awad@zyper.com
  Subject: Re: REFRESH MATERIALIZED VIEW CONCURRENTLY interaction with ORDER BY
  In-Reply-To: <155438966988.726.7863901426737518005@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox