Re: What's faster? BEGIN ... EXCEPTION or CREATE TEMP TABLE IF NOT EXISTS?

From: Moshe Jacobson <moshe(at)neadwerx(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: What's faster? BEGIN ... EXCEPTION or CREATE TEMP TABLE IF NOT EXISTS?
Date: 2012-10-03 19:14:08
Message-ID: CAJ4CxL=wqaukmWULaRy68MY7LUgTnzp3b9jb0wMsWDshB9L-iw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Oct 2, 2012 at 9:18 AM, Merlin Moncure <mmoncure(at)gmail(dot)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(at)neadwerx(dot)com | www.neadwerx.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2012-10-03 19:41:03 Re: syntax error collate
Previous Message Ben Chobot 2012-10-03 18:55:06 Re: surprising behavior or nothing to see here?