Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id CBA5F632F39 for ; Wed, 21 Oct 2009 08:52:50 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 18337-08 for ; Wed, 21 Oct 2009 11:52:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vw0-f172.google.com (mail-vw0-f172.google.com [209.85.212.172]) by mail.postgresql.org (Postfix) with ESMTP id F2E7C6329BB for ; Wed, 21 Oct 2009 08:52:42 -0300 (ADT) Received: by vws2 with SMTP id 2so2750173vws.15 for ; Wed, 21 Oct 2009 04:52:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=RSlzADBsZAnUwCSD2Yr8fTSu0TOPZdcn24LGXgLtEEg=; b=pk+Ip4BigFFitvpmCD6lQPS2Ja8IPcnsv/d1EoNwN7VgKRO8wvA4sCFt4WBETlGeZp cCRu+hLauBzvJH7CrB06RvgvQ5R6ei4GLo5tm95DczuWsTVqLbgLZ/YqENQoWjrHO2f+ zhrEf+S1Jo1xI1EOG5qep89yTwZkgIby3bBpM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=hxYVhXFyoWj5QLzjVNQbB5S2phamQVz/9TtMVXLE3kweclyAGxj3JA0u5yzT8aIvx5 nni78gLpSSKG1TxLmXpytcS5ia4qriX8S30AdmlF9NokqF+13BUWfkvpey23wLKcPqLx bICiJdYDwf9H3FhgHK1aCFvZmo3f6Uaw8Y57I= MIME-Version: 1.0 Received: by 10.220.124.70 with SMTP id t6mr2187835vcr.79.1256125961415; Wed, 21 Oct 2009 04:52:41 -0700 (PDT) Date: Wed, 21 Oct 2009 17:22:41 +0530 Message-ID: Subject: report generation from table. From: sathiya psql To: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=001636c92d15b92dfd0476709d45 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.109 tagged_above=-10 required=5 tests=BAYES_05=-1.11, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200910/85 X-Sequence-Number: 33284 --001636c92d15b92dfd0476709d45 Content-Type: text/plain; charset=ISO-8859-1 Hi All, I have been searching for, Preparing report from a huge table. Queries am executing now are, SELECT count(*) from HUGE_TBL where cond1, cond2; SELECT count(*) from HUGE_TBL where cond1, cond3; --- like this i have different conditions(10-15 different things ) and different amount of conditions ( 2 - 5 condition ). As that is a very huge table, it took time to execute each query ( 2 min ). And finally it takes 15 times that ( 30 min ). Is there anyway to do the above report efficiently ? Such executing the query only once, and getting all different outputs required ? or fetching result from some cache ? Or i dont have any other way ?! --001636c92d15b92dfd0476709d45 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi All,

I have been searching for, Preparing report from a huge tabl= e.

Queries am executing now are,
SELECT count(*) from HUGE_TBL wh= ere cond1, cond2;
SELECT count(*) from HUGE_TBL where cond1, cond3;
--- like this i have different conditions(10-15 different things ) and diff= erent amount of conditions ( 2 - 5 condition ).

As that is a very hu= ge table, it took time to execute each query ( 2 min ). And finally it take= s 15 times that ( 30 min ).=A0 Is there anyway to do the above report effic= iently ?

Such executing the query only once, and getting all different outputs r= equired ? or fetching result from some cache ?
Or i dont have any other = way ?!
--001636c92d15b92dfd0476709d45--