Skip site navigation (1) Skip section navigation (2)

Daily Rotated Insertion

From: Haifeng Liu <liuhaifeng(at)live(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Daily Rotated Insertion
Date: 2012-03-26 05:39:01
Message-ID: BLU0-SMTP195BAAB8B6E63CE73CF5849B9450@phx.gbl (view raw or flat)
Thread:
Lists: pgsql-admin
Hi all:

I want to do a daily rotated insertion according the data's date field. The data come from a real time analyzer, which means it's date field is nearly the current date but not exactly, even not exactly in the date order.

The real trouble is it will be a heavy insertion, I don't want to code a complex trigger function. I'd like to simply redirect the insertion to a "CURRENT" table, and rename it every mid-night. But it's difficult to make 'check', which is required by a better query performance.

Well, I can create a trigger to redirect insertion to 'yesterday', 'today' and 'tomorrow', but I am still expecting a more simple and more fast solution.

Any idea is appreciated. Thanks in advance.


Best regards.
liuhaifeng

Responses

pgsql-admin by date

Next:From: Sergey KonoplevDate: 2012-03-27 04:42:45
Subject: Re: Daily Rotated Insertion
Previous:From: BGoebelDate: 2012-03-23 18:04:57
Subject: Re: german sort is wrong

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group