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

Triggers, Stored Procedures to Aggregate table ?

From: Arvind Sharma <arvind321(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Triggers, Stored Procedures to Aggregate table ?
Date: 2010-07-08 14:27:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

Very new to the Triggers and Sprocs.

I have few tables  which stores raw data on minute basis. I want to aggregate 
this data  into another table to store every hour worth of data. And from there 
on -  from this hourly Aggregated table, want to store into another Aggregate  
Table for a day's worth of data. 

You got the direction I am  going with this.. :-)....  Hourly, Daily, Weekly 
aggregated data into  their respective tables.

I could write some Java code to run  periodically on these tables to transform 
them into Aggregate tables but  that would have the overhead (Network, Disk 
I/O).   I am wondering if  there is any easy way to be able to write something 
at the Postgres  level, where some Trigger will call some Stored Procedure on a  
particular table which  will do the Aggregate (min, max, avg) and store that 
into a new table.

Any  pointers or suggestions or examples would be highly appreciated !




pgsql-novice by date

Next:From: Richard BroersmaDate: 2010-07-08 15:29:16
Subject: Re: Triggers, Stored Procedures to Aggregate table ?
Previous:From: Atif JungDate: 2010-07-08 13:52:53
Subject: Re: Returning more than one value from a stored procedure

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