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

From Merlin Moncure
Subject Re: Re: What's faster? BEGIN ... EXCEPTION or CREATE TEMP TABLE IF NOT EXISTS?
Date
Msg-id CAHyXU0zVRmYP+6j6R5Q960sowodsGRzX+ZPtWRo6nfZWbTuK-w@mail.gmail.com
Whole thread Raw
In response to Re: Re: What's faster? BEGIN ... EXCEPTION or CREATE TEMP TABLE IF NOT EXISTS?  (Ivan Voras <ivoras@freebsd.org>)
Responses Re: Re: What's faster? BEGIN ... EXCEPTION or CREATE TEMP TABLE IF NOT EXISTS?  (Ivan Voras <ivoras@freebsd.org>)
List pgsql-general
On Fri, Oct 5, 2012 at 3:09 AM, Ivan Voras <ivoras@freebsd.org> wrote:
> I think I can make a fairly educated guess that catching exceptions
> while dealing with session variables should be much, much faster than
> creating any kind of a table :)

That is true, but it's not clear how using session variables keeps you
from having to create the table.  If the table is already there, a
session variable guarding the table construction shouldn't be any
faster/better than a simple 'create if not exists'.  A catalog scan is
basically boils down to a query.  So I'm not sure that actually helps.

On the other hand, if the temp table can be completely ditched for a
session variable or two, then yeah, that would be much better since
you'd avoid the overhead of creating the table completely.

merlin


pgsql-general by date:

Previous
From: Shaun Thomas
Date:
Subject: Re: Trajectory of a [Pg] DBA
Next
From: Moshe Jacobson
Date:
Subject: Counting all results before LIMIT