Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 016AD9F9EB8; Sat, 20 Oct 2007 14:14:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 29298-05; Sat, 20 Oct 2007 14:13:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from 137086.vserver.de (vs137086.vserver.de [62.75.137.86]) by postgresql.org (Postfix) with ESMTP id 91F829F9EAB; Sat, 20 Oct 2007 14:13:58 -0300 (ADT) Received: from a-kretschmer.de (p54B3C81D.dip0.t-ipconnect.de [84.179.200.29]) (authenticated bits=0) by 137086.vserver.de (8.12.8/8.12.8) with ESMTP id l9KHDtxk007609; Sat, 20 Oct 2007 19:13:56 +0200 Received: from kretschmer by a-kretschmer.de with local (Exim 4.61) (envelope-from ) id 1IjHz9-0006bd-5D; Sat, 20 Oct 2007 19:19:39 +0200 Date: Sat, 20 Oct 2007 19:19:39 +0200 From: Andreas Kretschmer To: pgsql-performance@postgresql.org, pgsql-sql@postgresql.org Subject: Re: [SQL] two queryes in a single tablescan Message-ID: <20071020171938.GA24518@KanotixBox> References: <290a5abc0710170530v215cb2b0q4fa000ad43096a28@mail.gmail.com> <20071020125824.75df357c@kingfisher.sec.intern.logix-tt.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20071020125824.75df357c@kingfisher.sec.intern.logix-tt.com> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-GPG-Fingerprint: EE16 3C01 7B9C 10F7 2C8B 3B86 4DB3 D9EE 7F45 84DA X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! X-Lugdd: Gerd Kube X-Info: My name is root. Just root. And I am licensed to kill -9 User-Agent: mutt-ng 1.5.9i (Linux) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/236 X-Sequence-Number: 27258 Markus Schaber schrieb: > > is there any way to get both results in a single query, > > eventually through stored procedure? > > The retrieved [count(*),A] ; [count(*),B)] data couldnt fit > > on a single table, of course. > > > > The main goal would be to get multiple results while scanning the > > table[s] once only > > thus getting results in a faster way. > > PostgreSQL 8.3 contains great improvements in this area, you can simply > start the selects from concurrent connections, and the backend will > synchronize the scans. works this right across different transactions? I mean, for instance, TX a insert rows and TX b insert other rows and both clients (with different transactions) starts a seq-scan? Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) "If I was god, I would recompile penguin with --enable-fly." (unknow) Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°