Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmXXR-0000EU-9X for pgsql-interfaces@arkaria.postgresql.org; Wed, 12 Apr 2023 10:17:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pmXXQ-0001Rh-7I for pgsql-interfaces@arkaria.postgresql.org; Wed, 12 Apr 2023 10:17:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmV0d-0000lF-4H for pgsql-interfaces@lists.postgresql.org; Wed, 12 Apr 2023 07:35:15 +0000 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.163]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pmV0a-002OXQ-5T for pgsql-interfaces@postgresql.org; Wed, 12 Apr 2023 07:35:14 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1681284910; cv=none; d=strato.com; s=strato-dkim-0002; b=LdvtqwvuMPyMX5j5dQTLTCVNsmmHTslEhWamHGhIAFV50Np3eqrXETRcR5HNo81Vg3 P/yA5z2Mq0Dqk+y632ob2iQvE4CvU9/BC4RZ6ypBrvVREtRBN9JTmA3EBIFYEsUfEXAH OReCIbQy9aLJV3OHphnrlcdgpo1CPeCl4sv3Sq8CbODvJmxcf3n6B09URtI/v8OJrX1O /IU0lIVIuwcZb7BmSApSr3kv3BUwHFU6kcIqPELHWN5BpCtgUFvavRwwwTY7F1NvADUX XBnIFPrMuFIx/of4TsoGbBQxN5r+P5GUT0OaElcbFBP5koUstkkiaQdDyA7z2UQw1wmu PMyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1681284910; s=strato-dkim-0002; d=strato.com; h=Subject:Message-ID:To:From:Date:Cc:Date:From:Subject:Sender; bh=W/HJs4tuol93uKG7/CozJtQk//O59S7RYNP7knWZW8s=; b=tDShq3xgwzKiVwyceSxWJBMKJWFl/uPQ5IIjR/u94zv0pk9Cgqfmrj2ohM5nfIkYk1 WJuIw1tSjtqfvbMQIzMyvSWULs9wry25PL2SoAR2oIGN7zHCy5KubtxJTyctmXap9ajt dRxA88XWloq8BgeLsKF9FmWFa7/PBTaGm+Z5TzylodLv+n6Lxx7RedC+E7+3Lq1huE6A KJNFogZj40dgYEARLWtOBpfjJ2A+9FxMFGkSUvYSMLEkF36sYueLLi8NZDqRgz7Z9xaw vsB8v44Iee7V09mXJKgszkei5ieZc4StAGZmFgQ8nSuAZuCZ7TOzUfE2QyCJRM4C6jB6 3G1g== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1681284910; s=strato-dkim-0002; d=tuschehund.de; h=Subject:Message-ID:To:From:Date:Cc:Date:From:Subject:Sender; bh=W/HJs4tuol93uKG7/CozJtQk//O59S7RYNP7knWZW8s=; b=oDcwnS9n0whkc+B2jvmgUmgOurjdnp6BDGAZKALW+LKQzybZ/wrcJ7e8pfZN7TulkY 0UqX8X4cuXzOUP2cZKfBrZYp3KLDXQuThCr5GtSuBC2DtHZHUH2z07C3y4Rc9W1EPRi1 CzbE6dBfXn7U3AXPGmUamQsrVSlPJctOytP+1qx8YKhnkySsYtW/ecu+R/FUn5IYhDN1 vUuMisuLs6WDlZFp55VbcUgMUsAycqqc/gzUPYPOC8Mtp8Yh6AcQrf+X0LBMRqIaIu0c QSShcD/UQ0MEfKrEPxJ9UTtZV7lXJjZY9BnMmA/DC67WCP1EUwl7YYA7AbzCwGdzehKU q3yw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1681284910; s=strato-dkim-0003; d=tuschehund.de; h=Subject:Message-ID:To:From:Date:Cc:Date:From:Subject:Sender; bh=W/HJs4tuol93uKG7/CozJtQk//O59S7RYNP7knWZW8s=; b=x8dECdhAj2dVPaxE84skjyMqojn3s9s383faf3VPCbT6q9U3FSzMBaeML64LDI66/R X7gixyVCdS/TqNiWp9Cg== X-RZG-AUTH: ":PGsHfUWlW+tE6dGLopx2tLHUf2ZSPNp165/ViMXYddg/otfF87vGByLk0QyiSLBPLg3c" Received: from ox-live-app101.back.ox.d0m.de by smtp-ox.front (RZmta 49.4.0 AUTH) with ESMTPSA id Y067e0z3C7ZAiD6 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate) for ; Wed, 12 Apr 2023 09:35:10 +0200 (CEST) Date: Wed, 12 Apr 2023 09:35:10 +0200 (CEST) From: pgchem pgchem To: "pgsql-interfaces@postgresql.org" Message-ID: <607407366.2321178.1681284910101@webmail.strato.de> Subject: C trigger significantly slower than PL/pgSQL? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2321177_1039064287.1681284910100" X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.6-Rev40 X-Originating-Client: open-xchange-appsuite Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_2321177_1039064287.1681284910100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hello all, I have a functionally identical trigger function in PL/pgSQL and C. Now, that the C version is about 3x _slower_ (~1500 vs. ~4500 TPS in pgbench) than PL/pgSQL comes somewhat unexpected. It can very well be, that I made a mistake on the C side, but before everything else, I'd like to ask if this may be expected behavior. Is it plausible that PL/pgSQL is so much faster than C when used in a trigger function? best regards Ernst-Georg ------=_Part_2321177_1039064287.1681284910100 MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Hello all,
 
I have a functionally identical trigger function in PL/pgSQL and C. Now, that the C version is about 3x _slower_ (~1500 vs. ~4500 TPS in pgbench) than PL/pgSQL comes somewhat unexpected.
 
It can very well be, that I made a mistake on the C side, but before everything else, I'd like to ask if this may be expected behavior. Is it plausible that PL/pgSQL is so much faster than C when used in a trigger function?
 
best regards
 
Ernst-Georg
 
------=_Part_2321177_1039064287.1681284910100--