Re: in BeginCopyTo make materialized view using COPY TO instead of COPY (query).

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: in BeginCopyTo make materialized view using COPY TO instead of COPY (query).
Date: 2024-12-20 00:01:48
Message-ID: Z2Sz7LU1akdewn5U@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 19, 2024 at 02:28:21PM +0800, jian he wrote:
> Since materialized views have physical storage,
>
> we can make materialized views also using COPY table_name, instead of
> COPY(query).
>
> Some simple tests show around %3.7 or 4.3% speed up.

This restriction comes from 3bf3ab8c5636 as such relations may not be
scannable when they have no data, no? Perhaps this restriction could
be lifted, but I'd suggest to dig more into the lists, there should be
arguments and ideas explaining what could be done in this case
(spoiler: I did not look at that).
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-12-20 00:13:33 Re: Back-patch of: avoid multiple hard links to same WAL file after a crash
Previous Message Tom Lane 2024-12-19 23:05:01 Re: Converting SetOp to read its two inputs separately