Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitadeee97

Browse files
committed
Fix dumb bug in tqueue.c
When I wrote this code originally, the intention was to recompute theremapinfo only when the tupledesc changes. This presumably onlyhappens once per query, but I copied the design pattern from otherDestReceivers. However, due to a silly oversight on my part,tqueue->tupledesc never got set, leading to recomputation for everytuple.This should improve the performance of parallel scans that return asignificant number of tuples.Report by Amit Kapila; patch by me, reviewed by him.
1 parent5f10b7a commitadeee97

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/backend/executor/tqueue.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,15 @@ tqueueReceiveSlot(TupleTableSlot *slot, DestReceiver *self)
127127
* new tupledesc. This is a strange test both because the executor really
128128
* shouldn't change the tupledesc, and also because it would be unsafe if
129129
* the old tupledesc could be freed and a new one allocated at the same
130-
* address. But since some very old code in printtup.c usesthis test, we
131-
* adopt it here as well.
130+
* address. But since some very old code in printtup.c usesa similar
131+
*test, weadopt it here as well.
132132
*/
133-
if (tqueue->tupledesc!=tupledesc||
134-
tqueue->remapinfo->natts!=tupledesc->natts)
133+
if (tqueue->tupledesc!=tupledesc)
135134
{
136135
if (tqueue->remapinfo!=NULL)
137136
pfree(tqueue->remapinfo);
138137
tqueue->remapinfo=BuildRemapInfo(tupledesc);
138+
tqueue->tupledesc=tupledesc;
139139
}
140140

141141
tuple=ExecMaterializeSlot(slot);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp