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.94.2) (envelope-from ) id 1sRLfc-00Ec4L-45 for pgsql-general@arkaria.postgresql.org; Wed, 10 Jul 2024 00:58:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sRLfa-00159Y-G9 for pgsql-general@arkaria.postgresql.org; Wed, 10 Jul 2024 00:58:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sRLfa-00157r-4t for pgsql-general@lists.postgresql.org; Wed, 10 Jul 2024 00:58:54 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sRLfX-001J9f-Ew for pgsql-general@lists.postgresql.org; Wed, 10 Jul 2024 00:58:53 +0000 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-6bce380eb96so3200543a12.0 for ; Tue, 09 Jul 2024 17:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720573129; x=1721177929; darn=lists.postgresql.org; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=q68uor8/CoJR3TluyI/q1kL3ziXKq1DYDdjHtXeSN5I=; b=DV7n4GitcZZk1Q1vRUCStb4eXmWjAHOGMx2MxzwAbeYHjWsFtNrPf5o2309urjmspf DyRe9Z91aIEvlyFNjaIo7uF0LznQPaY3kWmjq47pzzJmlG3fDWEAXIUZHu/gVjLpdEst b/WKAvazxScsUCrVJDbbtl7ebY8/wDrUg8Z+oibnXYbcWPV7syhBENSsqnMUA+MRUD2n +CHoxIQAx0Q4lDdabzrL2lmvoK+Ugwpk1+N5YCSjfLlC2T4tAG0g+j4PkKu+vIxSEFHC +pkP94eOfr+3+0iJ8nRj2ePaQ4uQJgdT4unwHVBs5HwurLzB7ie//N+n28ui7mOOOncQ +EqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720573129; x=1721177929; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=q68uor8/CoJR3TluyI/q1kL3ziXKq1DYDdjHtXeSN5I=; b=Jp1Qfb7vXjr52xl0DajCFYFz9tNeaSXIk6/zw9f2uz0HjtUEwS+oeEl2tb8vqM74G/ ONppyhVNXgHMIqZ11dpfF4gyq5+nsHZ5bOqVH/tHPZ5zjXHh575dhpQXDktR9YqicOey 9MNVJxRozbLt538IZMOfveX+jn8oGQa/5UWDrGaRgS4qN2WapKlgDKAobMWpiy3cIaPq RBRt7QiPaZkA9dC/AJXZv8AAlx629zAnqKIKx7yFbMv0/SdJiwYsq3MLcJ6b8xlQq36m xrFvQer9ToJtcX5nUXUyw7dLF5kfMwFxgJjco+3Qfcd9Qjwq4wSAQVf6oAzYPmruFpit +7hg== X-Gm-Message-State: AOJu0YyaGH1aIKWYB7KtwHLLmZhGsq9qZx+psy6jkjY9l6xHbt16lFKr qFg26p4W7EZMaQoYS8WIi+JKATszeFn4ZBmuAV2bfVJpM5dUugRuCKtzKg== X-Google-Smtp-Source: AGHT+IHyG6ZNVscyAzUZ/A6OSyN+R28hJATgTUVBw6qNaxpPui+LZe1POwkGQFKmKHh6aHn2+Knjdg== X-Received: by 2002:a05:6a21:6da6:b0:1bd:2214:e92f with SMTP id adf61e73a8af0-1c29821ffbdmr4256066637.14.1720573128720; Tue, 09 Jul 2024 17:58:48 -0700 (PDT) Received: from ?IPV6:2402:e280:3e2e:391:a875:5ac2:5b0b:f105? ([2402:e280:3e2e:391:a875:5ac2:5b0b:f105]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fbb6ab6c32sm22043565ad.165.2024.07.09.17.58.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jul 2024 17:58:48 -0700 (PDT) Message-ID: Date: Wed, 10 Jul 2024 06:28:46 +0530 MIME-Version: 1.0 User-Agent: Betterbird (Linux) Content-Language: en-US To: pgsql-general@lists.postgresql.org From: Krishnakant Mane Subject: can stored procedures with computational sql queries improve API performance? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello. I have a straight forward question, but I am just trying to analyze the specifics. So I have a set of queries depending on each other in a sequence to compute some results for generating financial report. It involves summing up some amounts from tuns or of rows and also on certain conditions it categorizes the amounts into types (aka Debit Balance, Credit balance etc). There are at least 6 queries in this sequence and apart from 4 input parameters. these queries never change. So will I get any performance benefit by having them in a stored procedure rather than sending the queries from my Python based API? Regards.