X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 58523475A80 for ; Tue, 15 Apr 2003 11:40:03 -0400 (EDT) Received: from isis.pcis.net (cr.pcis.net [207.18.226.3]) by postgresql.org (Postfix) with ESMTP id DB5A3474E44 for ; Tue, 15 Apr 2003 11:40:01 -0400 (EDT) Received: from lyric.ofsloans.com (unverified [209.180.142.225]) by isis.pcis.net (Rockliffe SMTPRA 4.5.6) with ESMTP id ; Tue, 15 Apr 2003 10:40:11 -0500 Subject: Re: for help! From: Will LaShell To: Shridhar Daithankar Cc: pgsql-performance@postgresql.org In-Reply-To: <200304151524.11721.shridhar_daithankar@nospam.persistent.co.in> References: <000901c30333$a52b7550$3c10a9c0@jinrong.sis.sh.cn> <200304151524.11721.shridhar_daithankar@nospam.persistent.co.in> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-UbhYXUzDSQc081K5WCyV" X-Mailer: Ximian Evolution 1.0.8 (1.0.8-10) Date: 15 Apr 2003 08:40:05 -0700 Message-Id: <1050421206.25390.16.camel@lyric.ofsloans.com> Mime-Version: 1.0 X-Spam-Status: No, hits=-28.1 required=5.0 tests=BAYES_10,IN_REP_TO,PGP_SIGNATURE_2,REFERENCES, USER_AGENT_XIMIAN autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/132 X-Sequence-Number: 1638 --=-UbhYXUzDSQc081K5WCyV Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > > 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. >=20 > If you are using say libpq, you don't need to issue a select count(*) whe= re=20 > foo and select where foo, to obtain record count and the records themselv= es.=20 > I believe every other interface stemming from libpq should provide any su= ch=20 > hooks as well. Never used any other myself (barring ecpg) The python interfaces most definitely do. Doing the count is quite unnecessary just as Shridhar points out. > HTH >=20 > Shridhar >=20 --=-UbhYXUzDSQc081K5WCyV Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQA+nCfVZr3R5kgOZd0RAvZ6AJ9+P+AyG5dHJOgeqZiFlMdcHoJcMgCgiFjf ofi+x2dMuVC+Fjr+5qCctw4= =T1tv -----END PGP SIGNATURE----- --=-UbhYXUzDSQc081K5WCyV--