From me@yourhouse.com Thu Sep 4 00:54:55 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 1A4DBD1B8A5 for ; Thu, 4 Sep 2003 00:54:55 +0000 (GMT) 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 64562-09 for ; Wed, 3 Sep 2003 21:54:47 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 51FD3D1B89D for ; Wed, 3 Sep 2003 21:54: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 h840sgDf062430 for ; Thu, 4 Sep 2003 00:54:42 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h840Tos3057427 for pgsql-performance@postgresql.org; Thu, 4 Sep 2003 00:29:50 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: SELECT's take a long time compared to other DBMS Date: Wed, 3 Sep 2003 17:28:26 -0700 Organization: Hub.Org Networking Services Lines: 25 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/37 X-Sequence-Number: 3403 I have a table with 102,384 records in it, each record is 934 bytes. Using the follow select statement: SELECT * from PG Info: version 7.3.4 under cygwin on Windows 2000 ODBC: version 7.3.100 Machine: 500 Mhz/ 512MB RAM / IDE HDD Under PG: Data is returned in 26 secs!! Under SQL Server: Data is returned in 5 secs. Under SQLBase: Data is returned in 6 secs. Under SAPDB: Data is returned in 7 secs. This is the ONLY table in the database and only 1 user. And yes I did a vacuum. Is this normal behavior for PG? Thanks From rbt@rbt.ca Thu Sep 4 01:04:53 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 40A75D1B94F for ; Thu, 4 Sep 2003 01:04:53 +0000 (GMT) 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 65959-09 for ; Wed, 3 Sep 2003 22:04:44 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 610BBD1B8F5 for ; Wed, 3 Sep 2003 22:04:40 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id DBDD61024D; Wed, 3 Sep 2003 20:56:38 -0400 (EDT) Received: from [192.168.1.200] (dyn-133-83.tor.dsl.tht.net [134.22.133.83]) by mailav.tor1.inquent.com (Postfix) with ESMTP id ADF5010248; Wed, 3 Sep 2003 20:56:36 -0400 (EDT) Subject: Re: SELECT's take a long time compared to other DBMS From: Rod Taylor To: Relaxin Cc: Postgresql Performance In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-THlmMwF3Wvrr12QDRv6C" Message-Id: <1062637505.84923.7.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 03 Sep 2003 21:05:06 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/39 X-Sequence-Number: 3405 --=-THlmMwF3Wvrr12QDRv6C Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > Under PG: Data is returned in 26 secs!! > Under SQL Server: Data is returned in 5 secs. > Under SQLBase: Data is returned in 6 secs. > Under SAPDB: Data is returned in 7 secs. What did you use as the client? Do those times include ALL resulting data or simply the first few lines? PostgreSQL performance on windows (via Cygwin) is known to be poor. Do you receive similar results with 7.4 beta 2? --=-THlmMwF3Wvrr12QDRv6C Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQA/Vo/B6DETLow6vwwRApdeAJ9TuX1iudKEA4ZEhN39x5efP3S7DgCfdT7j b9iC6UYXwuKNmrGDOwEG3Ss= =EhzH -----END PGP SIGNATURE----- --=-THlmMwF3Wvrr12QDRv6C-- From rudi@oasis.net.au Thu Sep 4 01:03:35 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 2F04AD1B8B4 for ; Thu, 4 Sep 2003 01:03:35 +0000 (GMT) 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 65565-09 for ; Wed, 3 Sep 2003 22:03:06 -0300 (ADT) Received: from water.oasis.net.au (water.oasis.net.au [210.8.139.2]) by svr1.postgresql.org (Postfix) with ESMTP id C0717D1B89E for ; Wed, 3 Sep 2003 22:02:59 -0300 (ADT) Received: from oasis.net.au (guardian [210.8.139.5]) by water.oasis.net.au (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id LAA14495; Thu, 4 Sep 2003 11:31:29 +1000 X-Authentication-Warning: water.oasis.net.au: Host guardian [210.8.139.5] claimed to be oasis.net.au Message-ID: <3F569012.3090209@oasis.net.au> Date: Thu, 04 Sep 2003 11:06:26 +1000 From: Rudi Starcevic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Relaxin Cc: pgsql-performance@postgresql.org Subject: Re: SELECT's take a long time compared to other DBMS References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/38 X-Sequence-Number: 3404 Hi, >And yes I did a vacuum. > Did you 'Analyze' too ? Cheers Rudi. From me@yourhouse.com Thu Sep 4 01:24:55 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 CAC70D1B93F for ; Thu, 4 Sep 2003 01:24:55 +0000 (GMT) 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 66823-06 for ; Wed, 3 Sep 2003 22:24:48 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 2A7EBD1B52C for ; Wed, 3 Sep 2003 22:24:45 -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 h841OgDj068889 for ; Thu, 4 Sep 2003 01:24:42 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h841NvkD068765 for pgsql-performance@postgresql.org; Thu, 4 Sep 2003 01:23:57 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Wed, 3 Sep 2003 18:22:33 -0700 Organization: Hub.Org Networking Services Lines: 24 Message-ID: References: <3F569012.3090209@oasis.net.au> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/40 X-Sequence-Number: 3406 Yes I Analyze also, but there was no need to because it was a fresh brand new database. "Rudi Starcevic" wrote in message news:3F569012.3090209@oasis.net.au... > Hi, > > > >And yes I did a vacuum. > > > > Did you 'Analyze' too ? > > Cheers > Rudi. > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > From me@yourhouse.com Thu Sep 4 01:54:55 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 248A4D1B8A3 for ; Thu, 4 Sep 2003 01:54:55 +0000 (GMT) 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 67009-10 for ; Wed, 3 Sep 2003 22:54:48 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 65071D1B550 for ; Wed, 3 Sep 2003 22:54: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 h841sgDf074539 for ; Thu, 4 Sep 2003 01:54:42 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h841PsU3069357 for pgsql-performance@postgresql.org; Thu, 4 Sep 2003 01:25:54 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Wed, 3 Sep 2003 18:24:31 -0700 Organization: Hub.Org Networking Services Lines: 9 Message-ID: References: <1062637505.84923.7.camel@jester> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.4 tagged_above=0.0 required=5.0 tests=BAYES_30, PRIORITY_NO_NAME, RCVD_IN_OSIRUSOFT_COM, REFERENCES X-Spam-Level: X-Archive-Number: 200309/42 X-Sequence-Number: 3408 All queries were ran on the SERVER for all of the databases I tested. This is all resulting data for all of the databases that I tested. "Rod Taylor" wrote in message news:1062637505.84923.7.camel@jester... From rudi@oasis.net.au Thu Sep 4 01:29:54 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 99E70D1B52C for ; Thu, 4 Sep 2003 01:29:54 +0000 (GMT) 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 66489-07 for ; Wed, 3 Sep 2003 22:29:27 -0300 (ADT) Received: from water.oasis.net.au (water.oasis.net.au [210.8.139.2]) by svr1.postgresql.org (Postfix) with ESMTP id 759A2D1B93F for ; Wed, 3 Sep 2003 22:29:22 -0300 (ADT) Received: from oasis.net.au (guardian [210.8.139.5]) by water.oasis.net.au (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id LAA15066; Thu, 4 Sep 2003 11:57:58 +1000 X-Authentication-Warning: water.oasis.net.au: Host guardian [210.8.139.5] claimed to be oasis.net.au Message-ID: <3F569636.4090809@oasis.net.au> Date: Thu, 04 Sep 2003 11:32:38 +1000 From: Rudi Starcevic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Relaxin Cc: pgsql-performance@postgresql.org Subject: Re: SELECT's take a long time compared to other DBMS References: <3F569012.3090209@oasis.net.au> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/41 X-Sequence-Number: 3407 Hi, >Yes I Analyze also, but there was no need to because it was a fresh brand >new database. > Hmm ... Sorry I'm not sure then. I only use Linux with PG. Even though it's 'brand new' you still need to Analyze so that any Indexes etc. are built. I'll keep an eye on this thread - Good luck. Regards Rudi. From neilc@samurai.com Thu Sep 4 01:55:06 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 2BFCED1B8BD for ; Thu, 4 Sep 2003 01:55:06 +0000 (GMT) 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 77291-01 for ; Wed, 3 Sep 2003 22:54:37 -0300 (ADT) Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) by svr1.postgresql.org (Postfix) with ESMTP id 11979D1B4E2 for ; Wed, 3 Sep 2003 22:54:34 -0300 (ADT) Received: from 6-allhosts (d226-85-166.home.cgocable.net [24.226.85.166]) by bob.samurai.com (Postfix) with ESMTP id 0395B1E2E; Wed, 3 Sep 2003 21:54:38 -0400 (EDT) Subject: Re: SELECT's take a long time compared to other DBMS From: Neil Conway To: Rudi Starcevic Cc: Relaxin , PostgreSQL Performance In-Reply-To: <3F569636.4090809@oasis.net.au> References: <3F569012.3090209@oasis.net.au> <3F569636.4090809@oasis.net.au> Content-Type: text/plain Message-Id: <1062640477.14620.7.camel@tokyo> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 03 Sep 2003 21:54:37 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/43 X-Sequence-Number: 3409 On Wed, 2003-09-03 at 21:32, Rudi Starcevic wrote: > Hmm ... Sorry I'm not sure then. I only use Linux with PG. > Even though it's 'brand new' you still need to Analyze so that any > Indexes etc. are built. ANALYZE doesn't build indexes, it only updates the statistics used by the query optimizer (and in any case, "select * from " has only one reasonable query plan anyway). -Neil From cbbrowne@acm.org Thu Sep 4 03:25:00 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 F17FED1B52C for ; Thu, 4 Sep 2003 03:25:00 +0000 (GMT) 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 82167-09 for ; Thu, 4 Sep 2003 00:24:50 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 4F6F7D1B91B for ; Thu, 4 Sep 2003 00:24:50 -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 h843OnDf097774 for ; Thu, 4 Sep 2003 03:24:49 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h843Ojae097756 for pgsql-performance@postgresql.org; Thu, 4 Sep 2003 03:24:45 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Wed, 03 Sep 2003 23:19:22 -0400 Organization: cbbrowne Computing Inc Lines: 29 Message-ID: References: <3F569012.3090209@oasis.net.au> 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:FmkVGPCsvdDes3PEJ7JU0CdmegY= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/46 X-Sequence-Number: 3412 Quoth "Relaxin" : > Yes I Analyze also, but there was no need to because it was a fresh > brand new database. That is _absolutely not true_. It is not true with any DBMS that uses a cost-based optimizer. Cost-based optimizers need some equivalent to ANALYZE in order to collect statistics to allow them to pick any path other than a sequential scan. In this particular case, a seq scan is pretty likely to be the best answer when there is no WHERE clause on the query. Actually, it doesn't make all that much sense that the other systems would be terribly much faster, because they obviously need to do some processing on 102,384 records. Can you tell us what you were *actually* doing? Somehow it sounds as though the other databases were throwing away the data whereas PostgreSQL was returning it all "kawhump!" in one batch. What programs were you using to submit the queries? -- let name="cbbrowne" and tld="acm.org" in name ^ "@" ^ tld;; http://cbbrowne.com/info/oses.html "Computers let you make more mistakes faster than any other invention in human history, with the possible exception of handguns and tequila." -- Mitch Radcliffe From cbbrowne@acm.org Thu Sep 4 03:25:01 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 217D1D1B53A for ; Thu, 4 Sep 2003 03:25:01 +0000 (GMT) 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 87003-04 for ; Thu, 4 Sep 2003 00:24:50 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 532BAD1B94F for ; Thu, 4 Sep 2003 00:24:50 -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 h843OnDh097774 for ; Thu, 4 Sep 2003 03:24:50 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h843Ok1B097760 for pgsql-performance@postgresql.org; Thu, 4 Sep 2003 03:24:46 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Wed, 03 Sep 2003 23:24:19 -0400 Organization: cbbrowne Computing Inc Lines: 26 Message-ID: References: <1062637505.84923.7.camel@jester> 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:WA5ip0o6AX0QZkWBvQgeyHH+AEE= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/47 X-Sequence-Number: 3413 In the last exciting episode, "Relaxin" wrote: > All queries were ran on the SERVER for all of the databases I tested. Queries obviously run "on the server." That's kind of the point of the database system being a "client/server" system. The question is what client program(s) you used to process the result sets. I'd be surprised to see any client process 100K records in any meaningful way in much less than 30 seconds. Rendering that much data into a console will take some time. Drawing it into cells on a GUI window will take a lot more time. Supposing you were using a graphical client, it would be unsurprising for it to have submitted something equivalent to "limit 30 rows" (or whatever you can display on screen), and defer further processing 'til later. If that were the case, then 26s to process the whole thing would be a lot more efficient than 5-6s to process a mere 30 rows... > This is all resulting data for all of the databases that I tested. You seem to have omitted "all resulting data." -- If this was helpful, rate me http://www.ntlug.org/~cbbrowne/sap.html "Women who seek to be equal to men lack ambition. " -- Timothy Leary From nickf@ontko.com Thu Sep 4 04:45:18 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 8B1A6D1B8C5 for ; Thu, 4 Sep 2003 04:45:18 +0000 (GMT) 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 96634-01 for ; Thu, 4 Sep 2003 01:44:48 -0300 (ADT) Received: from grebe.mail.pas.earthlink.net (grebe.mail.pas.earthlink.net [207.217.120.46]) by svr1.postgresql.org (Postfix) with ESMTP id 64212D1B8B3 for ; Thu, 4 Sep 2003 01:44:47 -0300 (ADT) Received: from 0-1pool116-178.nas15.indianapolis1.in.us.da.qwest.net ([65.128.116.178] helo=nick) by grebe.mail.pas.earthlink.net with smtp (Exim 3.33 #1) id 19ulzC-0002v1-00 for pgsql-performance@postgresql.org; Wed, 03 Sep 2003 21:44:46 -0700 Reply-To: From: "Nick Fankhauser" To: Subject: Re: SELECT's take a long time compared to other DBMS Date: Wed, 3 Sep 2003 23:43:45 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/49 X-Sequence-Number: 3415 > Yes I Analyze also, but there was no need to because it was a fresh brand > new database. This apparently wasn't the source of problem since he did an analyze anyway, but my impression was that a fresh brand new database is exactly the situation where an analyze is needed- ie: a batch of data has just been loaded and stats haven't been collected yet. Am I mistaken? -Nick From tgl@sss.pgh.pa.us Thu Sep 4 05:03:47 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 9D8DED1B8E9 for ; Thu, 4 Sep 2003 05:03:47 +0000 (GMT) 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 93554-09 for ; Thu, 4 Sep 2003 02:03:37 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 6B268D1B91B for ; Thu, 4 Sep 2003 02:03:35 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h84539jX014160; Thu, 4 Sep 2003 01:03:09 -0400 (EDT) To: nickf@ontko.com Cc: pgsql-performance@postgresql.org Subject: Re: SELECT's take a long time compared to other DBMS In-reply-to: References: Comments: In-reply-to "Nick Fankhauser" message dated "Wed, 03 Sep 2003 23:43:45 -0500" Date: Thu, 04 Sep 2003 01:03:08 -0400 Message-ID: <14159.1062651788@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/50 X-Sequence-Number: 3416 "Nick Fankhauser" writes: > This apparently wasn't the source of problem since he did an analyze anyway, > but my impression was that a fresh brand new database is exactly the > situation where an analyze is needed- ie: a batch of data has just been > loaded and stats haven't been collected yet. Indeed. But as someone else already pointed out, a seqscan is the only reasonable plan for an unqualified "SELECT whatever FROM table" query; lack of stats wouldn't deter the planner from arriving at that conclusion. My guess is that the OP is failing to account for some client-side inefficiency in absorbing a large query result. regards, tom lane From noname@spam.com Thu Sep 4 07:55:09 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 85685D1B8E9 for ; Thu, 4 Sep 2003 07:55:09 +0000 (GMT) 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 08914-10 for ; Thu, 4 Sep 2003 04:55:00 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 8B45FD1B8BC for ; Thu, 4 Sep 2003 04:54:58 -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 h847soDh054310 for ; Thu, 4 Sep 2003 07:54:58 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h847mRSV052921 for pgsql-performance@postgresql.org; Thu, 4 Sep 2003 07:48:27 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Thu, 4 Sep 2003 00:48:42 -0700 Organization: Hub.Org Networking Services Lines: 23 Message-ID: References: <3F569012.3090209@oasis.net.au> 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: 200309/54 X-Sequence-Number: 3420 > Can you tell us what you were *actually* doing? Somehow it sounds as > though the other databases were throwing away the data whereas > PostgreSQL was returning it all "kawhump!" in one batch. All of the databases that I tested the query against gave me immediate access to ANY row of the resultset once the data had been returned. Ex. If I'm currently at the first row and then wanted to goto the 100,000 row, I would be there immediately, and if I wanted to then goto the 5 row...same thing, I have the record immediately! The other databases I tested against stored the entire resultset on the Server, I'm not sure what PG does...It seems that brings the entire resultset client side. If that is the case, how can I have PG store the resultset on the Server AND still allow me immediate access to ANY row in the resultset? > What programs were you using to submit the queries? I used the same program for all of the database. I was using ODBC as connectivity. From shridhar_daithankar@persistent.co.in Thu Sep 4 07:59:02 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 A595BD1BAE7 for ; Thu, 4 Sep 2003 07:59:02 +0000 (GMT) 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 13221-01 for ; Thu, 4 Sep 2003 04:58:53 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 29D13D1B8F5 for ; Thu, 4 Sep 2003 04:58:51 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h8485LK8026414 for ; Thu, 4 Sep 2003 13:35:21 +0530 Received: from daithan (daithan.intranet.pspl.co.in [192.168.7.161]) (authenticated bits=0) by persistent.co.in (8.12.9/8.12.9) with ESMTP id h8485JCO026398 for ; Thu, 4 Sep 2003 13:35:19 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Thu, 04 Sep 2003 13:30:51 +0530 MIME-Version: 1.0 Subject: Re: SELECT's take a long time compared to other DBMS Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F573E8B.31916.A1063F8@localhost> In-reply-to: X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/55 X-Sequence-Number: 3421 On 4 Sep 2003 at 0:48, Relaxin wrote: > All of the databases that I tested the query against gave me immediate > access to ANY row of the resultset once the data had been returned. > Ex. If I'm currently at the first row and then wanted to goto the 100,000 > row, I would be there immediately, and if I wanted to then goto the 5 > row...same thing, I have the record immediately! > > The other databases I tested against stored the entire resultset on the > Server, I'm not sure what PG does...It seems that brings the entire > resultset client side. > If that is the case, how can I have PG store the resultset on the Server AND > still allow me immediate access to ANY row in the resultset? You can use a cursor and get only required rows. Bye Shridhar -- Nick the Greek's Law of Life: All things considered, life is 9 to 5 against. From noname@spam.com Thu Sep 4 08:25:01 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 09310D1BA71 for ; Thu, 4 Sep 2003 08:25:01 +0000 (GMT) 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 15290-01 for ; Thu, 4 Sep 2003 05:24:52 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 651CDD1B8E9 for ; Thu, 4 Sep 2003 05:24:50 -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 h848OoDf062957 for ; Thu, 4 Sep 2003 08:24:50 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h848GWA7060859 for pgsql-performance@postgresql.org; Thu, 4 Sep 2003 08:16:32 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Thu, 4 Sep 2003 01:16:47 -0700 Organization: Hub.Org Networking Services Lines: 35 Message-ID: References: <3F573E8B.31916.A1063F8@localhost> 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: 200309/56 X-Sequence-Number: 3422 All rows are required. ""Shridhar Daithankar"" wrote in message news:3F573E8B.31916.A1063F8@localhost... > On 4 Sep 2003 at 0:48, Relaxin wrote: > > All of the databases that I tested the query against gave me immediate > > access to ANY row of the resultset once the data had been returned. > > Ex. If I'm currently at the first row and then wanted to goto the 100,000 > > row, I would be there immediately, and if I wanted to then goto the 5 > > row...same thing, I have the record immediately! > > > > The other databases I tested against stored the entire resultset on the > > Server, I'm not sure what PG does...It seems that brings the entire > > resultset client side. > > If that is the case, how can I have PG store the resultset on the Server AND > > still allow me immediate access to ANY row in the resultset? > > You can use a cursor and get only required rows. > > > Bye > Shridhar > > -- > Nick the Greek's Law of Life: All things considered, life is 9 to 5 against. > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > From hannu@tm.ee Thu Sep 4 11:02: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 7F430D1B8BB for ; Thu, 4 Sep 2003 11:02:08 +0000 (GMT) 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 24076-10 for ; Thu, 4 Sep 2003 08:02:00 -0300 (ADT) Received: from fuji.krosing.net (silmet.estpak.ee [194.126.97.78]) by svr1.postgresql.org (Postfix) with ESMTP id 23820D1B8A3 for ; Thu, 4 Sep 2003 08:01:57 -0300 (ADT) Received: from fuji.krosing.net (localhost.localdomain [127.0.0.1]) by fuji.krosing.net (8.12.8/8.12.8) with ESMTP id h84B1tDN005704; Thu, 4 Sep 2003 14:01:55 +0300 Received: (from hannu@localhost) by fuji.krosing.net (8.12.8/8.12.8/Submit) id h84B1sb8005702; Thu, 4 Sep 2003 14:01:54 +0300 X-Authentication-Warning: fuji.krosing.net: hannu set sender to hannu@tm.ee using -f Subject: Re: SELECT's take a long time compared to other DBMS From: Hannu Krosing To: Relaxin Cc: pgsql-performance@postgresql.org In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1062673303.5200.135.camel@fuji.krosing.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 04 Sep 2003 14:01:53 +0300 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/58 X-Sequence-Number: 3424 Relaxin kirjutas N, 04.09.2003 kell 03:28: > I have a table with 102,384 records in it, each record is 934 bytes. I created a test database on my Linux (RH9) laptop with 30GB/4200RPM ide drive and P3-1133Mhz, 768MB, populated it with 128000 rows of 930 bytes each and did [hannu@fuji hannu]$ time psql test100k -c 'select * from test' > /dev/null real 0m3.970s user 0m0.980s sys 0m0.570s so it seems definitely not a problem with postgres as such, but perhaps with Cygwin and/or ODBC driver I also ran the same query using the "standard" pg adapter: >>> import pg, time >>> >>> con = pg.connect('test100k') >>> >>> def getall(): ... t1 = time.time() ... res = con.query('select * from test') ... t2 = time.time() ... list = res.getresult() ... t3 = time.time() ... print t2 - t1, t3-t2 ... >>> getall() 3.27637195587 1.10105705261 >>> getall() 3.07413101196 0.996125936508 >>> getall() 3.03377199173 1.07322502136 which gave similar results ------------------------------ Hannu From noname@spam.com Thu Sep 4 14:55:05 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 D4331D1BA9C for ; Thu, 4 Sep 2003 14:55:05 +0000 (GMT) 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 43891-04 for ; Thu, 4 Sep 2003 11:54:59 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 0E59CD1B9BE for ; Thu, 4 Sep 2003 11:54:55 -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 h84EsoDf071809 for ; Thu, 4 Sep 2003 14:54:50 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h84EZ6Bb065719 for pgsql-performance@postgresql.org; Thu, 4 Sep 2003 14:35:06 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Thu, 4 Sep 2003 07:35:24 -0700 Organization: Hub.Org Networking Services Lines: 63 Message-ID: References: <1062673303.5200.135.camel@fuji.krosing.net> 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: 200309/60 X-Sequence-Number: 3426 So after you did that, where able to position to ANY record within the resultset? Ex. Position 100,000; then to Position 5; then to position 50,000, etc... If you are able to do that and have your positioned row available to you immediately, then I'll believe that it's the ODBC driver. "Hannu Krosing" wrote in message news:1062673303.5200.135.camel@fuji.krosing.net... > Relaxin kirjutas N, 04.09.2003 kell 03:28: > > I have a table with 102,384 records in it, each record is 934 bytes. > > I created a test database on my Linux (RH9) laptop with 30GB/4200RPM ide > drive and P3-1133Mhz, 768MB, populated it with 128000 rows of 930 bytes > each and did > > [hannu@fuji hannu]$ time psql test100k -c 'select * from test' > > /dev/null > > real 0m3.970s > user 0m0.980s > sys 0m0.570s > > so it seems definitely not a problem with postgres as such, but perhaps > with Cygwin and/or ODBC driver > > I also ran the same query using the "standard" pg adapter: > > >>> import pg, time > >>> > >>> con = pg.connect('test100k') > >>> > >>> def getall(): > ... t1 = time.time() > ... res = con.query('select * from test') > ... t2 = time.time() > ... list = res.getresult() > ... t3 = time.time() > ... print t2 - t1, t3-t2 > ... > >>> getall() > 3.27637195587 1.10105705261 > >>> getall() > 3.07413101196 0.996125936508 > >>> getall() > 3.03377199173 1.07322502136 > > which gave similar results > > ------------------------------ > Hannu > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > From jllachan@nsd.ca Thu Sep 4 14:56:18 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 62B1AD1B99E for ; Thu, 4 Sep 2003 14:56:18 +0000 (GMT) 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 42593-06 for ; Thu, 4 Sep 2003 11:55:50 -0300 (ADT) Received: from beamish.nsd.ca (beamish.nsd.ca [205.150.156.194]) by svr1.postgresql.org (Postfix) with ESMTP id 01D11D1BA8D for ; Thu, 4 Sep 2003 11:55:46 -0300 (ADT) Received: (from smap@localhost) by beamish.nsd.ca (8.9.3/8.9.3) id KAA03507; Thu, 4 Sep 2003 10:55:49 -0400 X-Authentication-Warning: beamish.nsd.ca: smap set sender to using -f Received: from reddog.nsd.ca(192.168.101.30) by beamish.nsd.ca via smap (V2.1/2.1+anti-relay+anti-spam) id xma003499; Thu, 4 Sep 03 10:55:35 -0400 Received: from nsd.ca (jllachan-linux.nsd.ca [192.168.101.148]) by reddog.nsd.ca (8.8.7/8.8.7) with ESMTP id KAA06352; Thu, 4 Sep 2003 10:43:17 -0400 Message-ID: <3F5753B9.F4A5A63F@nsd.ca> Date: Thu, 04 Sep 2003 11:01:13 -0400 From: Jean-Luc Lachance X-Mailer: Mozilla 4.8 [en] (X11; U; Linux 2.4.18-24.7.x i686) X-Accept-Language: en MIME-Version: 1.0 To: nickf@ontko.com Cc: pgsql-performance@postgresql.org Subject: Re: SELECT's take a long time compared to other DBMS References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/61 X-Sequence-Number: 3427 You forgot that the original poster's query was: SELECT * from
This should require a simple table scan. NO need for stats. Either the table has not been properly vacuumed or he's got seq_scan off... JLL Nick Fankhauser wrote: > > > Yes I Analyze also, but there was no need to because it was a fresh brand > > new database. > > This apparently wasn't the source of problem since he did an analyze anyway, > but my impression was that a fresh brand new database is exactly the > situation where an analyze is needed- ie: a batch of data has just been > loaded and stats haven't been collected yet. > > Am I mistaken? > > -Nick > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) From noname@spam.com Thu Sep 4 15:25:07 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 3AF04D1B8CB for ; Thu, 4 Sep 2003 15:25:07 +0000 (GMT) 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 47853-02 for ; Thu, 4 Sep 2003 12:24:56 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 705C7D1B89A for ; Thu, 4 Sep 2003 12:24:56 -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 h84FOuDf081734 for ; Thu, 4 Sep 2003 15:24:56 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h84F521X075771 for pgsql-performance@postgresql.org; Thu, 4 Sep 2003 15:05:02 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Thu, 4 Sep 2003 08:05:15 -0700 Organization: Hub.Org Networking Services Lines: 39 Message-ID: References: <3F5753B9.F4A5A63F@nsd.ca> 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: 200309/62 X-Sequence-Number: 3428 The table has been Vacuumed and seq_scan is turned on. "Jean-Luc Lachance" wrote in message news:3F5753B9.F4A5A63F@nsd.ca... > You forgot that the original poster's query was: > SELECT * from
> > This should require a simple table scan. NO need for stats. > Either the table has not been properly vacuumed or he's got seq_scan > off... > > JLL > > > Nick Fankhauser wrote: > > > > > Yes I Analyze also, but there was no need to because it was a fresh brand > > > new database. > > > > This apparently wasn't the source of problem since he did an analyze anyway, > > but my impression was that a fresh brand new database is exactly the > > situation where an analyze is needed- ie: a batch of data has just been > > loaded and stats haven't been collected yet. > > > > Am I mistaken? > > > > -Nick > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 2: you can get off all lists at once with the unregister command > > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings > From hannu@tm.ee Thu Sep 4 16:30:44 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 6BDB1D1B9A8 for ; Thu, 4 Sep 2003 16:30:44 +0000 (GMT) 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 55572-01 for ; Thu, 4 Sep 2003 13:30:13 -0300 (ADT) Received: from fuji.krosing.net (silmet.estpak.ee [194.126.97.78]) by svr1.postgresql.org (Postfix) with ESMTP id BA231D1BAB6 for ; Thu, 4 Sep 2003 13:30:11 -0300 (ADT) Received: from fuji.krosing.net (localhost.localdomain [127.0.0.1]) by fuji.krosing.net (8.12.8/8.12.8) with ESMTP id h84GUADN006608; Thu, 4 Sep 2003 19:30:10 +0300 Received: (from hannu@localhost) by fuji.krosing.net (8.12.8/8.12.8/Submit) id h84GU9H4006606; Thu, 4 Sep 2003 19:30:09 +0300 X-Authentication-Warning: fuji.krosing.net: hannu set sender to hannu@tm.ee using -f Subject: Re: SELECT's take a long time compared to other DBMS From: Hannu Krosing To: Relaxin Cc: pgsql-performance@postgresql.org In-Reply-To: References: <1062673303.5200.135.camel@fuji.krosing.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1062693009.6174.21.camel@fuji.krosing.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 04 Sep 2003 19:30:09 +0300 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/64 X-Sequence-Number: 3430 Relaxin kirjutas N, 04.09.2003 kell 17:35: > So after you did that, where able to position to ANY record within the > resultset? > > Ex. Position 100,000; then to Position 5; then to position 50,000, etc... not in the case of : time psql test100k -c 'select * from test' > /dev/null as the whole result would be written to dev null (i.e discarded) Yes in case of python: after doing res = con.query('select * from test') # 3 sec - perform query list = res.getresult() # 1 sec - construct list of tuples the whole 128k records are in a python list , so that i can immediately access any record by python list syntax, ie list[5], list[50000] etc. > If you are able to do that and have your positioned row available to you > immediately, then I'll believe that it's the ODBC driver. It can also be the Cygwin port, which is known to have several problems, and if you run both your client and server on the same machine, then it can also be an interaction of the two processes (cygwin/pgsql server and native win32 ODBC client) not playing together very well. > "Hannu Krosing" wrote in message > news:1062673303.5200.135.camel@fuji.krosing.net... > > Relaxin kirjutas N, 04.09.2003 kell 03:28: > > > I have a table with 102,384 records in it, each record is 934 bytes. > > > > I created a test database on my Linux (RH9) laptop with 30GB/4200RPM ide > > drive and P3-1133Mhz, 768MB, populated it with 128000 rows of 930 bytes > > each and did > > > > [hannu@fuji hannu]$ time psql test100k -c 'select * from test' > > > /dev/null > > > > real 0m3.970s > > user 0m0.980s > > sys 0m0.570s > > > > so it seems definitely not a problem with postgres as such, but perhaps > > with Cygwin and/or ODBC driver > > > > I also ran the same query using the "standard" pg adapter: > > > > >>> import pg, time > > >>> > > >>> con = pg.connect('test100k') > > >>> > > >>> def getall(): > > ... t1 = time.time() > > ... res = con.query('select * from test') > > ... t2 = time.time() > > ... list = res.getresult() > > ... t3 = time.time() > > ... print t2 - t1, t3-t2 > > ... > > >>> getall() > > 3.27637195587 1.10105705261 > > >>> getall() > > 3.07413101196 0.996125936508 > > >>> getall() > > 3.03377199173 1.07322502136 > > > > which gave similar results ------------------- Hannu From noname@spam.com Thu Sep 4 16:55:07 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 7883ED1B9BE for ; Thu, 4 Sep 2003 16:55:07 +0000 (GMT) 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 55701-05 for ; Thu, 4 Sep 2003 13:54:57 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id A605CD1B8C6 for ; Thu, 4 Sep 2003 13:54:56 -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 h84GsuDf009752 for ; Thu, 4 Sep 2003 16:54:56 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h84GqFL7009131 for pgsql-performance@postgresql.org; Thu, 4 Sep 2003 16:52:15 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Thu, 4 Sep 2003 09:52:29 -0700 Organization: Hub.Org Networking Services Lines: 84 Message-ID: References: <1062673303.5200.135.camel@fuji.krosing.net> <1062693009.6174.21.camel@fuji.krosing.net> 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: 200309/65 X-Sequence-Number: 3431 I had these same issues with the PeerDirect version also. "Hannu Krosing" wrote in message news:1062693009.6174.21.camel@fuji.krosing.net... > Relaxin kirjutas N, 04.09.2003 kell 17:35: > > So after you did that, where able to position to ANY record within the > > resultset? > > > > Ex. Position 100,000; then to Position 5; then to position 50,000, etc... > > not in the case of : > time psql test100k -c 'select * from test' > /dev/null > as the whole result would be written to dev null (i.e discarded) > > Yes in case of python: after doing > > res = con.query('select * from test') # 3 sec - perform query > list = res.getresult() # 1 sec - construct list of tuples > > the whole 128k records are in a python list , > so that i can immediately access any record by python list syntax, > ie list[5], list[50000] etc. > > > If you are able to do that and have your positioned row available to you > > immediately, then I'll believe that it's the ODBC driver. > > It can also be the Cygwin port, which is known to have several problems, > and if you run both your client and server on the same machine, then it > can also be an interaction of the two processes (cygwin/pgsql server and > native win32 ODBC client) not playing together very well. > > > "Hannu Krosing" wrote in message > > news:1062673303.5200.135.camel@fuji.krosing.net... > > > Relaxin kirjutas N, 04.09.2003 kell 03:28: > > > > I have a table with 102,384 records in it, each record is 934 bytes. > > > > > > I created a test database on my Linux (RH9) laptop with 30GB/4200RPM ide > > > drive and P3-1133Mhz, 768MB, populated it with 128000 rows of 930 bytes > > > each and did > > > > > > [hannu@fuji hannu]$ time psql test100k -c 'select * from test' > > > > /dev/null > > > > > > real 0m3.970s > > > user 0m0.980s > > > sys 0m0.570s > > > > > > so it seems definitely not a problem with postgres as such, but perhaps > > > with Cygwin and/or ODBC driver > > > > > > I also ran the same query using the "standard" pg adapter: > > > > > > >>> import pg, time > > > >>> > > > >>> con = pg.connect('test100k') > > > >>> > > > >>> def getall(): > > > ... t1 = time.time() > > > ... res = con.query('select * from test') > > > ... t2 = time.time() > > > ... list = res.getresult() > > > ... t3 = time.time() > > > ... print t2 - t1, t3-t2 > > > ... > > > >>> getall() > > > 3.27637195587 1.10105705261 > > > >>> getall() > > > 3.07413101196 0.996125936508 > > > >>> getall() > > > 3.03377199173 1.07322502136 > > > > > > which gave similar results > ------------------- > Hannu > > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend > From wyu@talisys.com Thu Sep 4 17:55:07 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 E54C8D1B56C for ; Thu, 4 Sep 2003 17:55:07 +0000 (GMT) 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 61260-08 for ; Thu, 4 Sep 2003 14:54:58 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 55FF3D1BAA1 for ; Thu, 4 Sep 2003 14:54: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 h84HsuDf027289 for ; Thu, 4 Sep 2003 17:54:56 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h84HiMaZ024094 for pgsql-performance@postgresql.org; Thu, 4 Sep 2003 17:44:22 GMT From: William Yu X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Thu, 04 Sep 2003 10:44:28 -0700 Organization: Hub.Org Networking Services Lines: 31 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en In-Reply-To: To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/67 X-Sequence-Number: 3433 Relaxin wrote: > I have a table with 102,384 records in it, each record is 934 bytes. > > Using the follow select statement: > SELECT * from
> > PG Info: version 7.3.4 under cygwin on Windows 2000 > ODBC: version 7.3.100 > > Machine: 500 Mhz/ 512MB RAM / IDE HDD > > Under PG: Data is returned in 26 secs!! > Under SQL Server: Data is returned in 5 secs. > Under SQLBase: Data is returned in 6 secs. > Under SAPDB: Data is returned in 7 secs. I created a similar table (934 bytes, 102K records) on a slightly faster machine: P3/800 + 512MB RAM + IDE HD. The server OS is Solaris 8 x86 and the version is 7.3.3. On the server (via PSQL client) : 7.5 seconds Using ODBC under VFPW: 10.5 seconds How that translates to what you should see, I'm not sure. Assuming it was just the CPU difference, you should see numbers of roughly 13 seconds. But the documentation says PG under CYGWIN is significantly slower than PG under UNIX so your mileage may vary... Have you changed any of the settings yet in postgresql.conf, specifically the shared_buffers setting? From scott.marlowe@ihs.com Thu Sep 4 22:32:17 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 9E025D1B8E0 for ; Thu, 4 Sep 2003 22:32:17 +0000 (GMT) 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 56799-04 for ; Thu, 4 Sep 2003 19:32:08 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id C1FECD1B52C for ; Thu, 4 Sep 2003 19:32:05 -0300 (ADT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.9/8.12.9) with ESMTP id h84MUXp5012286; Thu, 4 Sep 2003 16:30:33 -0600 (MDT) Date: Thu, 4 Sep 2003 16:28:36 -0600 (MDT) From: "scott.marlowe" To: Relaxin Cc: Subject: Re: SELECT's take a long time compared to other DBMS In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IHS-MailScanner: Found to be clean X-IHS-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/74 X-Sequence-Number: 3440 On Wed, 3 Sep 2003, Relaxin wrote: > I have a table with 102,384 records in it, each record is 934 bytes. > > Using the follow select statement: > SELECT * from
> > PG Info: version 7.3.4 under cygwin on Windows 2000 > ODBC: version 7.3.100 > > Machine: 500 Mhz/ 512MB RAM / IDE HDD > > > Under PG: Data is returned in 26 secs!! > Under SQL Server: Data is returned in 5 secs. > Under SQLBase: Data is returned in 6 secs. > Under SAPDB: Data is returned in 7 secs. This is typical of postgresql under cygwin, it's much faster under a Unix OS like Linux or BSD. That said, you CAN do some things to help speed it up, the biggest being tuning the shared_buffers to be something large enough to hold a fair bit of data. Set the shared_buffers to 1000, restart, and see if things get better. Running Postgresql in a unix emulation layer is guaranteed to make it slow. If you've got a spare P100 with 128 Meg of RAM you can throw redhat 9 or FreeBSD 4.7 on and run Postgresql on, it will likely outrun your 500MHZ cygwin box, and might even keep up with the other databases on that machine as well. From scott.marlowe@ihs.com Thu Sep 4 23:01:48 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 8B3C8D1B8C3 for ; Thu, 4 Sep 2003 23:01:48 +0000 (GMT) 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 58880-05 for ; Thu, 4 Sep 2003 20:01:40 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 668D3D1B52C for ; Thu, 4 Sep 2003 20:01:37 -0300 (ADT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.9/8.12.9) with ESMTP id h84N0Gp5014820; Thu, 4 Sep 2003 17:00:16 -0600 (MDT) Date: Thu, 4 Sep 2003 16:58:19 -0600 (MDT) From: "scott.marlowe" To: Relaxin Cc: Subject: Re: SELECT's take a long time compared to other DBMS In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IHS-MailScanner: Found to be clean X-IHS-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/77 X-Sequence-Number: 3443 You would "get" all rows, but they'd be stored server side until your client asked for them. I.e. a cursor would level the field here, since you say that the other test cases stored the entire result set on the server. Or did I misunderstand what you meant there? On Thu, 4 Sep 2003, Relaxin wrote: > All rows are required. > > ""Shridhar Daithankar"" wrote in > message news:3F573E8B.31916.A1063F8@localhost... > > On 4 Sep 2003 at 0:48, Relaxin wrote: > > > All of the databases that I tested the query against gave me immediate > > > access to ANY row of the resultset once the data had been returned. > > > Ex. If I'm currently at the first row and then wanted to goto the > 100,000 > > > row, I would be there immediately, and if I wanted to then goto the 5 > > > row...same thing, I have the record immediately! > > > > > > The other databases I tested against stored the entire resultset on the > > > Server, I'm not sure what PG does...It seems that brings the entire > > > resultset client side. > > > If that is the case, how can I have PG store the resultset on the Server > AND > > > still allow me immediate access to ANY row in the resultset? > > > > You can use a cursor and get only required rows. > > > > > > Bye > > Shridhar > > > > -- > > Nick the Greek's Law of Life: All things considered, life is 9 to 5 > against. > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > From noname@spam.com Thu Sep 4 23:25: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 C7541D1B96E for ; Thu, 4 Sep 2003 23:25:08 +0000 (GMT) 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 60440-06 for ; Thu, 4 Sep 2003 20:25:00 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 83915D1B8E9 for ; Thu, 4 Sep 2003 20:24: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 h84NOvDh016459 for ; Thu, 4 Sep 2003 23:24:57 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h84NEWb2014149 for pgsql-performance@postgresql.org; Thu, 4 Sep 2003 23:14:32 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Thu, 4 Sep 2003 16:14:50 -0700 Organization: Hub.Org Networking Services Lines: 10 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: 200309/79 X-Sequence-Number: 3445 > > Have you changed any of the settings yet in postgresql.conf, > specifically the shared_buffers setting? > fsync = false tcpip_socket = true shared_buffers = 128 From noname@spam.com Fri Sep 5 01:25:07 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 DEC81D1BA6C for ; Fri, 5 Sep 2003 01:25:07 +0000 (GMT) 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 70889-10 for ; Thu, 4 Sep 2003 22:25:00 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 3FA4AD1B9BC for ; Thu, 4 Sep 2003 22:24: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 h851OvDh040893 for ; Fri, 5 Sep 2003 01:24:57 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h851KjE8040164 for pgsql-performance@postgresql.org; Fri, 5 Sep 2003 01:20:45 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Thu, 4 Sep 2003 17:45:20 -0700 Organization: Hub.Org Networking Services Lines: 42 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: 200309/83 X-Sequence-Number: 3449 I reset the shared_buffers to 1000 from 128, but it made no difference. ""scott.marlowe"" wrote in message news:Pine.LNX.4.33.0309041625300.28714-100000@css120.ihs.com... > On Wed, 3 Sep 2003, Relaxin wrote: > > > I have a table with 102,384 records in it, each record is 934 bytes. > > > > Using the follow select statement: > > SELECT * from
> > > > PG Info: version 7.3.4 under cygwin on Windows 2000 > > ODBC: version 7.3.100 > > > > Machine: 500 Mhz/ 512MB RAM / IDE HDD > > > > > > Under PG: Data is returned in 26 secs!! > > Under SQL Server: Data is returned in 5 secs. > > Under SQLBase: Data is returned in 6 secs. > > Under SAPDB: Data is returned in 7 secs. > > This is typical of postgresql under cygwin, it's much faster under a Unix > OS like Linux or BSD. That said, you CAN do some things to help speed it > up, the biggest being tuning the shared_buffers to be something large > enough to hold a fair bit of data. Set the shared_buffers to 1000, > restart, and see if things get better. > > Running Postgresql in a unix emulation layer is guaranteed to make it > slow. If you've got a spare P100 with 128 Meg of RAM you can throw redhat > 9 or FreeBSD 4.7 on and run Postgresql on, it will likely outrun your > 500MHZ cygwin box, and might even keep up with the other databases on that > machine as well. > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > From cbbrowne@acm.org Fri Sep 5 01:55: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 23954D1BA97 for ; Fri, 5 Sep 2003 01:55:08 +0000 (GMT) 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 75914-02 for ; Thu, 4 Sep 2003 22:55:01 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 66829D1BAA3 for ; Thu, 4 Sep 2003 22:54: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 h851svDj046452 for ; Fri, 5 Sep 2003 01:54:57 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h851aFOE043394 for pgsql-performance@postgresql.org; Fri, 5 Sep 2003 01:36:15 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Thu, 04 Sep 2003 21:26:14 -0400 Organization: cbbrowne Computing Inc Lines: 34 Message-ID: References: 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:oRLWmsxHdfbzDVAr3LAfQy1h71s= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/84 X-Sequence-Number: 3450 A long time ago, in a galaxy far, far away, "Relaxin" wrote: >> Have you changed any of the settings yet in postgresql.conf, >> specifically the shared_buffers setting? > > fsync = false > tcpip_socket = true > shared_buffers = 128 Change fsync to true (you want your data to survive, right?) and increase shared buffers to something that represents ~10% of your system memory, in blocks of 8K. So, if you have 512MB of RAM, then the total blocks is 65536, and it would likely be reasonable to increase shared_buffers to 1/10 of that, or about 6500. What is the value of effective_cache_size? That should probably be increased a whole lot, too. If you are mainly just running the database on your system, then it would be reasonable to set it to most of memory, or (* 1/2 (/ (* 512 1024 1024) 8192)) 32768. None of this is likely to substantially change the result of that one query, however, and it seems quite likely that it is because PostgreSQL is honestly returning the whole result set of ~100K rows at once, whereas the other DBMSes are probably using cursors to return only the few rows of the result that you actually looked at. -- "cbbrowne","@","cbbrowne.com" http://www3.sympatico.ca/cbbrowne/linuxdistributions.html Rules of the Evil Overlord #14. "The hero is not entitled to a last kiss, a last cigarette, or any other form of last request." From noname@spam.com Fri Sep 5 02:25: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 5837CD1B8A8 for ; Fri, 5 Sep 2003 02:25:08 +0000 (GMT) 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 76582-10 for ; Thu, 4 Sep 2003 23:25:01 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 6D196D1B52C for ; Thu, 4 Sep 2003 23:24: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 h852OvDf052710 for ; Fri, 5 Sep 2003 02:24:57 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h852DBoQ050652 for pgsql-performance@postgresql.org; Fri, 5 Sep 2003 02:13:11 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Thu, 4 Sep 2003 19:13:30 -0700 Organization: Hub.Org Networking Services Lines: 75 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: 200309/85 X-Sequence-Number: 3451 Thank you Christopher. > Change fsync to true (you want your data to survive, right?) and > increase shared buffers to something that represents ~10% of your > system memory, in blocks of 8K. I turned it off just in the hope that things would run faster. > None of this is likely to substantially change the result of that one > query, however, and it seems quite likely that it is because > PostgreSQL is honestly returning the whole result set of ~100K rows at > once, whereas the other DBMSes are probably using cursors to return > only the few rows of the result that you actually looked at. Finally, someone who will actually assume/admit that it is returning the entire result set to the client. Where as other DBMS manage the records at the server. I hope PG could fix/enhance this issue. There are several issues that's stopping our company from going with PG (with paid support, if available), but this seems to big the one at the top of the list. The next one is the handling of BLOBS. PG handles them like no other system I have ever come across. After that is a native Windows port, but we would deal cygwin (for a very little while) if these other issues were handled. Thanks "Christopher Browne" wrote in message news:m3fzjc58ll.fsf@chvatal.cbbrowne.com... > A long time ago, in a galaxy far, far away, "Relaxin" wrote: > >> Have you changed any of the settings yet in postgresql.conf, > >> specifically the shared_buffers setting? > > > > fsync = false > > tcpip_socket = true > > shared_buffers = 128 > > Change fsync to true (you want your data to survive, right?) and > increase shared buffers to something that represents ~10% of your > system memory, in blocks of 8K. > > So, if you have 512MB of RAM, then the total blocks is 65536, and it > would likely be reasonable to increase shared_buffers to 1/10 of that, > or about 6500. > > What is the value of effective_cache_size? That should probably be > increased a whole lot, too. If you are mainly just running the > database on your system, then it would be reasonable to set it to most > of memory, or > (* 1/2 (/ (* 512 1024 1024) 8192)) > 32768. > > None of this is likely to substantially change the result of that one > query, however, and it seems quite likely that it is because > PostgreSQL is honestly returning the whole result set of ~100K rows at > once, whereas the other DBMSes are probably using cursors to return > only the few rows of the result that you actually looked at. > -- > "cbbrowne","@","cbbrowne.com" > http://www3.sympatico.ca/cbbrowne/linuxdistributions.html > Rules of the Evil Overlord #14. "The hero is not entitled to a last > kiss, a last cigarette, or any other form of last request." > From neilc@samurai.com Fri Sep 5 02:32:30 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 DBADFD1B8A8 for ; Fri, 5 Sep 2003 02:32:30 +0000 (GMT) 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 78330-04 for ; Thu, 4 Sep 2003 23:32:24 -0300 (ADT) Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) by svr1.postgresql.org (Postfix) with ESMTP id E843FD1B52C for ; Thu, 4 Sep 2003 23:32:19 -0300 (ADT) Received: from 6-allhosts (d226-85-166.home.cgocable.net [24.226.85.166]) by bob.samurai.com (Postfix) with ESMTP id D39771D6B; Thu, 4 Sep 2003 22:32:23 -0400 (EDT) Subject: Re: SELECT's take a long time compared to other DBMS From: Neil Conway To: Relaxin Cc: PostgreSQL Performance In-Reply-To: References: Content-Type: text/plain Message-Id: <1062729142.364.20.camel@tokyo> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 04 Sep 2003 22:32:23 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/86 X-Sequence-Number: 3452 On Thu, 2003-09-04 at 22:13, Relaxin wrote: > Finally, someone who will actually assume/admit that it is returning the > entire result set to the client. > Where as other DBMS manage the records at the server. Is there a reason you can't use cursors (explicitely, or via ODBC if it provides some glue on top of them) to keep the result set on the server? http://candle.pha.pa.us/main/writings/pgsql/sgml/sql-declare.html http://candle.pha.pa.us/main/writings/pgsql/sgml/sql-fetch.html > The next one is the handling of BLOBS. PG handles them like no other system > I have ever come across. Just FYI, you can use both the lo_*() functions, as well as simple bytea/text columns (which can be very large in PostgreSQL). -Neil From ltning@anduin.net Fri Sep 5 05:49:01 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 3B04BD1B8B1 for ; Fri, 5 Sep 2003 05:49:01 +0000 (GMT) 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 96983-08 for ; Fri, 5 Sep 2003 02:48:31 -0300 (ADT) Received: from anduin.net (anduin.net [212.12.46.226]) by svr1.postgresql.org (Postfix) with SMTP id 6D69FD1B973 for ; Fri, 5 Sep 2003 02:48:29 -0300 (ADT) Received: (qmail 92566 invoked by uid 85); 5 Sep 2003 05:48:29 -0000 Received: from ltning@anduin.net by anduin.net by uid 82 with qmail-scanner-1.20rc1 (clamscan: 0.60. Clear:RC:1:. Processed in 0.031791 secs); 05 Sep 2003 05:48:29 -0000 X-Qmail-Scanner-Mail-From: ltning@anduin.net via anduin.net X-Qmail-Scanner: 1.20rc1 (Clear:RC:1:. Processed in 0.031791 secs) Received: from celduin.net (HELO anduin.net) (81.0.162.106) by anduin.net with SMTP; 5 Sep 2003 05:48:29 -0000 Date: Fri, 5 Sep 2003 06:54:24 +0200 From: Eirik Oeverby To: pgsql-performance@postgresql.org Subject: Re: SELECT's take a long time compared to other DBMS Message-Id: <20030905065424.03e5c217.ltning@anduin.net> In-Reply-To: References: <1062729142.364.20.camel@tokyo> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i386-portbld-freebsd5.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/89 X-Sequence-Number: 3455 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I think the problem is the ODBC driver NOT using cursors properly even if it should. The database itself is not doing anything it shouldn't do, in fact it has all the needed functionality to handle this request in a fast and effective way - just like any other respectable RDBMS. I don't know what ODBC driver you are using, and how it is configrued - and I never actually used PostgreSQL with ODBC myself. However in the applications I have developed we DO use 'standardized' DB access libraries, which work on just about any DBMS you throw them at. In our development system, which is running on a low-end dual P2-433mhz box with IDE drives, we routinely test both simple queries as yours and more complex ones, which at times returns several hundred thousand (or sometimes even millions) of rows. And processing time is, generally speaking, in range with what you are seeing on the other DBMSes you have. So if PG is indeed returning ALL the rows, it is because it is explicitly told to by the ODBC driver, so you need to look there to find the problem. Could there be some kind of connection parameters you are overlooking, or is the driver too old? Just throwing out ideas here, most likely you have already thought about it :) Just thought I'd point out that this is NOT expected behaviour from PG itself. /Eirik On Thu, 4 Sep 2003 21:59:01 -0700 "Relaxin" wrote: > > Is there a reason you can't use cursors (explicitely, or via ODBC if > > it provides some glue on top of them) to keep the result set on the > > server? > > > > http://candle.pha.pa.us/main/writings/pgsql/sgml/sql-declare.html > > http://candle.pha.pa.us/main/writings/pgsql/sgml/sql-fetch.html > > I can only use generally accepted forms of connectivity (ie. ODBC, ADO > or OLEDB). > This is what many of the people on the Windows side are going to need, > because most of us are going to be converting from an existing already > established system, such as Oracle, SQL Server or DB2, all of which > have 1 or more of the 3 mentioned above. > > > > > The next one is the handling of BLOBS. PG handles them like no > > > other > system > > > I have ever come across. > > > > Just FYI, you can use both the lo_*() functions, as well as simple > > bytea/text columns (which can be very large in PostgreSQL). > > > > -Neil > > I know PG has a ODBC driver (that's all I've been using), but it or PG > just doesn't handle BLOBS the way people on the Windows side (don't > know about Unix) are use too. > > There is this conversion to octet that must be performed on the data , > I don't understand why, but I guess there was a reason for it long > ago, but it seems that it can now be modified to just accept ANY byte > you give it and then store it without any manipulation of the data. > This will make Postgresql much more portable for the Windows > developers...no need for any special handling for a data type that all > large RDBMS support. > > > Thanks > > > > ---------------------------(end of > broadcast)--------------------------- TIP 3: if posting/reading > through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that > your message can get through to the mailing list cleanly -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/WBcAdAvR8ct7fEcRAvZPAJ9FgkYxck6Yh5gPeomk8QgWraeV0gCfQF/v CjyihMwTdrEZo2Y5YBwLVrI= =Ng2I -----END PGP SIGNATURE----- From noname@spam.com Fri Sep 5 05:25: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 613CAD1B89E for ; Fri, 5 Sep 2003 05:25:14 +0000 (GMT) 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 91102-08 for ; Fri, 5 Sep 2003 02:25:04 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id B8856D1B897 for ; Fri, 5 Sep 2003 02:25:03 -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 h855P3Df094663 for ; Fri, 5 Sep 2003 05:25:03 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h854wkkD089211 for pgsql-performance@postgresql.org; Fri, 5 Sep 2003 04:58:46 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Thu, 4 Sep 2003 21:59:01 -0700 Organization: Hub.Org Networking Services Lines: 38 Message-ID: References: <1062729142.364.20.camel@tokyo> 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: 200309/88 X-Sequence-Number: 3454 > Is there a reason you can't use cursors (explicitely, or via ODBC if it > provides some glue on top of them) to keep the result set on the server? > > http://candle.pha.pa.us/main/writings/pgsql/sgml/sql-declare.html > http://candle.pha.pa.us/main/writings/pgsql/sgml/sql-fetch.html I can only use generally accepted forms of connectivity (ie. ODBC, ADO or OLEDB). This is what many of the people on the Windows side are going to need, because most of us are going to be converting from an existing already established system, such as Oracle, SQL Server or DB2, all of which have 1 or more of the 3 mentioned above. > > The next one is the handling of BLOBS. PG handles them like no other system > > I have ever come across. > > Just FYI, you can use both the lo_*() functions, as well as simple > bytea/text columns (which can be very large in PostgreSQL). > > -Neil I know PG has a ODBC driver (that's all I've been using), but it or PG just doesn't handle BLOBS the way people on the Windows side (don't know about Unix) are use too. There is this conversion to octet that must be performed on the data , I don't understand why, but I guess there was a reason for it long ago, but it seems that it can now be modified to just accept ANY byte you give it and then store it without any manipulation of the data. This will make Postgresql much more portable for the Windows developers...no need for any special handling for a data type that all large RDBMS support. Thanks From PHatcher@macys.com Fri Sep 5 15:13:13 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 3BCDAD1B8B7; Fri, 5 Sep 2003 15:13:13 +0000 (GMT) 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 44839-09; Fri, 5 Sep 2003 12:12:42 -0300 (ADT) Received: from fddlnint05.fds.com (fddlnint05.fds.com [208.15.91.52]) by svr1.postgresql.org (Postfix) with ESMTP id 4BF28D1B89F; Fri, 5 Sep 2003 12:12:41 -0300 (ADT) In-Reply-To: Subject: Re: SELECT's take a long time compared to other DBMS To: noname@spam.com Cc: pgsql-performance@postgresql.org, pgsql-performance-owner@postgresql.org X-Mailer: Lotus Notes Release 6.0 September 26, 2002 Message-ID: From: "Patrick Hatcher" Date: Fri, 5 Sep 2003 08:05:00 -0700 X-MIMETrack: Serialize by Router on FDDLNINT05/FSG/SVR/FDD(Release 5.0.4 |June 8, 2000) at 09/05/2003 11:07:36 AM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/95 X-Sequence-Number: 3461 Relaxin, I can't remember during this thread if you said you were using ODBC or not. If you are, then your problem is with the ODBC driver. You will need to check the Declare/Fetch box or you will definitely bring back the entire recordset. For small a small recordset this is not a problem, but the larger the recordset the slower the data is return to the client. I played around with the cache size on the driver and found a value between 100 to 200 provided good results. HTH Patrick Hatcher "Relaxin" Sent by: To: pgsql-performance@postgresql.org pgsql-performance-owner@post cc: gresql.org Subject: Re: [PERFORM] SELECT's take a long time compared to other DBMS 09/04/2003 07:13 PM Thank you Christopher. > Change fsync to true (you want your data to survive, right?) and > increase shared buffers to something that represents ~10% of your > system memory, in blocks of 8K. I turned it off just in the hope that things would run faster. > None of this is likely to substantially change the result of that one > query, however, and it seems quite likely that it is because > PostgreSQL is honestly returning the whole result set of ~100K rows at > once, whereas the other DBMSes are probably using cursors to return > only the few rows of the result that you actually looked at. Finally, someone who will actually assume/admit that it is returning the entire result set to the client. Where as other DBMS manage the records at the server. I hope PG could fix/enhance this issue. There are several issues that's stopping our company from going with PG (with paid support, if available), but this seems to big the one at the top of the list. The next one is the handling of BLOBS. PG handles them like no other system I have ever come across. After that is a native Windows port, but we would deal cygwin (for a very little while) if these other issues were handled. Thanks "Christopher Browne" wrote in message news:m3fzjc58ll.fsf@chvatal.cbbrowne.com... > A long time ago, in a galaxy far, far away, "Relaxin" wrote: > >> Have you changed any of the settings yet in postgresql.conf, > >> specifically the shared_buffers setting? > > > > fsync = false > > tcpip_socket = true > > shared_buffers = 128 > > Change fsync to true (you want your data to survive, right?) and > increase shared buffers to something that represents ~10% of your > system memory, in blocks of 8K. > > So, if you have 512MB of RAM, then the total blocks is 65536, and it > would likely be reasonable to increase shared_buffers to 1/10 of that, > or about 6500. > > What is the value of effective_cache_size? That should probably be > increased a whole lot, too. If you are mainly just running the > database on your system, then it would be reasonable to set it to most > of memory, or > (* 1/2 (/ (* 512 1024 1024) 8192)) > 32768. > > None of this is likely to substantially change the result of that one > query, however, and it seems quite likely that it is because > PostgreSQL is honestly returning the whole result set of ~100K rows at > once, whereas the other DBMSes are probably using cursors to return > only the few rows of the result that you actually looked at. > -- > "cbbrowne","@","cbbrowne.com" > http://www3.sympatico.ca/cbbrowne/linuxdistributions.html > Rules of the Evil Overlord #14. "The hero is not entitled to a last > kiss, a last cigarette, or any other form of last request." > ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend From noname@spam.com Fri Sep 5 20:05:22 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 4A1FCD1D1D5 for ; Fri, 5 Sep 2003 20:05:22 +0000 (GMT) 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 17541-03 for ; Fri, 5 Sep 2003 17:05:10 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 20242D1E761 for ; Fri, 5 Sep 2003 15:25:10 -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 h85IP9Df094744 for ; Fri, 5 Sep 2003 18:25:09 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h85IInWv093354 for pgsql-performance@postgresql.org; Fri, 5 Sep 2003 18:18:49 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Fri, 5 Sep 2003 11:18:35 -0700 Organization: Hub.Org Networking Services Lines: 129 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: 200309/103 X-Sequence-Number: 3469 Expect that the Declare/Fetch only creates a forwardonly cursor, you can go backwards thru the result set. ""Patrick Hatcher"" wrote in message news:OFAD2A2CF4.499F8F67-ON88256D98.00527BCB-88256D98.00538130@fds.com... > > Relaxin, > I can't remember during this thread if you said you were using ODBC or not. > If you are, then your problem is with the ODBC driver. You will need to > check the Declare/Fetch box or you will definitely bring back the entire > recordset. For small a small recordset this is not a problem, but the > larger the recordset the slower the data is return to the client. I played > around with the cache size on the driver and found a value between 100 to > 200 provided good results. > > HTH > Patrick Hatcher > > > > > > "Relaxin" > Sent by: To: pgsql-performance@postgresql.org > pgsql-performance-owner@post cc: > gresql.org Subject: Re: [PERFORM] SELECT's take a long time compared to other DBMS > > > 09/04/2003 07:13 PM > > > > > > Thank you Christopher. > > > Change fsync to true (you want your data to survive, right?) and > > increase shared buffers to something that represents ~10% of your > > system memory, in blocks of 8K. > > I turned it off just in the hope that things would run faster. > > > None of this is likely to substantially change the result of that one > > query, however, and it seems quite likely that it is because > > PostgreSQL is honestly returning the whole result set of ~100K rows at > > once, whereas the other DBMSes are probably using cursors to return > > only the few rows of the result that you actually looked at. > > Finally, someone who will actually assume/admit that it is returning the > entire result set to the client. > Where as other DBMS manage the records at the server. > > I hope PG could fix/enhance this issue. > > There are several issues that's stopping our company from going with PG > (with paid support, if available), but this seems to big the one at the top > of the list. > > The next one is the handling of BLOBS. PG handles them like no other > system > I have ever come across. > > After that is a native Windows port, but we would deal cygwin (for a very > little while) if these other issues were handled. > > Thanks > > > > > > "Christopher Browne" wrote in message > news:m3fzjc58ll.fsf@chvatal.cbbrowne.com... > > A long time ago, in a galaxy far, far away, "Relaxin" > wrote: > > >> Have you changed any of the settings yet in postgresql.conf, > > >> specifically the shared_buffers setting? > > > > > > fsync = false > > > tcpip_socket = true > > > shared_buffers = 128 > > > > Change fsync to true (you want your data to survive, right?) and > > increase shared buffers to something that represents ~10% of your > > system memory, in blocks of 8K. > > > > So, if you have 512MB of RAM, then the total blocks is 65536, and it > > would likely be reasonable to increase shared_buffers to 1/10 of that, > > or about 6500. > > > > What is the value of effective_cache_size? That should probably be > > increased a whole lot, too. If you are mainly just running the > > database on your system, then it would be reasonable to set it to most > > of memory, or > > (* 1/2 (/ (* 512 1024 1024) 8192)) > > 32768. > > > > None of this is likely to substantially change the result of that one > > query, however, and it seems quite likely that it is because > > PostgreSQL is honestly returning the whole result set of ~100K rows at > > once, whereas the other DBMSes are probably using cursors to return > > only the few rows of the result that you actually looked at. > > -- > > "cbbrowne","@","cbbrowne.com" > > http://www3.sympatico.ca/cbbrowne/linuxdistributions.html > > Rules of the Evil Overlord #14. "The hero is not entitled to a last > > kiss, a last cigarette, or any other form of last request." > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > From neilc@samurai.com Fri Sep 5 21:10:27 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 0A8F7D1B9BD for ; Fri, 5 Sep 2003 21:10:27 +0000 (GMT) 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 28163-03 for ; Fri, 5 Sep 2003 18:09:56 -0300 (ADT) Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) by svr1.postgresql.org (Postfix) with ESMTP id ED563D1B53A for ; Fri, 5 Sep 2003 18:09:55 -0300 (ADT) Received: from 6-allhosts (d226-85-166.home.cgocable.net [24.226.85.166]) by bob.samurai.com (Postfix) with ESMTP id 516131E3E; Fri, 5 Sep 2003 17:09:55 -0400 (EDT) Subject: Re: SELECT's take a long time compared to other DBMS From: Neil Conway To: Relaxin Cc: PostgreSQL Performance In-Reply-To: References: Content-Type: text/plain Message-Id: <1062796189.447.9.camel@tokyo> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Fri, 05 Sep 2003 17:09:49 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/107 X-Sequence-Number: 3473 On Fri, 2003-09-05 at 14:18, Relaxin wrote: > Expect that the Declare/Fetch only creates a forwardonly cursor, you can go > backwards thru the result set. No, DECLARE can create scrollable cursors, read the ref page again. This functionality is much improved in PostgreSQL 7.4, though. -Neil From noname@spam.com Sat Sep 6 01:07:11 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 59B10D1B4E2 for ; Sat, 6 Sep 2003 01:07:11 +0000 (GMT) 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 43714-05 for ; Fri, 5 Sep 2003 22:07:02 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id AD050D1BA5D for ; Fri, 5 Sep 2003 22:07:00 -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 h8616tsn091068 for ; Sat, 6 Sep 2003 01:06:59 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h860tQSc088781 for pgsql-performance@postgresql.org; Sat, 6 Sep 2003 00:55:26 GMT From: "Relaxin" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: SELECT's take a long time compared to other DBMS Date: Fri, 5 Sep 2003 17:55:46 -0700 Organization: Hub.Org Networking Services Lines: 22 Message-ID: References: <1062796189.447.9.camel@tokyo> 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: 200309/111 X-Sequence-Number: 3477 It is forward only in the ODBC driver. "Neil Conway" wrote in message news:1062796189.447.9.camel@tokyo... > On Fri, 2003-09-05 at 14:18, Relaxin wrote: > > Expect that the Declare/Fetch only creates a forwardonly cursor, you can go > > backwards thru the result set. > > No, DECLARE can create scrollable cursors, read the ref page again. This > functionality is much improved in PostgreSQL 7.4, though. > > -Neil > > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match >