Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id F28212E0035 for ; Mon, 31 Mar 2008 21:52:39 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 64900-10 for ; Mon, 31 Mar 2008 21:52:29 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tamriel.snowman.net (tamriel.snowman.net [72.66.115.51]) by developer.postgresql.org (Postfix) with ESMTP id 9F6202E0060 for ; Mon, 31 Mar 2008 21:52:36 -0300 (ADT) Received: by tamriel.snowman.net (Postfix, from userid 1000) id 6C32584097; Mon, 31 Mar 2008 20:52:35 -0400 (EDT) Date: Mon, 31 Mar 2008 20:52:35 -0400 From: Stephen Frost To: Ravi Chemudugunta Cc: pgsql-performance@postgresql.org Subject: Re: Performance Implications of Using Exceptions Message-ID: <20080401005235.GM4999@tamriel.snowman.net> Mail-Followup-To: Ravi Chemudugunta , pgsql-performance@postgresql.org References: <7a4208ef0803311720s1dac8362gff2477d3dc534968@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XRwESHC7KXlqFpSs" Content-Disposition: inline In-Reply-To: <7a4208ef0803311720s1dac8362gff2477d3dc534968@mail.gmail.com> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/2.6.24-1-amd64 (x86_64) X-Uptime: 20:48:22 up 21 days, 23:03, 22 users, load average: 0.26, 0.35, 0.35 User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/536 X-Sequence-Number: 29490 --XRwESHC7KXlqFpSs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Ravi Chemudugunta (chemuduguntar@gmail.com) wrote: > Which version is faster? In general I would recommend that you benchmark them using as-close-to-real load as possible again as-real-as-possible data. > Does the exception mechanism add any overhead? Yes, using exceptions adds a fair bit of overhead. Quote from the documentation found here: http://www.postgresql.org/docs/8.3/static/plpgsql-control-structures.html Tip: A block containing an EXCEPTION clause is significantly more expensive to enter and exit than a block without one. Therefore, don't use EXCEPTION without need. > Which is more cleaner? That would be in the eye of the beholder, generally. Given the lack of complexity, I don't think 'cleanness' in this case really matters all that much. Enjoy, Stephen --XRwESHC7KXlqFpSs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFH8YdTrzgMPqB3kigRAv2uAJwOED/o2a1SAxCYjf8PQdbQndt/OQCeMCUI WpOiyc5Qi9fYu8kVjVvJxWk= =mDi4 -----END PGP SIGNATURE----- --XRwESHC7KXlqFpSs--