Re: Incremental View Maintenance, take 2

Started by Alexandre Felipe23 days ago7 messages
Jump to latest
#1Alexandre Felipe
o.alexandre.felipe@gmail.com

Sorry for creating a new thread for this.
I don't have the original email.

This is my attempt on rebasing
https://commitfest.postgresql.org/patch/4337/

Regards,
Alexandre

Attachments:

v35-0003-IMMV-Long-life-to-transition-tables.patchapplication/octet-stream; name=v35-0003-IMMV-Long-life-to-transition-tables.patchDownload+79-3
v35-0005-IMMV-support-on-psql.patchapplication/octet-stream; name=v35-0005-IMMV-support-on-psql.patchDownload+55-13
v35-0001-IMMV-Parser-support.patchapplication/octet-stream; name=v35-0001-IMMV-Parser-support.patchDownload+23-12
v35-0004-IMMV-pg_dump-maintanence-support.patchapplication/octet-stream; name=v35-0004-IMMV-pg_dump-maintanence-support.patchDownload+35-4
v35-0002-IMMV-relisivm-column-in-pg_class-system-catalog.patchapplication/octet-stream; name=v35-0002-IMMV-relisivm-column-in-pg_class-system-catalog.patchDownload+40-1
v35-0006-IMMV-Update-logic.patchapplication/octet-stream; name=v35-0006-IMMV-Update-logic.patchDownload+2138-36
v35-0009-IMMV-min-max-aggregates.patchapplication/octet-stream; name=v35-0009-IMMV-min-max-aggregates.patchDownload+2244-11
v35-0008-IMMV-aggregates.patchapplication/octet-stream; name=v35-0008-IMMV-aggregates.patchDownload+663-38
v35-0007-IMMV-DISTINCT-support.patchapplication/octet-stream; name=v35-0007-IMMV-DISTINCT-support.patchDownload+320-46
v35-0010-IMMV-regression-tests.patchapplication/octet-stream; name=v35-0010-IMMV-regression-tests.patchDownload+6-5
v35-0011-IMMV-documentation.patchapplication/octet-stream; name=v35-0011-IMMV-documentation.patchDownload+583-5
#2Andreas Karlsson
andreas.karlsson@percona.com
In reply to: Alexandre Felipe (#1)

On 2/12/26 7:08 PM, Alexandre Felipe wrote:

Sorry for creating a new thread for this.
I don't have the original email.

For future cases: the mailing list archives have a feature where you can
resend a message and then reply to that.

Andreas

#3Alexandre Felipe
o.alexandre.felipe@gmail.com
In reply to: Andreas Karlsson (#2)

Hi Andreas,

I tried resending, multiple times. I tried the last change, the first
message, the message with the last patches, and a few others.

Regards,
Alexandre

On Fri, Feb 13, 2026 at 5:56 AM Andreas Karlsson <andreas@proxel.se> wrote:

Show quoted text

On 2/12/26 7:08 PM, Alexandre Felipe wrote:

Sorry for creating a new thread for this.
I don't have the original email.

For future cases: the mailing list archives have a feature where you can
resend a message and then reply to that.

Andreas

#4Alexandre Felipe
o.alexandre.felipe@gmail.com
In reply to: Alexandre Felipe (#1)

There was a warning on my initial rebase, so I fixed that.

I also changed the bitmap set to a list, I don't think we need O(1) lookup
here as suggested by Zhang [1] on patch 6.

Yugo,
I think there is an issue in
src/backend/commands/matview.c, IVM_immediate_maintenance, line 1688, when
apply_delta fails, and PG_RE_THROW is called, wouldn't we have to cleanup?
As in line 1699 onwards?

Regards,
Alexandre

On Thu, Feb 12, 2026 at 6:08 PM Alexandre Felipe <
o.alexandre.felipe@gmail.com> wrote:

Show quoted text

Sorry for creating a new thread for this.
I don't have the original email.

This is my attempt on rebasing
https://commitfest.postgresql.org/patch/4337/

Regards,
Alexandre

Attachments:

v36-0001-IMMV-Parser-support.patchapplication/octet-stream; name=v36-0001-IMMV-Parser-support.patchDownload+23-12
v36-0002-IMMV-relisivm-column-in-pg_class-system-catalog.patchapplication/octet-stream; name=v36-0002-IMMV-relisivm-column-in-pg_class-system-catalog.patchDownload+40-1
v36-0005-IMMV-support-on-psql.patchapplication/octet-stream; name=v36-0005-IMMV-support-on-psql.patchDownload+55-13
v36-0003-IMMV-Long-life-to-transition-tables.patchapplication/octet-stream; name=v36-0003-IMMV-Long-life-to-transition-tables.patchDownload+79-3
v36-0004-IMMV-pg_dump-maintanence-support.patchapplication/octet-stream; name=v36-0004-IMMV-pg_dump-maintanence-support.patchDownload+35-4
v36-0007-IMMV-DISTINCT-support.patchapplication/octet-stream; name=v36-0007-IMMV-DISTINCT-support.patchDownload+320-46
v36-0006-IMMV-Update-logic.patchapplication/octet-stream; name=v36-0006-IMMV-Update-logic.patchDownload+2138-36
v36-0008-IMMV-aggregates.patchapplication/octet-stream; name=v36-0008-IMMV-aggregates.patchDownload+663-38
v36-0010-IMMV-regression-tests.patchapplication/octet-stream; name=v36-0010-IMMV-regression-tests.patchDownload+6-5
v36-0009-IMMV-min-max-aggregates.patchapplication/octet-stream; name=v36-0009-IMMV-min-max-aggregates.patchDownload+2244-11
v36-0011-IMMV-documentation.patchapplication/octet-stream; name=v36-0011-IMMV-documentation.patchDownload+583-5
#5Alexandre Felipe
o.alexandre.felipe@gmail.com
In reply to: Alexandre Felipe (#4)

Sorry,
the previous line missed the removal of the function declared but not used.

Regards,
Alexandre

On Mon, Feb 16, 2026 at 4:07 PM Alexandre Felipe <
o.alexandre.felipe@gmail.com> wrote:

Show quoted text

There was a warning on my initial rebase, so I fixed that.

I also changed the bitmap set to a list, I don't think we need O(1) lookup
here as suggested by Zhang [1] on patch 6.

Yugo,
I think there is an issue in
src/backend/commands/matview.c, IVM_immediate_maintenance, line 1688, when
apply_delta fails, and PG_RE_THROW is called, wouldn't we have to cleanup?
As in line 1699 onwards?

Regards,
Alexandre

On Thu, Feb 12, 2026 at 6:08 PM Alexandre Felipe <
o.alexandre.felipe@gmail.com> wrote:

Sorry for creating a new thread for this.
I don't have the original email.

This is my attempt on rebasing
https://commitfest.postgresql.org/patch/4337/

Regards,
Alexandre

Attachments:

v36-0001-IMMV-Parser-support.patchapplication/octet-stream; name=v36-0001-IMMV-Parser-support.patchDownload+23-12
v36-0002-IMMV-relisivm-column-in-pg_class-system-catalog.patchapplication/octet-stream; name=v36-0002-IMMV-relisivm-column-in-pg_class-system-catalog.patchDownload+40-1
v36-0005-IMMV-support-on-psql.patchapplication/octet-stream; name=v36-0005-IMMV-support-on-psql.patchDownload+55-13
v36-0003-IMMV-Long-life-to-transition-tables.patchapplication/octet-stream; name=v36-0003-IMMV-Long-life-to-transition-tables.patchDownload+79-3
v36-0004-IMMV-pg_dump-maintanence-support.patchapplication/octet-stream; name=v36-0004-IMMV-pg_dump-maintanence-support.patchDownload+35-4
v36-0010-IMMV-regression-tests.patchapplication/octet-stream; name=v36-0010-IMMV-regression-tests.patchDownload+6-5
v36-0008-IMMV-aggregates.patchapplication/octet-stream; name=v36-0008-IMMV-aggregates.patchDownload+663-38
v36-0006-IMMV-Update-logic.patchapplication/octet-stream; name=v36-0006-IMMV-Update-logic.patchDownload+2137-36
v36-0007-IMMV-DISTINCT-support.patchapplication/octet-stream; name=v36-0007-IMMV-DISTINCT-support.patchDownload+320-46
v36-0009-IMMV-min-max-aggregates.patchapplication/octet-stream; name=v36-0009-IMMV-min-max-aggregates.patchDownload+2244-11
v36-0011-IMMV-documentation.patchapplication/octet-stream; name=v36-0011-IMMV-documentation.patchDownload+583-5
#6Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Alexandre Felipe (#3)

On 2026-Feb-13, Alexandre Felipe wrote:

Hi Andreas,

I tried resending, multiple times. I tried the last change, the first
message, the message with the last patches, and a few others.

Yeah, it's not really guaranteed to work -- I think it would especially
fail to work if the original message comes from a domain that's strict
about its DMARC configuration; though there may be other issues as well.

I think we need to rewrite that feature somehow. For instance, maybe we
can send the message (or the thread) as an attachment in a new email,
rather than delivering the original as is.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/

#7Yugo Nagata
nagata@sraoss.co.jp
In reply to: Alexandre Felipe (#5)

On Mon, 16 Feb 2026 21:43:09 +0000
Alexandre Felipe <o.alexandre.felipe@gmail.com> wrote:

Thank you for looking over and updating the patches!
I’m planning an overhaul of the patch set, but I really appreciate your time
and effort in getting them up to date.

Sorry,
the previous line missed the removal of the function declared but not used.

Regards,
Alexandre

On Mon, Feb 16, 2026 at 4:07 PM Alexandre Felipe <
o.alexandre.felipe@gmail.com> wrote:

There was a warning on my initial rebase, so I fixed that.

I also changed the bitmap set to a list, I don't think we need O(1) lookup
here as suggested by Zhang [1] on patch 6.

Yugo,
I think there is an issue in
src/backend/commands/matview.c, IVM_immediate_maintenance, line 1688, when
apply_delta fails, and PG_RE_THROW is called, wouldn't we have to cleanup?
As in line 1699 onwards?

Do you mean calling clean_up_IVM_hash_entry() as part of the cleanup?
I would need to look into this more carefully, but my understanding is that i
might be handled by AtAbort_IVM() in that situation.

Regards,
Yugo Nagata

Regards,
Alexandre

On Thu, Feb 12, 2026 at 6:08 PM Alexandre Felipe <
o.alexandre.felipe@gmail.com> wrote:

Sorry for creating a new thread for this.
I don't have the original email.

This is my attempt on rebasing
https://commitfest.postgresql.org/patch/4337/

Regards,
Alexandre

--
Yugo Nagata <nagata@sraoss.co.jp>