From hello@noname.com Mon Aug 25 20:21:58 2003 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 0E892D1B8E6 for ; Mon, 25 Aug 2003 17:21:58 -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 31230-04 for ; Mon, 25 Aug 2003 17:21:49 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 70E03D1B8E3 for ; Mon, 25 Aug 2003 17:21:47 -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 h7PKLhek032527 for ; Mon, 25 Aug 2003 20:21:43 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7PJuf5U026008 for pgsql-performance@postgresql.org; Mon, 25 Aug 2003 19:56:41 GMT From: "Bupp Phillips" X-Newsgroups: comp.databases.postgresql.performance Subject: What is the fastest way to get a resultset Date: Mon, 25 Aug 2003 12:56:59 -0700 Organization: Hub.Org Networking Services Lines: 20 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/328 X-Sequence-Number: 3144 I'm very new to Postgresql, so don't beat me up to bad if you see a problem, just inform me what I've done wrong. I'm use Postgresql 7.2 (PeerDirect's Windows port) on Win2000 384MB RAM 10GB of Free space 800 Mhz, using the ODBC driver 7.03.01.00. 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? Thanks From mag@fbab.net Mon Aug 25 20:38:24 2003 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 50806D1B89D for ; Mon, 25 Aug 2003 17:38:24 -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 33564-06 for ; Mon, 25 Aug 2003 17:37:55 -0300 (ADT) Received: from mail2.fbab.net (mail2.fbab.net [195.54.134.228]) by svr1.postgresql.org (Postfix) with SMTP id 5BE9DD1B550 for ; Mon, 25 Aug 2003 17:37:52 -0300 (ADT) Received: (qmail 31972 invoked by uid 136); 25 Aug 2003 20:37:37 -0000 Received: from mag@fbab.net by mail2.fbab.net by uid 133 with qmail-scanner-1.20rc1 (avp: 4.0.3.0. Clear:RC:0:. Processed in 0.058429 secs); 25 Aug 2003 20:37:37 -0000 Received: from unknown (HELO TEST11) (magpool1@195.54.134.132) by mail2.fbab.net with SMTP; 25 Aug 2003 20:37:37 -0000 Message-ID: <007f01c36b48$b0f06df0$f80c0a0a@mnd> From: "Magnus Naeslund(f)" To: "Bupp Phillips" Cc: References: Subject: Re: What is the fastest way to get a resultset Date: Mon, 25 Aug 2003 22:37:24 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/331 X-Sequence-Number: 3147 Bupp Phillips wrote: > I'm very new to Postgresql, so don't beat me up to bad if you see a > problem, just inform me what I've done wrong. > > I'm use Postgresql 7.2 (PeerDirect's Windows port) on Win2000 384MB > RAM 10GB of Free space 800 Mhz, using the ODBC driver 7.03.01.00. > > 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? > Probably you need to fetch more than one row at a time. I made that misstake once myself :) Magnus From threshar@torgo.978.org Mon Aug 25 20:47:14 2003 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 2E5A6D1B8AB for ; Mon, 25 Aug 2003 17:47:14 -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 33568-09 for ; Mon, 25 Aug 2003 17:46:44 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id 29250D1B523 for ; Mon, 25 Aug 2003 17:46:27 -0300 (ADT) Received: (qmail 15815 invoked from network); 25 Aug 2003 20:46:34 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 25 Aug 2003 20:46:34 -0000 Date: Mon, 25 Aug 2003 16:46:34 -0400 (EDT) From: Jeff To: Bupp Phillips Cc: "pgsql-performance@postgresql.org" Subject: Re: What is the fastest way to get a resultset In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/330 X-Sequence-Number: 3146 On Mon, 25 Aug 2003, 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. > You probably want a cursor. Typically what happens is postgres sends _all_ the data to the client - which can be rather substantial. A cursor allows you to say "get me the first 1000 records. now the next 1000" - it should get you the speed you want. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From hello@noname.com Tue Aug 26 17:52:08 2003 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 59B0FD1B8D1 for ; Tue, 26 Aug 2003 14:52:08 -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 78176-01 for ; Tue, 26 Aug 2003 14:51:58 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 26711D1B8D0 for ; Tue, 26 Aug 2003 14:51:57 -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 h7QHpuek021378 for ; Tue, 26 Aug 2003 17:51:56 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7QHd1bN017932 for pgsql-performance@postgresql.org; Tue, 26 Aug 2003 17:39:01 GMT From: "Bupp Phillips" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: What is the fastest way to get a resultset Date: Tue, 26 Aug 2003 02:18:23 -0700 Organization: Hub.Org Networking Services Lines: 40 Message-ID: References: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/339 X-Sequence-Number: 3155 Is this something that can be done thru a SQL statement, or are you saying that I need to develop logic to handle this because the database won't hold the resultset on the server, but instead sends it all to the client? It there a way to get server side cursors with Postgresql like SQLServer has or is this a limitation that it has? Thanks "Jeff" wrote in message news:Pine.BSF.4.44.0308251645360.15800-100000@torgo.978.org... > On Mon, 25 Aug 2003, 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. > > > You probably want a cursor. > Typically what happens is postgres sends _all_ the data to the client - > which can be rather substantial. A cursor allows you to say "get me the > first 1000 records. now the next 1000" - it should get you the speed you > want. > > > -- > Jeff Trout > http://www.jefftrout.com/ > http://www.stuarthamm.net/ > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > From neilc@samurai.com Tue Aug 26 18:27:10 2003 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 07626D1B897 for ; Tue, 26 Aug 2003 15:27:10 -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 92056-01 for ; Tue, 26 Aug 2003 15:26:40 -0300 (ADT) Received: from home.samurai.com (home.samurai.com [205.207.28.66]) by svr1.postgresql.org (Postfix) with ESMTP id CA48ED1B8B7 for ; Tue, 26 Aug 2003 15:26:38 -0300 (ADT) Received: by home.samurai.com (Postfix, from userid 1014) id 409C92621E; Tue, 26 Aug 2003 14:26:24 -0400 (EDT) Date: Tue, 26 Aug 2003 14:26:24 -0400 From: Neil Conway To: Bupp Phillips Cc: pgsql-performance@postgresql.org Subject: Re: What is the fastest way to get a resultset Message-ID: <20030826182624.GF64198@home.samurai.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/341 X-Sequence-Number: 3157 On Tue, Aug 26, 2003 at 02:18:23AM -0700, Bupp Phillips wrote: > It there a way to get server side cursors with Postgresql like SQLServer has > or is this a limitation that it has? http://www.postgresql.org/docs/7.3/static/sql-declare.html http://www.postgresql.org/docs/7.3/static/sql-fetch.html -Neil From hello@noname.com Wed Aug 27 06:22:19 2003 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 D3076D1B95B for ; Wed, 27 Aug 2003 03:22:19 -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 10069-02 for ; Wed, 27 Aug 2003 03:22:09 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 157C0D1B550 for ; Wed, 27 Aug 2003 03:22:07 -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 h7R6M3em078150 for ; Wed, 27 Aug 2003 06:22:07 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7R5tuD0072163 for pgsql-performance@postgresql.org; Wed, 27 Aug 2003 05:55:56 GMT From: "Bupp Phillips" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: What is the fastest way to get a resultset Date: Tue, 26 Aug 2003 22:56:10 -0700 Organization: Hub.Org Networking Services Lines: 27 Message-ID: References: <20030826182624.GF64198@home.samurai.com> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/350 X-Sequence-Number: 3166 So there are no settings for PG to can give me this same (fast) capability just by issuing a SQL statement thru the ODBC driver? The reason I can't go the route of a DECLARE CURSOR is because my application runs on multiple databases, so I have stay clear of certain routines that may are may not be supported on another database. "Neil Conway" wrote in message news:20030826182624.GF64198@home.samurai.com... > On Tue, Aug 26, 2003 at 02:18:23AM -0700, Bupp Phillips wrote: > > It there a way to get server side cursors with Postgresql like SQLServer has > > or is this a limitation that it has? > > http://www.postgresql.org/docs/7.3/static/sql-declare.html > http://www.postgresql.org/docs/7.3/static/sql-fetch.html > > -Neil > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) >