Skip to content

Allow inserting data into a materialized view that is being populated #2901

Closed

Description

@simPod

For creating materialized views, there's a great option to add POPULATE clause to it to fill new view with data that were inserted to the table before the view was created.

However, the docs states:

We don't recommend using POPULATE, since data inserted in the table during the view creation will not be inserted in it.

It would be very helpful if it was possible to POPULATE view and also have data, that are inserted to the table while populating the view, inserted to the view as well.

Activity

  1. mcarbonneaux commented on Apr 1, 2019

    @mcarbonneaux

    when origin table are enormous, populate can be very long and can fail...
    can be usefull to populate by range of data to avoid fail...
    will be usefull to more secure the populate option to be abel to trottle the populate even if the populate will be more long....

    or add the ability to insert into the materialized view...

  2. simPod commented on Apr 1, 2019

    @simPod
    ContributorAuthor

    As I learnt some time ago, materialized view is just a little unfortunately chosen name for insert trigger. Inserting into view is just inserting into it's inner table.

    If you need to populate by range, I guess it would be better to use INSERT AS SELECT. But personally. I'd not use POPULATE anymore just because it seems easier to me to use few selects, inserts and deletes, tweaked to the current use case.

  3. added
    comp-materialized-view
    on May 6, 2019
  4. added a commit that references this issue on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-materialized-viewfeature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions