Re: What's faster? BEGIN ... EXCEPTION or CREATE TEMP TABLE IF NOT EXISTS? - Mailing list pgsql-general

From Moshe Jacobson
Subject Re: What's faster? BEGIN ... EXCEPTION or CREATE TEMP TABLE IF NOT EXISTS?
Date
Msg-id CAJ4CxL=wqaukmWULaRy68MY7LUgTnzp3b9jb0wMsWDshB9L-iw@mail.gmail.com
Whole thread Raw
In response to Re: What's faster? BEGIN ... EXCEPTION or CREATE TEMP TABLE IF NOT EXISTS?  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
On Tue, Oct 2, 2012 at 9:18 AM, Merlin Moncure <mmoncure@gmail.com> wrote:
> Yes but that is irrelevant to the discussion. I am comparing the speed of
> repeated table existence checks with the speed of repeated exception blocks
> that access said table.

Both approaches have to do a catalog scan (even if you've established
an exception block the server still internally has to do a catalog
scan in order to raise an appropriate error).  The exception block has
the additional overhead of a subtransaction.

OK this makes sense. Thanks :-) I will go for the CREATE TABLE approach.

--
Moshe Jacobson
Nead Werx, Inc. | Senior Systems Engineer
2323 Cumberland Parkway, Suite 201 | Atlanta, GA 30339
moshe@neadwerx.com | 
www.neadwerx.com

pgsql-general by date:

Previous
From: Ben Chobot
Date:
Subject: Re: surprising behavior or nothing to see here?
Next
From: Wolf Schwurack
Date:
Subject: Re: [Pgbouncer-general] Again, problem with pgbouncer