Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 383AA9FC20D for ; Fri, 23 Feb 2007 10:39:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 47500-09 for ; Fri, 23 Feb 2007 10:39:28 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 83C4B9FC204 for ; Fri, 23 Feb 2007 10:39:29 -0400 (AST) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 315E776481; Fri, 23 Feb 2007 14:39:22 +0000 (GMT) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 04562274160; Fri, 23 Feb 2007 14:39:22 +0000 (GMT) Message-ID: <45DEFC99.4070408@archonet.com> Date: Fri, 23 Feb 2007 14:39:21 +0000 From: Richard Huxton User-Agent: IceDove 1.5.0.9 (X11/20061220) MIME-Version: 1.0 To: "msmbarabino@virgilio.it" Cc: pgsql-performance@postgresql.org Subject: Re: R: Very slow bytea data extraction References: <110ee8b13e5.msmbarabino@virgilio.it> In-Reply-To: <110ee8b13e5.msmbarabino@virgilio.it> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.209 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200702/241 X-Sequence-Number: 23295 msmbarabino@virgilio.it wrote: > Thanks for your reply, > > >> Is it in executing the query (what does > EXPLAIN ANALYSE show)? > > Here is the output of explain analyze SELECT * > FROM "FILE" > > "Seq Scan on "FILE" (cost=0.00..1.36 rows=36 width=235) > (actual time=0.023..0.107 rows=36 loops=1)" If you look at the "actual time" it's completing very quickly indeed. So - it must be something to do with either: 1. Fetching/formatting the data 2. Transferring the data to the client. What happens if you only select half the rows? Does the time to run the select halve? -- Richard Huxton Archonet Ltd