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: Pine.LNX.4.33.0304151032440.18680-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

Responses

Browse pgsql-performance by date

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