Received: from gate.experian.it (IDENT:qmailr@gate.experian.it [212.210.24.10]) by hub.org (8.9.2/8.9.1) with SMTP id QAA40993 for ; Tue, 9 Feb 1999 16:56:36 -0500 (EST) (envelope-from ludo@experian.it) Received: (qmail 16140 invoked from network); 9 Feb 1999 21:56:02 -0000 Received: from unknown (HELO deskproludo) (192.168.11.105) by gate.experian.it with SMTP; 9 Feb 1999 21:56:02 -0000 Message-ID: <009001be5476$f6213c80$140aa8c0@deskproludo> From: "Ludovico Magnocavallo" To: "Jackson, DeJuan" , Cc: "PGSQL SQL" Subject: Re: [GENERAL] pqReadData() -- backend closed the channel unexpect edly. Date: Tue, 9 Feb 1999 22:55:47 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.0810.800 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 Thanks again, Jackson, but your query is not right :( Here is a sample output: your query: SELECT o.origine, sum(o.bytes), sum(d.bytes), '09/02/1999 00:59:59'::datetime FROM day o, day d where o.origine=d.destinazione and o.origine << '194.74.133.0/24' and o.when between '09/02/1999 00:00:01' and '09/02/1999 00:59:59' and d.when between '09/02/1999 00:00:01' and '09/02/1999 00:59:59' GROUP BY o.origine,4; result (only for host 194.74.133.11, query is too long): 194.74.133.11|18569856|13493249|09/02/1999 00:59:59.00 MET simple query to check first sum: SELECT o.origine, sum(o.bytes) FROM day o where o.origine = '194.74.133.11' and o.when between '09/02/1999 00:00:01' and '09/02/1999 00:59:59' GROUP BY o.origine; 194.74.133.11|250944 Huge difference! Moreover, your query is slow, much much slower than two separate queries. I would have used it though, if it worked. Postgresql keeps crashing on my loop. :( Thanks L.