public inbox for [email protected]help / color / mirror / Atom feed
[PATCH v9 4/4] WIP: check tuple size 24+ 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; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v10 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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 e018946c0e..ec9e43ac55 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -760,7 +760,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 --8nsIa27JVQLqB7/C-- ^ permalink raw reply [nested|flat] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v8 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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 47a5271b91..b4f523e32d 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 --AZuoSAvZwvV/ife4-- ^ permalink raw reply [nested|flat] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v9 4/4] WIP: check tuple size @ 2020-12-01 23:20 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 24+ 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] 24+ messages in thread
* [PATCH v3 2/2] Add const to read only TableInfo pointers in pg_dump @ 2025-12-18 12:47 Bertrand Drouvot <[email protected]> 0 siblings, 0 replies; 24+ messages in thread From: Bertrand Drouvot @ 2025-12-18 12:47 UTC (permalink / raw) Functions that dump table data receive their parameters through const void * but were casting away const. Add const qualifiers to functions that only read the table information. Discussion: https://postgr.es/m/aUQHy/MmWq7c97wK%40ip-10-97-1-34.eu-west-3.compute.internal --- src/bin/pg_dump/pg_dump.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 100.0% src/bin/pg_dump/ diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 7df56d8b1b0..e3b4035e57a 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -2379,8 +2379,8 @@ selectDumpableObject(DumpableObject *dobj, Archive *fout) static int dumpTableData_copy(Archive *fout, const void *dcontext) { - TableDataInfo *tdinfo = (TableDataInfo *) dcontext; - TableInfo *tbinfo = tdinfo->tdtable; + const TableDataInfo *tdinfo = dcontext; + const TableInfo *tbinfo = tdinfo->tdtable; const char *classname = tbinfo->dobj.name; PQExpBuffer q = createPQExpBuffer(); @@ -2547,8 +2547,8 @@ dumpTableData_copy(Archive *fout, const void *dcontext) static int dumpTableData_insert(Archive *fout, const void *dcontext) { - TableDataInfo *tdinfo = (TableDataInfo *) dcontext; - TableInfo *tbinfo = tdinfo->tdtable; + const TableDataInfo *tdinfo = dcontext; + const TableInfo *tbinfo = tdinfo->tdtable; DumpOptions *dopt = fout->dopt; PQExpBuffer q = createPQExpBuffer(); PQExpBuffer insertStmt = NULL; @@ -2618,7 +2618,7 @@ dumpTableData_insert(Archive *fout, const void *dcontext) */ if (insertStmt == NULL) { - TableInfo *targettab; + const TableInfo *targettab; insertStmt = createPQExpBuffer(); @@ -2870,7 +2870,7 @@ static void dumpTableData(Archive *fout, const TableDataInfo *tdinfo) { DumpOptions *dopt = fout->dopt; - TableInfo *tbinfo = tdinfo->tdtable; + const TableInfo *tbinfo = tdinfo->tdtable; PQExpBuffer copyBuf = createPQExpBuffer(); PQExpBuffer clistBuf = createPQExpBuffer(); DataDumperPtr dumpFn; @@ -2891,7 +2891,7 @@ dumpTableData(Archive *fout, const TableDataInfo *tdinfo) (dopt->load_via_partition_root || forcePartitionRootLoad(tbinfo))) { - TableInfo *parentTbinfo; + const TableInfo *parentTbinfo; char *sanitized; parentTbinfo = getRootTableInfo(tbinfo); -- 2.34.1 --z8zicCKlggXCVSIM-- ^ permalink raw reply [nested|flat] 24+ messages in thread
end of thread, other threads:[~2025-12-18 12:47 UTC | newest] Thread overview: 24+ 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]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v10 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v8 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2020-12-01 23:20 [PATCH v9 4/4] WIP: check tuple size Justin Pryzby <[email protected]> 2025-12-18 12:47 [PATCH v3 2/2] Add const to read only TableInfo pointers in pg_dump Bertrand Drouvot <[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