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

Re: for help!

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: linweidong <wdlin(at)sis(dot)sh(dot)cn>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: for help!
Date: 2003-04-15 16:34:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
On Tue, 15 Apr 2003, linweidong wrote:

> Under this condition, I want get some useful suggestion from you. How to
> optimize the database?  How to improve the Count(*)? Because we  want to get
> the number of records in the recordset  we got.

Well, you can always use the trick of putting an on insert / delete 
trigger on the table that maintains a single row table with the current 
count.  That way, whenever a row is added or removed, the count is 
updated.  this will slow down inserts and deletes a little, but TANSTAAFL.

In response to

  • for help! at 2003-04-15 09:44:44 from linweidong


pgsql-performance by date

Next:From: Tom LaneDate: 2003-04-15 17:26:23
Subject: Re: Do Views offer any performance advantage?
Previous:From: Richard HuxtonDate: 2003-04-15 16:29:45
Subject: Re: [PERFORM] Yet Another (Simple) Case of Index not used

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