public inbox for [email protected]
help / color / mirror / Atom feed[PATCH v9 4/4] WIP: check tuple size
2+ messages / 2 participants
[nested] [flat]
* [PATCH v9 4/4] WIP: check tuple size
@ 2020-12-01 23:20 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Justin Pryzby @ 2020-12-01 23:20 UTC (permalink / raw)
Or maybe INSERT should flush buffer based only on the *number* of tuples, and
not their size ?
---
src/backend/executor/nodeModifyTable.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c
index 2059428e2a..04b0598183 100644
--- a/src/backend/executor/nodeModifyTable.c
+++ b/src/backend/executor/nodeModifyTable.c
@@ -703,7 +703,13 @@ ExecInsert(ModifyTableState *mtstate,
batchslot = MultiInsertInfoNextFreeSlot(mtstate->miinfo, resultRelInfo);
ExecCopySlot(batchslot, slot);
- MultiInsertInfoStore(mtstate->miinfo, resultRelInfo, batchslot, 0, 0); // XXX: tuplen/lineno
+ MultiInsertInfoStore(mtstate->miinfo, resultRelInfo, batchslot,
+ // sizeof(void*) * batchslot->tts_nvalid, /* tuple size - underestimate */
+ MemoryContextMemAllocated(batchslot->tts_mcxt, true), /* tuple size */
+ mtstate->ntuples); /* lineno */
+
+ elog(DEBUG2, "bufferedBytes %d; tuples %ld",
+ mtstate->miinfo->bufferedBytes, mtstate->ntuples);
if (MultiInsertInfoIsFull(mtstate->miinfo))
MultiInsertInfoFlush(mtstate->miinfo, resultRelInfo);
--
2.17.0
--3yNHWXBV/QO9xKNm--
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: attndims, typndims still not enforced, but make the value within a sane threshold
@ 2024-12-05 14:43 Alvaro Herrera <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Alvaro Herrera @ 2024-12-05 14:43 UTC (permalink / raw)
To: Kirill Reshke <[email protected]>; +Cc: jian he <[email protected]>; Tom Lane <[email protected]>; pgsql-hackers
On 2024-Dec-05, Kirill Reshke wrote:
> On Fri, 20 Sept 2024 at 07:11, jian he <[email protected]> wrote:
> > attached patch removes attndims and typndims entirely.
>
> LGTM?
> I see no open items in this thread. Are there any issues about v1?
Should we leave TupleDescInitEntry()'s API alone, to avoid breaking the
compilation of every extension in the world? Maybe we could rename the
function (say to TupleDescInitializeEntry()) and use a define?
#define TupleDescInitEntry(a,b,c,d,e,f) TupleDescInitializeEntry(a,b,c,d,e)
Then the amount of churn is reduced, no extensions are broken, and we
can remove the define in a few years.
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Debido a que la velocidad de la luz es mucho mayor que la del sonido,
algunas personas nos parecen brillantes un minuto antes
de escuchar las pelotudeces que dicen." (Roberto Fontanarrosa)
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2024-12-05 14:43 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]>
2024-12-05 14:43 Re: attndims, typndims still not enforced, but make the value within a sane threshold Alvaro Herrera <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox