Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w3Cg9-0010J8-0T for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Mar 2026 12:40:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w3Cf9-0000dS-05 for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Mar 2026 12:39:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w3Cf8-0000dG-1g for pgsql-hackers@lists.postgresql.org; Thu, 19 Mar 2026 12:39:42 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w3Cf4-00000000YYm-464g for pgsql-hackers@lists.postgresql.org; Thu, 19 Mar 2026 12:39:41 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-b976536806cso128445466b.0 for ; Thu, 19 Mar 2026 05:39:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773923979; cv=none; d=google.com; s=arc-20240605; b=FZ/BKJTwK5ywab0F5DYo6fjfMeJgL2QMzP57/dGZh9XIi6SAUODZbLlEb4SDD+h3N3 mURMBcAliWfDAFWqh5Nc5Hc40g6Y2BRxPJJ4O5wwhcwrEhRooJXOK+zQZqvoJ1EbO2GQ 5Flti8HPP400PwUNLmiSDhMYgLWt8Dy4brVK+a4oGfwWeeNulNvQbn7KKiyYqMZezki8 0H61DuFM+ZuHIJUk9dA0H4Tp/M78xxD8oTuWQLJMcNPZJWml5/wUsEreUsEMDQmtswxH fNgSqVVt4LZW/DB0w9SGLAyQm4W2eEpWJiNadWZZdi4qAijnBLYIbus4yzi5tAPzo7t5 mvgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/wpf8KMuQ5fc1X6QAD/nZPxr6IvVz8c5OR932xoRe0E=; fh=JNFO/aOEQsn76WFBqGe1wsTI52H951l/amWIjS8cTK0=; b=UwlzDtfaUmN3eMuPO5t8AuDiQ8NgKp8GUkr3nSWhzb8aMXqPxpxGnL4IuQSfMGJNky be+o8W5dre/YHnM3Z2JE8C+CZJQEPVb69ObHn9hg86sP+CSpQnqw34jrSFUg7uTtt2YT xPCATajx42x2vjSxPcYICRx43eMTvoiqkKdPEC2jpB5UDmQNHjPGNhaqkzrdn2+zXEkg 3RHDgL9T5/OSKYkUSleag6TwvSsYGZjb2Zx/WwgkMyMk6Jt7L+p2vOYxk8Gy4uf86xAn 4NJmjLsgJOeGaVj2wDcRMmeT5G8gk+fGsMI8MU5bSwLBIS9ZJ+E7Tq2iwImqW28bXHoZ 7O/g==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773923979; x=1774528779; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/wpf8KMuQ5fc1X6QAD/nZPxr6IvVz8c5OR932xoRe0E=; b=kAIr9g1/Vp4CjFNlH5IZ95XtIpMlp2ZQQSC4JMTG8QRj4tz8ki+S6ne1jQsUMPUHU6 Da8Kcm3t2AdVBG0Qk3w/H6m0d9l3eVKlkmuUOs9pzOMU07PGFEa+I3EpzY+t8RIqDPou MASU5Bj623fivGtFUlU4OCSn76YKhAJXSJiiOZFgTv2B8Wivuft9FgncfPnpqe9E2H2N Z+qe+J9BnI6BDf99zGvZxuEFpELinNWqh9zmOVJFr89kB34QsXMhS9xpVincg3UjapxC IxkC9BE2ckWsuXVAi992XtbEWIx7buYLSaldkbz2JYQUG6Y+2wk+8yHjRe5skGQ3p7ek zZ4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773923979; x=1774528779; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/wpf8KMuQ5fc1X6QAD/nZPxr6IvVz8c5OR932xoRe0E=; b=E2Sa9AeVm7TUQq3KhBWXncsj6um7qs90iKCjwymXG5oX7LJUZcEQUeSv5i8cdk6xrF CJTb2u2Dy2yT3ybti2ApcTvfAL5CkRbQMShh/rfcyEYojkR6H3Rm4gHqwyYjyGGmB+OG i1bAwHIvbgivBBgmiur0HHY2N+Ul7qF0YdHMSYDjo1uhQgIY1L94BRg3BpVxCnQRNgcC 195jhb5lAQFkdmI0FhmXtcInVsFeNMsKhMYny/gGAUe8nmUAroSy7RH5yfEyLxyq5G2/ Fr1iBs8tHr5cHmA93/QoLKY0GPsd702RJY+FtCUXDjq52fCvK9JRPfVB03pPgxyrLAq0 T5ww== X-Forwarded-Encrypted: i=1; AJvYcCXRwkZLLymdeFULafkl6T+vngmwMZ6FuiZvyENQEiR1B83N8gQbI9ZJEt/9Sa++MmoPQ4bkDus1WlVMr/Vc@lists.postgresql.org X-Gm-Message-State: AOJu0YzY7OUeCxblNwLiYlysEhIbh2AXofoDxnh59cVJXAZlgGfWK4om 2y07QbgmNoZh9rcEYVucOiXuwfem7Pvl+8y+pU9x/APwh7D6Gs1fuUBvlqiYS/ptzHUyjhNFiob F4DlNXPgcZqs0FxBFrrUbqEWmoiMqqG4= X-Gm-Gg: ATEYQzxSRjvf6fQIJ0a1/4trWKu7urZ9aP7ELuumM/qOQ5C6ybrPjgM8kKmNZVaeEmw LH9K2T6+EAb1cD8J4eWajoIgIYV6f55dAyRsmesp749y0zclTkqyIzprSr6/chcqOtpTGK4CkaO hpdwVlTyLuUCQ972h7WPAS0Dx5vufHOS2mOSGTGjxoYTuZ1foCj3JJDCuUphg1SYSgEvvSsvGJo /7sKvfiF5u8uAdowZO2m1nDekhecbFOLP8mGvC3CBKRr93F8QLglYpwrVRcFu3IJCXhz2qQqgm6 u/T4i+0bx4IyZteaTQQxWkoyfJIBauslNQt8 X-Received: by 2002:a17:906:d14b:b0:b96:eb7e:bc55 with SMTP id a640c23a62f3a-b97f48855d7mr325090866b.10.1773923978692; Thu, 19 Mar 2026 05:39:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Tender Wang Date: Thu, 19 Mar 2026 20:39:26 +0800 X-Gm-Features: AaiRm528-HpUp57HgQxGwntcVIn077AnPzQChOsgED4c7bbhYjVs_7-fPIKVL6s Message-ID: Subject: Re: More speedups for tuple deformation To: David Rowley Cc: Andres Freund , John Naylor , PostgreSQL Developers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi David, David Rowley =E4=BA=8E2026=E5=B9=B43=E6=9C=8817=E6= =97=A5=E5=91=A8=E4=BA=8C 05:15=E5=86=99=E9=81=93=EF=BC=9A > > On Mon, 16 Mar 2026 at 22:17, David Rowley wrote: > > > > On Mon, 16 Mar 2026 at 20:01, Tender Wang wrote: > > > SELECT * FROM t2, t4 RIGHT OUTER JOIN t0 ON t4.c0 WHERE t4.c1 ORDER B= Y > > > > > 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=3D1) test. How to reproduce: 1. prepare TPCH s =3D1 data. 2. Execute the following query postgres=3D# update public.region set r_comment =3D 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=3D0, signo=3D6, threadid=3D140696004203456) at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=3D6, threadid=3D140696004203456) at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=3D140696004203456, signo=3Dsigno@entry=3D6) at ./nptl/pthread_kill.c:89 #3 0x00007ff659450476 in __GI_raise (sig=3Dsig@entry=3D6) at ../sysdeps/posix/raise.c:26 #4 0x00007ff6594367f3 in __GI_abort () at ./stdlib/abort.c:79 #5 0x000055d8ae8cad94 in ExceptionalCondition (conditionName=3D0x55d8aeac5beb "attlen > 0 || attlen =3D=3D -1", fileName=3D0x55d8aeac5a18 "execTuples.c", lineNumber=3D1197) at assert.c:65 #6 0x000055d8ae3afa2e in slot_deform_heap_tuple (slot=3D0x55d8cabf1a58, tuple=3D0x55d8cabf1ab0, offp=3D0x55d8cabf1ac8, reqnatts=3D2) at execTuples.c:1197 #7 0x000055d8ae3ae853 in tts_minimal_getsomeattrs (slot=3D0x55d8cabf1a58, natts=3D2) at execTuples.c:550 #8 0x000055d8ae06ac3b in slot_getsomeattrs (slot=3D0x55d8cabf1a58, attnum=3D2) at ../../../../src/include/executor/tuptable.h:380 #9 0x000055d8ae06ac62 in slot_getallattrs (slot=3D0x55d8cabf1a58) at ../../../../src/include/executor/tuptable.h:392 #10 0x000055d8ae06b5f5 in printtup (slot=3D0x55d8cabf1a58, self=3D0x55d8cab11828) at printtup.c:319 #11 0x000055d8ae6bfd82 in RunFromStore (portal=3D0x55d8cab860a0, direction=3DForwardScanDirection, count=3D0, dest=3D0x55d8cab11828) at pquery.c:1089 #12 0x000055d8ae6bf88b in PortalRunSelect (portal=3D0x55d8cab860a0, forward=3Dtrue, count=3D0, dest=3D0x55d8cab11828) at pquery.c:912 #13 0x000055d8ae6bf4ea in PortalRun (portal=3D0x55d8cab860a0, count=3D9223372036854775807, isTopLevel=3Dtrue, dest=3D0x55d8cab11828, altdest=3D0x55d8cab11828, qc=3D0x7ffe1b92e4f0) at pquery.c:760 #14 0x000055d8ae6b7c2b in exec_simple_query ( query_string=3D0x55d8caadb4b0 "update public.region set \n r_comment =3D public.region.r_comment\n returning \n 5 as c0, \n pg_catalog.bittypmodout(\n", ' ' , "cast(public.region.r_regionkey as int4)) a"...) at postgres.c:1278 #15 0x000055d8ae6bd47b in PostgresMain (dbname=3D0x55d8cab218d0 "postgres", username=3D0x55d8cab218b8 "ubuntu") at postgres.c:4810 #16 0x000055d8ae6b3068 in BackendMain (startup_data=3D0x7ffe1b92e7a0, startup_data_len=3D24) at backend_startup.c:124 #17 0x000055d8ae5a17a6 in postmaster_child_launch (child_type=3DB_BACKEND, child_slot=3D2, startup_data=3D0x7ffe1b92e7a0, startup_data_len=3D24, client_sock=3D0x7ffe1b92e800) at launch_backend.c:268 #18 0x000055d8ae5a8290 in BackendStartup (client_sock=3D0x7ffe1b92e800) at postmaster.c:3606 #19 0x000055d8ae5a57d2 in ServerLoop () at postmaster.c:1713 #20 0x000055d8ae5a509c in PostmasterMain (argc=3D3, argv=3D0x55d8caad5b30) at postmaster.c:1403 #21 0x000055d8ae430b37 in main (argc=3D3, argv=3D0x55d8caad5b30) at main.c:= 231 (gdb) f 6 #6 0x000055d8ae3afa2e in slot_deform_heap_tuple (slot=3D0x55d8cabf1a58, tuple=3D0x55d8cabf1ab0, offp=3D0x55d8cabf1ac8, reqnatts=3D2) at execTuples.c:1197 1197 pg_assume(attlen > 0 || attlen =3D=3D -1); (gdb) p attlen $1 =3D -2 Please take a look. --=20 Thanks, Tender Wang