X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3EE20D1B17A for ; Fri, 18 Jun 2004 09:52:42 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 60868-04 for ; Fri, 18 Jun 2004 12:52:42 +0000 (GMT) Received: from junk.nocrew.org (junk.nocrew.org [213.242.147.30]) by svr1.postgresql.org (Postfix) with ESMTP id BDBACD1B170 for ; Fri, 18 Jun 2004 09:52:37 -0300 (ADT) Received: from tomas by junk.nocrew.org with local (Exim 3.35 #1 (Debian)) for pgsql-odbc@postgresql.org id 1BbIrJ-000375-00; Fri, 18 Jun 2004 14:52:41 +0200 To: pgsql-odbc@postgresql.org Subject: Re: Bad performance with large objects References: <80r7sd6sh0.fsf@junk.nocrew.org> From: tomas@nocrew.org (Tomas =?iso-8859-1?q?Sk=E4re?=) Date: 18 Jun 2004 14:52:41 +0200 In-Reply-To: <80r7sd6sh0.fsf@junk.nocrew.org> Message-ID: <80n0316nae.fsf@junk.nocrew.org> Lines: 31 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/39 X-Sequence-Number: 4109 tomas@nocrew.org (Tomas Skäre) writes: > I'm using psqlodbc (latest from CVS) together with PostgreSQL 7.4.3 in > a project. In it, I have a table that uses large objects (type > "lo"). Functions for lo was imported from the contrib/lo-script. > > The table looks like this: > > timestamp | bigint | not null > jobid | bigint | not null > objectid | bigint | not null > class | integer | not null > field | character varying | not null > data | lo | ... > So, why does it take so much longer from ODBC, than from psql (even if > I pick out the bytea-data)? The program and postgresql both run on the > same machine, so there is no network delay. I've measured that it's > not my program that is slow, it's the ODBC calls. An addition to this: If I change the table from lo to bytea, the program is able to read the data much much faster. But, psqlodbc doesn't seem to like bytea when writing to the database, so it's only the fetching that works with this. Tomas