Re: Errors on CREATE TABLE IF NOT EXISTS - Mailing list pgsql-bugs

From Matteo Beccati
Subject Re: Errors on CREATE TABLE IF NOT EXISTS
Date
Msg-id 4FA16A02.10109@beccati.com
Whole thread Raw
In response to Re: Errors on CREATE TABLE IF NOT EXISTS  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-bugs
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/

pgsql-bugs by date:

Previous
From: stuart@stuartbishop.net
Date:
Subject: BUG #6624: Tab completion of identifier containing single backslash triggers warnings
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #6624: Tab completion of identifier containing single backslash triggers warnings