Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 7822B9FBF1B for ; Fri, 23 Feb 2007 06:46:27 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 60799-07 for ; Fri, 23 Feb 2007 06:46:15 -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 C36549FB683 for ; Fri, 23 Feb 2007 06:46:15 -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 77FDE75A50; Fri, 23 Feb 2007 10:46:14 +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 5BA3D274160; Fri, 23 Feb 2007 10:46:14 +0000 (GMT) Message-ID: <45DEC5F6.4000101@archonet.com> Date: Fri, 23 Feb 2007 10:46:14 +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: Very slow bytea data extraction References: <110ee1452b5.msmbarabino@virgilio.it> In-Reply-To: <110ee1452b5.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.211 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200702/239 X-Sequence-Number: 23293 msmbarabino@virgilio.it wrote: > Hi all, > I'm using Postgresql 8.2.3 on a Windows XP system. > > I need to > write and retrieve bytea data from a table. > The problem is that, while > data insertion is quite fast, bytea extraction is very slow. > I'm trying > to store a 250KB image into the bytea field. > A simple select query on a > 36-row table takes more than one minute to execute. Where is the problem? Is it in executing the query (what does EXPLAIN ANALYSE show)? Is it in fetching/formatting the data (what does the equivalent COUNT(*) show)? How are you accessing the database: odbc,jdbc,other? Does it do this with psql too? -- Richard Huxton Archonet Ltd