X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 917A5D9B13 for ; Sat, 15 Oct 2005 10:40:28 -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 43416-03 for ; Sat, 15 Oct 2005 13:40:24 +0000 (GMT) Received: from wimpy.net.nih.gov (mailfwd.nih.gov [128.231.88.106]) by svr1.postgresql.org (Postfix) with ESMTP id E37F8D9A99 for ; Sat, 15 Oct 2005 10:40:26 -0300 (ADT) Received: from wimpy.net.nih.gov (localhost [127.0.0.1]) by wimpy.net.nih.gov (8.12.11/8.11.7) with ESMTP id j9FDeTdq023557 for ; Sat, 15 Oct 2005 09:40:30 -0400 (EDT) Received: from [128.231.145.14] (holmes.nhgri.nih.gov [128.231.145.14]) by wimpy.net.nih.gov (8.12.11/8.11.7) with ESMTP id j9FDeS8g023552; Sat, 15 Oct 2005 09:40:29 -0400 (EDT) User-Agent: Microsoft-Entourage/10.1.4.030702.0 Date: Sat, 15 Oct 2005 09:40:28 -0400 Subject: Re: Bytea poor performance From: Sean Davis To: NSO , Message-ID: In-Reply-To: <17260.81.7.89.65.1129382454.squirrel@fmf.vtu.lt> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.013 required=5 tests=[AWL=0.013] X-Spam-Level: X-Archive-Number: 200510/239 X-Sequence-Number: 15007 On 10/15/05 9:20 AM, "NSO" wrote: > Hello, > > I am trying to select form table with bytea field. And queries runs very > slow. > My table: > CREATE TABLE files (file bytea, nr serial NOT NULL) WITH OIDS; > > Query: > select * from files where nr > 1450 > > (I have total 1500 records in it, every holds picture of 23kB size) > Query runs very long: > Total query runtime: 23625 ms. > Data retrieval runtime: 266 ms. > 50 rows retrieved. > > explain: > Index Scan using pk on files (cost=0.00..3.67 rows=50 width=36) > Index Cond: (nr > 1450) > > Is it possible to do something with it? or it is normal? Our server is > fast, and all other tables work fine.. How about some explain analyze output? Have you done a full vacuum lately? How about reindexing? Sean