pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matteo Beccati <php@beccati.com>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: Errors on CREATE TABLE IF NOT EXISTS
Date: Wed, 02 May 2012 19:08:18 +0200
Message-ID: <4FA16A02.10109@beccati.com> (raw)
In-Reply-To: <1335900770-sup-854@alvh.no-ip.org>
References: <4F9541D3.1000202@beccati.com>
	<1335900770-sup-854@alvh.no-ip.org>

Hi Alvaro,

On 01/05/2012 21:36, Alvaro Herrera wrote:
> The question you were asking has already been answered, but I think it's
> worth pointing out that a partitioned-insert trigger that has to check
> whether the partition exist beforehand is a lot slower than one that
> doesn't have to.  Our usual suggestion is to create the partitions by
> some other means, e.g. create a couple months worth of weekly
> partitions, a couple of months ahead of time, via cron.  The insert
> trigger is then assured that the partition exists, and it can become
> faster by not having to check.

Thanks for the suggestion. I will surely follow the advice as soon as 
the load starts to grow. For now catching the "table not found" 
exception within the insert trigger and creating the table on the fly 
seems a good balance between performance and ease of use.


Cheers
-- 
Matteo Beccati

Development & Consulting - http://www.beccati.com/



view thread (6+ messages)  latest in thread

Message-ID: <4FA16A02.10109@beccati.com>
Permalink:  ../4FA16A02.10109@beccati.com/
Also on:    postgresql.org/message-id/4FA16A02.10109@beccati.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: php@beccati.com, alvherre@commandprompt.com
  Subject: Re: Errors on CREATE TABLE IF NOT EXISTS
  In-Reply-To: <4FA16A02.10109@beccati.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox