From: | vignesh C <vignesh21(at)gmail(dot)com> |
---|---|
To: | jian he <jian(dot)universality(at)gmail(dot)com> |
Cc: | David Rowley <dgrowleyml(at)gmail(dot)com>, Melih Mutlu <m(dot)melihmutlu(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: speedup COPY TO for partitioned table. |
Date: | 2025-03-28 13:02:57 |
Message-ID: | CALDaNm1UdvSWXbwAMcvc5ARK0-znvJq0vvjof-q846uDtF305Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, 28 Mar 2025 at 08:39, jian he <jian(dot)universality(at)gmail(dot)com> wrote:
>
> hi.
>
> I made a mistake.
> The regress test sql file should have a new line at the end of the file.
Couple of suggestions:
1) Can you add some comments here, this is the only code that is
different from the regular table handling code:
+ scan_tupdesc = RelationGetDescr(scan_rel);
+ map = build_attrmap_by_name_if_req(tupDesc,
scan_tupdesc, false);
2) You can see if you can try to make a function add call it from both
the partitioned table and regular table case, that way you could
reduce the duplicate code:
+ while (table_scan_getnextslot(scandesc,
ForwardScanDirection, slot))
+ {
+ CHECK_FOR_INTERRUPTS();
+
+ /* Deconstruct the tuple ... */
+ if (map != NULL)
+ {
+ original_slot = slot;
+ root_slot =
MakeSingleTupleTableSlot(tupDesc, &TTSOpsBufferHeapTuple);
+ slot =
execute_attr_map_slot(map, slot, root_slot);
+ }
+ else
+ slot_getallattrs(slot);
+
+ /* Format and send the data */
+ CopyOneRowTo(cstate, slot);
+
+
pgstat_progress_update_param(PROGRESS_COPY_TUPLES_PROCESSED,
+
++processed);
+
+ if (original_slot != NULL)
+
ExecDropSingleTupleTableSlot(original_slot);
+ };
Regards,
Vignesh
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2025-03-28 13:09:29 | Re: making EXPLAIN extensible |
Previous Message | Tomas Vondra | 2025-03-28 13:00:21 | Re: Improve monitoring of shared memory allocations |