public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tender Wang <[email protected]>
To: David Rowley <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: John Naylor <[email protected]>
Cc: PostgreSQL Developers <[email protected]>
Subject: Re: More speedups for tuple deformation
Date: Thu, 19 Mar 2026 20:39:26 +0800
Message-ID: <CAHewXNmSK+gKziAt_WvQoMVWt3_LRVMmRYY9dAbMPMcpPV0QmA@mail.gmail.com> (raw)
In-Reply-To: <CAApHDvoy9AJ4D2+pJE0ZRhPPCHh-Mm-sZAfookKtf_3V+GeP0g@mail.gmail.com>
References: <CAApHDvpbntG7V3_EsZ+w-V=jU-y8rFmv9RB1EDJm4sxKno-4UA@mail.gmail.com>
<e7sto7tk5dk5hfyvoocaddnxcngemcmfvbuh23l32w5cssaizy@znuphjqug7qe>
<CAApHDvpuEbhvH1ViCZRz5vks+_bGbEnPoEdZYAZXK76_isb_+Q@mail.gmail.com>
<v6z545yozjtywghn5glujemu72z4i4ynadsc2xks4ejotdg7yl@4rry7ixwr4us>
<CANWCAZabO1oj+khF+YNVpmkTQwRRyNJesbsBhRFL5emZJh3tow@mail.gmail.com>
<lzgoxzbh2gel5w362revuwaecrsbjr44kjdzrewuejugcodkeq@ixymojwnylsy>
<CAApHDvodSVBj3ypOYbYUCJX+NWL=VZs63RNBQ_FxB_F+6QXF-A@mail.gmail.com>
<rbxc2qqhsvzxpukgd36caoa4ydgn5r22fxktxanrkn6nobg7j6@27b4vogohgu2>
<CAApHDvpWQn8sXDYpSNNpieJW-UTG4Nf4TVjT8ew64L073hz-Fw@mail.gmail.com>
<mq6ddpgctt42srolsvo5kph2s6shfg62meb7i5fbg6n3s73zju@2n7gviiyga3h>
<uhqul2ryci4tyg5ylddjrmf4kybzwb7m5z7rmurhhjp37vrn5f@zgxil7egr62n>
<CAApHDvq21qQigiM6z2YgadFusQC_pfEYP8D=oQCrwJ_kKzcqDg@mail.gmail.com>
<CAApHDvpdB1t7LCgH8=KOKC6VBb2rsEbaas0FiXo5awsRgCsDxQ@mail.gmail.com>
<CAEG8a3KeKcZxJsH9nL+D1JzC4Ekx51ps7-1ZGWkwdXbPS5jTXw@mail.gmail.com>
<CAApHDvqp_DGNkz3Rr29hPuSYdai5c_32mWSv2inrW2ufsE+qZQ@mail.gmail.com>
<CAHewXNnb-s_=VdVUZ9h7dPA0u3hxV8x2aU3obZytnqQZ_MiROA@mail.gmail.com>
<CAApHDvrFmW+2GhdDKuWRaJmp8MfghmBiEGaeqjOD_Y2RWUFSow@mail.gmail.com>
<CAApHDvoy9AJ4D2+pJE0ZRhPPCHh-Mm-sZAfookKtf_3V+GeP0g@mail.gmail.com>
Hi David,
David Rowley <[email protected]> 于2026年3月17日周二 05:15写道:
>
> On Mon, 16 Mar 2026 at 22:17, David Rowley <[email protected]> wrote:
> >
> > On Mon, 16 Mar 2026 at 20:01, Tender Wang <[email protected]> wrote:
> > > SELECT * FROM t2, t4 RIGHT OUTER JOIN t0 ON t4.c0 WHERE t4.c1 ORDER BY
> >
> > > server closed the connection unexpectedly
> >
> > Thanks. Looks like I didn't get the startAttr logic correct in
> > nocachegetattr(). Starting by using the attcacheoff of the first NULL
> > attribute isn't valid. It should be the attribute prior to that one.
> >
> > I'm just verifying some code locally now.
>
> Now pushed. Some concerns about the lack of exercise in the tests for
> fastgetattr() for user tables. I ended up testing by injecting the
> following into slot_deform_heap_tuple()
I encountered a crash when doing SQLSmith on TPCH (s=1) test.
How to reproduce:
1. prepare TPCH s =1 data.
2. Execute the following query
postgres=# update public.region set
r_comment = public.region.r_comment
returning
5 as c0,
pg_catalog.bittypmodout(
cast(public.region.r_regionkey as int4)) as c1;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
(gdb) bt
#0 __pthread_kill_implementation (no_tid=0, signo=6,
threadid=140696004203456) at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=6, threadid=140696004203456) at
./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=140696004203456,
signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3 0x00007ff659450476 in __GI_raise (sig=sig@entry=6) at
../sysdeps/posix/raise.c:26
#4 0x00007ff6594367f3 in __GI_abort () at ./stdlib/abort.c:79
#5 0x000055d8ae8cad94 in ExceptionalCondition
(conditionName=0x55d8aeac5beb "attlen > 0 || attlen == -1",
fileName=0x55d8aeac5a18 "execTuples.c", lineNumber=1197) at
assert.c:65
#6 0x000055d8ae3afa2e in slot_deform_heap_tuple (slot=0x55d8cabf1a58,
tuple=0x55d8cabf1ab0, offp=0x55d8cabf1ac8, reqnatts=2) at
execTuples.c:1197
#7 0x000055d8ae3ae853 in tts_minimal_getsomeattrs
(slot=0x55d8cabf1a58, natts=2) at execTuples.c:550
#8 0x000055d8ae06ac3b in slot_getsomeattrs (slot=0x55d8cabf1a58,
attnum=2) at ../../../../src/include/executor/tuptable.h:380
#9 0x000055d8ae06ac62 in slot_getallattrs (slot=0x55d8cabf1a58) at
../../../../src/include/executor/tuptable.h:392
#10 0x000055d8ae06b5f5 in printtup (slot=0x55d8cabf1a58,
self=0x55d8cab11828) at printtup.c:319
#11 0x000055d8ae6bfd82 in RunFromStore (portal=0x55d8cab860a0,
direction=ForwardScanDirection, count=0, dest=0x55d8cab11828) at
pquery.c:1089
#12 0x000055d8ae6bf88b in PortalRunSelect (portal=0x55d8cab860a0,
forward=true, count=0, dest=0x55d8cab11828) at pquery.c:912
#13 0x000055d8ae6bf4ea in PortalRun (portal=0x55d8cab860a0,
count=9223372036854775807, isTopLevel=true, dest=0x55d8cab11828,
altdest=0x55d8cab11828, qc=0x7ffe1b92e4f0) at pquery.c:760
#14 0x000055d8ae6b7c2b in exec_simple_query (
query_string=0x55d8caadb4b0 "update public.region set \n
r_comment = public.region.r_comment\n returning \n 5
as c0, \n pg_catalog.bittypmodout(\n", ' ' <repeats 12
times>, "cast(public.region.r_regionkey as int4)) a"...)
at postgres.c:1278
#15 0x000055d8ae6bd47b in PostgresMain (dbname=0x55d8cab218d0
"postgres", username=0x55d8cab218b8 "ubuntu") at postgres.c:4810
#16 0x000055d8ae6b3068 in BackendMain (startup_data=0x7ffe1b92e7a0,
startup_data_len=24) at backend_startup.c:124
#17 0x000055d8ae5a17a6 in postmaster_child_launch
(child_type=B_BACKEND, child_slot=2, startup_data=0x7ffe1b92e7a0,
startup_data_len=24, client_sock=0x7ffe1b92e800) at
launch_backend.c:268
#18 0x000055d8ae5a8290 in BackendStartup (client_sock=0x7ffe1b92e800)
at postmaster.c:3606
#19 0x000055d8ae5a57d2 in ServerLoop () at postmaster.c:1713
#20 0x000055d8ae5a509c in PostmasterMain (argc=3, argv=0x55d8caad5b30)
at postmaster.c:1403
#21 0x000055d8ae430b37 in main (argc=3, argv=0x55d8caad5b30) at main.c:231
(gdb) f 6
#6 0x000055d8ae3afa2e in slot_deform_heap_tuple (slot=0x55d8cabf1a58,
tuple=0x55d8cabf1ab0, offp=0x55d8cabf1ac8, reqnatts=2) at
execTuples.c:1197
1197 pg_assume(attlen > 0 || attlen == -1);
(gdb) p attlen
$1 = -2
Please take a look.
--
Thanks,
Tender Wang
view thread (31+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: More speedups for tuple deformation
In-Reply-To: <CAHewXNmSK+gKziAt_WvQoMVWt3_LRVMmRYY9dAbMPMcpPV0QmA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox