Re: [SQL] Maintaining a counter up-to-date

2003-06-03 Thread Samuel Tardieu
On 2/06, Richard Huxton wrote: | You want to use triggers not rules here (see the "server programming" and | "procedural language" manual sections). A trigger will be fired for each row | inserted/deleted/updated. Of course this means it will be fired 5000 times | for 5000 updated rows. Ouch.

Re: [SQL] Maintaining a counter up-to-date

2003-06-03 Thread Richard Huxton
On Monday 02 Jun 2003 4:47 pm, Samuel Tardieu wrote: > I have an "ips" table with 10+ records, each record having a > "catid" field representing its category. "catid" references a row in a > table called "categories". > > For statistics purpose (generation of images with the evolution of the >

[SQL] Maintaining a counter up-to-date

2003-06-03 Thread Samuel Tardieu
I have an "ips" table with 10+ records, each record having a "catid" field representing its category. "catid" references a row in a table called "categories". For statistics purpose (generation of images with the evolution of the number of rows by category), I am trying to reduce the load on t