X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id DB8A9D1B8B3 for ; Mon, 25 Aug 2003 19:51:55 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 65487-02 for ; Mon, 25 Aug 2003 19:51:46 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 0BAD0D1B8CC for ; Mon, 25 Aug 2003 19:51:44 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h7PMphek065044 for ; Mon, 25 Aug 2003 22:51:43 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7PMSNUl060789 for pgsql-performance@postgresql.org; Mon, 25 Aug 2003 22:28:23 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Replication Ideas Date: Mon, 25 Aug 2003 18:28:09 -0400 Organization: cbbrowne Computing Inc Lines: 33 Message-ID: References: <3F483EBD.3020108@travelamericas.com> <1061705587.3733.452.camel@haggis> <3F4A420E.6090604@travelamericas.com> <20030825182441.GB9597@dcc.uchile.cl> <3F4A5724.3060002@travelamericas.com> <11627.1061845759@sss.pgh.pa.us> <3F4A8A7D.30308@travelamericas.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:7H3smKpt3QcyQw0V35isuFhnHnM= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/329 X-Sequence-Number: 3145 A long time ago, in a galaxy far, far away, "Bupp Phillips" wrote: >I have a table that has 103,000 records in it (record size is about >953 bytes) and when I do a select all (select * from ) it takes >a whopping 30 secs for the data to return!! >SQLServer on the other hand takes 6 secs, but you can also use what is >called a firehose cursor, which will return the data in < 1 sec. >I have done everything that I know how to speed this up, does anyone >have any advise? Have you VACUUMed the table? 30 seconds to start getting data back from such a query _seems_ a liittle high. It would be quite a reasonable idea to open up a CURSOR and request the data in more byte-sized pieces so that the result set wouldn't forcibly bloat in any one spot. You start by submitting the cursor definition, inside a transaction: begin transaction; declare cursor my_fire_hose for select * from
; You then iterate over the following, which fetches 1000 rows at a time: fetch forward 1000 in my_fire_hose; That should cut down the time it takes to start getting records to near enough to zero... -- output = reverse("gro.gultn" "@" "enworbbc") http://www3.sympatico.ca/cbbrowne/lisp.html "Microsoft is sort of a mixture between the Borg and the Ferengi. Combine the Borg marketing with Ferengi networking..." -- Andre Beck in dcouln