From pgsql-performance-owner@postgresql.org Fri Aug 1 00:40: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 BBDCCD1C92A for ; Fri, 1 Aug 2003 03:40:34 +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 03413-10 for ; Fri, 1 Aug 2003 00:39:27 -0300 (ADT) Received: from trade-india.com (ns5.trade-india.com [66.234.10.13]) by svr1.postgresql.org (Postfix) with SMTP id 96729D1C921 for ; Fri, 1 Aug 2003 00:40:27 -0300 (ADT) Received: (qmail 16343 invoked by uid 0); 1 Aug 2003 03:39:50 -0000 Received: from mallah@trade-india.com by ns5.trade-india.com by uid 502 with qmail-scanner-1.15 (uvscan: v4.1.60/v4171. Clear:. Processed in 1.427526 secs); 01 Aug 2003 03:39:50 -0000 Received: from unknown (HELO trade-india.com) (203.145.130.142) by ns5.trade-india.com with SMTP; 1 Aug 2003 03:39:49 -0000 Message-ID: <3F29E12F.7030207@trade-india.com> Date: Fri, 01 Aug 2003 09:10:31 +0530 From: Rajesh Kumar Mallah User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030701 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephan Szabo Cc: Christopher Browne , pgsql-performance@postgresql.org Subject: Re: Views With Unions References: <20030731152719.V26943-100000@megazone.bigpanda.com> In-Reply-To: <20030731152719.V26943-100000@megazone.bigpanda.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1 X-Sequence-Number: 2818 Stephan Szabo wrote: >On Thu, 31 Jul 2003, Christopher Browne wrote: > > > >> select * from log_table where request_time between 'june 11 2003' and >> 'june 12 2003'; >> >>returns a plan: >>Subquery Scan log_table (cost=0.00..10950.26 rows=177126 width=314) >> -> Append (cost=0.00..10950.26 rows=177126 width=314) >> -> Subquery Scan *SELECT* 1 (cost=0.00..3089.07 rows=50307 width=71) >> -> Seq Scan on log_table_1 (cost=0.00..3089.07 rows=50307 width=71) >> -> Subquery Scan *SELECT* 2 (cost=0.00..602.92 rows=9892 width=314) >> -> Seq Scan on log_table_2 (cost=0.00..602.92 rows=9892 width=314) >> -> Subquery Scan *SELECT* 3 (cost=0.00..2390.09 rows=39209 width=314) >> -> Seq Scan on log_table_3 (cost=0.00..2390.09 rows=39209 width=314) >> >> > >What version are you using? In 7.3 and up it should be willing to >consider moving the clause down, unless there's something like a type >mismatch (because in that case it may not be equivalent without a bunch >more work on the clause). > Dear Chris, I had the same problem(type mismatch) and it was solved finally. check the list "factoring problem ... " subject only 2 weeks back . regds mallah. > > > >---------------------------(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 > > From pgsql-performance-owner@postgresql.org Fri Aug 1 09:20: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 45431D1C4D5 for ; Fri, 1 Aug 2003 12:16: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 38911-03 for ; Fri, 1 Aug 2003 09:15:06 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 3399DD1C4BF for ; Fri, 1 Aug 2003 09:16:09 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19iYpQ-0004bY-00 for ; Fri, 01 Aug 2003 08:16:12 -0400 Received: by dba2 (Postfix, from userid 1019) id B7519CEC9; Fri, 1 Aug 2003 08:16:12 -0400 (EDT) Date: Fri, 1 Aug 2003 08:16:12 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: Odd explain estimate Message-ID: <20030801121612.GD18200@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <20030731195145.GD55392@nasby.net> <20030731205921.GF16230@libertyrms.info> <20030731225959.GH55392@nasby.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030731225959.GH55392@nasby.net> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/2 X-Sequence-Number: 2819 On Thu, Jul 31, 2003 at 05:59:59PM -0500, Jim C. Nasby wrote: > > Well, if I don't do this it wants to seqscan a table that occupies 350k > pages, instead of pulling a couple thousand rows. I started running it > with the seqscan and it's already taken way longer than it does if I > disable seqscan. That was indeed the question. If it uses a seqscan when it ought not to do, then there's something wrong with the statistics, or you haven't vacuum analysed correctly, or your table needs vacuum full (is it really 350k pages, or is that mostly dead space?), &c. -- all the usual bad-seqscan candidates. enable_seqscan=off is probably not a good strategy for any moderately complicated query. If the planner were perfect, of course, you'd never need it at all. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Fri Aug 1 09:21: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 9C182D1C9DB for ; Fri, 1 Aug 2003 12:20: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 37238-10 for ; Fri, 1 Aug 2003 09:18:57 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id BDC68D1C9D8 for ; Fri, 1 Aug 2003 09:19:59 -0300 (ADT) Received: from acdc.int.libertyrms.com ([10.1.2.254] helo=libertyrms.info) by mail.libertyrms.com with smtp (Exim 3.22 #3 (Debian)) id 19iYt8-0004fA-00; Fri, 01 Aug 2003 08:20:02 -0400 Received: from 64.229.210.126 (SquirrelMail authenticated user cbbrowne) by look.libertyrms.com with HTTP; Fri, 1 Aug 2003 08:20:02 -0400 (EDT) Message-ID: <61665.64.229.210.126.1059740402.squirrel@look.libertyrms.com> Date: Fri, 1 Aug 2003 08:20:02 -0400 (EDT) Subject: Re: Views With Unions From: "Christopher Browne" To: In-Reply-To: <20030731152719.V26943-100000@megazone.bigpanda.com> References: <60adaunxmc.fsf@dev6.int.libertyrms.info> <20030731152719.V26943-100000@megazone.bigpanda.com> X-Priority: 3 Importance: Normal Cc: Reply-To: cbbrowne@libertyrms.info X-Mailer: SquirrelMail (version 1.2.11) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/3 X-Sequence-Number: 2820 Stephan Szabo said: > > On Thu, 31 Jul 2003, Christopher Browne wrote: > >> select * from log_table where request_time between 'june 11 2003' >> and >> 'june 12 2003'; >> >> returns a plan: >> Subquery Scan log_table (cost=0.00..10950.26 rows=177126 width=314) >> -> Append (cost=0.00..10950.26 rows=177126 width=314) >> -> Subquery Scan *SELECT* 1 (cost=0.00..3089.07 rows=50307 >> width=71) >> -> Seq Scan on log_table_1 (cost=0.00..3089.07 >> rows=50307 width=71) >> -> Subquery Scan *SELECT* 2 (cost=0.00..602.92 rows=9892 >> width=314) >> -> Seq Scan on log_table_2 (cost=0.00..602.92 >> rows=9892 width=314) >> -> Subquery Scan *SELECT* 3 (cost=0.00..2390.09 rows=39209 >> width=314) >> -> Seq Scan on log_table_3 (cost=0.00..2390.09 >> rows=39209 width=314) > > What version are you using? In 7.3 and up it should be willing to > consider moving the clause down, unless there's something like a type > mismatch (because in that case it may not be equivalent without a bunch > more work on the clause). That was 7.2.4, although I had also tried it on 7.4 (yesterday's CVS). Which provides four findings: 1. On 7.2.4, adding additional type info just doesn't help, fitting with the notion that, consistent with your comment, improvement wouldn't happen earlier than 7.3. There's no help on 7.2 :-(, and the system I'm initially most interested in using this on is still on 7.2. 2. When I retried on 7.4, it _did_ find search paths based on Index Scan, when I added in additional type information. So the optimization I was wishing for _is_ there :-). In the longer term, that's very good news. 3. I'll have to test this out on 7.3.4, now, as I hadn't, and it sounds as though that is an interesting case. 4. It's often necessary to expressly specify type information in queries to get the optimizer to do the Right Thing. -- (reverse (concatenate 'string "ofni.smrytrebil@" "enworbbc")) Christopher Browne (416) 646 3304 x124 (land) From pgsql-performance-owner@postgresql.org Fri Aug 1 12:10:49 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 D01B9D1C518 for ; Fri, 1 Aug 2003 15:10: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 48799-06 for ; Fri, 1 Aug 2003 12:09:31 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id 6183FD1C4F1 for ; Fri, 1 Aug 2003 12:10:33 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 94534D630; Fri, 1 Aug 2003 08:10:32 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 81F335C10; Fri, 1 Aug 2003 08:10:32 -0700 (PDT) Date: Fri, 1 Aug 2003 08:10:32 -0700 (PDT) From: Stephan Szabo To: Christopher Browne Cc: Subject: Re: Views With Unions In-Reply-To: <61665.64.229.210.126.1059740402.squirrel@look.libertyrms.com> Message-ID: <20030801075335.D51229-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/4 X-Sequence-Number: 2821 On Fri, 1 Aug 2003, Christopher Browne wrote: > Stephan Szabo said: > > > > > > What version are you using? In 7.3 and up it should be willing to > > consider moving the clause down, unless there's something like a type > > mismatch (because in that case it may not be equivalent without a bunch > > more work on the clause). > > That was 7.2.4, although I had also tried it on 7.4 (yesterday's CVS). > > Which provides four findings: > > 1. On 7.2.4, adding additional type info just doesn't help, fitting with > the notion that, consistent with your comment, improvement wouldn't happen > earlier than 7.3. > > There's no help on 7.2 :-(, and the system I'm initially most interested > in using this on is still on 7.2. If you really wanted you could try going back and finding the diffs associated with this in the CVS history or committers archives and see if you can make equivalent changes to 7.2, but that's possibly going to be difficult. > 2. When I retried on 7.4, it _did_ find search paths based on Index Scan, > when I added in additional type information. So the optimization I was > wishing for _is_ there :-). In the longer term, that's very good news. > > 3. I'll have to test this out on 7.3.4, now, as I hadn't, and it sounds > as though that is an interesting case. > > 4. It's often necessary to expressly specify type information in queries > to get the optimizer to do the Right Thing. Especially for cases like this. It takes the safer route of not pushing things down when it's not sure if pushing down might change the semantics (for example if a union piece has a different type from the union output, simply pushing clauses down unchanged could change the results) Tom would probably be willing to relax conditions if it could be proven safe even for the wierd outlying cases with char and varchar and such. From pgsql-performance-owner@postgresql.org Fri Aug 1 12:50: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 DEC8BD1C7F3 for ; Fri, 1 Aug 2003 15:48: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 51008-08 for ; Fri, 1 Aug 2003 12:46:56 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 879C3D1C518 for ; Fri, 1 Aug 2003 12:48:03 -0300 (ADT) Received: from dev6.int.libertyrms.com ([10.1.2.212] helo=libertyrms.info) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19ic8Q-0007ay-00; Fri, 01 Aug 2003 11:48:02 -0400 Received: by libertyrms.info (Postfix, from userid 1079) id E9DCBBBAD8; Fri, 1 Aug 2003 11:48:01 -0400 (EDT) To: Stephan Szabo Cc: Subject: Re: Views With Unions References: <20030801075335.D51229-100000@megazone.bigpanda.com> From: Christopher Browne Date: Fri, 01 Aug 2003 11:48:01 -0400 In-Reply-To: <20030801075335.D51229-100000@megazone.bigpanda.com> (Stephan Szabo's message of "Fri, 1 Aug 2003 08:10:32 -0700 (PDT)") Message-ID: <60vfthl6q6.fsf@dev6.int.libertyrms.info> User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/5 X-Sequence-Number: 2822 Stephan Szabo writes: > On Fri, 1 Aug 2003, Christopher Browne wrote: >> Stephan Szabo said: >> > What version are you using? In 7.3 and up it should be willing to >> > consider moving the clause down, unless there's something like a type >> > mismatch (because in that case it may not be equivalent without a bunch >> > more work on the clause). >> >> That was 7.2.4, although I had also tried it on 7.4 (yesterday's CVS). >> >> Which provides four findings: >> >> 1. On 7.2.4, adding additional type info just doesn't help, fitting with >> the notion that, consistent with your comment, improvement wouldn't happen >> earlier than 7.3. >> >> There's no help on 7.2 :-(, and the system I'm initially most interested >> in using this on is still on 7.2. > > If you really wanted you could try going back and finding the diffs > associated with this in the CVS history or committers archives and see if > you can make equivalent changes to 7.2, but that's possibly going to be > difficult. Somehow I don't think that'll fly; I have taken a brief look at some of the optimizer code, and I very much don't want to leap into that at the moment. (I don't imagine I'd be able to muster much enthusiasm for the idea from others that are involved, either. More likely, I'm understating the probable opposition to the idea... :-)) I was hoping there would be some help on 7.2, but can live without it. This approach to improving log purgeability is NOT the sort of thing that you deploy on a day's notice because it seems like a "neat idea." If it waits a couple months to be implemented, that's doubtless OK. >> 2. When I retried on 7.4, it _did_ find search paths based on Index Scan, >> when I added in additional type information. So the optimization I was >> wishing for _is_ there :-). In the longer term, that's very good news. >> >> 3. I'll have to test this out on 7.3.4, now, as I hadn't, and it sounds >> as though that is an interesting case. It turns out nicely on 7.3.4, using index scans for the subqueries in the query: select count(*) from log_table where event_date between '2003-04-01' and '2003-05-01'; Which is a Good Thing. >> 4. It's often necessary to expressly specify type information in >> queries to get the optimizer to do the Right Thing. > > Especially for cases like this. It takes the safer route of not > pushing things down when it's not sure if pushing down might change > the semantics (for example if a union piece has a different type > from the union output, simply pushing clauses down unchanged could > change the results) > > Tom would probably be willing to relax conditions if it could be > proven safe even for the wierd outlying cases with char and varchar > and such. Evidently the dates of the form '2003-04-01' and such are getting types promoted properly enough. I don't see anything to "lobby" for at this point. The DOMAIN case I mentioned the other day had something odd going on that LOST the type information associated with the domain. Albeit that was on 7.3, whereas the changes in DOMAIN functionality that make them meaningfully useful come in 7.4... -- let name="cbbrowne" and tld="libertyrms.info" in name ^ "@" ^ tld;; Christopher Browne (416) 646 3304 x124 (land) From pgsql-admin-owner@postgresql.org Fri Aug 1 12:51:25 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 75FECD1C4BF for ; Fri, 1 Aug 2003 15:51:24 +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 51804-05 for ; Fri, 1 Aug 2003 12:50:16 -0300 (ADT) Received: from pns.mm.eutelsat.org (pns.mm.eutelsat.org [194.214.173.227]) by svr1.postgresql.org (Postfix) with ESMTP id 3E347D1C4E6 for ; Fri, 1 Aug 2003 12:51:22 -0300 (ADT) Received: from nts-03.mm.eutelsat.org (localhost [127.0.0.1]) by pns.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id h71Freq19046; Fri, 1 Aug 2003 17:53:40 +0200 Received: from gmendola (gmendola.mm.eutelsat.org [194.214.173.50]) by nts-03.mm.eutelsat.org (8.11.6/linuxconf) with SMTP id h71FkgR03996; Fri, 1 Aug 2003 17:46:42 +0200 Message-ID: <006b01c35844$739ec030$32add6c2@mm.eutelsat.org> From: "Mendola Gaetano" To: Cc: "\"HansH\"" References: <00c101c35074$1e5f5b20$152aa8c0@GMENDOLA2> Subject: Re: Wrong plan or what ? Date: Fri, 1 Aug 2003 17:49:11 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/26 X-Sequence-Number: 9749 ""HansH"" > In response to "Mendola Gaetano": > > I'm running Postgres7.3.3 and I'm performing this simple select: > > Looking at your fast three step plan > > SELECT id_class from class_default where id_provider = 39; > > SELECT id_user from user_data where id_class in ( 48 ); > > SELECT * from user_logs where id_user in ( > > 10943, 10942, 10934, 10927, 10910, 10909 ); > I'ld stem for reordering the from and where clauses alike: > select * > from > class_default cd, > user_data ud, > user_logs ul > where > cd.id_provider = 39 and > ud.id_class = cd.id_class and > ul.id_user = ud.id_user; still wrong: Hash Join (cost=267.10..32994.34 rows=41881 width=264) (actual time=6620.17..6847.20 rows=94 loops=1) Hash Cond: ("outer".id_user = "inner".id_user) -> Seq Scan on user_logs ul (cost=0.00..25712.15 rows=1298315 width=48) (actual time=0.01..5381.69 rows=1298351 loops=1) -> Hash (cost=266.25..266.25 rows=339 width=216) (actual time=0.89..0.89 rows=0 loops=1) -> Nested Loop (cost=0.00..266.25 rows=339 width=216) (actual time=0.16..0.83 rows=21 loops=1) -> Seq Scan on class_default cd (cost=0.00..1.39 rows=1 width=55) (actual time=0.08..0.09 rows=1 loops=1) Filter: (id_provider = 39) -> Index Scan using idx_user_data_class on user_data ud (cost=0.00..260.00 rows=389 width=161) (actual time=0.06..0.40 rows=21 loops=1) Index Cond: (ud.id_class = "outer".id_class) Total runtime: 6847.60 msec (10 rows) the returned are 94. > Personally I dislike implied joins and rather go for _about_ this: > select * > from > ( class_default cd > LEFT JOIN user_data ud ON ud.id_class = cd.id_class ) > LEFT JOIN user_logs ul ON ul.id_user = ud.id_user, > where > cd.id_provider = 39; worst: Merge Join (cost=280.48..55717.14 rows=41881 width=264) (actual time=18113.64..18182.94 rows=105 loops=1) Merge Cond: ("outer".id_user = "inner".id_user) -> Index Scan using idx_user_user_logs on user_logs ul (cost=0.00..51665.66 rows=1298315 width=48) (actual time=10.78..15459.37 rows=1298354 loops=1) -> Sort (cost=280.48..281.33 rows=339 width=216) (actual time=1.11..1.20 rows=105 loops=1) Sort Key: ud.id_user -> Nested Loop (cost=0.00..266.25 rows=339 width=216) (actual time=0.14..0.82 rows=21 loops=1) -> Seq Scan on class_default cd (cost=0.00..1.39 rows=1 width=55) (actual time=0.07..0.07 rows=1 loops=1) Filter: (id_provider = 39) -> Index Scan using idx_user_data_class on user_data ud (cost=0.00..260.00 rows=389 width=161) (actual time=0.05..0.39 rows=21 loops=1) Index Cond: (ud.id_class = "outer".id_class) Total runtime: 18185.61 msec :-( thank you anyway. Gaetano From pgsql-performance-owner@postgresql.org Fri Aug 1 13:08:40 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 6D192D1C7F3 for ; Fri, 1 Aug 2003 16:06:50 +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 53459-08 for ; Fri, 1 Aug 2003 13:05:38 -0300 (ADT) Received: from mail1.acecape.com (mail1.acecape.com [66.114.74.12]) by svr1.postgresql.org (Postfix) with ESMTP id 6DCF5D1C952 for ; Fri, 1 Aug 2003 13:06:44 -0300 (ADT) Received: from p65-147.acedsl.com (p65-147.acedsl.com [66.114.65.147]) by mail1.acecape.com (8.12.9/8.12.9) with ESMTP id h71G6i0H031778 for ; Fri, 1 Aug 2003 12:06:44 -0400 Date: Fri, 1 Aug 2003 12:08:18 -0400 (EDT) From: Francisco Reyes X-X-Sender: fran@zoraida.natserv.net To: PostgreSQL performance Subject: How number of columns affects performance Message-ID: <20030801115257.I92555@zoraida.natserv.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/6 X-Sequence-Number: 2823 If a table which will be heavily used has numerous fields, yet only a handfull of them will be used heavily, would it make sense performance wise to split it? Example Table 1 Field 1 .... Field 100 Table 2 References Field 1 of table1 ..... Table n References Field 1 of table 1 So table 1 basically will be referenced by many tables and most of the time only a handfull of fields of table 1 are needed. Don't have exact numbers, but let's say that more than 60% of queries to table 1 queries only use 20 fields or less. If I split Table 1 then the second table will basically be a 1 to 1 to Table 1. I have this simmilar scenario for two tables. One is close to 1 Million records and the other is about 300,000 records. Programming wise it is much easier to only have one table, but I am just concerned about performance. Most access to these tables will be indexed with some occassional sequential scans. Number of concurrent users now is probably 10 or less. Expect to grow to 20+ concurrent connections. Will this be more of an issue if I had hundreds/thousands of users? From pgsql-performance-owner@postgresql.org Fri Aug 1 13:34: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 A52A2D1C50C for ; Fri, 1 Aug 2003 16:34: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 55583-06 for ; Fri, 1 Aug 2003 13:33:45 -0300 (ADT) Received: from lakemtao03.cox.net (lakemtao03.cox.net [68.1.17.242]) by svr1.postgresql.org (Postfix) with ESMTP id B1CDAD1C4E6 for ; Fri, 1 Aug 2003 13:34:51 -0300 (ADT) Received: from [192.168.1.1] ([68.11.66.83]) by lakemtao03.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030801163449.FJUT23518.lakemtao03.cox.net@[192.168.1.1]> for ; Fri, 1 Aug 2003 12:34:49 -0400 Subject: Re: How number of columns affects performance From: Ron Johnson To: PostgreSQL performance In-Reply-To: <20030801115257.I92555@zoraida.natserv.net> References: <20030801115257.I92555@zoraida.natserv.net> Content-Type: text/plain Message-Id: <1059755687.7508.638.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 01 Aug 2003 11:34:48 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/7 X-Sequence-Number: 2824 On Fri, 2003-08-01 at 11:08, Francisco Reyes wrote: > If a table which will be heavily used has numerous fields, yet only a > handfull of them will be used heavily, would it make sense performance wise to split it? > > Example > Table 1 > Field 1 > .... > Field 100 > > Table 2 > References Field 1 of table1 > ..... > > Table n > References Field 1 of table 1 > > So table 1 basically will be referenced by many tables and most of the > time only a handfull of fields of table 1 are needed. Don't have exact > numbers, but let's say that more than 60% of queries to table 1 queries > only use 20 fields or less. > > If I split Table 1 then the second table will basically be a 1 to 1 to > Table 1. Do all 100 fields *really* all refer to the same *one* entity, with no repeating values, etc? If not, then good design says to split the table. Also, if it's a high-activity table, but you only rarely need fields 60-90, then splitting them out to their own table might be useful (especially if some of those fields are large *CHAR or TEXT). > I have this simmilar scenario for two tables. One is close to 1 Million > records and the other is about 300,000 records. > > Programming wise it is much easier to only have one table, but I am just > concerned about performance. > > Most access to these tables will be indexed with some occassional > sequential scans. Number of concurrent users now is probably 10 or less. > Expect to grow to 20+ concurrent connections. Will this be more of an > issue if I had hundreds/thousands of users? > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) -- +-----------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "I'm not a vegetarian because I love animals, I'm a vegetarian | | because I hate vegetables!" | | unknown | +-----------------------------------------------------------------+ From pgsql-performance-owner@postgresql.org Fri Aug 1 13:51:38 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 AE74FD1C50C for ; Fri, 1 Aug 2003 16:51:37 +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 54479-08 for ; Fri, 1 Aug 2003 13:50:29 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id B21DFD1C4E6 for ; Fri, 1 Aug 2003 13:51: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 h71GpXQ3016389; Fri, 1 Aug 2003 12:51:33 -0400 (EDT) To: Christopher Browne Cc: Stephan Szabo , pgsql-performance@postgresql.org Subject: Re: Views With Unions In-reply-to: <60vfthl6q6.fsf@dev6.int.libertyrms.info> References: <20030801075335.D51229-100000@megazone.bigpanda.com> <60vfthl6q6.fsf@dev6.int.libertyrms.info> Comments: In-reply-to Christopher Browne message dated "Fri, 01 Aug 2003 11:48:01 -0400" Date: Fri, 01 Aug 2003 12:51:33 -0400 Message-ID: <16388.1059756693@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/8 X-Sequence-Number: 2825 Christopher Browne writes: > The DOMAIN case I mentioned the other day had something odd going on > that LOST the type information associated with the domain. Albeit > that was on 7.3, whereas the changes in DOMAIN functionality that make > them meaningfully useful come in 7.4... Domains were a work-in-progress in 7.3, and to some extent still are. Please try to test out 7.4beta and let us know about deficiencies you find. regards, tom lane From pgsql-performance-owner@postgresql.org Fri Aug 1 14:13:24 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id B472FD1C50C for ; Fri, 1 Aug 2003 17:13:21 +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 58327-01 for ; Fri, 1 Aug 2003 14:12:13 -0300 (ADT) Received: from mail1.acecape.com (mail1.acecape.com [66.114.74.12]) by svr1.postgresql.org (Postfix) with ESMTP id 7377AD1C4E6 for ; Fri, 1 Aug 2003 14:13:19 -0300 (ADT) Received: from p65-147.acedsl.com (p65-147.acedsl.com [66.114.65.147]) by mail1.acecape.com (8.12.9/8.12.9) with ESMTP id h71HDJ0H015806; Fri, 1 Aug 2003 13:13:19 -0400 Date: Fri, 1 Aug 2003 13:14:53 -0400 (EDT) From: Francisco J Reyes To: Ron Johnson Cc: PostgreSQL performance Subject: Re: How number of columns affects performance In-Reply-To: <1059755687.7508.638.camel@haggis> Message-ID: <20030801130507.M93127@zoraida.natserv.net> References: <20030801115257.I92555@zoraida.natserv.net> <1059755687.7508.638.camel@haggis> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/9 X-Sequence-Number: 2826 On Fri, 1 Aug 2003, Ron Johnson wrote: > Do all 100 fields *really* all refer to the same *one* entity, > with no repeating values, etc? Yes all fields belong to the same entity. I used 100 as an example it may be something like 60 to 80 fields (there are two tables in question). I don't formally do 3rd normal form, but for the most part I do most of the general concepts of normalization. > If not, then good design says to split the table. The original data was in Foxpro tables and I have made better normalized tables in PostgreSQL. > Also, if it's a high-activity table, but you only rarely need fields > 60-90, then splitting them out to their own table might be useful > (especially if some of those fields are large *CHAR or TEXT). Yes some of the fields are varchars. 5 fields are varchar(22) and 3 longer (35, 58, 70). The total row length is a little over 400 characters in Foxpro. In postgreSQL may be less than 300 (ie Foxpro uses ASCII representation for numbers so to store "1234567" it uses 7 bytes, whereas in PostgreSQL I can just make it an int and use 4 bytes) From pgsql-general-owner@postgresql.org Fri Aug 1 17:13:25 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 7BD4FD1C510 for ; Fri, 1 Aug 2003 17:25:15 +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 57036-08 for ; Fri, 1 Aug 2003 14:24:08 -0300 (ADT) Received: from mail1.acecape.com (mail1.acecape.com [66.114.74.12]) by svr1.postgresql.org (Postfix) with ESMTP id 4EBA3D1C4E6 for ; Fri, 1 Aug 2003 14:25:14 -0300 (ADT) Received: from p65-147.acedsl.com (p65-147.acedsl.com [66.114.65.147]) by mail1.acecape.com (8.12.9/8.12.9) with ESMTP id h71HPC0H018344; Fri, 1 Aug 2003 13:25:12 -0400 Date: Fri, 1 Aug 2003 13:26:47 -0400 (EDT) From: Francisco J Reyes To: Tom Lane Cc: Christopher Browne , Stephan Szabo , pgsql General List Subject: Domains (Was [PERFORM] Views With Unions) In-Reply-To: <16388.1059756693@sss.pgh.pa.us> Message-ID: <20030801131642.Q93127@zoraida.natserv.net> References: <20030801075335.D51229-100000@megazone.bigpanda.com> <60vfthl6q6.fsf@dev6.int.libertyrms.info> <16388.1059756693@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/57 X-Sequence-Number: 46474 On Fri, 1 Aug 2003, Tom Lane wrote: > Domains were a work-in-progress in 7.3, and to some extent still are. > Please try to test out 7.4beta and let us know about deficiencies you > find. Are domains user defined types? That they seem to be based on what I see on the docs. Any drawbacks to using them? Right now I have a new database I am making and wanted some consistency accros some tables. Currently I used inheritance to enforce the consitency since a good number of fields needed to be common among the tables AND the inheritted tables are basically a supperset of the data, so some times I would want to access the inheritted tables and other times the parent/main table. From pgsql-performance-owner@postgresql.org Fri Aug 1 14:32:16 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 D4A03D1C510 for ; Fri, 1 Aug 2003 17:32: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 56361-08 for ; Fri, 1 Aug 2003 14:31:06 -0300 (ADT) Received: from lakemtao02.cox.net (lakemtao02.cox.net [68.1.17.243]) by svr1.postgresql.org (Postfix) with ESMTP id EA5CDD1C4E6 for ; Fri, 1 Aug 2003 14:32:12 -0300 (ADT) Received: from [192.168.1.1] ([68.11.66.83]) by lakemtao02.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030801173213.EBHJ24359.lakemtao02.cox.net@[192.168.1.1]> for ; Fri, 1 Aug 2003 13:32:13 -0400 Subject: Re: How number of columns affects performance From: Ron Johnson To: PostgreSQL performance In-Reply-To: <20030801130507.M93127@zoraida.natserv.net> References: <20030801115257.I92555@zoraida.natserv.net> <1059755687.7508.638.camel@haggis> <20030801130507.M93127@zoraida.natserv.net> Content-Type: text/plain Message-Id: <1059759132.22384.5.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 01 Aug 2003 12:32:13 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/10 X-Sequence-Number: 2827 On Fri, 2003-08-01 at 12:14, Francisco J Reyes wrote: > On Fri, 1 Aug 2003, Ron Johnson wrote: > > > Do all 100 fields *really* all refer to the same *one* entity, > > with no repeating values, etc? > > Yes all fields belong to the same entity. I used 100 as an example it may > be something like 60 to 80 fields (there are two tables in question). I > don't formally do 3rd normal form, but for the most part I do most of > the general concepts of normalization. Woo hoo!! > Yes some of the fields are varchars. 5 fields are varchar(22) and 3 longer > (35, 58, 70). The total row length is a little over 400 characters in > Foxpro. In postgreSQL may be less than 300 (ie Foxpro uses ASCII > representation for numbers so to store "1234567" it uses 7 bytes, whereas > in PostgreSQL I can just make it an int and use 4 bytes) But I'd only split if these big field are rarely used. Note that VARCHAR(xx) removes trailing spaces, so that also is a factor. -- +-----------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "I'm not a vegetarian because I love animals, I'm a vegetarian | | because I hate vegetables!" | | unknown | +-----------------------------------------------------------------+ From pgsql-performance-owner@postgresql.org Fri Aug 1 14:45: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 B0EBAD1C4E6 for ; Fri, 1 Aug 2003 17:45:34 +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 57500-10 for ; Fri, 1 Aug 2003 14:44:26 -0300 (ADT) Received: from davinci.ethosmedia.com (209-128-84-228.bayarea.net [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 9EDC7D1C4BF for ; Fri, 1 Aug 2003 14:45:32 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3368147; Fri, 01 Aug 2003 10:45:53 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Francisco J Reyes , Ron Johnson Subject: Re: How number of columns affects performance Date: Fri, 1 Aug 2003 10:44:03 -0700 User-Agent: KMail/1.4.3 Cc: PostgreSQL performance References: <20030801115257.I92555@zoraida.natserv.net> <1059755687.7508.638.camel@haggis> <20030801130507.M93127@zoraida.natserv.net> In-Reply-To: <20030801130507.M93127@zoraida.natserv.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200308011044.03493.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/11 X-Sequence-Number: 2828 Francisco, > Yes all fields belong to the same entity. I used 100 as an example it may > be something like 60 to 80 fields (there are two tables in question). I > don't formally do 3rd normal form, but for the most part I do most of > the general concepts of normalization. > > > If not, then good design says to split the table. Actually, no, it doesn't. If all 60-80 fields are unitary and required characteristics of the row-entity, normalization says keep them in one table. The only time NF would recommend splitting the table is for fields which are frequenly NULL for reasons other than missing data entry. For those, you'd create a child table. Although while this is good 4NF, it's impractical in PostgreSQL, where queries with several LEFT OUTER JOINs tend to be very slow indeed. My attitude toward these normalization vs. performance issues is consistenly the same: First, verify that you have a problem. That is, build the database with everything in one table (or with child tables for Nullable fields, as above) and try to run your application. If performance is appalling, *then* take denormalization steps to improve it. I'm frequently distressed by the number of developers who make questionable design decisions "for performance reasons" without every verifying that they were, in fact, improving performance ... -- Josh Berkus Aglio Database Solutions San Francisco From pgsql-general-owner@postgresql.org Fri Aug 1 17:21:00 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id E0B97D1C92D; Fri, 1 Aug 2003 17:56: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 58951-04; Fri, 1 Aug 2003 14:55:48 -0300 (ADT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by svr1.postgresql.org (Postfix) with ESMTP id 22CD3D1C7F3; Fri, 1 Aug 2003 14:56:54 -0300 (ADT) Received: from ibm-a.pdx.osdl.net (ibm-a.pdx.osdl.net [172.20.1.50]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h71HuoI06633; Fri, 1 Aug 2003 10:56:50 -0700 Subject: OSDL Database Test Suite 3 is available on PostgreSQL From: Jenny Zhang To: pgsql-performance@postgresql.org, pgsql-general@postgresql.org Cc: osdldbt-general@lists.sourceforge.net Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.5 Date: 01 Aug 2003 11:04:10 -0700 Message-Id: <1059761051.1535.396.camel@ibm-a> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/60 X-Sequence-Number: 46477 OSDL has ported OSDL Database Test Suite 3(OSDL-DBT3) to PostgreSQL. It drives the database with an ad-hoc decision support workload. It helps database developers and users to identify database performance issues. OSDL-DBT3 is derived from TPC-H benchmark. TPC-H is an ad-hoc decision support benchmark. It has 22 complicated queries doing a lot of table/index scanning, sorting and grouping by. Details about TPC-H can be found at: http://www.tpc.org/tpch/ Though OSDL-DBT3 is based on TPC-H, it deviates from TPC-H significantly. It skipped many of the requirements for audit purpose, as well as added flexibility. OSDL-DBT3 performance test results are not comparable to TPC-H results. OSDL-DBT3 tarball can be downloaded from: http://sourceforge.net/projects/osdldbt/ The source can be downloaded from source forge cvs tree and osdl bk tree http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/osdldbt/dbt3/ bk://developer.osdl.org/dbt3 OSDL-DBT3 is also implemented on OSDL Scalable Test Platform(STP). The platform provides a framework where users run a set of performance and scalability tests on various hardware platforms. Currently, OSDL-DBT3 is running against PostgreSQL 7.3.3 only. We plan to improve it so that it can run against PostgreSQL patches. To find more information about STP, visit: http://www.osdl.org/stp/. A sample OSDL-DBT3 test result report can be found at: http://khack.osdl.org/stp/276912/ Your comments are welcome, Regards, Jenny -- Jenny Zhang Open Source Development Lab Inc 12725 SW Millikan Way Suite 400 Beaverton, OR 97005 (503)626-2455 ext 31 From pgsql-general-owner@postgresql.org Fri Aug 1 15:59:18 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 12104D1C4E6; Fri, 1 Aug 2003 18:59:15 +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 62699-05; Fri, 1 Aug 2003 15:58:07 -0300 (ADT) Received: from davinci.ethosmedia.com (209-128-84-228.bayarea.net [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id EB4E5D1C4D5; Fri, 1 Aug 2003 15:59:12 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3368411; Fri, 01 Aug 2003 11:59:34 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Jenny Zhang , pgsql-performance@postgresql.org, pgsql-general@postgresql.org Subject: Re: [PERFORM] OSDL Database Test Suite 3 is available on PostgreSQL Date: Fri, 1 Aug 2003 11:57:44 -0700 User-Agent: KMail/1.4.3 Cc: osdldbt-general@lists.sourceforge.net References: <1059761051.1535.396.camel@ibm-a> In-Reply-To: <1059761051.1535.396.camel@ibm-a> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200308011157.44228.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/54 X-Sequence-Number: 46471 Jenny, > OSDL has ported OSDL Database Test Suite 3(OSDL-DBT3) to PostgreSQL. > It drives the database with an ad-hoc decision support workload. It > helps database developers and users to identify database performance > issues. Way, way, cool! We've been waiting for something like this eagerly. I really look forward to trying it out. Further, OSDL-DBT3 can hopefully serve as the kernel of our internal performance option testing suite. We'll evaluate very soon. Thanks so much for your hard work! -- Josh Berkus PostgreSQL Core Team San Francisco From pgsql-performance-owner@postgresql.org Fri Aug 1 16:19:23 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 C56F0D1C9EC for ; Fri, 1 Aug 2003 19:19:21 +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 65981-02 for ; Fri, 1 Aug 2003 16:18:14 -0300 (ADT) Received: from lakemtao03.cox.net (lakemtao03.cox.net [68.1.17.242]) by svr1.postgresql.org (Postfix) with ESMTP id DAB0DD1C9EE for ; Fri, 1 Aug 2003 16:19:19 -0300 (ADT) Received: from [192.168.1.1] ([68.11.66.83]) by lakemtao03.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030801191922.GYEW23518.lakemtao03.cox.net@[192.168.1.1]> for ; Fri, 1 Aug 2003 15:19:22 -0400 Subject: Re: How number of columns affects performance From: Ron Johnson To: pgsql-performance@postgresql.org In-Reply-To: <200308011044.03493.josh@agliodbs.com> References: <20030801115257.I92555@zoraida.natserv.net> <1059755687.7508.638.camel@haggis> <20030801130507.M93127@zoraida.natserv.net> <200308011044.03493.josh@agliodbs.com> Content-Type: text/plain Message-Id: <1059765560.22384.67.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 01 Aug 2003 14:19:20 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/14 X-Sequence-Number: 2831 On Fri, 2003-08-01 at 12:44, Josh Berkus wrote: > Francisco, > > > Yes all fields belong to the same entity. I used 100 as an example it may > > be something like 60 to 80 fields (there are two tables in question). I > > don't formally do 3rd normal form, but for the most part I do most of > > the general concepts of normalization. > > > > > If not, then good design says to split the table. > > Actually, no, it doesn't. If all 60-80 fields are unitary and required > characteristics of the row-entity, normalization says keep them in one table. You snipped out too much, because that's exactly what I said... Another way of writing it: only split the table if some of the fields are not unitary to the entity. > The only time NF would recommend splitting the table is for fields which are > frequenly NULL for reasons other than missing data entry. For those, you'd > create a child table. Although while this is good 4NF, it's impractical in > PostgreSQL, where queries with several LEFT OUTER JOINs tend to be very slow > indeed. Good to know. > My attitude toward these normalization vs. performance issues is consistenly > the same: First, verify that you have a problem. That is, build the > database with everything in one table (or with child tables for Nullable > fields, as above) and try to run your application. If performance is > appalling, *then* take denormalization steps to improve it. The OP was not talking about denormalizing ... It was: will vertically partitioning a table increase performance. And the answer is "sometimes", -- +-----------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "I'm not a vegetarian because I love animals, I'm a vegetarian | | because I hate vegetables!" | | unknown | +-----------------------------------------------------------------+ From pgsql-performance-owner@postgresql.org Fri Aug 1 16:23:15 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 A72F6D1C9EC for ; Fri, 1 Aug 2003 19:23: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 66782-01 for ; Fri, 1 Aug 2003 16:22:06 -0300 (ADT) Received: from davinci.ethosmedia.com (209-128-84-228.bayarea.net [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id B4318D1C9ED for ; Fri, 1 Aug 2003 16:23:11 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3368496; Fri, 01 Aug 2003 12:23:33 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Ron Johnson , pgsql-performance@postgresql.org Subject: Re: How number of columns affects performance Date: Fri, 1 Aug 2003 12:21:43 -0700 User-Agent: KMail/1.4.3 References: <20030801115257.I92555@zoraida.natserv.net> <200308011044.03493.josh@agliodbs.com> <1059765560.22384.67.camel@haggis> In-Reply-To: <1059765560.22384.67.camel@haggis> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200308011221.43159.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/15 X-Sequence-Number: 2832 Ron, > You snipped out too much, because that's exactly what I said... > Another way of writing it: only split the table if some of the fields > are not unitary to the entity. Sorry! No offense meant. -- Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Fri Aug 1 17:54:36 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 675DED1C50C for ; Fri, 1 Aug 2003 20:54: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 70710-05 for ; Fri, 1 Aug 2003 17:53:28 -0300 (ADT) Received: from mail1.acecape.com (mail1.acecape.com [66.114.74.12]) by svr1.postgresql.org (Postfix) with ESMTP id 4778DD1C4BD for ; Fri, 1 Aug 2003 17:54:33 -0300 (ADT) Received: from p65-147.acedsl.com (p65-147.acedsl.com [66.114.65.147]) by mail1.acecape.com (8.12.9/8.12.9) with ESMTP id h71KsW0H016077; Fri, 1 Aug 2003 16:54:32 -0400 Date: Fri, 1 Aug 2003 16:56:08 -0400 (EDT) From: Francisco J Reyes To: Josh Berkus Cc: Ron Johnson , PostgreSQL performance Subject: Re: How number of columns affects performance In-Reply-To: <200308011044.03493.josh@agliodbs.com> Message-ID: <20030801163346.V49062@zoraida.natserv.net> References: <20030801115257.I92555@zoraida.natserv.net> <1059755687.7508.638.camel@haggis> <20030801130507.M93127@zoraida.natserv.net> <200308011044.03493.josh@agliodbs.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/16 X-Sequence-Number: 2833 On Fri, 1 Aug 2003, Josh Berkus wrote: > My attitude toward these normalization vs. performance issues is consistenly > the same: First, verify that you have a problem. That is, build the > database with everything in one table (or with child tables for Nullable > fields, as above) and try to run your application. If performance is > appalling, *then* take denormalization steps to improve it. I think I understand your point, however it would be very laborious after you do all development to find out you need to de-normalize. On your experience at which point it would actually help to do this de-normalization in PostgreSQL? I know there are numerous factors ,but any feedback based on previous experiences would help. Right now the work I am doing is only for company internal use. If I was to ever do work that outside users would have access to then I would be looking at 100+ concurrent users. From pgsql-performance-owner@postgresql.org Fri Aug 1 18:17:31 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 223D6D1C9ED for ; Fri, 1 Aug 2003 21:17:29 +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 70665-09 for ; Fri, 1 Aug 2003 18:16:22 -0300 (ADT) Received: from claxson.com (mx7.claxson.com [200.32.96.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0F534D1C92D for ; Fri, 1 Aug 2003 18:17:26 -0300 (ADT) content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C35872.4952213A" Subject: I can't wait too much: Total runtime 432478.44 msec X-MIMEOLE: Produced By Microsoft Exchange V6.0.6249.0 Date: Fri, 1 Aug 2003 18:17:17 -0300 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: I can't wait too much: Total runtime 432478.44 msec Thread-Index: AcNYckHRvPJxrmWXRXqaBiKh3GPsIA== From: "Fernando Papa" To: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/17 X-Sequence-Number: 2834 This is a multi-part message in MIME format. ------_=_NextPart_001_01C35872.4952213A Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable =20 Hi all! Really I don't know what happened with this query. I'm running PG 7.3.1 on solaris, vaccumed (full) every nigth. The cardinality of each table was: =20 cont_contenido: 97 rows juegos_config: 40 rows cont_publicacion: 446 rows not huge tables... =20 however, this query took a lot of time to run: Total runtime: 432478.44 msec I made a explain analyze, but really I don't undertand why... =20 esdc=3D> explain analyze SELECT cont_contenido.id_contenido ,cont_contenido.pertenece_premium ,cont_contenido.Titulo_esp as v_sufix=20 ,cont_contenido.url_contenido ,cont_contenido.tipo_acceso ,cont_contenido.id_sbc ,cont_contenido.cant_vistos ,cont_contenido.cant_votos=20 ,cont_contenido.puntaje_total=20 ,cont_contenido.id_contenido_padre=20 ,juegos_config.imagen_tapa_especial=20 ,juegos_config.info_general_esp as info_general=20 ,juegos_config.ayuda=20 ,juegos_config.tips_tricks_esp as tips_tricks=20 ,juegos_config.mod_imagen_tapa_especial=20 ,cont_publicacion.fecha_publicacion as fecha_publicacion=20 ,cont_publicacion.generar_Vainilla=20 FROM=20 cont_contenido=20=20=20 ,juegos_config=20=20=20=20 ,cont_publicacion=20 WHERE=20 cont_contenido.id_instalacion =3D 2 AND cont_contenido.id_sbc =3D 619 AND cont_contenido.id_tipo =3D 2 AND cont_contenido.id_instalacion =3D juegos_config.id_instalacion=20 AND cont_contenido.id_contenido =3D juegos_config.id_contenido=20=20=20= =20=20=20=20=20=20 AND upper(cont_publicacion.generar_Vainilla) =3D 'S' AND cont_publicacion.id_instalacion =3D cont_contenido.id_instalacion=20 AND cont_publicacion.id_contenido =3D cont_contenido.id_contenido=20 AND cont_publicacion.fecha_publicacion =3D (SELECT max(cp1.fecha_publicacion)=20 FROM cont_publicacion cp1=20=20 WHERE cp1.id_instalacion =3D cont_publicacion.id_instalacion=20 AND cp1.id_contenido =3D cont_publicacion.id_contenido AND cp1.generar_vainilla =3D cont_publicacion.generar_vainilla)=20=20=20=20=20 ORDER BY cont_publicacion.fecha_publicacion desc=20 LIMIT 10 OFFSET 0 esdc->; =20 QUERY PLAN ------------------------------------------------------------------------ ------------------------------------------------------------------------ --------- Limit (cost=3D8.72..8.73 rows=3D1 width=3D478) (actual time=3D432473.69..432473.72 rows=3D8 loops=3D1) -> Sort (cost=3D8.72..8.73 rows=3D1 width=3D478) (actual time=3D432473.67..432473.68 rows=3D8 loops=3D1) Sort Key: cont_publicacion.fecha_publicacion -> Merge Join (cost=3D8.69..8.71 rows=3D1 width=3D478) (actual time=3D197393.80..432471.92 rows=3D8 loops=3D1) Merge Cond: (("outer".id_instalacion =3D "inner".id_instalacion) AND ("outer".id_contenido =3D "inner".id_contenido)) -> Nested Loop (cost=3D0.00..281713.36 rows=3D1 width=3D36= 7) (actual time=3D7524.66..432454.11 rows=3D40 loops=3D1) Join Filter: (("inner".id_contenido =3D "outer".id_contenido) AND ("inner".id_instalacion =3D "outer".id_instalacion)) -> Index Scan using jue_conf_pk on juegos_config (cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.39..7.81 rows= =3D40 loops=3D1) -> Seq Scan on cont_publicacion (cost=3D0.00..7042.51 rows=3D1 width=3D35) (actual time=3D23.64..10807.83 rows=3D96 loops=3D40) Filter: ((upper((generar_vainilla)::text) =3D 'S'::text) AND (fecha_publicacion =3D (subplan))) SubPlan -> Aggregate (cost=3D15.79..15.79 rows=3D1 width=3D8) (actual time=3D24.16..24.16 rows=3D1 loops=3D17800) -> Seq Scan on cont_publicacion cp1 (cost=3D0.00..15.79 rows=3D1 width=3D8) (actual time=3D10.14..24.01 rows=3D7 loops=3D17800) Filter: ((id_instalacion =3D $0) AND (id_contenido =3D $1) AND (generar_vainilla =3D $2)) -> Sort (cost=3D8.69..8.70 rows=3D3 width=3D111) (actual time=3D11.14..11.18 rows=3D8 loops=3D1) Sort Key: cont_contenido.id_instalacion, cont_contenido.id_contenido -> Seq Scan on cont_contenido (cost=3D0.00..8.66 rows=3D3 width=3D111) (actual time=3D0.57..8.62 rows=3D8 loops=3D1) Filter: ((id_instalacion =3D 2::numeric) AND (id_sbc =3D 619::numeric) AND (id_tipo =3D 2::numeric)) Total runtime: 432478.44 msec (19 rows) =20 esdc=3D>=20 =20 =20 If I replace the subquery with a fixed date =20 "AND cont_publicacion.fecha_publicacion =3D '17/01/2003'::timestamp" =20 QUERY PLAN ------------------------------------------------------------------------ ------------------------------------------------------------------------ ---------------- Limit (cost=3D8.72..8.73 rows=3D1 width=3D478) (actual time=3D797.26..797= .26 rows=3D0 loops=3D1) -> Sort (cost=3D8.72..8.73 rows=3D1 width=3D478) (actual time=3D797.25..797.25 rows=3D0 loops=3D1) Sort Key: cont_publicacion.fecha_publicacion -> Merge Join (cost=3D8.69..8.71 rows=3D1 width=3D478) (actual time=3D796.45..796.45 rows=3D0 loops=3D1) Merge Cond: (("outer".id_instalacion =3D "inner".id_instalacion) AND ("outer".id_contenido =3D "inner".id_contenido)) -> Nested Loop (cost=3D0.00..644.29 rows=3D1 width=3D367) (actual time=3D796.44..796.44 rows=3D0 loops=3D1) Join Filter: (("inner".id_contenido =3D "outer".id_contenido) AND ("inner".id_instalacion =3D "outer".id_instalacion)) -> Index Scan using jue_conf_pk on juegos_config (cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.23..6.71 rows= =3D40 loops=3D1) -> Seq Scan on cont_publicacion (cost=3D0.00..15.79 rows=3D1 width=3D35) (actual time=3D19.70..19.70 rows=3D0 loops=3D40) Filter: ((upper((generar_vainilla)::text) =3D 'S'::text) AND (fecha_publicacion =3D '17/01/2003 00:00:00'::timestamp without time zone)) -> Sort (cost=3D8.69..8.70 rows=3D3 width=3D111) (never executed) Sort Key: cont_contenido.id_instalacion, cont_contenido.id_contenido -> Seq Scan on cont_contenido (cost=3D0.00..8.66 rows=3D3 width=3D111) (never executed) Filter: ((id_instalacion =3D 2::numeric) AND (id_sbc =3D 619::numeric) AND (id_tipo =3D 2::numeric)) Total runtime: 798.79 msec =20 run very smooth. =20 I have another query similar to this query (include more tables, but have the same subquery) but I don't have any problems. =20 Somebody can help me with this mess? Thanks in advance!!! =20 Fernando.- ------_=_NextPart_001_01C35872.4952213A Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Mensaje
 
Hi=20 all!
Really I = don't know=20 what happened with this query. I'm running PG 7.3.1 on solaris, vaccumed (f= ull)=20 every nigth.
The cardi= nality of=20 each table was:
 
cont_contenido: 97 rows
juegos_config: 40 rows
cont_publicacion: 446 rows
not huge= =20 tables...
 =
however, = this query=20 took a lot of time to run:  Total runtime: 432478.44 msec
I ma= de a=20 explain analyze, but really I don't undertand=20 why...
 
esdc=3D> explain analyze
SELECT
&= nbsp;=20 cont_contenido.id_contenido
 ,cont_contenido.pertenece_premium
&= nbsp;,cont_contenido.Titulo_esp=20 as v_sufix=20
 ,cont_contenido.url_contenido
 ,cont_contenido.tipo_acces= o
 ,cont_contenido.id_sbc
 ,cont_contenido.cant_vistos
&= nbsp;,cont_contenido.cant_votos=20
 ,cont_contenido.puntaje_total=20
 ,cont_contenido.id_contenido_padre=20
 ,juegos_config.imagen_tapa_especial=20
 ,juegos_config.info_general_esp as info_general=20
 ,juegos_config.ayuda
 ,juegos_config.tips_tricks_esp as= =20 tips_tricks
 ,juegos_config.mod_imagen_tapa_especial=20
 ,cont_publicacion.fecha_publicacion as fecha_publicacion=20
 ,cont_publicacion.generar_Vainilla
 FROM=20
 cont_contenido  
 ,juegos_config  &n= bsp;=20
 ,cont_publicacion
WHERE=20
 cont_contenido.id_instalacion      =  =20 =3D 2
 AND=20 cont_contenido.id_sbc         =  =20 =3D 619
 AND=20 cont_contenido.id_tipo         = ; =20 =3D 2
 AND cont_contenido.id_instalacion  =3D=20 juegos_config.id_instalacion
 AND=20 cont_contenido.id_contenido   =3D=20 juegos_config.id_contenido        = =20
 AND upper(cont_publicacion.generar_Vainilla) =3D 'S'
 AND= =20 cont_publicacion.id_instalacion =3D cont_contenido.id_instalacion
 = ;AND=20 cont_publicacion.id_contenido =3D cont_contenido.id_contenido
 AND= =20 cont_publicacion.fecha_publicacion =3D (SELECT max(cp1.fecha_publicacion)= =20
            = ;     =20 FROM cont_publicacion cp1 =20
            = ;     =20 WHERE cp1.id_instalacion =3D cont_publicacion.id_instalacion=20
            = ;       =20 AND cp1.id_contenido =3D cont_publicacion.id_contenido =20
            = ;       =20 AND cp1.generar_vainilla =3D=20 cont_publicacion.generar_vainilla)    
 ORDER= =20 BY  cont_publicacion.fecha_publicacion desc
 LIMIT=20 10
 OFFSET=20 0
esdc->;
         &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;          =20 QUERY=20 PLAN            = ;            &n= bsp;            = ;            &n= bsp;            = ;         =20
-----------------------------------------------------------------------= ---------------------------------------------------------------------------= -------
 Limit =20 (cost=3D8.72..8.73 rows=3D1 width=3D478) (actual time=3D432473.69..432473.7= 2 rows=3D8=20 loops=3D1)
   ->  Sort  (cost=3D8.72..8.73 rows= =3D1=20 width=3D478) (actual time=3D432473.67..432473.68 rows=3D8=20 loops=3D1)
         Sort Key:=20 cont_publicacion.fecha_publicacion
      &= nbsp; =20 ->  Merge Join  (cost=3D8.69..8.71 rows=3D1 width=3D478) (actu= al=20 time=3D197393.80..432471.92 rows=3D8=20 loops=3D1)
          &= nbsp;   =20 Merge Cond: (("outer".id_instalacion =3D "inner".id_instalacion) AND=20 ("outer".id_contenido =3D=20 "inner".id_contenido))
        &= nbsp;     =20 ->  Nested Loop  (cost=3D0.00..281713.36 rows=3D1 width=3D367)= (actual=20 time=3D7524.66..432454.11 rows=3D40=20 loops=3D1)
          &= nbsp;         =20 Join Filter: (("inner".id_contenido =3D "outer".id_contenido) AND=20 ("inner".id_instalacion =3D=20 "outer".id_instalacion))
        = ;            = =20 ->  Index Scan using jue_conf_pk on juegos_config =20 (cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.39..7.81 rows= =3D40=20 loops=3D1)
          &= nbsp;         =20 ->  Seq Scan on cont_publicacion  (cost=3D0.00..7042.51 rows= =3D1=20 width=3D35) (actual time=3D23.64..10807.83 rows=3D96=20 loops=3D40)
          =             &nb= sp;   =20 Filter: ((upper((generar_vainilla)::text) =3D 'S'::text) AND (fecha_publica= cion =3D=20 (subplan)))
          =             &nb= sp;   =20 SubPlan
          &nbs= p;            &= nbsp;    =20 ->  Aggregate  (cost=3D15.79..15.79 rows=3D1 width=3D8) (actua= l=20 time=3D24.16..24.16 rows=3D1=20 loops=3D17800)
         &nb= sp;            =             =20 ->  Seq Scan on cont_publicacion cp1  (cost=3D0.00..15.79 rows= =3D1=20 width=3D8) (actual time=3D10.14..24.01 rows=3D7=20 loops=3D17800)
         &nb= sp;            =             &nb= sp;     =20 Filter: ((id_instalacion =3D $0) AND (id_contenido =3D $1) AND (generar_vai= nilla =3D=20 $2))
           &= nbsp;  =20 ->  Sort  (cost=3D8.69..8.70 rows=3D3 width=3D111) (actual=20 time=3D11.14..11.18 rows=3D8=20 loops=3D1)
          &= nbsp;         =20 Sort Key: cont_contenido.id_instalacion,=20 cont_contenido.id_contenido
       &n= bsp;            = ;=20 ->  Seq Scan on cont_contenido  (cost=3D0.00..8.66 rows=3D3 wi= dth=3D111)=20 (actual time=3D0.57..8.62 rows=3D8=20 loops=3D1)
          &= nbsp;           &nbs= p;   =20 Filter: ((id_instalacion =3D 2::numeric) AND (id_sbc =3D 619::numeric) AND = (id_tipo=20 =3D 2::numeric))
 Total runtime: 432478.44 msec
(19 rows)
=
 
esdc=3D>
 
 

If I replace the subquery with a fixed=20 date
 
"AND=20 cont_publicacion.fecha_publicacion =3D=20 '17/01/2003'::timestamp"
        =             &nb= sp;            =             &nb= sp;            =             &nb= sp;   =20 QUERY=20 PLAN            = ;            &n= bsp;            = ;            &n= bsp;            = ;            = =20
-----------------------------------------------------------------------= ---------------------------------------------------------------------------= --------------
 Limit =20 (cost=3D8.72..8.73 rows=3D1 width=3D478) (actual time=3D797.26..797.26 rows= =3D0=20 loops=3D1)
   ->  Sort  (cost=3D8.72..8.73 rows= =3D1=20 width=3D478) (actual time=3D797.25..797.25 rows=3D0=20 loops=3D1)
         Sort Key:=20 cont_publicacion.fecha_publicacion
      &= nbsp; =20 ->  Merge Join  (cost=3D8.69..8.71 rows=3D1 width=3D478) (actu= al=20 time=3D796.45..796.45 rows=3D0=20 loops=3D1)
          &= nbsp;   =20 Merge Cond: (("outer".id_instalacion =3D "inner".id_instalacion) AND=20 ("outer".id_contenido =3D=20 "inner".id_contenido))
        &= nbsp;     =20 ->  Nested Loop  (cost=3D0.00..644.29 rows=3D1 width=3D367) (a= ctual=20 time=3D796.44..796.44 rows=3D0=20 loops=3D1)
          &= nbsp;         =20 Join Filter: (("inner".id_contenido =3D "outer".id_contenido) AND=20 ("inner".id_instalacion =3D=20 "outer".id_instalacion))
        = ;            = =20 ->  Index Scan using jue_conf_pk on juegos_config =20 (cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.23..6.71 rows= =3D40=20 loops=3D1)
          &= nbsp;         =20 ->  Seq Scan on cont_publicacion  (cost=3D0.00..15.79 rows=3D1= =20 width=3D35) (actual time=3D19.70..19.70 rows=3D0=20 loops=3D40)
          =             &nb= sp;   =20 Filter: ((upper((generar_vainilla)::text) =3D 'S'::text) AND (fecha_publica= cion =3D=20 '17/01/2003 00:00:00'::timestamp without time=20 zone))
           = ;   =20 ->  Sort  (cost=3D8.69..8.70 rows=3D3 width=3D111) (never=20 executed)
          &n= bsp;         =20 Sort Key: cont_contenido.id_instalacion,=20 cont_contenido.id_contenido
       &n= bsp;            = ;=20 ->  Seq Scan on cont_contenido  (cost=3D0.00..8.66 rows=3D3 wi= dth=3D111)=20 (never=20 executed)
          &n= bsp;            = ;   =20 Filter: ((id_instalacion =3D 2::numeric) AND (id_sbc =3D 619::numeric) AND = (id_tipo=20 =3D 2::numeric))
 Total runtime: 798.79 msec
 
run very= =20 smooth.
 
I have an= other query=20 similar to this query (include more tables, but have the same subquery) but= I=20 don't have any problems.
 
Somebody = can help me=20 with this mess? Thanks in advance!!!
 
Fernando.-
=00 ------_=_NextPart_001_01C35872.4952213A-- From pgsql-performance-owner@postgresql.org Fri Aug 1 18:19: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 D460CD1C9F9 for ; Fri, 1 Aug 2003 21:19: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 71975-06 for ; Fri, 1 Aug 2003 18:18:48 -0300 (ADT) Received: from davinci.ethosmedia.com (209-128-84-228.bayarea.net [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id D3916D1C9F5 for ; Fri, 1 Aug 2003 18:19:52 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3368865; Fri, 01 Aug 2003 14:20:15 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Francisco J Reyes Subject: Re: How number of columns affects performance Date: Fri, 1 Aug 2003 14:18:51 -0700 User-Agent: KMail/1.4.3 Cc: Ron Johnson , PostgreSQL performance References: <20030801115257.I92555@zoraida.natserv.net> <200308011044.03493.josh@agliodbs.com> <20030801163346.V49062@zoraida.natserv.net> In-Reply-To: <20030801163346.V49062@zoraida.natserv.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308011418.51572.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/18 X-Sequence-Number: 2835 Francisco, > I think I understand your point, however it would be very laborious after > you do all development to find out you need to de-normalize. Not terribly. Views and Rules are good for this. > On your experience at which point it would actually help to do this > de-normalization in PostgreSQL? I know there are numerous factors ,but any > feedback based on previous experiences would help. My experience? If you're running on good hardware, it's completely=20 unnecessary to vertically partition the table. The only thing I'd do woul= d=20 be to look for columns which are frequently NULL and can be grouped togethe= r,=20 and spin those off into a sub-table. That is, if you have 4 columns which= =20 are generally either all null or all filled, and are all null for 70% of=20 records then those 4 could make a nice child table. --=20 -Josh Berkus ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco From pgsql-performance-owner@postgresql.org Fri Aug 1 18:27:15 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 EBA06D1C50C for ; Fri, 1 Aug 2003 21:27:12 +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 71879-08 for ; Fri, 1 Aug 2003 18:26:06 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id CAD2ED1C4DB for ; Fri, 1 Aug 2003 18:27:10 -0300 (ADT) Received: from dev6.int.libertyrms.com ([10.1.2.212] helo=libertyrms.info) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19ihQb-0003kl-00; Fri, 01 Aug 2003 17:27:09 -0400 Received: by libertyrms.info (Postfix, from userid 1079) id E8875BBAD8; Fri, 1 Aug 2003 17:27:08 -0400 (EDT) To: "Fernando Papa" Cc: pgsql-performance@postgresql.org Subject: Re: I can't wait too much: Total runtime 432478.44 msec From: Christopher Browne Date: Fri, 01 Aug 2003 17:27:08 -0400 Message-ID: <60u191jcgj.fsf@dev6.int.libertyrms.info> User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/19 X-Sequence-Number: 2836 I'd point at the following as being a sterling candidate for being a cause of this being slow... =A0AND cont_publicacion.fecha_publicacion =3D (SELECT max(cp1.fecha_publica= cion)=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 FROM cont_publicacion c= p1=A0=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 WHERE cp1.id_instalacio= n =3D cont_publicacion.id_instalacion=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 AND cp1.id_conten= ido =3D cont_publicacion.id_contenido=A0=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 AND cp1.generar_v= ainilla =3D cont_publicacion.generar_vainilla)=A0=A0=A0=A0=20 May I suggest changing it to: =A0AND cont_publicacion.fecha_publicacion =3D (SELECT cp1.fecha_publicacion =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 FROM cont_publicacion c= p1=A0=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 WHERE cp1.id_instalacio= n =3D cont_publicacion.id_instalacion=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 AND cp1.id_conten= ido =3D cont_publicacion.id_contenido=A0=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 AND cp1.generar_v= ainilla =3D cont_publicacion.generar_vainilla ORDER BY fecha_publicacion LIMIT 1) That would get rid of the aggregate that's sitting deep in the query. --=20 select 'cbbrowne' || '@' || 'libertyrms.info'; Christopher Browne (416) 646 3304 x124 (land) From pgsql-performance-owner@postgresql.org Fri Aug 1 18:33: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 06339D1CA07 for ; Fri, 1 Aug 2003 21:32:56 +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 70608-10 for ; Fri, 1 Aug 2003 18:31:49 -0300 (ADT) Received: from davinci.ethosmedia.com (209-128-84-228.bayarea.net [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 04023D1C94D for ; Fri, 1 Aug 2003 18:32:53 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3368907; Fri, 01 Aug 2003 14:33:16 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Christopher Browne , "Fernando Papa" Subject: Re: I can't wait too much: Total runtime 432478.44 msec Date: Fri, 1 Aug 2003 14:31:52 -0700 User-Agent: KMail/1.4.3 Cc: pgsql-performance@postgresql.org References: <60u191jcgj.fsf@dev6.int.libertyrms.info> In-Reply-To: <60u191jcgj.fsf@dev6.int.libertyrms.info> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308011431.52677.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/20 X-Sequence-Number: 2837 Fernando, > AND cont_publicacion.fecha_publicacion =3D (SELECT max(cp1.fecha_publica= cion)=20 > FROM cont_publicacion cp1=20=20 > WHERE cp1.id_instalacion =3D cont_publicacion.id_instal= acion=20 > AND cp1.id_contenido =3D cont_publicacion.id_contenid= o=20=20 > AND cp1.generar_vainilla =3D=20 cont_publicacion.generar_vainilla)=20=20=20=20=20 Or event changing it to: AND EXISTS (SELECT max(cp1.fecha_publicacion) FROM cont_publicacion cp1 WHERE cp1.id_instalacion =3D cont_publicacion.id_instalacion=20 AND cp1.id_contenido =3D cont_publicacion.id_contenido=20=20 AND cp1.generar_vainilla =3D cont_publicacion.generar_vainilla HAVING max(cp1.fecha_publicacion) =3D cont_publicacion.fecha_publicacion) --=20 -Josh Berkus Aglio Database Solutions San Francisco From pgsql-general-owner@postgresql.org Fri Aug 1 20:56:34 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 4A050D1C918 for ; Fri, 1 Aug 2003 23:56:32 +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 79636-09 for ; Fri, 1 Aug 2003 20:55:26 -0300 (ADT) Received: from lakemtao02.cox.net (lakemtao02.cox.net [68.1.17.243]) by svr1.postgresql.org (Postfix) with ESMTP id 561DBD1C914 for ; Fri, 1 Aug 2003 20:56:30 -0300 (ADT) Received: from [192.168.1.1] ([68.11.66.83]) by lakemtao02.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030801235632.HMVD24359.lakemtao02.cox.net@[192.168.1.1]> for ; Fri, 1 Aug 2003 19:56:32 -0400 Subject: Re: Domains (Was [PERFORM] Views With Unions) From: Ron Johnson To: pgsql General List In-Reply-To: <20030801131642.Q93127@zoraida.natserv.net> References: <20030801075335.D51229-100000@megazone.bigpanda.com> <60vfthl6q6.fsf@dev6.int.libertyrms.info> <16388.1059756693@sss.pgh.pa.us> <20030801131642.Q93127@zoraida.natserv.net> Content-Type: text/plain Message-Id: <1059782193.22384.85.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 01 Aug 2003 18:56:33 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/74 X-Sequence-Number: 46491 On Fri, 2003-08-01 at 12:26, Francisco J Reyes wrote: > On Fri, 1 Aug 2003, Tom Lane wrote: [snip] > accros some tables. Currently I used inheritance to enforce the consitency > since a good number of fields needed to be common among the tables AND the > inheritted tables are basically a supperset of the data, so some times I > would want to access the inheritted tables and other times the parent/main > table. Isn't this when you'd really want child tables, instead? -- +-----------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "I'm not a vegetarian because I love animals, I'm a vegetarian | | because I hate vegetables!" | | unknown | +-----------------------------------------------------------------+ From pgsql-performance-owner@postgresql.org Sat Aug 2 07:37:10 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2ABD1D1C509 for ; Sat, 2 Aug 2003 10:37: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 23070-01 for ; Sat, 2 Aug 2003 07:36:01 -0300 (ADT) Received: from smtp.noos.fr (nan-smtp-08.noos.net [212.198.2.77]) by svr1.postgresql.org (Postfix) with ESMTP id C4555D1C4E1 for ; Sat, 2 Aug 2003 07:37:06 -0300 (ADT) Received: (qmail 22408602 invoked by uid 0); 2 Aug 2003 10:37:07 -0000 Received: from unknown (HELO gmendola) ([212.198.37.110]) (envelope-sender ) by 212.198.2.77 (qmail-ldap-1.03) with SMTP for ; 2 Aug 2003 10:37:07 -0000 Message-ID: <005701c358e1$e4b52af0$10d4a8c0@mm.eutelsat.org> From: "Mendola Gaetano" To: Cc: "\"Fernando Papa\"" References: Subject: Re: I can't wait too much: Total runtime 432478.44 msec Date: Sat, 2 Aug 2003 12:36:12 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=REFERENCES X-Spam-Level: X-Archive-Number: 200308/21 X-Sequence-Number: 2838 From: ""Fernando Papa"" > AND upper(cont_publicacion.generar_Vainilla) = 'S' > Filter: ((upper((generar_vainilla)::text) = 'S'::text) AND (fecha_publicacion = (subplan))) using a functional index on this field should help create index idx_generar_vainilla_ci on cont_publicacion ( upper(generar_Vainilla) ) Regards Gaetano Mendola From pgsql-performance-owner@postgresql.org Sat Aug 2 12:59:58 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id EAAC5D1C9ED for ; Sat, 2 Aug 2003 15:59:57 +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 35626-05 for ; Sat, 2 Aug 2003 12:58:46 -0300 (ADT) Received: from flake.decibel.org (unknown [66.143.173.58]) by svr1.postgresql.org (Postfix) with SMTP id 665EBD1C9EA for ; Sat, 2 Aug 2003 12:59:55 -0300 (ADT) Received: (qmail 9205 invoked by uid 1001); 2 Aug 2003 15:59:54 -0000 Date: Sat, 2 Aug 2003 10:59:54 -0500 From: "Jim C. Nasby" To: pgsql-performance@postgresql.org Subject: Re: Odd explain estimate Message-ID: <20030802155954.GK55392@nasby.net> References: <20030731195145.GD55392@nasby.net> <20030731205921.GF16230@libertyrms.info> <20030731225959.GH55392@nasby.net> <20030801121612.GD18200@libertyrms.info> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030801121612.GD18200@libertyrms.info> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.8-RELEASE i386 X-Distributed: Join the Effort! http://www.distributed.net X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/22 X-Sequence-Number: 2839 On Fri, Aug 01, 2003 at 08:16:12AM -0400, Andrew Sullivan wrote: > On Thu, Jul 31, 2003 at 05:59:59PM -0500, Jim C. Nasby wrote: > > > > Well, if I don't do this it wants to seqscan a table that occupies 350k > > pages, instead of pulling a couple thousand rows. I started running it > > with the seqscan and it's already taken way longer than it does if I > > disable seqscan. > > That was indeed the question. > > If it uses a seqscan when it ought not to do, then there's something > wrong with the statistics, or you haven't vacuum analysed correctly, > or your table needs vacuum full (is it really 350k pages, or is that > mostly dead space?), &c. -- all the usual bad-seqscan candidates. > > enable_seqscan=off is probably not a good strategy for any moderately > complicated query. If the planner were perfect, of course, you'd > never need it at all. Set statistics on the ID colum to 1000, vacuum analyze, and it's good to go now. Thanks for your help! -- Jim C. Nasby, Database Consultant jim@nasby.net Member: Triangle Fraternity, Sports Car Club of America Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?" From pgsql-general-owner@postgresql.org Sun Aug 3 13:43:12 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id B4073D1C91F for ; Sat, 2 Aug 2003 18:20:59 +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 42657-05 for ; Sat, 2 Aug 2003 15:19:49 -0300 (ADT) Received: from mail1.acecape.com (mail1.acecape.com [66.114.74.12]) by svr1.postgresql.org (Postfix) with ESMTP id A47A5D1C4E1 for ; Sat, 2 Aug 2003 15:20:57 -0300 (ADT) Received: from p65-147.acedsl.com (p65-147.acedsl.com [66.114.65.147]) by mail1.acecape.com (8.12.9/8.12.9) with ESMTP id h72IKv0H019908; Sat, 2 Aug 2003 14:20:57 -0400 Date: Sat, 2 Aug 2003 14:22:39 -0400 (EDT) From: Francisco J Reyes To: Ron Johnson Cc: pgsql General List Subject: Inheritance vs child tables (Was Domains) In-Reply-To: <1059782193.22384.85.camel@haggis> Message-ID: <20030802140600.G99004@zoraida.natserv.net> References: <20030801075335.D51229-100000@megazone.bigpanda.com> <60vfthl6q6.fsf@dev6.int.libertyrms.info> <16388.1059756693@sss.pgh.pa.us> <20030801131642.Q93127@zoraida.natserv.net> <1059782193.22384.85.camel@haggis> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/125 X-Sequence-Number: 46542 On Fri, 1 Aug 2003, Ron Johnson wrote: > On Fri, 2003-08-01 at 12:26, Francisco J Reyes wrote: > > On Fri, 1 Aug 2003, Tom Lane wrote: > [snip] > > Currently I used inheritance to enforce the consitency > > since a good number of fields needed to be common among the tables AND the > > inheritted tables are basically a supperset of the data, so some times I > > would want to access the inheritted tables and other times the parent/main > > table. > > Isn't this when you'd really want child tables, instead? I think both ways can accomplish the same (if not very simmilar functionality), however I find using inherittance easier. Not really sure about efficiency though. A simple example of the type of design I am planning to do would be: Table A Userid date entered last changed Table B inherited from A(additional fields) person name birthday Table C inherited from A(additional fields) book isbn comment I plan to keep track of how many records a user has so with inherittance it's easy to do this. I can count for the user in Table A and find out how many records he/she has or I can count in each of the inheritted tables and see how many there are for that particular table. Inheritance makes it easier to see everything for a userid or just a particular type of records. From pgsql-general-owner@postgresql.org Sat Aug 2 18:50:35 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id EA5E0D1C995 for ; Sat, 2 Aug 2003 21:50:33 +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 52013-07 for ; Sat, 2 Aug 2003 18:49:24 -0300 (ADT) Received: from lakemtao02.cox.net (lakemtao02.cox.net [68.1.17.243]) by svr1.postgresql.org (Postfix) with ESMTP id D413FD1C9DD for ; Sat, 2 Aug 2003 18:50:31 -0300 (ADT) Received: from [192.168.1.1] ([68.11.66.83]) by lakemtao02.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030802215034.OFBP24359.lakemtao02.cox.net@[192.168.1.1]> for ; Sat, 2 Aug 2003 17:50:34 -0400 Subject: Re: Inheritance vs child tables (Was Domains) From: Ron Johnson To: pgsql General List In-Reply-To: <20030802140600.G99004@zoraida.natserv.net> References: <20030801075335.D51229-100000@megazone.bigpanda.com> <60vfthl6q6.fsf@dev6.int.libertyrms.info> <16388.1059756693@sss.pgh.pa.us> <20030801131642.Q93127@zoraida.natserv.net> <1059782193.22384.85.camel@haggis> <20030802140600.G99004@zoraida.natserv.net> Content-Type: multipart/mixed; boundary="=-h97oAXxMLvPOSyqbgYso" Message-Id: <1059861033.24817.57.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 02 Aug 2003 16:50:33 -0500 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/113 X-Sequence-Number: 46530 --=-h97oAXxMLvPOSyqbgYso Content-Type: text/plain Content-Transfer-Encoding: 7bit On Sat, 2003-08-02 at 13:22, Francisco J Reyes wrote: > On Fri, 1 Aug 2003, Ron Johnson wrote: > > > On Fri, 2003-08-01 at 12:26, Francisco J Reyes wrote: > > > On Fri, 1 Aug 2003, Tom Lane wrote: > > [snip] > > > Currently I used inheritance to enforce the consitency > > > since a good number of fields needed to be common among the tables AND the > > > inheritted tables are basically a supperset of the data, so some times I > > > would want to access the inheritted tables and other times the parent/main > > > table. > > > > Isn't this when you'd really want child tables, instead? > > > I think both ways can accomplish the same (if not very simmilar > functionality), however I find using inherittance easier. > Not really sure about efficiency though. > > A simple example of the type of design I am planning to do would be: > > Table A > Userid > date entered > last changed > > > Table B inherited from A(additional fields) > person name > birthday > > Table C inherited from A(additional fields) > book > isbn > comment > > I plan to keep track of how many records a user has so with inherittance > it's easy to do this. I can count for the user in Table A and find out how > many records he/she has or I can count in each of the inheritted tables > and see how many there are for that particular table. > > Inheritance makes it easier to see everything for a userid or just a > particular type of records. But isn't this what LEFT OUTER JOIN is for? Attached is a zip of the sql and results of what I mean. Plain inner joins or LOJ with "WHERE {B|C}.whatever IS NOT NULL" also pare things dawn. Of course, just yesterday, in a post on -general or -performance, I read that LEFT OUTER JOIN isn't particularly efficient in PG. Also, wouldn't it be odd to have a userid without a name? So, why isn't table_b combined with table_a? But all circumstances are different, I guess... -- +-----------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "I'm not a vegetarian because I love animals, I'm a vegetarian | | because I hate vegetables!" | | unknown | +-----------------------------------------------------------------+ --=-h97oAXxMLvPOSyqbgYso Content-Disposition: attachment; filename=oj_example.zip Content-Type: application/zip; name=oj_example.zip Content-Transfer-Encoding: base64 UEsDBBQAAAAIAEuDAi9Yr/EqzAAAAEECAAANABUAb2pfdGFibGVzLnNxbFVU CQADfSwsP4csLD9VeAQA6APoA61Quw7CMAzc/RWGqUhlgJWPqZzElAiaICcU +vcYyqMVrwUPlnxn+84GJ3GPmcyO+1zRCl4w8wazKwArTJnH41jAIbF4h4/w IXPNgiU4ba9YS+Erf6lL2FHKld1QqIfoXnxD0uGWOyz6lTOcvVc1n1V1EUuK oQrU8JXIfMolGC9546i7t38WLWEdhX0dxlaE13pGsJyep/+wab/ZNDFucRC9 TZ9MGKItiX5KisVSfRkbm0bfORpBnM9xemOm6BOSelXVVr97jOIm/7zyDFBL AwQUAAAACABLhAIvhROVTecAAAC0AgAACgAVAG9qX3BvcC5zcWxVVAkAA14u LD9yLiw/VXgEAOgD6AOt0UFrwyAUB/C7n8JbOpigRk3anDfa7TAYuw9NXtuA NWBfy/btF0s2GhbCGD3J+8P78VdJAx4Q6DZ2B4rWeXivK/I7dFOhrQghbThC RNoG7L5jerb+BEe6EPc0k5znjBdMqmy1aizCT1YyLobsrpp15I2c/NrR/3fU tWPmnQnIjR7oqYOsP8TSGCYk42augxvd5TFCM+wWqQtXf9tN/dc2xs9huW8s mSxnS9ej33jbA113zrV4IWSutCnKJRcyzQ8fNXgPAbPJIvXoEq+Apxjoy5Ym 9LkNuwupldGF0slN8yYg9FACvwBQSwMEFAAAAAgAa4UCL0jWTtp4AAAAywAA AAsAFQBval90ZXN0LnNxbFVUCQADeTAsP4YwLD9VeAQA6APoA4WNsQ7CMBBD 93yFR0BVfgDxLdXd9SoCyR1K0oG/p4WKgQUvtiU/OTTNKh0UTwM4PrQ2t9Go 6FY51X6d6DlAIrvfN0+N7d3FS1HrYa5e0ImzjgRCwK6sc4cvXStunmyfMBhu OFBcmtY04bL+fOLxDyqQX1S+6Dm8AFBLAwQUAAAACACNhQIvoRb9ZnQFAACW FwAADgAVAG9qX3Jlc3VsdHMubGlzVVQJAAO5MCw/tjAsP1V4BADoA+gD5Vdt b9s2EP6uX3FLC9hpLc+S31IXxZamyuq1TTrXw1AgQCDRtM1WFh2JTmLA2G/f UaYkypFsNeuAAhOCyOQdH/LeHp5ISF1BQbier/5fu1A3VhEN2QTShwWCzmgI DWOC6tcUhyGN5XLcMHw3Etdk7gYzfXYZsoUbruErXUN9C3kMxy+NZXTjD/iX pnxZrQFcXI6HZ84A4GzknI4dGJ++fu/Az/BxNPxwOvoM75zPcMd8H8j2tGyx 9BlhAo81ofdQU+e+XuJGNZjyUNmTCGqGDmyQhzZ75TajGTSMeHAduAsaCwS9 Fw3DY6GYT9x1ol5ucsPAI1E2C/KOCOkUnRgQGmWOL3NS/3s5yStzkleruGPh HiJkM/RVPTqOkc8vR87wt4v4TGROyVcUHIwB2RcDj/OvoD3bGLDIC/TZWzfE JAzrlo1O9whfLDBTc0sATBOOlOQIWAQuBgJ3vcXEvePh5Kf/KIR293uFkJSF kNQq7vh9Qrigv87d2YxFg7+fwi0D/uVa0EjIvfMyeSgwXTCnug7IH5YxoT7F Y0xDvkjy4KXxxnnv4D6tAqm3V+pqUhZgJKTvBE+jc+v6KwxW3WpAzW612mar b9qd2mAQV28yd2K2LDWHURxefHJGY7D6VqcP1l5Y+3GwJwdg2zpstzLsiwOw HR22VxW22yqE9XK+/Z3TGr6sF72eadlmq1eIZB1Aknaf4z2joPryoK1OIZR9 AEra+tYNw7XCQuts0z4pxGoXYpFclMdzCm+55zERA9rtTrfXP3nRsmw5du4J 9X1kmFoeuXMAWRo8omIVBnA5BbnHOxbM4h26nV633+nKbeR4iMSIQDv4XcQv LD1VbH9RH6kPCZdvJf1mu4l7CtzoI4/ELKSf/ngfk27oEsFuUZOGCxa4ftMA Y7xeUqSSK8KXaySLuYiJYsIipA5vJRgPYvXIUIR7NY8V5tRfIuWIOUhwSb1u MMmUfsmUECDeG/eDCFuK+UPtGUjW2x4KSz+GjeiCEe7L7TnQe0pWKLlZ0XCd LruRopsVE2hG7IpXT3CZT4mAZzv8AeoO2kCu1dmA3uMYpnqem7lnZ6j2t3B1 Rgs4kQxljSkdu4JOW9fpFut0dJ3erk69AyG/Qybf7wZPd4Pe/mwAkr6nxAXP S+xHRkiv6Q1kxKCZdq5aylRFFbxmWVzCuoqqY6PermQY0Q1Tj95abCfTtmID SRNRFvCDWaCFN+MM3RMadeAwZQ7NLw8ZQa7TCAGHig+Muv3AD1eTJLmTchjH XcPRcuXh1d9UwqNYesb91SJQrpAFH//6wCdsyjAPjDJD8ybn2rhN+vWwgYAL CFa+b+wWlxzGykauznKSoeyCaDRIzIn7INDbNU+ElKYtWJEPPKPcBV7sgm/y QBUHFNufryrZmyrz9e+KPdZ7B60/Vx3rOxQRHiBLu3gQBHhq5bq7tGMdOefO yLk4cz4lHk5Flxfw58c3sve7uITTs/EQJ/BP9VrpXJHHSZJ1pX4n0u+J2zeZ 6tb3aRYVhaCwGsujkYUi/+iBSekgi8qOsqEThPzewLsSIfHjY421KT8+4jgm nx/lODshJT94SBWhus1nDfCaz7bz5pPc/QluI+29vFTjbo5ljgtVIF7h8u3P itctDh95HZUOq91apTcypJla8XIrvbczpIp3YOntniE98qo8EFnw6VQAX8lk /8JZkAVadm71gvAe/z/iu7d3A43TMnJTRPIjpsfDFvEq/3GfzxYtXnKYxKsB pCmpVL4lXcbjpJnK51V6QXx7fh1YSoDsLiXp0uq5WZKSWjz/VQ+5d/i8XHR4 eeVML0vwnYwtTOM0jyuXwUOQxzfH+wunrF6+savOymZ/dZUVVUU3pqX3D1BL AQIXAxQAAAAIAEuDAi9Yr/EqzAAAAEECAAANAA0AAAAAAAEAAACkgQAAAABv al90YWJsZXMuc3FsVVQFAAN9LCw/VXgAAFBLAQIXAxQAAAAIAEuEAi+FE5VN 5wAAALQCAAAKAA0AAAAAAAEAAACkgQwBAABval9wb3Auc3FsVVQFAANeLiw/ VXgAAFBLAQIXAxQAAAAIAGuFAi9I1k7aeAAAAMsAAAALAA0AAAAAAAEAAACk gTACAABval90ZXN0LnNxbFVUBQADeTAsP1V4AABQSwECFwMUAAAACACNhQIv oRb9ZnQFAACWFwAADgANAAAAAAABAAAApIHmAgAAb2pfcmVzdWx0cy5saXNV VAUAA7kwLD9VeAAAUEsFBgAAAAAEAAQAHAEAAJsIAAAAAA== --=-h97oAXxMLvPOSyqbgYso-- From pgsql-performance-owner@postgresql.org Sun Aug 3 04:10: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 53219D1C9C7 for ; Sun, 3 Aug 2003 07:10: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 11034-08 for ; Sun, 3 Aug 2003 04:08:50 -0300 (ADT) Received: from lakemtao03.cox.net (lakemtao03.cox.net [68.1.17.242]) by svr1.postgresql.org (Postfix) with ESMTP id 53348D1C9C5 for ; Sun, 3 Aug 2003 04:09:50 -0300 (ADT) Received: from [192.168.1.1] ([68.11.66.83]) by lakemtao03.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030803070951.TRHK23518.lakemtao03.cox.net@[192.168.1.1]> for ; Sun, 3 Aug 2003 03:09:51 -0400 Subject: testing From: Ron Johnson To: PgSQL Performance ML Content-Type: text/plain Message-Id: <1059894590.24818.111.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 03 Aug 2003 02:09:51 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/23 X-Sequence-Number: 2840 -- +-----------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "I'm not a vegetarian because I love animals, I'm a vegetarian | | because I hate vegetables!" | | unknown | +-----------------------------------------------------------------+ From pgsql-general-owner@postgresql.org Sun Aug 3 13:44:52 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D0649D1C4D5 for ; Sun, 3 Aug 2003 14:25: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 33072-10 for ; Sun, 3 Aug 2003 11:24:21 -0300 (ADT) Received: from mail1.acecape.com (mail1.acecape.com [66.114.74.12]) by svr1.postgresql.org (Postfix) with ESMTP id 9FB3CD1C4BF for ; Sun, 3 Aug 2003 11:25:19 -0300 (ADT) Received: from p65-147.acedsl.com (p65-147.acedsl.com [66.114.65.147]) by mail1.acecape.com (8.12.9/8.12.9) with ESMTP id h73EPM0H023829; Sun, 3 Aug 2003 10:25:23 -0400 Date: Sun, 3 Aug 2003 10:27:11 -0400 (EDT) From: Francisco J Reyes To: Ron Johnson Cc: pgsql General List Subject: Re: Inheritance vs child tables (Was Domains) In-Reply-To: <1059861033.24817.57.camel@haggis> Message-ID: <20030803093159.M47689@zoraida.natserv.net> References: <20030801075335.D51229-100000@megazone.bigpanda.com> <60vfthl6q6.fsf@dev6.int.libertyrms.info> <16388.1059756693@sss.pgh.pa.us> <20030801131642.Q93127@zoraida.natserv.net> <1059782193.22384.85.camel@haggis> <20030802140600.G99004@zoraida.natserv.net> <1059861033.24817.57.camel@haggis> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/127 X-Sequence-Number: 46544 On Sat, 2 Aug 2003, Ron Johnson wrote: > > Inheritance makes it easier to see everything for a userid or just a > > particular type of records. > > But isn't this what LEFT OUTER JOIN is for? Yes but the more tables you have the more cumbersome it would become to do with outer joins. Imagine a parent table and 20 children tables. To get a count of all records the user has I either have to do a nasty/ugly union or do 20 counts and then add them (ie doing the separate counts and keeping track of them with a language like PHP) > Of course, just yesterday, in a post on -general or -performance, > I read that LEFT OUTER JOIN isn't particularly efficient in PG. And it's probably worse when many tables are involved. > Also, wouldn't it be odd to have a userid without a name? So, > why isn't table_b combined with table_a? I have a separate table with user information. The main reason I thought of inherittance was because I need to do accounting and keep track of how many records a user has for certain type of data or in total. Inheritance makes this really easy. Table A, B and C are not combined because B, C and onward have totally different type of data and they are not one to one. There are times when children tables make more sense like: *person table -person id -name -address *phones -person id -phone type (ie fax, home, work) -area -phone *emails -person id -email type (home, work) -email In my opinion a case like that is best handled with children tables. Specially if there are only a couple of childre tables. On my case I have about 8 inherited tables and what I believe inheritance does for me is: * Easy way to count both a grand total or a table per inherited table. * Easy to work with each inheritted table, which will be very often. * Much simpler queries/reporting From pgsql-general-owner@postgresql.org Mon Aug 4 11:09:58 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 66637D1C9E7 for ; Mon, 4 Aug 2003 13:33: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 13949-05 for ; Mon, 4 Aug 2003 10:32:36 -0300 (ADT) Received: from email02.aon.at (WARSL402PIP7.highway.telekom.at [195.3.96.94]) by svr1.postgresql.org (Postfix) with SMTP id CBFFED1C93E for ; Mon, 4 Aug 2003 10:33:36 -0300 (ADT) Received: (qmail 414456 invoked from network); 4 Aug 2003 13:33:39 -0000 Received: from m154p007.dipool.highway.telekom.at (HELO cantor) ([62.46.9.39]) (envelope-sender ) by qmail2rs.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 4 Aug 2003 13:33:39 -0000 From: Manfred Koizar To: Jenny Zhang Cc: pgsql-performance@postgresql.org, pgsql-general@postgresql.org, osdldbt-general@lists.sourceforge.net Subject: Re: [PERFORM] OSDL Database Test Suite 3 is available on PostgreSQL Date: Mon, 04 Aug 2003 15:33:49 +0200 Message-ID: References: <1059761051.1535.396.camel@ibm-a> In-Reply-To: <1059761051.1535.396.camel@ibm-a> X-Mailer: Forte Agent 1.93/32.576 English (American) 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: 200308/143 X-Sequence-Number: 46560 On 01 Aug 2003 11:04:10 -0700, Jenny Zhang wrote: >A sample OSDL-DBT3 test result report can be found at: >http://khack.osdl.org/stp/276912/ > >Your comments are welcome, | effective_cache_size | 1000 With 4GB of memory this is definitely too low and *can* (note that I don't say *must*) lead the planner to wrong decisions. | shared_buffers | 15200 ... looks reasonable. Did you test with other values? | sort_mem | 524288 This is a bit high, IMHO, but might be ok given that DBT3 is not run with many concurrent sessions (right?). http://khack.osdl.org/stp/276912/results/plot/vmstat_swap.png shows some swapping activity towards the end of the run which could be caused by a too high sort_mem setting. Servus Manfred From pgsql-performance-owner@postgresql.org Mon Aug 4 11:15:49 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 4F38FD1C4E0 for ; Mon, 4 Aug 2003 14:01:51 +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 14442-05 for ; Mon, 4 Aug 2003 11:00:39 -0300 (ADT) Received: from claxson.com (unknown [200.32.96.144]) by svr1.postgresql.org (Postfix) with ESMTP id E6539D1C9DB for ; Mon, 4 Aug 2003 11:01:38 -0300 (ADT) X-MIMEOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Re: I can't wait too much: Total runtime 432478.44 msec Date: Mon, 4 Aug 2003 11:01:41 -0300 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PERFORM] I can't wait too much: Total runtime 432478.44 msec Thread-Index: AcNYc6x5l3i1iy2eT6qLNjc5/LeQqgCHOwzQ From: "Fernando Papa" To: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/26 X-Sequence-Number: 2843 Sorry Chris... a little slower... esdc=3D> EXPLAIN ANALYZE=20 SELECT cont_contenido.id_contenido ,cont_contenido.pertenece_premium ,cont_contenido.Titulo_esp as v_sufix=20 ,cont_contenido.url_contenido ,cont_contenido.tipo_acceso ,cont_contenido.id_sbc ,cont_contenido.cant_vistos ,cont_contenido.cant_votos=20 ,cont_contenido.puntaje_total=20 ,cont_contenido.id_contenido_padre=20 ,juegos_config.imagen_tapa_especial=20 ,juegos_config.info_general_esp as info_general=20 ,juegos_config.ayuda=20 ,juegos_config.tips_tricks_esp as tips_tricks=20 ,juegos_config.mod_imagen_tapa_especial=20 ,cont_publicacion.fecha_publicacion as fecha_publicacion=20 ,cont_publicacion.generar_Vainilla=20 FROM=20 cont_contenido=20=20=20 ,juegos_config=20=20=20=20 ,cont_publicacion=20 WHERE=20 cont_contenido.id_instalacion =3D 2 AND cont_contenido.id_sbc =3D 619 AND cont_contenido.id_tipo =3D 2 AND cont_contenido.id_instalacion =3D juegos_config.id_instalacion=20 AND cont_contenido.id_contenido =3D juegos_config.id_contenido=20=20=20 AND upper(cont_publicacion.generar_Vainilla) =3D 'S' AND cont_publicacion.id_instalacion =3D cont_contenido.id_instalacion=20 AND cont_publicacion.id_contenido =3D cont_contenido.id_contenido=20 AND cont_publicacion.fecha_publicacion =3D (SELECT cp1.fecha_publicacion FROM cont_publicacion cp1 WHERE cp1.id_instalacion =3D cont_publicacion.id_instalacion AND cp1.id_contenido =3D cont_publicacion.id_contenido AND cp1.generar_vainilla =3D cont_publicacion.generar_vainilla ORDER BY fecha_publicacion LIMIT 1) ORDER BY cont_publicacion.fecha_publicacion desc=20 LIMIT 10 OFFSET 0 ; Q= UERY PLAN=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= --------- Limit (cost=3D9.75..9.76 rows=3D1 width=3D479) (actual time=3D465085.25..= 465085.27 rows=3D8 loops=3D1) -> Sort (cost=3D9.75..9.76 rows=3D1 width=3D479) (actual time=3D465085= .23..465085.24 rows=3D8 loops=3D1) Sort Key: cont_publicacion.fecha_publicacion -> Merge Join (cost=3D9.73..9.74 rows=3D1 width=3D479) (actual t= ime=3D210743.83..465083.31 rows=3D8 loops=3D1) Merge Cond: (("outer".id_instalacion =3D "inner".id_instalac= ion) AND ("outer".id_contenido =3D "inner".id_contenido)) -> Nested Loop (cost=3D0.00..284756.79 rows=3D1 width=3D36= 7) (actual time=3D8319.87..464981.68 rows=3D40 loops=3D1) Join Filter: (("inner".id_contenido =3D "outer".id_con= tenido) AND ("inner".id_instalacion =3D "outer".id_instalacion)) -> Index Scan using jue_conf_pk on juegos_config (co= st=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D52.93..142.31 rows= =3D40 loops=3D1) -> Seq Scan on cont_publicacion (cost=3D0.00..7118.6= 0 rows=3D1 width=3D35) (actual time=3D51.79..11617.12 rows=3D97 loops=3D40) Filter: ((upper((generar_vainilla)::text) =3D 'S= '::text) AND (fecha_publicacion =3D (subplan))) SubPlan -> Limit (cost=3D15.85..15.85 rows=3D1 width= =3D8) (actual time=3D25.86..25.86 rows=3D1 loops=3D17880) -> Sort (cost=3D15.85..15.86 rows=3D1 = width=3D8) (actual time=3D25.82..25.82 rows=3D2 loops=3D17880) Sort Key: fecha_publicacion -> Seq Scan on cont_publicacion c= p1 (cost=3D0.00..15.84 rows=3D1 width=3D8) (actual time=3D10.68..25.32 row= s=3D7 loops=3D17880) Filter: ((id_instalacion =3D= $0) AND (id_contenido =3D $1) AND (generar_vainilla =3D $2)) -> Sort (cost=3D9.73..9.74 rows=3D3 width=3D112) (actual t= ime=3D94.91..94.93 rows=3D8 loops=3D1) Sort Key: cont_contenido.id_instalacion, cont_contenid= o.id_contenido -> Seq Scan on cont_contenido (cost=3D0.00..9.70 row= s=3D3 width=3D112) (actual time=3D21.70..92.96 rows=3D8 loops=3D1) Filter: ((id_instalacion =3D 2::numeric) AND (id= _sbc =3D 619::numeric) AND (id_tipo =3D 2::numeric)) Total runtime: 465088.66 msec (21 rows) -----Mensaje original----- De: Christopher Browne [mailto:cbbrowne@libertyrms.info]=20 Enviado el: viernes, 01 de agosto de 2003 18:27 Para: Fernando Papa CC: pgsql-performance@postgresql.org Asunto: Re: [PERFORM] I can't wait too much: Total runtime 432478.44 msec I'd point at the following as being a sterling candidate for being a cause = of this being slow... =A0AND cont_publicacion.fecha_publicacion =3D (SELECT max(cp1.fecha_publica= cion)=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 FROM cont_publicacion c= p1=A0=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 WHERE cp1.id_instalacio= n =3D cont_publicacion.id_instalacion=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 AND cp1.id_conten= ido =3D cont_publicacion.id_contenido=A0=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 AND cp1.generar_v= ainilla =3D cont_publicacion.generar_vainilla)=A0=A0=A0=A0=20 May I suggest changing it to: =A0AND cont_publicacion.fecha_publicacion =3D (SELECT cp1.fecha_publicacion =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 FROM cont_publicacion c= p1=A0=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 WHERE cp1.id_instalacio= n =3D cont_publicacion.id_instalacion=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 AND cp1.id_conten= ido =3D cont_publicacion.id_contenido=A0=20 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 AND cp1.generar_v= ainilla =3D cont_publicacion.generar_vainilla ORDER BY fecha_publicacion LIMIT 1) That would get rid of the aggregate that's sitting deep in the query. --=20 select 'cbbrowne' || '@' || 'libertyrms.info'; Christopher Browne (416) 646 3304 x124 (land) From pgsql-performance-owner@postgresql.org Mon Aug 4 11:14: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 BF13CD1C9EA for ; Mon, 4 Aug 2003 14:10:16 +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 14442-08 for ; Mon, 4 Aug 2003 11:09:04 -0300 (ADT) Received: from email03.aon.at (WARSL402PIP6.highway.telekom.at [195.3.96.93]) by svr1.postgresql.org (Postfix) with SMTP id 6550AD1C4BD for ; Mon, 4 Aug 2003 11:10:05 -0300 (ADT) Received: (qmail 378542 invoked from network); 4 Aug 2003 14:10:08 -0000 Received: from m154p007.dipool.highway.telekom.at (HELO cantor) ([62.46.9.39]) (envelope-sender ) by qmail3rs.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 4 Aug 2003 14:10:08 -0000 From: Manfred Koizar To: "Fernando Papa" Cc: Subject: Re: I can't wait too much: Total runtime 432478.44 msec Date: Mon, 04 Aug 2003 16:10:18 +0200 Message-ID: References: In-Reply-To: X-Mailer: Forte Agent 1.93/32.576 English (American) 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: 200308/25 X-Sequence-Number: 2842 On Fri, 1 Aug 2003 18:17:17 -0300, "Fernando Papa" wrote: > AND cont_publicacion.fecha_publicacion = (SELECT >max(cp1.fecha_publicacion) > FROM cont_publicacion cp1 > WHERE cp1.id_instalacion = >cont_publicacion.id_instalacion > AND cp1.id_contenido = cont_publicacion.id_contenido > > AND cp1.generar_vainilla = >cont_publicacion.generar_vainilla) If certain uniqueness conditions are met, the Postgres specific DISTINCT ON clause could help totally eliminating the subselect: SELECT DISTINCT ON ( cp.id_instalacion, cp.id_contenido, cp.generar_vainilla, cp.fecha_publicacion ) cc.id_contenido ,cc.pertenece_premium ,cc.Titulo_esp as v_sufix ,cc.url_contenido ,cc.tipo_acceso ,cc.id_sbc ,cc.cant_vistos ,cc.cant_votos ,cc.puntaje_total ,cc.id_contenido_padre ,jc.imagen_tapa_especial ,jc.info_general_esp as info_general ,jc.ayuda ,jc.tips_tricks_esp as tips_tricks ,jc.mod_imagen_tapa_especial ,cp.fecha_publicacion as fecha_publicacion ,cp.generar_Vainilla FROM cont_contenido cc ,juegos_config jc ,cont_publicacion cp WHERE cc.id_instalacion = 2 AND cc.id_sbc = 619 AND cc.id_tipo = 2 AND cc.id_instalacion = jc.id_instalacion AND cc.id_contenido = jc.id_contenido AND upper(cp.generar_Vainilla) = 'S' AND cp.id_instalacion = cc.id_instalacion AND cp.id_contenido = cc.id_contenido ORDER BY cp.id_instalacion, cp.id_contenido, cp.generar_vainilla, cp.fecha_publicacion desc However, this doesn't get the result in the original order, so you have to wrap another SELECT ... ORDER BY ... LIMIT around it. Or try to move the subselect into the FROM clause: SELECT cc.id_contenido ,cc.pertenece_premium ,cc.Titulo_esp as v_sufix ,cc.url_contenido ,cc.tipo_acceso ,cc.id_sbc ,cc.cant_vistos ,cc.cant_votos ,cc.puntaje_total ,cc.id_contenido_padre ,jc.imagen_tapa_especial ,jc.info_general_esp as info_general ,jc.ayuda ,jc.tips_tricks_esp as tips_tricks ,jc.mod_imagen_tapa_especial ,cp.fecha_publicacion as fecha_publicacion ,cp.generar_Vainilla FROM cont_contenido cc ,juegos_config jc ,(SELECT DISTINCT ON ( id_instalacion, id_contenido, generar_vainilla, fecha_publicacion ) * FROM cont_publicacion ORDER BY id_instalacion, id_contenido, generar_vainilla, fecha_publicacion desc ) AS cp WHERE cc.id_instalacion = 2 AND cc.id_sbc = 619 AND cc.id_tipo = 2 AND cc.id_instalacion = jc.id_instalacion AND cc.id_contenido = jc.id_contenido AND upper(cp.generar_Vainilla) = 'S' AND cp.id_instalacion = cc.id_instalacion AND cp.id_contenido = cc.id_contenido ORDER BY cp.fecha_publicacion desc LIMIT 10 OFFSET 0 [completely untested] Servus Manfred From pgsql-performance-owner@postgresql.org Mon Aug 4 11:19:57 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 EDF38D1C4E0 for ; Mon, 4 Aug 2003 14:13:52 +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 15870-05 for ; Mon, 4 Aug 2003 11:12:41 -0300 (ADT) Received: from claxson.com (mx7.claxson.com [200.32.96.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2DE6ED1C995 for ; Mon, 4 Aug 2003 11:13:41 -0300 (ADT) X-MIMEOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: I can't wait too much: Total runtime 432478.44 msec Date: Mon, 4 Aug 2003 11:13:43 -0300 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PERFORM] I can't wait too much: Total runtime 432478.44 msec Thread-Index: AcNYdIlxZmNaOOtRT5Kx1waYYCGx6ACHdH2w From: "Fernando Papa" To: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/27 X-Sequence-Number: 2844 Hi Josh... a little worse time: EXPLAIN ANALYZE=20 SELECT cont_contenido.id_contenido ,cont_contenido.pertenece_premium ,cont_contenido.Titulo_esp as v_sufix=20 ,cont_contenido.url_contenido ,cont_contenido.tipo_acceso ,cont_contenido.id_sbc ,cont_contenido.cant_vistos ,cont_contenido.cant_votos=20 ,cont_contenido.puntaje_total=20 ,cont_contenido.id_contenido_padre=20 ,juegos_config.imagen_tapa_especial=20 ,juegos_config.info_general_esp as info_general=20 ,juegos_config.ayuda=20 ,juegos_config.tips_tricks_esp as tips_tricks=20 ,juegos_config.mod_imagen_tapa_especial=20 ,cont_publicacion.fecha_publicacion as fecha_publicacion=20 ,cont_publicacion.generar_Vainilla=20 FROM=20 cont_contenido=20=20=20 ,juegos_config=20=20=20=20 ,cont_publicacion=20 WHERE=20 cont_contenido.id_instalacion =3D 2 AND cont_contenido.id_sbc =3D 619 AND cont_contenido.id_tipo =3D 2 AND cont_contenido.id_instalacion =3D juegos_config.id_instalacion=20 AND cont_contenido.id_contenido =3D juegos_config.id_contenido=20=20=20= =20=20=20=20=20=20 AND upper(cont_publicacion.generar_Vainilla) =3D 'S' AND cont_publicacion.id_instalacion =3D cont_contenido.id_instalacion=20 AND cont_publicacion.id_contenido =3D cont_contenido.id_contenido=20 AND EXISTS (SELECT max(cp1.fecha_publicacion) FROM cont_publicacion cp1 WHERE cp1.id_instalacion =3D cont_publicacion.id_instalacion AND cp1.id_contenido =3D cont_publicacion.id_contenido AND cp1.generar_vainilla =3D cont_publicacion.generar_vainilla HAVING max(cp1.fecha_publicacion) =3D cont_publicacion.fecha_publicacion) ORDER BY cont_publicacion.fecha_publicacion desc=20 LIMIT 10 OFFSET 0 ; =20 QUERY PLAN ------------------------------------------------------------------------ ------------------------------------------------------------------------ --------- Limit (cost=3D9.75..9.76 rows=3D1 width=3D479) (actual time=3D449760.88..449760.91 rows=3D8 loops=3D1) -> Sort (cost=3D9.75..9.76 rows=3D1 width=3D479) (actual time=3D449760.87..449760.88 rows=3D8 loops=3D1) Sort Key: cont_publicacion.fecha_publicacion -> Merge Join (cost=3D9.73..9.74 rows=3D1 width=3D479) (actual time=3D202257.20..449759.00 rows=3D8 loops=3D1) Merge Cond: (("outer".id_instalacion =3D "inner".id_instalacion) AND ("outer".id_contenido =3D "inner".id_contenido)) -> Nested Loop (cost=3D0.00..284556.86 rows=3D1 width=3D36= 7) (actual time=3D7794.28..449741.85 rows=3D40 loops=3D1) Join Filter: (("inner".id_contenido =3D "outer".id_contenido) AND ("inner".id_instalacion =3D "outer".id_instalacion)) -> Index Scan using jue_conf_pk on juegos_config (cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.43..8.12 rows= =3D40 loops=3D1) -> Seq Scan on cont_publicacion (cost=3D0.00..7113.60 rows=3D1 width=3D35) (actual time=3D24.10..11239.67 rows=3D97 loops=3D40) Filter: ((upper((generar_vainilla)::text) =3D 'S'::text) AND (subplan)) SubPlan -> Aggregate (cost=3D15.85..15.85 rows=3D1 width=3D8) (actual time=3D25.03..25.03 rows=3D0 loops=3D17880) Filter: (max(fecha_publicacion) =3D $3) -> Seq Scan on cont_publicacion cp1 (cost=3D0.00..15.84 rows=3D1 width=3D8) (actual time=3D10.51..24.85 rows=3D7 loops=3D17880) Filter: ((id_instalacion =3D $0) AND (id_contenido =3D $1) AND (generar_vainilla =3D $2)) -> Sort (cost=3D9.73..9.74 rows=3D3 width=3D112) (actual time=3D10.49..10.52 rows=3D8 loops=3D1) Sort Key: cont_contenido.id_instalacion, cont_contenido.id_contenido -> Seq Scan on cont_contenido (cost=3D0.00..9.70 rows=3D3 width=3D112) (actual time=3D0.59..8.07 rows=3D8 loops=3D1) Filter: ((id_instalacion =3D 2::numeric) AND (id_sbc =3D 619::numeric) AND (id_tipo =3D 2::numeric)) Total runtime: 449765.69 msec (20 rows) -----Mensaje original----- De: Josh Berkus [mailto:josh@agliodbs.com]=20 Enviado el: viernes, 01 de agosto de 2003 18:32 Para: Christopher Browne; Fernando Papa CC: pgsql-performance@postgresql.org Asunto: Re: [PERFORM] I can't wait too much: Total runtime 432478.44 msec Fernando, > AND cont_publicacion.fecha_publicacion =3D (SELECT max(cp1.fecha_publicacion)=20 > FROM cont_publicacion cp1=20=20 > WHERE cp1.id_instalacion =3D cont_publicacion.id_instalacion=20 > AND cp1.id_contenido =3D cont_publicacion.id_contenido=20=20 > AND cp1.generar_vainilla =3D cont_publicacion.generar_vainilla)=20=20=20=20=20 Or event changing it to: AND EXISTS (SELECT max(cp1.fecha_publicacion) FROM cont_publicacion cp1 WHERE cp1.id_instalacion =3D cont_publicacion.id_instalacion=20 AND cp1.id_contenido =3D cont_publicacion.id_contenido=20=20 AND cp1.generar_vainilla =3D cont_publicacion.generar_vainilla HAVING max(cp1.fecha_publicacion) =3D cont_publicacion.fecha_publicacion) --=20 -Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Mon Aug 4 11:51: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 6CD88D1C995 for ; Mon, 4 Aug 2003 14:51:42 +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 19783-01 for ; Mon, 4 Aug 2003 11:50:30 -0300 (ADT) Received: from claxson.com (mx7.claxson.com [200.32.96.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9D12CD1C9ED for ; Mon, 4 Aug 2003 11:51:30 -0300 (ADT) X-MIMEOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Re: I can't wait too much: Total runtime 432478.44 msec Date: Mon, 4 Aug 2003 11:51:30 -0300 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: I can't wait too much: Total runtime 432478.44 msec Thread-Index: AcNY4gerw6r/R57lQy6j5W0+4aMbhgBtddHA From: "Fernando Papa" To: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/28 X-Sequence-Number: 2845 I create the index, but doesn't help too much: = QUERY PLAN=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20 ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ------------------- Limit (cost=3D9.75..9.76 rows=3D1 width=3D479) (actual time=3D486421.35..= 486421.38 rows=3D8 loops=3D1) -> Sort (cost=3D9.75..9.76 rows=3D1 width=3D479) (actual time=3D486421= .33..486421.34 rows=3D8 loops=3D1) Sort Key: cont_publicacion.fecha_publicacion -> Merge Join (cost=3D9.73..9.74 rows=3D1 width=3D479) (actual t= ime=3D220253.76..486420.35 rows=3D8 loops=3D1) Merge Cond: (("outer".id_instalacion =3D "inner".id_instalac= ion) AND ("outer".id_contenido =3D "inner".id_contenido)) -> Nested Loop (cost=3D0.00..1828.35 rows=3D1 width=3D367)= (actual time=3D8347.78..486405.02 rows=3D40 loops=3D1) Join Filter: (("inner".id_contenido =3D "outer".id_con= tenido) AND ("inner".id_instalacion =3D "outer".id_instalacion)) -> Index Scan using jue_conf_pk on juegos_config (co= st=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.23..6.73 rows=3D40= loops=3D1) -> Index Scan using idx_generar_vainilla_ci on cont_p= ublicacion (cost=3D0.00..45.39 rows=3D1 width=3D35) (actual time=3D56.01..= 12156.48 rows=3D97 loops=3D40) Index Cond: (upper((generar_vainilla)::text) =3D= 'S'::text) Filter: (fecha_publicacion =3D (subplan)) SubPlan -> Aggregate (cost=3D15.84..15.84 rows=3D1 w= idth=3D8) (actual time=3D27.03..27.03 rows=3D1 loops=3D17880) -> Seq Scan on cont_publicacion cp1 (c= ost=3D0.00..15.84 rows=3D1 width=3D8) (actual time=3D11.21..26.86 rows=3D7 = loops=3D17880) Filter: ((id_instalacion =3D $0) A= ND (id_contenido =3D $1) AND (generar_vainilla =3D $2)) -> Sort (cost=3D9.73..9.74 rows=3D3 width=3D112) (actual t= ime=3D9.28..9.32 rows=3D8 loops=3D1) Sort Key: cont_contenido.id_instalacion, cont_contenid= o.id_contenido -> Seq Scan on cont_contenido (cost=3D0.00..9.70 row= s=3D3 width=3D112) (actual time=3D0.47..7.48 rows=3D8 loops=3D1) Filter: ((id_instalacion =3D 2::numeric) AND (id= _sbc =3D 619::numeric) AND (id_tipo =3D 2::numeric)) Total runtime: 486445.19 msec (20 rows) -----Mensaje original----- De: Mendola Gaetano [mailto:mendola@bigfoot.com]=20 Enviado el: s=E1bado, 02 de agosto de 2003 7:36 Para: pgsql-performance@postgresql.org CC: Fernando Papa Asunto: Re: I can't wait too much: Total runtime 432478.44 msec From: ""Fernando Papa"" > AND upper(cont_publicacion.generar_Vainilla) =3D 'S' > Filter: ((upper((generar_vainilla)::text) =3D 'S'::text) AND (fecha_publicacion =3D (subplan))) using a functional index on this field should help create index idx_generar_vainilla_ci on cont_publicacion ( upper(generar_Vainilla) ) Regards Gaetano Mendola From pgsql-performance-owner@postgresql.org Mon Aug 4 12:04:37 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 EF571D1C4E0 for ; Mon, 4 Aug 2003 15:04: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 19254-05 for ; Mon, 4 Aug 2003 12:03:18 -0300 (ADT) Received: from claxson.com (mx7.claxson.com [200.32.96.144]) by svr1.postgresql.org (Postfix) with ESMTP id 43720D1C4BD for ; Mon, 4 Aug 2003 12:02:53 -0300 (ADT) X-MIMEOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C35A99.767BA64A" Subject: Re: I can't wait too much: Total runtime 432478.44 msec Date: Mon, 4 Aug 2003 12:02:46 -0300 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PERFORM] I can't wait too much: Total runtime 432478.44 msec Thread-Index: AcNalvZDOOXXd+TtQsuvYzR/to4BngAAi9Lw From: "Fernando Papa" To: "Volker Helm" Cc: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/29 X-Sequence-Number: 2846 This is a multi-part message in MIME format. ------_=_NextPart_001_01C35A99.767BA64A Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Volker!!! I think you're right. Look at times: = QUERY PLAN=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= --------------------- Limit (cost=3D23.37..23.37 rows=3D1 width=3D487) (actual time=3D2245.61..= 2245.61 rows=3D0 loops=3D1) -> Sort (cost=3D23.37..23.37 rows=3D1 width=3D487) (actual time=3D2245= .60..2245.60 rows=3D0 loops=3D1) Sort Key: cont_publicacion.fecha_publicacion -> Nested Loop (cost=3D23.33..23.36 rows=3D1 width=3D487) (actua= l time=3D2244.10..2244.10 rows=3D0 loops=3D1) Join Filter: ("outer".fecha_publicacion =3D "inner".max_pub) -> Merge Join (cost=3D9.73..9.74 rows=3D1 width=3D479) (ac= tual time=3D918.73..1988.43 rows=3D16 loops=3D1) Merge Cond: (("outer".id_instalacion =3D "inner".id_in= stalacion) AND ("outer".id_contenido =3D "inner".id_contenido)) -> Nested Loop (cost=3D0.00..409.35 rows=3D1 width= =3D367) (actual time=3D35.44..1967.20 rows=3D82 loops=3D1) Join Filter: (("inner".id_contenido =3D "outer".= id_contenido) AND ("inner".id_instalacion =3D "outer".id_instalacion)) -> Index Scan using jue_conf_pk on juegos_confi= g (cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.42..6.73 row= s=3D40 loops=3D1) -> Index Scan using idx_generar_vainilla_ci on = cont_publicacion (cost=3D0.00..9.90 rows=3D2 width=3D35) (actual time=3D0.= 20..35.19 rows=3D447 loops=3D40) Index Cond: (upper((generar_vainilla)::tex= t) =3D 'S'::text) -> Sort (cost=3D9.73..9.74 rows=3D3 width=3D112) (ac= tual time=3D10.42..10.48 rows=3D15 loops=3D1) Sort Key: cont_contenido.id_instalacion, cont_co= ntenido.id_contenido -> Seq Scan on cont_contenido (cost=3D0.00..9.= 70 rows=3D3 width=3D112) (actual time=3D0.57..8.11 rows=3D8 loops=3D1) Filter: ((id_instalacion =3D 2::numeric) A= ND (id_sbc =3D 619::numeric) AND (id_tipo =3D 2::numeric)) -> Subquery Scan a (cost=3D13.60..13.60 rows=3D1 width=3D8= ) (actual time=3D15.89..15.90 rows=3D1 loops=3D16) -> Aggregate (cost=3D13.60..13.60 rows=3D1 width=3D8= ) (actual time=3D15.87..15.88 rows=3D1 loops=3D16) -> Seq Scan on cont_publicacion cp1 (cost=3D0.= 00..12.48 rows=3D448 width=3D8) (actual time=3D0.05..11.62 rows=3D448 loops= =3D16) Total runtime: 2250.92 msec (20 rows) The problem was the subquery, no doubt. =20 -----Mensaje original----- De: Volker Helm [mailto:vhelm@shcom.de]=20 Enviado el: lunes, 04 de agosto de 2003 11:45 Para: Fernando Papa Asunto: AW: [PERFORM] I can't wait too much: Total runtime 432478.44 msec =09 =09 Hi, =09=20 just use the subquery as inline-View an join the tables: =09=20 SELECT cont_contenido.id_contenido ,cont_contenido.pertenece_premium ,cont_contenido.Titulo_esp as v_sufix=20 ,cont_contenido.url_contenido ,cont_contenido.tipo_acceso ,cont_contenido.id_sbc ,cont_contenido.cant_vistos ,cont_contenido.cant_votos=20 ,cont_contenido.puntaje_total=20 ,cont_contenido.id_contenido_padre=20 ,juegos_config.imagen_tapa_especial=20 ,juegos_config.info_general_esp as info_general=20 ,juegos_config.ayuda=20 ,juegos_config.tips_tricks_esp as tips_tricks=20 ,juegos_config.mod_imagen_tapa_especial=20 ,cont_publicacion.fecha_publicacion as fecha_publicacion=20 ,cont_publicacion.generar_Vainilla=20 FROM=20 cont_contenido=20=20=20 ,juegos_config=20=20=20=20 ,cont_publicacion=20 ,(SELECT max(cp1.fecha_publicacion) as max_pub = --change here FROM cont_publicacion cp1) a --change here WHERE=20 cont_contenido.id_instalacion =3D 2 AND cont_contenido.id_sbc =3D 619 AND cont_contenido.id_tipo =3D 2 AND cont_contenido.id_instalacion =3D juegos_config.id_instalacion=20 AND cont_contenido.id_contenido =3D juegos_config.id_contenido=20=20=20= =20=20=20=20=20=20 AND upper(cont_publicacion.generar_Vainilla) =3D 'S' AND cont_publicacion.id_instalacion =3D cont_contenido.id_instalacion=20 AND cont_publicacion.id_contenido =3D cont_contenido.id_contenido=20 AND cont_publicacion.fecha_publicacion =3D a.max_pub = -- change here=20=20=20=20=20 ORDER BY cont_publicacion.fecha_publicacion desc =09=20 hope it helps, =09=20 Volker Helm -----Urspr=FCngliche Nachricht----- Von: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-own= er@postgresql.org]Im Auftrag von Fernando Papa Gesendet: Freitag, 1. August 2003 23:17 An: pgsql-performance@postgresql.org Betreff: [PERFORM] I can't wait too much: Total runtime 432478.44 msec =09=09 =09=09 =09=09=20 Hi all! Really I don't know what happened with this query. I'm running PG 7.3.1 o= n solaris, vaccumed (full) every nigth. The cardinality of each table was: =09=09=20 cont_contenido: 97 rows juegos_config: 40 rows cont_publicacion: 446 rows not huge tables... =09=09=20 however, this query took a lot of time to run: Total runtime: 432478.44 = msec I made a explain analyze, but really I don't undertand why... =09=09=20 esdc=3D> explain analyze SELECT cont_contenido.id_contenido ,cont_contenido.pertenece_premium ,cont_contenido.Titulo_esp as v_sufix=20 ,cont_contenido.url_contenido ,cont_contenido.tipo_acceso ,cont_contenido.id_sbc ,cont_contenido.cant_vistos ,cont_contenido.cant_votos=20 ,cont_contenido.puntaje_total=20 ,cont_contenido.id_contenido_padre=20 ,juegos_config.imagen_tapa_especial=20 ,juegos_config.info_general_esp as info_general=20 ,juegos_config.ayuda=20 ,juegos_config.tips_tricks_esp as tips_tricks=20 ,juegos_config.mod_imagen_tapa_especial=20 ,cont_publicacion.fecha_publicacion as fecha_publicacion=20 ,cont_publicacion.generar_Vainilla=20 FROM=20 cont_contenido=20=20=20 ,juegos_config=20=20=20=20 ,cont_publicacion=20 WHERE=20 cont_contenido.id_instalacion =3D 2 AND cont_contenido.id_sbc =3D 619 AND cont_contenido.id_tipo =3D 2 AND cont_contenido.id_instalacion =3D juegos_config.id_instalacion=20 AND cont_contenido.id_contenido =3D juegos_config.id_contenido=20=20= =20=20=20=20=20=20=20 AND upper(cont_publicacion.generar_Vainilla) =3D 'S' AND cont_publicacion.id_instalacion =3D cont_contenido.id_instalacion=20 AND cont_publicacion.id_contenido =3D cont_contenido.id_contenido=20 AND cont_publicacion.fecha_publicacion =3D (SELECT max(cp1.fecha_publica= cion)=20 FROM cont_publicacion cp1=20=20 WHERE cp1.id_instalacion =3D cont_publicacion.id_instal= acion=20 AND cp1.id_contenido =3D cont_publicacion.id_contenid= o=20=20 AND cp1.generar_vainilla =3D cont_publicacion.generar= _vainilla)=20=20=20=20=20 ORDER BY cont_publicacion.fecha_publicacion desc=20 LIMIT 10 OFFSET 0 esdc->; QU= ERY PLAN=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 -------------------------------------------------------------------------= ---------------------------------------------------------------------------= ----- Limit (cost=3D8.72..8.73 rows=3D1 width=3D478) (actual time=3D432473.69= ..432473.72 rows=3D8 loops=3D1) -> Sort (cost=3D8.72..8.73 rows=3D1 width=3D478) (actual time=3D4324= 73.67..432473.68 rows=3D8 loops=3D1) Sort Key: cont_publicacion.fecha_publicacion -> Merge Join (cost=3D8.69..8.71 rows=3D1 width=3D478) (actual= time=3D197393.80..432471.92 rows=3D8 loops=3D1) Merge Cond: (("outer".id_instalacion =3D "inner".id_instal= acion) AND ("outer".id_contenido =3D "inner".id_contenido)) -> Nested Loop (cost=3D0.00..281713.36 rows=3D1 width=3D= 367) (actual time=3D7524.66..432454.11 rows=3D40 loops=3D1) Join Filter: (("inner".id_contenido =3D "outer".id_c= ontenido) AND ("inner".id_instalacion =3D "outer".id_instalacion)) -> Index Scan using jue_conf_pk on juegos_config (= cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.39..7.81 rows=3D= 40 loops=3D1) -> Seq Scan on cont_publicacion (cost=3D0.00..7042= .51 rows=3D1 width=3D35) (actual time=3D23.64..10807.83 rows=3D96 loops=3D4= 0) Filter: ((upper((generar_vainilla)::text) =3D = 'S'::text) AND (fecha_publicacion =3D (subplan))) SubPlan -> Aggregate (cost=3D15.79..15.79 rows=3D1= width=3D8) (actual time=3D24.16..24.16 rows=3D1 loops=3D17800) -> Seq Scan on cont_publicacion cp1 = (cost=3D0.00..15.79 rows=3D1 width=3D8) (actual time=3D10.14..24.01 rows=3D= 7 loops=3D17800) Filter: ((id_instalacion =3D $0)= AND (id_contenido =3D $1) AND (generar_vainilla =3D $2)) -> Sort (cost=3D8.69..8.70 rows=3D3 width=3D111) (actual= time=3D11.14..11.18 rows=3D8 loops=3D1) Sort Key: cont_contenido.id_instalacion, cont_conten= ido.id_contenido -> Seq Scan on cont_contenido (cost=3D0.00..8.66 r= ows=3D3 width=3D111) (actual time=3D0.57..8.62 rows=3D8 loops=3D1) Filter: ((id_instalacion =3D 2::numeric) AND (= id_sbc =3D 619::numeric) AND (id_tipo =3D 2::numeric)) Total runtime: 432478.44 msec (19 rows) =09=09=20 esdc=3D>=20 =09=09=20 =09=09=20 =09=09 =09=09 If I replace the subquery with a fixed date =09=09=20 "AND cont_publicacion.fecha_publicacion =3D '17/01/2003'::timestamp" =09=09 = QUERY PLAN=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20 -------------------------------------------------------------------------= ---------------------------------------------------------------------------= ------------ Limit (cost=3D8.72..8.73 rows=3D1 width=3D478) (actual time=3D797.26..7= 97.26 rows=3D0 loops=3D1) -> Sort (cost=3D8.72..8.73 rows=3D1 width=3D478) (actual time=3D797.= 25..797.25 rows=3D0 loops=3D1) Sort Key: cont_publicacion.fecha_publicacion -> Merge Join (cost=3D8.69..8.71 rows=3D1 width=3D478) (actual= time=3D796.45..796.45 rows=3D0 loops=3D1) Merge Cond: (("outer".id_instalacion =3D "inner".id_instal= acion) AND ("outer".id_contenido =3D "inner".id_contenido)) -> Nested Loop (cost=3D0.00..644.29 rows=3D1 width=3D367= ) (actual time=3D796.44..796.44 rows=3D0 loops=3D1) Join Filter: (("inner".id_contenido =3D "outer".id_c= ontenido) AND ("inner".id_instalacion =3D "outer".id_instalacion)) -> Index Scan using jue_conf_pk on juegos_config (= cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.23..6.71 rows=3D= 40 loops=3D1) -> Seq Scan on cont_publicacion (cost=3D0.00..15.7= 9 rows=3D1 width=3D35) (actual time=3D19.70..19.70 rows=3D0 loops=3D40) Filter: ((upper((generar_vainilla)::text) =3D = 'S'::text) AND (fecha_publicacion =3D '17/01/2003 00:00:00'::timestamp with= out time zone)) -> Sort (cost=3D8.69..8.70 rows=3D3 width=3D111) (never = executed) Sort Key: cont_contenido.id_instalacion, cont_conten= ido.id_contenido -> Seq Scan on cont_contenido (cost=3D0.00..8.66 r= ows=3D3 width=3D111) (never executed) Filter: ((id_instalacion =3D 2::numeric) AND (= id_sbc =3D 619::numeric) AND (id_tipo =3D 2::numeric)) Total runtime: 798.79 msec =09=09=20 run very smooth. =09=09=20 I have another query similar to this query (include more tables, but have= the same subquery) but I don't have any problems. =09=09=20 Somebody can help me with this mess? Thanks in advance!!! =09=09=20 Fernando.- ------_=_NextPart_001_01C35A99.767BA64A Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Mensaje
Hi=20 Volker!!! I think you're right. Look at times:
        =             &nb= sp;            =             &nb= sp;            =             &nb= sp;       =20 QUERY=20 PLAN            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;     =20
-----------------------------------------------------------------------= ---------------------------------------------------------------------------= -------------------------
 Limit =20 (cost=3D23.37..23.37 rows=3D1 width=3D487) (actual time=3D2245.61..2245.61 = rows=3D0=20 loops=3D1)
   ->  Sort  (cost=3D23.37..23.37 rows= =3D1=20 width=3D487) (actual time=3D2245.60..2245.60 rows=3D0=20 loops=3D1)
         Sort Key:=20 cont_publicacion.fecha_publicacion
      &= nbsp; =20 ->  Nested Loop  (cost=3D23.33..23.36 rows=3D1 width=3D487) (a= ctual=20 time=3D2244.10..2244.10 rows=3D0=20 loops=3D1)
          &= nbsp;   =20 Join Filter: ("outer".fecha_publicacion =3D=20 "inner".max_pub)
         &= nbsp;    =20 ->  Merge Join  (cost=3D9.73..9.74 rows=3D1 width=3D479) (actu= al=20 time=3D918.73..1988.43 rows=3D16=20 loops=3D1)
          &= nbsp;         =20 Merge Cond: (("outer".id_instalacion =3D "inner".id_instalacion) AND=20 ("outer".id_contenido =3D=20 "inner".id_contenido))
        &= nbsp;           =20 ->  Nested Loop  (cost=3D0.00..409.35 rows=3D1 width=3D367) (a= ctual=20 time=3D35.44..1967.20 rows=3D82=20 loops=3D1)
          &= nbsp;           &nbs= p;   =20 Join Filter: (("inner".id_contenido =3D "outer".id_contenido) AND=20 ("inner".id_instalacion =3D=20 "outer".id_instalacion))
        = ;            &n= bsp;     =20 ->  Index Scan using jue_conf_pk on juegos_config =20 (cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.42..6.73 rows= =3D40=20 loops=3D1)
          &= nbsp;           &nbs= p;   =20 ->  Index Scan using idx_generar_vainilla_ci on cont_publicacion&nb= sp;=20 (cost=3D0.00..9.90 rows=3D2 width=3D35) (actual time=3D0.20..35.19 rows=3D4= 47=20 loops=3D40)
          =             &nb= sp;         =20 Index Cond: (upper((generar_vainilla)::text) =3D=20 'S'::text)
          &= nbsp;         =20 ->  Sort  (cost=3D9.73..9.74 rows=3D3 width=3D112) (actual=20 time=3D10.42..10.48 rows=3D15=20 loops=3D1)
          &= nbsp;           &nbs= p;   =20 Sort Key: cont_contenido.id_instalacion,=20 cont_contenido.id_contenido
       &n= bsp;            = ;      =20 ->  Seq Scan on cont_contenido  (cost=3D0.00..9.70 rows=3D3 wi= dth=3D112)=20 (actual time=3D0.57..8.11 rows=3D8=20 loops=3D1)
          &= nbsp;           &nbs= p;         =20 Filter: ((id_instalacion =3D 2::numeric) AND (id_sbc =3D 619::numeric) AND = (id_tipo=20 =3D=20 2::numeric))
          = ;    =20 ->  Subquery Scan a  (cost=3D13.60..13.60 rows=3D1 width=3D8) = (actual=20 time=3D15.89..15.90 rows=3D1=20 loops=3D16)
          =           =20 ->  Aggregate  (cost=3D13.60..13.60 rows=3D1 width=3D8) (actua= l=20 time=3D15.87..15.88 rows=3D1=20 loops=3D16)
          =             &nb= sp;   =20 ->  Seq Scan on cont_publicacion cp1  (cost=3D0.00..12.48 rows= =3D448=20 width=3D8) (actual time=3D0.05..11.62 rows=3D448 loops=3D16)
 Total= runtime:=20 2250.92 msec
(20 rows)
The=20 problem was the subquery, no doubt.
 
-----Mensaje original-----
De: Volker Helm=20 [mailto:vhelm@shcom.de]
Enviado el: lunes, 04 de agosto de 200= 3=20 11:45
Para: Fernando Papa
Asunto: AW: [PERFORM] I can= 't=20 wait too much: Total runtime 432478.44 msec

Hi,
 
just use the subquery as inline-View an join t= he=20 tables:
 
SELECT
 =20 cont_contenido.id_contenido
 ,cont_contenido.pertenece_premium ,cont_contenido.Titulo_esp=20 as v_sufix=20
 ,cont_contenido.url_contenido
 ,cont_contenido.tipo_acc= eso
 ,cont_contenido.id_sbc
 ,cont_contenido.cant_vistos ,cont_contenido.cant_votos=20
 ,cont_contenido.puntaje_total=20
 ,cont_contenido.id_contenido_padre=20
 ,juegos_config.imagen_tapa_especial=20
 ,juegos_config.info_general_esp as info_general=20
 ,juegos_config.ayuda
 ,juegos_config.tips_tricks_esp a= s=20 tips_tricks
 ,juegos_config.mod_imagen_tapa_especial=20
 ,cont_publicacion.fecha_publicacion as fecha_publicacion=20
 ,cont_publicacion.generar_Vainilla
 FROM=20
 cont_contenido  =20
 ,juegos_config   
 ,cont_publicacion=20
 ,(SELECT max(cp1.fecha_publicacion) as= =20 max_pub           =             &nb= sp;            =     =20 --change=20 here
           = ;      =20 FROM cont_publicacion cp1) a     --change=20 here
WHERE=20
 cont_contenido.id_instalacion     &nbs= p; =20 =3D 2
 AND=20 cont_contenido.id_sbc        &nbs= p; =20 =3D 619
 AND=20 cont_contenido.id_tipo        &nb= sp; =20 =3D 2
 AND cont_contenido.id_instalacion  =3D=20 juegos_config.id_instalacion
 AND=20 cont_contenido.id_contenido   =3D=20 juegos_config.id_contenido        = ;=20
 AND upper(cont_publicacion.generar_Vainilla) =3D 'S'
 A= ND=20 cont_publicacion.id_instalacion =3D cont_contenido.id_instalacion
&nb= sp;AND=20 cont_publicacion.id_contenido =3D cont_contenido.id_contenido
 A= ND=20 cont_publicacion.fecha_publicacion=20 =3D a.max_pub         &= nbsp;           &nbs= p;       =20 --  change here     
 ORDER BY = ;=20 cont_publicacion.fecha_publicacion desc
 
hope it helps,
 
Volker Helm
-----Urspr=FCngliche Nachricht-----
Von:=20 pgsql-performance-owner@postgresql.org=20 [mailto:pgsql-performance-owner@postgresql.org]Im Auftrag von=20 Fernando Papa
Gesendet: Freitag, 1. August 2003=20 23:17
An: pgsql-performance@postgresql.org
Betreff:= =20 [PERFORM] I can't wait too much: Total runtime 432478.44=20 msec

 
Hi=20 all!
Reall= y I don't=20 know what happened with this query. I'm running PG 7.3.1 on solaris,=20 vaccumed (full) every nigth.
The c= ardinality=20 of each table was:
 
cont_contenido: 97 rows
juegos_config: 40 rows
cont_publicacion: 446 rows
not h= uge=20 tables...
 
howev= er, this=20 query took a lot of time to run:  Total runtime: 432478.44=20 msec
I made a explain analyze, but really I don't undertand=20 why...
 
esdc=3D> explain analyze
SELECT<= BR> =20 cont_contenido.id_contenido
 ,cont_contenido.pertenece_premium<= BR> ,cont_contenido.Titulo_esp=20 as v_sufix=20
 ,cont_contenido.url_contenido
 ,cont_contenido.tipo_a= cceso
 ,cont_contenido.id_sbc
 ,cont_contenido.cant_vistos<= BR> ,cont_contenido.cant_votos=20
 ,cont_contenido.puntaje_total=20
 ,cont_contenido.id_contenido_padre=20
 ,juegos_config.imagen_tapa_especial=20
 ,juegos_config.info_general_esp as info_general=20
 ,juegos_config.ayuda
 ,juegos_config.tips_tricks_esp= as=20 tips_tricks
 ,juegos_config.mod_imagen_tapa_especial=20
 ,cont_publicacion.fecha_publicacion as fecha_publicacion=20
 ,cont_publicacion.generar_Vainilla
 FROM=20
 cont_contenido  =20
 ,juegos_config   
 ,cont_publicacion= =20
WHERE=20
 cont_contenido.id_instalacion     &n= bsp; =20 =3D 2
 AND=20 cont_contenido.id_sbc        &n= bsp; =20 =3D 619
 AND=20 cont_contenido.id_tipo        &= nbsp; =20 =3D 2
 AND cont_contenido.id_instalacion  =3D=20 juegos_config.id_instalacion
 AND=20 cont_contenido.id_contenido   =3D=20 juegos_config.id_contenido       &nb= sp;=20
 AND upper(cont_publicacion.generar_Vainilla) =3D 'S'
 = ;AND=20 cont_publicacion.id_instalacion =3D cont_contenido.id_instalacion=20
 AND cont_publicacion.id_contenido =3D cont_contenido.id_conte= nido=20
 AND cont_publicacion.fecha_publicacion =3D (SELECT=20 max(cp1.fecha_publicacion)=20
           &= nbsp;     =20 FROM cont_publicacion cp1 =20
           &= nbsp;     =20 WHERE cp1.id_instalacion =3D cont_publicacion.id_instalacion=20
           &= nbsp;       =20 AND cp1.id_contenido =3D cont_publicacion.id_contenido =20
           &= nbsp;       =20 AND cp1.generar_vainilla =3D=20 cont_publicacion.generar_vainilla)    
 OR= DER=20 BY  cont_publicacion.fecha_publicacion desc
 LIMIT=20 10
 OFFSET=20 0
esdc->;
        &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;           =20 QUERY=20 PLAN           &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;         =20
-------------------------------------------------------------------= ---------------------------------------------------------------------------= -----------
 Limit =20 (cost=3D8.72..8.73 rows=3D1 width=3D478) (actual time=3D432473.69..4324= 73.72 rows=3D8=20 loops=3D1)
   ->  Sort  (cost=3D8.72..8.73 ro= ws=3D1=20 width=3D478) (actual time=3D432473.67..432473.68 rows=3D8=20 loops=3D1)
         Sort Key= :=20 cont_publicacion.fecha_publicacion
     &nb= sp;  =20 ->  Merge Join  (cost=3D8.69..8.71 rows=3D1 width=3D478) (= actual=20 time=3D197393.80..432471.92 rows=3D8=20 loops=3D1)
         &nb= sp;    =20 Merge Cond: (("outer".id_instalacion =3D "inner".id_instalacion) AND=20 ("outer".id_contenido =3D=20 "inner".id_contenido))
       &nb= sp;      =20 ->  Nested Loop  (cost=3D0.00..281713.36 rows=3D1 width=3D= 367)=20 (actual time=3D7524.66..432454.11 rows=3D40=20 loops=3D1)
         &nb= sp;          =20 Join Filter: (("inner".id_contenido =3D "outer".id_contenido) AND=20 ("inner".id_instalacion =3D=20 "outer".id_instalacion))
       &= nbsp;           &nbs= p;=20 ->  Index Scan using jue_conf_pk on juegos_config =20 (cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.39..7.81 ro= ws=3D40=20 loops=3D1)
         &nb= sp;          =20 ->  Seq Scan on cont_publicacion  (cost=3D0.00..7042.51 ro= ws=3D1=20 width=3D35) (actual time=3D23.64..10807.83 rows=3D96=20 loops=3D40)
         &n= bsp;            = ;    =20 Filter: ((upper((generar_vainilla)::text) =3D 'S'::text) AND=20 (fecha_publicacion =3D=20 (subplan)))
         &n= bsp;            = ;    =20 SubPlan
          =             &nb= sp;     =20 ->  Aggregate  (cost=3D15.79..15.79 rows=3D1 width=3D8) (a= ctual=20 time=3D24.16..24.16 rows=3D1=20 loops=3D17800)
         = ;            &n= bsp;            = ;=20 ->  Seq Scan on cont_publicacion cp1  (cost=3D0.00..15.79 = rows=3D1=20 width=3D8) (actual time=3D10.14..24.01 rows=3D7=20 loops=3D17800)
         = ;            &n= bsp;            = ;      =20 Filter: ((id_instalacion =3D $0) AND (id_contenido =3D $1) AND (generar= _vainilla=20 =3D=20 $2))
          &nb= sp;   =20 ->  Sort  (cost=3D8.69..8.70 rows=3D3 width=3D111) (actual= =20 time=3D11.14..11.18 rows=3D8=20 loops=3D1)
         &nb= sp;          =20 Sort Key: cont_contenido.id_instalacion,=20 cont_contenido.id_contenido
      &nbs= p;            &= nbsp;=20 ->  Seq Scan on cont_contenido  (cost=3D0.00..8.66 rows=3D= 3=20 width=3D111) (actual time=3D0.57..8.62 rows=3D8=20 loops=3D1)
         &nb= sp;            =     =20 Filter: ((id_instalacion =3D 2::numeric) AND (id_sbc =3D 619::numeric) = AND=20 (id_tipo =3D 2::numeric))
 Total runtime: 432478.44 msec
(19= =20 rows)
 
esdc=3D>
 
 
<= FONT=20 face=3DArial size=3D2>

If I replace the subquery with a fixed=20 date
 
"AND= =20 cont_publicacion.fecha_publicacion =3D=20 '17/01/2003'::timestamp"
       &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;    =20 QUERY=20 PLAN           &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;=20
-------------------------------------------------------------------= ---------------------------------------------------------------------------= ------------------
 Limit =20 (cost=3D8.72..8.73 rows=3D1 width=3D478) (actual time=3D797.26..797.26 = rows=3D0=20 loops=3D1)
   ->  Sort  (cost=3D8.72..8.73 ro= ws=3D1=20 width=3D478) (actual time=3D797.25..797.25 rows=3D0=20 loops=3D1)
         Sort Key= :=20 cont_publicacion.fecha_publicacion
     &nb= sp;  =20 ->  Merge Join  (cost=3D8.69..8.71 rows=3D1 width=3D478) (= actual=20 time=3D796.45..796.45 rows=3D0=20 loops=3D1)
         &nb= sp;    =20 Merge Cond: (("outer".id_instalacion =3D "inner".id_instalacion) AND=20 ("outer".id_contenido =3D=20 "inner".id_contenido))
       &nb= sp;      =20 ->  Nested Loop  (cost=3D0.00..644.29 rows=3D1 width=3D367= ) (actual=20 time=3D796.44..796.44 rows=3D0=20 loops=3D1)
         &nb= sp;          =20 Join Filter: (("inner".id_contenido =3D "outer".id_contenido) AND=20 ("inner".id_instalacion =3D=20 "outer".id_instalacion))
       &= nbsp;           &nbs= p;=20 ->  Index Scan using jue_conf_pk on juegos_config =20 (cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.23..6.71 ro= ws=3D40=20 loops=3D1)
         &nb= sp;          =20 ->  Seq Scan on cont_publicacion  (cost=3D0.00..15.79 rows= =3D1=20 width=3D35) (actual time=3D19.70..19.70 rows=3D0=20 loops=3D40)
         &n= bsp;            = ;    =20 Filter: ((upper((generar_vainilla)::text) =3D 'S'::text) AND=20 (fecha_publicacion =3D '17/01/2003 00:00:00'::timestamp without time=20 zone))
          &= nbsp;   =20 ->  Sort  (cost=3D8.69..8.70 rows=3D3 width=3D111) (never= =20 executed)
         &nbs= p;          =20 Sort Key: cont_contenido.id_instalacion,=20 cont_contenido.id_contenido
      &nbs= p;            &= nbsp;=20 ->  Seq Scan on cont_contenido  (cost=3D0.00..8.66 rows=3D= 3=20 width=3D111) (never=20 executed)
         &nbs= p;            &= nbsp;   =20 Filter: ((id_instalacion =3D 2::numeric) AND (id_sbc =3D 619::numeric) = AND=20 (id_tipo =3D 2::numeric))
 Total runtime: 798.79=20 msec
 
run v= ery=20 smooth.
 
I hav= e another=20 query similar to this query (include more tables, but have the same=20 subquery) but I don't have any problems.
 
Someb= ody can=20 help me with this mess? Thanks in advance!!!
 
Fernando.-
=00 ------_=_NextPart_001_01C35A99.767BA64A-- From pgsql-performance-owner@postgresql.org Mon Aug 4 12:17:40 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 B9097D1C4E0 for ; Mon, 4 Aug 2003 15:17:32 +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 22707-01 for ; Mon, 4 Aug 2003 12:16:15 -0300 (ADT) Received: from email04.aon.at (WARSL402PIP5.highway.telekom.at [195.3.96.90]) by svr1.postgresql.org (Postfix) with SMTP id EF1CBD1C4BD for ; Mon, 4 Aug 2003 12:17:20 -0300 (ADT) Received: (qmail 530016 invoked from network); 4 Aug 2003 15:16:55 -0000 Received: from m154p007.dipool.highway.telekom.at (HELO cantor) ([62.46.9.39]) (envelope-sender ) by qmail4rs.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 4 Aug 2003 15:16:55 -0000 From: Manfred Koizar To: "Fernando Papa" Cc: "Volker Helm" , Subject: Re: I can't wait too much: Total runtime 432478.44 msec Date: Mon, 04 Aug 2003 17:17:06 +0200 Message-ID: <13usivgqnvs076tgivbo0mubpke841d68v@4ax.com> References: In-Reply-To: X-Mailer: Forte Agent 1.93/32.576 English (American) 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: 200308/30 X-Sequence-Number: 2847 On Mon, 4 Aug 2003 12:02:46 -0300, "Fernando Papa" wrote: > FROM > cont_contenido > ,juegos_config > ,cont_publicacion > ,(SELECT max(cp1.fecha_publicacion) as max_pub --change here > FROM cont_publicacion cp1) a --change here But this calculates the global maximum, not per id_instalacion, id_contenido, and generar_vainilla as in > AND cont_publicacion.fecha_publicacion = (SELECT max(cp1.fecha_publicacion) > FROM cont_publicacion cp1 > WHERE cp1.id_instalacion = cont_publicacion.id_instalacion > AND cp1.id_contenido = cont_publicacion.id_contenido > AND cp1.generar_vainilla = cont_publicacion.generar_vainilla) Servus Manfred From pgsql-performance-owner@postgresql.org Mon Aug 4 12:26: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 7D166D1C9DB for ; Mon, 4 Aug 2003 15:25:50 +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 21237-06 for ; Mon, 4 Aug 2003 12:24:31 -0300 (ADT) Received: from mail-2.zoominternet.net (mail-2.zoominternet.net [63.67.120.22]) by svr1.postgresql.org (Postfix) with SMTP id 3A980D1C7EB for ; Mon, 4 Aug 2003 12:25:37 -0300 (ADT) Received: (qmail 327 invoked from network); 4 Aug 2003 15:25:33 -0000 Received: from acs-24-154-209-142.zoominternet.net (HELO gmod.lajolla) ([24.154.209.142]) (envelope-sender ) by mail-2.zoominternet.net (qmail-ldap-1.03) with SMTP for ; 4 Aug 2003 15:25:33 -0000 Subject: Re: EXTERNAL storage and substring on long strings From: Scott Cain To: PgSQL Performance ML Cc: pgsql-sql@postgresql.org In-Reply-To: <1059686498.7505.558.camel@haggis> References: <1059679600.1429.41.camel@localhost.localdomain> <3F297CBA.1080703@joeconway.com> <1059686498.7505.558.camel@haggis> Content-Type: text/plain Organization: Cold Spring Harbor Lab Message-Id: <1060010735.1433.26.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 04 Aug 2003 11:25:36 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/31 X-Sequence-Number: 2848 Hello, Note: there is a SQL question way at the bottom of this narrative :-) Last week I asked about doing substring operations on very long strings (>10 million characters). I was given a suggestion to use EXTERNAL storage on the column via the ALTER TABLE ... SET STORAGE command. In one test case, the performance of substring actually got worse using EXTERNAL storage. In an effort to find the best way to do this operation, I decided to look at what is my "worst case" scenario: the DNA sequence for human chromosome 1, which is about 250 million characters long (previous strings where about 20 million characters long). I wrote a perl script to do several substring operations over this very long string, with substring lengths varying between 1000 and 40,000 characters spread out over various locations along the string. While EXTENDED storage won in this case, it was a hollow victory: 38 seconds per operation versus 40 seconds, both of which are way too long to for an interactive application. Time for a new method. A suggestion from my boss was to "shred" the DNA into smallish chunks and a column giving offsets from the beginning of the string, so that it can be reassembled when needed. Here is the test table: string=> \d dna Table "public.dna" Column | Type | Modifiers ---------+---------+----------- foffset | integer | pdna | text | Indexes: foffset_idx btree (foffset) In practice, there would also be a foreign key column to give the identifier of the dna. Then I wrote the following function (here's the SQL part promised above): CREATE OR REPLACE FUNCTION dna_string (integer, integer) RETURNS TEXT AS ' DECLARE smin ALIAS FOR $1; smax ALIAS FOR $2; longdna TEXT := ''''; dna_row dna%ROWTYPE; dnastring TEXT; firstchunk INTEGER; lastchunk INTEGER; in_longdnastart INTEGER; in_longdnalen INTEGER; chunksize INTEGER; BEGIN SELECT INTO chunksize min(foffset) FROM dna WHERE foffset>0; firstchunk := chunksize*(smin/chunksize); lastchunk := chunksize*(smax/chunksize); in_longdnastart := smin % chunksize; in_longdnalen := smax - smin + 1; FOR dna_row IN SELECT * FROM dna WHERE foffset >= firstchunk AND foffset <= lastchunk ORDER BY foffset LOOP longdna := longdna || dna_row.pdna; END LOOP; dnastring := substring(longdna FROM in_longdnastart FOR in_longdnalen); RETURN dnastring; END; ' LANGUAGE 'plpgsql'; So here's the question: I've never written a plpgsql function before, so I don't have much experience with it; is there anything obviously wrong with this function, or are there things that could be done better? At least this appears to work and is much faster, completing substring operations like above in about 0.27 secs (that's about two orders of magnitude improvement!) Thanks, Scott -- ------------------------------------------------------------------------ Scott Cain, Ph. D. cain@cshl.org GMOD Coordinator (http://www.gmod.org/) 216-392-3087 Cold Spring Harbor Laboratory From pgsql-performance-owner@postgresql.org Mon Aug 4 12:27:51 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 4CDC2D1C9FD for ; Mon, 4 Aug 2003 15:26:52 +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 20003-10 for ; Mon, 4 Aug 2003 12:25:35 -0300 (ADT) Received: from claxson.com (mx7.claxson.com [200.32.96.144]) by svr1.postgresql.org (Postfix) with ESMTP id AB563D1C9F7 for ; Mon, 4 Aug 2003 12:26:40 -0300 (ADT) X-MIMEOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: I can't wait too much: Total runtime 432478.44 msec Date: Mon, 4 Aug 2003 12:26:38 -0300 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PERFORM] I can't wait too much: Total runtime 432478.44 msec Thread-Index: AcNam4EcVi2lqe3YSkeMDojnvKhWEwAASWlg From: "Fernando Papa" To: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/32 X-Sequence-Number: 2849 Err... you're right... one of us say the same thing when I show the Volker mail... -----Mensaje original----- De: Manfred Koizar [mailto:mkoi-pg@aon.at]=20 Enviado el: lunes, 04 de agosto de 2003 12:17 Para: Fernando Papa CC: Volker Helm; pgsql-performance@postgresql.org Asunto: Re: [PERFORM] I can't wait too much: Total runtime 432478.44 msec On Mon, 4 Aug 2003 12:02:46 -0300, "Fernando Papa" wrote: > FROM=20 > cont_contenido=20=20=20 > ,juegos_config=20=20=20=20 > ,cont_publicacion=20 > ,(SELECT max(cp1.fecha_publicacion) as max_pub --change here > FROM cont_publicacion cp1) a --change here But this calculates the global maximum, not per id_instalacion, id_contenido, and generar_vainilla as in > AND cont_publicacion.fecha_publicacion =3D (SELECT max(cp1.fecha_publicacion)=20 > FROM cont_publicacion cp1=20=20 > WHERE cp1.id_instalacion =3D cont_publicacion.id_instalacion=20 > AND cp1.id_contenido =3D cont_publicacion.id_contenido=20=20 > AND cp1.generar_vainilla =3D cont_publicacion.generar_vainilla)=20=20=20=20=20 Servus Manfred From pgsql-performance-owner@postgresql.org Mon Aug 4 12:57: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 A4A4DD1C9DB; Mon, 4 Aug 2003 15:53:57 +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 24438-06; Mon, 4 Aug 2003 12:52:40 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id B4BABD1C9ED; Mon, 4 Aug 2003 12:53:46 -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 h74FrhSa003575; Mon, 4 Aug 2003 11:53:44 -0400 (EDT) To: Scott Cain Cc: PgSQL Performance ML , pgsql-sql@postgresql.org Subject: Re: [SQL] EXTERNAL storage and substring on long strings In-reply-to: <1060010735.1433.26.camel@localhost.localdomain> References: <1059679600.1429.41.camel@localhost.localdomain> <3F297CBA.1080703@joeconway.com> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> Comments: In-reply-to Scott Cain message dated "04 Aug 2003 11:25:36 -0400" Date: Mon, 04 Aug 2003 11:53:43 -0400 Message-ID: <3574.1060012423@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/33 X-Sequence-Number: 2850 Scott Cain writes: > At least this appears to work and is much faster, completing substring > operations like above in about 0.27 secs (that's about two orders of > magnitude improvement!) I find it really, really hard to believe that a crude reimplementation in plpgsql of the TOAST concept could beat the built-in implementation at all, let alone beat it by two orders of magnitude. Either there's something unrealistic about your testing of the dna_string function, or your original tests are not causing TOAST to be invoked in the expected way, or there's a bug we need to fix. I'd really like to see some profiling of the poor-performing external-storage case, so we can figure out what's going on. regards, tom lane From pgsql-performance-owner@postgresql.org Mon Aug 4 13:00:10 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 7EE7ED1C9EA; Mon, 4 Aug 2003 15:56:04 +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 24013-06; Mon, 4 Aug 2003 12:54:47 -0300 (ADT) Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by svr1.postgresql.org (Postfix) with ESMTP id 7DAC9D1C92F; Mon, 4 Aug 2003 12:55:53 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-34.mail.demon.net with esmtp (Exim 3.35 #1) id 19jhgd-0002lP-0Y; Mon, 04 Aug 2003 16:55:51 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 2D47A1662F; Mon, 4 Aug 2003 16:55:50 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 74D841662A; Mon, 4 Aug 2003 16:55:49 +0100 (BST) From: Richard Huxton To: Scott Cain , PgSQL Performance ML Subject: Re: [SQL] EXTERNAL storage and substring on long strings Date: Mon, 4 Aug 2003 16:55:48 +0100 User-Agent: KMail/1.5 Cc: pgsql-sql@postgresql.org References: <1059679600.1429.41.camel@localhost.localdomain> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> In-Reply-To: <1060010735.1433.26.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308041655.48151.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/34 X-Sequence-Number: 2851 On Monday 04 August 2003 16:25, Scott Cain wrote: [snip] > In an effort to find the best way to do this operation, I decided to > look at what is my "worst case" scenario: the DNA sequence for human > chromosome 1, which is about 250 million characters long (previous > strings where about 20 million characters long). I wrote a perl script > to do several substring operations over this very long string, with > substring lengths varying between 1000 and 40,000 characters spread out > over various locations along the string. While EXTENDED storage won in > this case, it was a hollow victory: 38 seconds per operation versus 40 > seconds, both of which are way too long to for an interactive > application. > > Time for a new method. A suggestion from my boss was to "shred" the DNA > into smallish chunks and a column giving offsets from the beginning of > the string, so that it can be reassembled when needed. Here is the test > table: > > string=> \d dna > Table "public.dna" > Column | Type | Modifiers > ---------+---------+----------- > foffset | integer | > pdna | text | > Indexes: foffset_idx btree (foffset) [snipped plpgsql function which stitches chunks together and then substrings] > So here's the question: I've never written a plpgsql function before, so > I don't have much experience with it; is there anything obviously wrong > with this function, or are there things that could be done better? At > least this appears to work and is much faster, completing substring > operations like above in about 0.27 secs (that's about two orders of > magnitude improvement!) You might want some checks to make sure that smin < smax, otherwise looks like it does the job in a good clean fashion. Glad to hear it's going to solve your problems. Two things you might want to bear in mind: 1. There's probably a "sweet spot" where the chunk size interacts well with your data, usage patterns and PGs backend to give you peak performance. You'll have to test. 2. If you want to search for a sequence you'll need to deal with the case where it starts in one chunk and ends in another. -- Richard Huxton Archonet Ltd From pgsql-general-owner@postgresql.org Mon Aug 4 13:23:01 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 7A9F2D1C914; Mon, 4 Aug 2003 16:22: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 26305-06; Mon, 4 Aug 2003 13:20:54 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 4D881D1C92D; Mon, 4 Aug 2003 13:22:00 -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 h74GKLGh027970; Mon, 4 Aug 2003 10:20:21 -0600 (MDT) Date: Mon, 4 Aug 2003 10:07:01 -0600 (MDT) From: "scott.marlowe" To: Manfred Koizar Cc: Jenny Zhang , , , Subject: Re: [PERFORM] OSDL Database Test Suite 3 is available on PostgreSQL In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/158 X-Sequence-Number: 46575 On Mon, 4 Aug 2003, Manfred Koizar wrote: > On 01 Aug 2003 11:04:10 -0700, Jenny Zhang wrote: > >A sample OSDL-DBT3 test result report can be found at: > >http://khack.osdl.org/stp/276912/ > > > >Your comments are welcome, > > | effective_cache_size | 1000 > > With 4GB of memory this is definitely too low and *can* (note that I > don't say *must*) lead the planner to wrong decisions. > > | shared_buffers | 15200 > > ... looks reasonable. Did you test with other values? > > | sort_mem | 524288 > > This is a bit high, IMHO, but might be ok given that DBT3 is not run > with many concurrent sessions (right?). > http://khack.osdl.org/stp/276912/results/plot/vmstat_swap.png shows > some swapping activity towards the end of the run which could be > caused by a too high sort_mem setting. And, as always, don't forget to set effect_cache_size. From pgsql-general-owner@postgresql.org Mon Aug 4 13:24:59 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 00C20D1CA07; Mon, 4 Aug 2003 16:24:04 +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 25490-07; Mon, 4 Aug 2003 13:22:47 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id E406BD1CA03; Mon, 4 Aug 2003 13:23:52 -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 h74GMTGh028128; Mon, 4 Aug 2003 10:22:29 -0600 (MDT) Date: Mon, 4 Aug 2003 10:09:09 -0600 (MDT) From: "scott.marlowe" To: Manfred Koizar Cc: Jenny Zhang , , , Subject: Re: [PERFORM] OSDL Database Test Suite 3 is available on PostgreSQL In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/159 X-Sequence-Number: 46576 On Mon, 4 Aug 2003, Manfred Koizar wrote: > On 01 Aug 2003 11:04:10 -0700, Jenny Zhang wrote: > >A sample OSDL-DBT3 test result report can be found at: > >http://khack.osdl.org/stp/276912/ > > > >Your comments are welcome, > > | effective_cache_size | 1000 > > With 4GB of memory this is definitely too low and *can* (note that I > don't say *must*) lead the planner to wrong decisions. > > | shared_buffers | 15200 > > ... looks reasonable. Did you test with other values? > > | sort_mem | 524288 > > This is a bit high, IMHO, but might be ok given that DBT3 is not run > with many concurrent sessions (right?). > http://khack.osdl.org/stp/276912/results/plot/vmstat_swap.png shows > some swapping activity towards the end of the run which could be > caused by a too high sort_mem setting. Sorry, my last email shot off out of the gun before it was completed... To repeat: Don't forget to set effective_cache_size the same way as shared buffers (i.e. it's in 8k blocks for most systems.) If you have a machine with 4 gig ram, and 3 gigs is available as disk cache, then divide out 3 gigs by 8k to get the right number. My quick calculation shows that being about 393216 blocks. From pgsql-performance-owner@postgresql.org Mon Aug 4 13:14:20 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 90446D1C92D for ; Mon, 4 Aug 2003 16:14:19 +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 25250-07 for ; Mon, 4 Aug 2003 13:13:02 -0300 (ADT) Received: from mail-3.zoominternet.net (mail-3.zoominternet.net [63.67.120.3]) by svr1.postgresql.org (Postfix) with SMTP id A7D2AD1CA05 for ; Mon, 4 Aug 2003 13:14:07 -0300 (ADT) Received: (qmail 20886 invoked from network); 4 Aug 2003 16:14:04 -0000 Received: from acs-24-154-209-142.zoominternet.net (HELO gmod.lajolla) ([24.154.209.142]) (envelope-sender ) by mail-3.zoominternet.net (qmail-ldap-1.03) with SMTP for ; 4 Aug 2003 16:14:04 -0000 Subject: Re: [SQL] EXTERNAL storage and substring on long strings From: Scott Cain To: Richard Huxton Cc: PgSQL Performance ML , pgsql-sql@postgresql.org In-Reply-To: <200308041655.48151.dev@archonet.com> References: <1059679600.1429.41.camel@localhost.localdomain> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> <200308041655.48151.dev@archonet.com> Content-Type: text/plain Organization: Cold Spring Harbor Lab Message-Id: <1060013646.1434.40.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 04 Aug 2003 12:14:06 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/35 X-Sequence-Number: 2852 On Mon, 2003-08-04 at 11:55, Richard Huxton wrote: > On Monday 04 August 2003 16:25, Scott Cain wrote: > [snip] > > [snip] > > You might want some checks to make sure that smin < smax, otherwise looks like > it does the job in a good clean fashion. Good point--smin < smax generally by virtue of the application using the database, but I shouldn't assume that will always be the case. > > Glad to hear it's going to solve your problems. Two things you might want to > bear in mind: > 1. There's probably a "sweet spot" where the chunk size interacts well with > your data, usage patterns and PGs backend to give you peak performance. > You'll have to test. Yes, I had a feeling that was probably the case-- since this is an open source project, I will need to write directions for installers on picking a reasonable chunk size. > 2. If you want to search for a sequence you'll need to deal with the case > where it starts in one chunk and ends in another. I forgot about searching--I suspect that application is why I faced opposition for shredding in my schema development group. Maybe I should push that off to the file system and use grep (or BLAST). Otherwise, I could write a function that would search the chunks first, then after failing to find the substring in those, I could start sewing the chunks together to look for the query string. That could get ugly (and slow--but if the user knows that and expects it to be slow, I'm ok with that). Thanks, Scott -- ------------------------------------------------------------------------ Scott Cain, Ph. D. cain@cshl.org GMOD Coordinator (http://www.gmod.org/) 216-392-3087 Cold Spring Harbor Laboratory From pgsql-performance-owner@postgresql.org Mon Aug 4 13:17:40 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 5CBC4D1CA1B for ; Mon, 4 Aug 2003 16:17:39 +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 27399-02 for ; Mon, 4 Aug 2003 13:16:22 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 05418D1CA08 for ; Mon, 4 Aug 2003 13:17:27 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h74GHP8D029120 for ; Mon, 4 Aug 2003 21:47:25 +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 h74GHOK7029107; Mon, 4 Aug 2003 21:47:25 +0530 From: "Shridhar Daithankar" To: PgSQL Performance ML , pgsql-sql@postgresql.org Date: Mon, 04 Aug 2003 21:49:15 +0530 MIME-Version: 1.0 Subject: Re: [SQL] EXTERNAL storage and substring on long strings Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F2ED4DB.30291.5A1A19@localhost> In-reply-to: <1060013646.1434.40.camel@localhost.localdomain> References: <200308041655.48151.dev@archonet.com> 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: 200308/36 X-Sequence-Number: 2853 On 4 Aug 2003 at 12:14, Scott Cain wrote: > I forgot about searching--I suspect that application is why I faced > opposition for shredding in my schema development group. Maybe I should > push that off to the file system and use grep (or BLAST). Otherwise, I > could write a function that would search the chunks first, then after > failing to find the substring in those, I could start sewing the chunks > together to look for the query string. That could get ugly (and > slow--but if the user knows that and expects it to be slow, I'm ok with > that). I assume your DNA sequence is compacted. Your best bet would be to fetch them from database and run blast on them in client memory. No point duplicating blast functionality. Last I tried it beat every technique of text searching when heuristics are involved. Bye Shridhar -- There are two types of Linux developers - those who can spell, andthose who can't. There is a constant pitched battle between the two.(From one of the post- 1.1.54 kernel update messages posted to c.o.l.a) From pgsql-performance-owner@postgresql.org Mon Aug 4 13:28:57 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 4BF0ED1C9EC for ; Mon, 4 Aug 2003 16:25: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 27146-05 for ; Mon, 4 Aug 2003 13:24:36 -0300 (ADT) Received: from mail-2.zoominternet.net (mail-2.zoominternet.net [63.67.120.22]) by svr1.postgresql.org (Postfix) with SMTP id 414B4D1C9FE for ; Mon, 4 Aug 2003 13:25:41 -0300 (ADT) Received: (qmail 11206 invoked from network); 4 Aug 2003 16:25:38 -0000 Received: from acs-24-154-209-142.zoominternet.net (HELO gmod.lajolla) ([24.154.209.142]) (envelope-sender ) by mail-2.zoominternet.net (qmail-ldap-1.03) with SMTP for ; 4 Aug 2003 16:25:37 -0000 Subject: Re: [SQL] EXTERNAL storage and substring on long strings From: Scott Cain To: Tom Lane Cc: PgSQL Performance ML , pgsql-sql@postgresql.org In-Reply-To: <3574.1060012423@sss.pgh.pa.us> References: <1059679600.1429.41.camel@localhost.localdomain> <3F297CBA.1080703@joeconway.com> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> <3574.1060012423@sss.pgh.pa.us> Content-Type: text/plain Organization: Cold Spring Harbor Lab Message-Id: <1060014341.1434.53.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 04 Aug 2003 12:25:41 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/39 X-Sequence-Number: 2856 On Mon, 2003-08-04 at 11:53, Tom Lane wrote: > Scott Cain writes: > > At least this appears to work and is much faster, completing substring > > operations like above in about 0.27 secs (that's about two orders of > > magnitude improvement!) > > I find it really, really hard to believe that a crude reimplementation > in plpgsql of the TOAST concept could beat the built-in implementation > at all, let alone beat it by two orders of magnitude. > > Either there's something unrealistic about your testing of the > dna_string function, or your original tests are not causing TOAST to be > invoked in the expected way, or there's a bug we need to fix. I'd > really like to see some profiling of the poor-performing > external-storage case, so we can figure out what's going on. > I was really hoping for a "Good job and glad to hear it" from you :-) I don't think there is anything unrealistic about my function or its testing, as it is very much along the lines of the types of things we do now. I will really try to do some profiling this week to help figure out what is going on. Scott -- ------------------------------------------------------------------------ Scott Cain, Ph. D. cain@cshl.org GMOD Coordinator (http://www.gmod.org/) 216-392-3087 Cold Spring Harbor Laboratory From pgsql-general-owner@postgresql.org Mon Aug 4 13:37:51 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 77E79D1C92F for ; Mon, 4 Aug 2003 16:37:50 +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 26065-10 for ; Mon, 4 Aug 2003 13:36:33 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 8AA19D1C914 for ; Mon, 4 Aug 2003 13:37:38 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h74Gbc1f000483 for ; Mon, 4 Aug 2003 22:07:38 +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 h74GbbK7000456; Mon, 4 Aug 2003 22:07:37 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org, pgsql-general@postgresql.org, osdldbt-general@lists.sourceforge.net Date: Mon, 04 Aug 2003 22:09:27 +0530 MIME-Version: 1.0 Subject: Re: [PERFORM] OSDL Database Test Suite 3 is available on PostgreSQL Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F2ED997.25642.6C9A5E@localhost> In-reply-to: References: <1059761051.1535.396.camel@ibm-a> 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: 200308/162 X-Sequence-Number: 46579 On 4 Aug 2003 at 15:33, Manfred Koizar wrote: > On 01 Aug 2003 11:04:10 -0700, Jenny Zhang wrote: > >A sample OSDL-DBT3 test result report can be found at: > >http://khack.osdl.org/stp/276912/ > > > >Your comments are welcome, I could not get postgresql .conf so I will combine the comments. 1. Effective cache size, already mentioned 2. Sort memory already mentioned. 3. Was WAL put on different drive? 4. Can you try with autovacuum daemon and 7.4beta when it comes out.. 5. What was the file system? Ext2/Ext3/reiser/XFS? Is there any comparison available for other databases.. Could be interesting to see..:-) Thanks for the good work. I understand it must have been quite an effort to run it.. Keep it up.. Bye Shridhar -- Fourth Law of Revision: It is usually impractical to worry beforehand about interferences -- if you have none, someone will make one for you. From pgsql-performance-owner@postgresql.org Mon Aug 4 13:56:15 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 D0DCDD1CA11 for ; Mon, 4 Aug 2003 16:56: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 30676-01 for ; Mon, 4 Aug 2003 13:54:57 -0300 (ADT) Received: from wight.ymogen.net (unknown [217.27.240.153]) by svr1.postgresql.org (Postfix) with SMTP id F36F8D1CA05 for ; Mon, 4 Aug 2003 13:56:01 -0300 (ADT) Received: (qmail 7578 invoked from network); 4 Aug 2003 16:56:01 -0000 Received: from unknown (HELO solent) (213.165.136.12) by wight.ymogen.net with SMTP; 4 Aug 2003 16:56:01 -0000 From: "Matt Clark" To: "Scott Cain" , "Richard Huxton" Cc: "PgSQL Performance ML" , Subject: Re: [SQL] EXTERNAL storage and substring on long strings Date: Mon, 4 Aug 2003 17:56:00 +0100 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) Importance: Normal In-Reply-To: <1060013646.1434.40.camel@localhost.localdomain> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/41 X-Sequence-Number: 2858 > > 2. If you want to search for a sequence you'll need to deal with the case > > where it starts in one chunk and ends in another. > > I forgot about searching--I suspect that application is why I faced > opposition for shredding in my schema development group. Maybe I should > push that off to the file system and use grep (or BLAST). Otherwise, I > could write a function that would search the chunks first, then after > failing to find the substring in those, I could start sewing the chunks > together to look for the query string. That could get ugly (and > slow--but if the user knows that and expects it to be slow, I'm ok with > that). If you know the max length of the sequences being searched for, and this is much less than the chunk size, then you could simply have the chunks overlap by that much, thus guaranteeing every substring will be found in its entirety in at least one chunk. From pgsql-performance-owner@postgresql.org Mon Aug 4 17:17: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 8A97AD1C4E1 for ; Mon, 4 Aug 2003 20:17:52 +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 42714-10 for ; Mon, 4 Aug 2003 17:16:37 -0300 (ADT) Received: from claxson.com (mx7.claxson.com [200.32.96.144]) by svr1.postgresql.org (Postfix) with ESMTP id 87E9ED1C91C for ; Mon, 4 Aug 2003 17:17:38 -0300 (ADT) X-MIMEOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: I can't wait too much: Total runtime 432478.44 msec Date: Mon, 4 Aug 2003 17:17:36 -0300 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PERFORM] I can't wait too much: Total runtime 432478.44 msec Thread-Index: AcNam4EcVi2lqe3YSkeMDojnvKhWEwAASWlgAAoKgtA= From: "Fernando Papa" To: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/42 X-Sequence-Number: 2859 I was play with nested loops, and I found this: Original explain: Limit (cost=3D9.75..9.76 rows=3D1 width=3D479) (actual time=3D436858.90..436858.93 rows=3D8 loops=3D1) -> Sort (cost=3D9.75..9.76 rows=3D1 width=3D479) (actual time=3D436858.88..436858.89 rows=3D8 loops=3D1) Sort Key: cont_publicacion.fecha_publicacion -> Merge Join (cost=3D9.73..9.74 rows=3D1 width=3D479) (actual time=3D196970.93..436858.04 rows=3D8 loops=3D1) Merge Cond: (("outer".id_instalacion =3D "inner".id_instalacion) AND ("outer".id_contenido =3D "inner".id_contenido)) -> Nested Loop (cost=3D0.00..1828.46 rows=3D1 width=3D367) (actual time=3D7525.51..436843.27 rows=3D40 loops=3D1) Join Filter: (("inner".id_contenido =3D "outer".id_contenido) AND ("inner".id_instalacion =3D "outer".id_instalacion)) -> Index Scan using jue_conf_pk on juegos_config (cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.38..6.63 rows= =3D40 loops=3D1) -> Index Scan using idx_generar_vainilla_ci on cont_publicacion (cost=3D0.00..45.39 rows=3D1 width=3D35) (actual time=3D48.81..10917.53 rows=3D97 loops=3D40) Index Cond: (upper((generar_vainilla)::text) =3D 'S'::text) Filter: (subplan) SubPlan -> Aggregate (cost=3D15.85..15.85 rows=3D1 width=3D8) (actual time=3D24.30..24.30 rows=3D0 loops=3D17880) Filter: (max(fecha_publicacion) =3D $3) -> Seq Scan on cont_publicacion cp1 (cost=3D0.00..15.84 rows=3D1 width=3D8) (actual time=3D10.17..24.12 rows=3D7 loops=3D17880) Filter: ((id_instalacion =3D $0) AND (id_contenido =3D $1) AND (generar_vainilla =3D $2)) -> Sort (cost=3D9.73..9.74 rows=3D3 width=3D112) (actual time=3D8.91..8.95 rows=3D8 loops=3D1) Sort Key: cont_contenido.id_instalacion, cont_contenido.id_contenido -> Seq Scan on cont_contenido (cost=3D0.00..9.70 rows=3D3 width=3D112) (actual time=3D0.45..7.59 rows=3D8 loops=3D1) Filter: ((id_instalacion =3D 2::numeric) AND (id_sbc =3D 619::numeric) AND (id_tipo =3D 2::numeric)) Total runtime: 436860.84 msec (21 rows) With set enable_nestloop to off : =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------ Limit (cost=3D55.15..55.16 rows=3D1 width=3D479) (actual time=3D11394.79..11394.82 rows=3D8 loops=3D1) -> Sort (cost=3D55.15..55.16 rows=3D1 width=3D479) (actual time=3D11394.77..11394.79 rows=3D8 loops=3D1) Sort Key: cont_publicacion.fecha_publicacion -> Merge Join (cost=3D55.13..55.14 rows=3D1 width=3D479) (actual time=3D11380.12..11394.01 rows=3D8 loops=3D1) Merge Cond: (("outer".id_instalacion =3D "inner".id_instalacion) AND ("outer".id_contenido =3D "inner".id_contenido)) -> Merge Join (cost=3D45.40..45.41 rows=3D1 width=3D367) (actual time=3D11358.48..11380.18 rows=3D40 loops=3D1) Merge Cond: (("outer".id_instalacion =3D "inner".id_instalacion) AND ("outer".id_contenido =3D "inner".id_contenido)) -> Index Scan using jue_conf_pk on juegos_config (cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.23..5.62 rows= =3D40 loops=3D1) -> Sort (cost=3D45.40..45.40 rows=3D1 width=3D35) (actual time=3D11357.48..11357.68 rows=3D97 loops=3D1) Sort Key: cont_publicacion.id_instalacion, cont_publicacion.id_contenido -> Index Scan using idx_generar_vainilla_ci on cont_publicacion (cost=3D0.00..45.39 rows=3D1 width=3D35) (actual time=3D48.81..11339.80 rows=3D97 loops=3D1) Index Cond: (upper((generar_vainilla)::text) =3D 'S'::text) Filter: (fecha_publicacion =3D (subplan)) SubPlan -> Aggregate (cost=3D15.84..15.84 rows=3D1 width=3D8) (actual time=3D25.21..25.22 rows=3D1 loops=3D447) -> Seq Scan on cont_publicacion cp1 (cost=3D0.00..15.84 rows=3D1 width=3D8) (actual time=3D10.21..25.07 rows=3D7 loops=3D447) Filter: ((id_instalacion =3D $0) AND (id_contenido =3D $1) AND (generar_vainilla =3D $2)) -> Sort (cost=3D9.73..9.74 rows=3D3 width=3D112) (actual time=3D8.77..8.79 rows=3D8 loops=3D1) Sort Key: cont_contenido.id_instalacion, cont_contenido.id_contenido -> Seq Scan on cont_contenido (cost=3D0.00..9.70 rows=3D3 width=3D112) (actual time=3D0.45..7.41 rows=3D8 loops=3D1) Filter: ((id_instalacion =3D 2::numeric) AND (id_sbc =3D 619::numeric) AND (id_tipo =3D 2::numeric)) Total runtime: 11397.66 msec (22 rows) Why postgresql don't choose not to use nested loop? Why is more cheap to use nested loops but It's take a lot of time?=20 From pgsql-performance-owner@postgresql.org Mon Aug 4 17:33:39 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 1F763D1C518; Mon, 4 Aug 2003 20:33:33 +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 45342-06; Mon, 4 Aug 2003 17:32:17 -0300 (ADT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 747DCD1C4ED; Mon, 4 Aug 2003 17:33:21 -0300 (ADT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.0.6) with ESMTP-TLS id 22796; Mon, 04 Aug 2003 12:54:47 -0700 Message-ID: <3F2EC244.9040107@joeconway.com> Date: Mon, 04 Aug 2003 13:29:56 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Scott Cain Cc: Tom Lane , PgSQL Performance ML , pgsql-sql@postgresql.org Subject: Re: [SQL] EXTERNAL storage and substring on long strings References: <1059679600.1429.41.camel@localhost.localdomain> <3F297CBA.1080703@joeconway.com> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> <3574.1060012423@sss.pgh.pa.us> <1060014341.1434.53.camel@localhost.localdomain> In-Reply-To: <1060014341.1434.53.camel@localhost.localdomain> 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: 200308/43 X-Sequence-Number: 2860 Scott Cain wrote: > On Mon, 2003-08-04 at 11:53, Tom Lane wrote: >>I find it really, really hard to believe that a crude reimplementation >>in plpgsql of the TOAST concept could beat the built-in implementation >>at all, let alone beat it by two orders of magnitude. >> >>Either there's something unrealistic about your testing of the >>dna_string function, or your original tests are not causing TOAST to be >>invoked in the expected way, or there's a bug we need to fix. I'd >>really like to see some profiling of the poor-performing >>external-storage case, so we can figure out what's going on. > > I was really hoping for a "Good job and glad to hear it" from you :-) > > I don't think there is anything unrealistic about my function or its > testing, as it is very much along the lines of the types of things we do > now. I will really try to do some profiling this week to help figure > out what is going on. Is there a sample table schema and dataset available (external-storage case) that we can play with? Joe From pgsql-performance-owner@postgresql.org Mon Aug 4 18:14:52 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 62EFFD1C4E1 for ; Mon, 4 Aug 2003 21:14:50 +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 49469-07 for ; Mon, 4 Aug 2003 18:13:35 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 3345BD1C518 for ; Mon, 4 Aug 2003 18:14:39 -0300 (ADT) Received: (qmail 14556 invoked by uid 500); 4 Aug 2003 21:19:51 -0000 Date: Mon, 4 Aug 2003 16:19:51 -0500 From: Bruno Wolff III To: "Valsecchi, Patrick" Cc: pgsql-performance@postgresql.org Subject: Re: Indexes not used for "min()" Message-ID: <20030804211951.GA14522@wolff.to> Mail-Followup-To: "Valsecchi, Patrick" , pgsql-performance@postgresql.org References: <4E2CE3FB9E1B744482F6669A9AE2F72E68F0E8@NSTAREXCH1.windows.nagrastar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E2CE3FB9E1B744482F6669A9AE2F72E68F0E8@NSTAREXCH1.windows.nagrastar.com> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/44 X-Sequence-Number: 2861 On Mon, Aug 04, 2003 at 15:05:08 -0600, "Valsecchi, Patrick" wrote: > Sir, > > I did a search with the "index" keyword on the mailing list archive and it did come with no result. Sorry if it's a known bug. It isn't a bug. It is a design trade off. The database has no special knowledge about the min and max aggregate functions that would allow it to use indexes. > But in general, I think the indexes are under used. I have several queries that are taking at least 30 minutes and that would take less than one minute if indexes where used (comes with a comparison I made with Oracle). In particular, I have the feeling that indexes are not used for "IN" statements (within a where clauses). There are know performance problems with in. These are addressed in 7.4 which will be going into beta any time now. You can usually rewrite IN queries to use exists instead, which will speed things up. Also be sure to run analyze (or vacuum analyze) so that the database server has accurate statistics on which to bases its decisions. > On the same subject, I'd add that the ability to provide plan "hints" within the queries (like provided in Oracle) would be helpful. I know that the Postgres optimizer is supposed to do a better job than the one from Oracle, but an optimizer cannot be perfect for every cases. "Hints" aren't going to happen. They cause maintainance problems. You can disable features for a session (such as sequential scans) and try to get a plan you like. But generally, rather than adding this to you application code, you should try to find out why the planner is making the wrong choice. Adjusting the relative costs for doing things might allow the planner to do a much better job for you. This kind of thing gets discussed on the performance list. From pgsql-performance-owner@postgresql.org Mon Aug 4 18:28: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 C2911D1CA47 for ; Mon, 4 Aug 2003 21:28:16 +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 52323-01 for ; Mon, 4 Aug 2003 18:27:01 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 8A6AFD1CA16 for ; Mon, 4 Aug 2003 18:28:02 -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 h74LS0Sa012727; Mon, 4 Aug 2003 17:28:01 -0400 (EDT) To: "Fernando Papa" Cc: pgsql-performance@postgresql.org Subject: Re: I can't wait too much: Total runtime 432478.44 msec In-reply-to: References: Comments: In-reply-to "Fernando Papa" message dated "Mon, 04 Aug 2003 17:17:36 -0300" Date: Mon, 04 Aug 2003 17:28:00 -0400 Message-ID: <12726.1060032480@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/45 X-Sequence-Number: 2862 "Fernando Papa" writes: > -> Nested Loop (cost=0.00..1828.46 rows=1 width=367) > (actual time=7525.51..436843.27 rows=40 loops=1) > Join Filter: (("inner".id_contenido = > "outer".id_contenido) AND ("inner".id_instalacion = > "outer".id_instalacion)) > -> Index Scan using jue_conf_pk on juegos_config > (cost=0.00..12.19 rows=40 width=332) (actual time=0.38..6.63 rows=40 > loops=1) > -> Index Scan using idx_generar_vainilla_ci on > cont_publicacion (cost=0.00..45.39 rows=1 width=35) (actual > time=48.81..10917.53 rows=97 loops=40) > Index Cond: (upper((generar_vainilla)::text) > = 'S'::text) > Filter: (subplan) > SubPlan > -> Aggregate (cost=15.85..15.85 rows=1 > width=8) (actual time=24.30..24.30 rows=0 loops=17880) As best I can tell, the problem here is coming from a drastic underestimate of the number of rows selected by "upper(generar_vainilla) = 'S'". Evidently there are about 450 such rows (since in 40 repetitions of the inner index scan, the aggregate subplan gets evaluated 17880 times), but the planner seems to think there will be only about two such rows. Had it made a more correct estimate, it would never have picked a plan that required multiple repetitions of the indexscan. One thing I'm wondering is if you've VACUUM ANALYZEd cont_publicacion lately --- the cost estimate seems on the small side, and I'm wondering if the planner thinks the table is much smaller than it really is. But assuming you didn't make that mistake, the only solution I can see is to not use a functional index. The planner is not good about making row count estimates for functional indexes. You could replace the index on upper(generar_vainilla) with a plain index on generar_vainilla, and change the query condition from "upper(generar_vainilla) = 'S'" to "generar_vainilla IN ('S', 's')". I think the planner would have a lot better chance at understanding the statistics that way. regards, tom lane From pgsql-performance-owner@postgresql.org Mon Aug 4 19:02: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 807B4D1C9EA for ; Mon, 4 Aug 2003 22:02: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 52483-07 for ; Mon, 4 Aug 2003 19:00:50 -0300 (ADT) Received: from claxson.com (mx7.claxson.com [200.32.96.144]) by svr1.postgresql.org (Postfix) with ESMTP id C2C93D1C92D for ; Mon, 4 Aug 2003 19:01:53 -0300 (ADT) X-MIMEOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: I can't wait too much: Total runtime 432478.44 msec Date: Mon, 4 Aug 2003 19:01:50 -0300 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PERFORM] I can't wait too much: Total runtime 432478.44 msec Thread-Index: AcNaz0sHt731/t0lQyC8djqM8/XJIAAA/1Gg From: "Fernando Papa" To: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/46 X-Sequence-Number: 2863 Thanks Tom. I vaccumed full every night. Now I drop function index and change the upper. Nothing change (I know, total time rise because we are doing other things on database now). But you can see, if was any performace gain i didn't see. Actually I get better results when I disable nested loops or disable merge joins, as I write in a older post. Thanks! Limit (cost=3D9.76..9.76 rows=3D1 width=3D479) (actual time=3D720480.00..720480.03 rows=3D8 loops=3D1) -> Sort (cost=3D9.76..9.76 rows=3D1 width=3D479) (actual time=3D720479.99..720480.00 rows=3D8 loops=3D1) Sort Key: cont_publicacion.fecha_publicacion -> Merge Join (cost=3D9.73..9.75 rows=3D1 width=3D479) (actual time=3D323197.81..720477.96 rows=3D8 loops=3D1) Merge Cond: (("outer".id_instalacion =3D "inner".id_instalacion) AND ("outer".id_contenido =3D "inner".id_contenido)) -> Nested Loop (cost=3D0.00..213197.04 rows=3D4 width=3D36= 7) (actual time=3D12136.55..720425.66 rows=3D40 loops=3D1) Join Filter: (("inner".id_contenido =3D "outer".id_contenido) AND ("inner".id_instalacion =3D "outer".id_instalacion)) -> Index Scan using jue_conf_pk on juegos_config (cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D34.13..92.02 rows= =3D40 loops=3D1) -> Seq Scan on cont_publicacion (cost=3D0.00..5329.47 rows=3D10 width=3D35) (actual time=3D41.74..18004.75 rows=3D97 loops=3D40) Filter: (((generar_vainilla =3D 'S'::character varying) OR (generar_vainilla =3D 's'::character varying)) AND (fecha_publicacion =3D (subplan))) SubPlan -> Aggregate (cost=3D11.86..11.86 rows=3D1 width=3D8) (actual time=3D40.15..40.15 rows=3D1 loops=3D17880) -> Index Scan using cont_pub_gen_vainilla on cont_publicacion cp1 (cost=3D0.00..11.86 rows=3D1 width=3D8) (actual time=3D16.89..40.01 rows=3D7 loops=3D17880) Index Cond: (generar_vainilla =3D $2) Filter: ((id_instalacion =3D $0) AND (id_contenido =3D $1)) -> Sort (cost=3D9.73..9.74 rows=3D3 width=3D112) (actual time=3D30.96..31.00 rows=3D8 loops=3D1) Sort Key: cont_contenido.id_instalacion, cont_contenido.id_contenido -> Seq Scan on cont_contenido (cost=3D0.00..9.70 rows=3D3 width=3D112) (actual time=3D0.65..28.98 rows=3D8 loops=3D1) Filter: ((id_instalacion =3D 2::numeric) AND (id_sbc =3D 619::numeric) AND (id_tipo =3D 2::numeric)) Total runtime: 720595.77 msec (20 rows) -----Mensaje original----- De: Tom Lane [mailto:tgl@sss.pgh.pa.us]=20 Enviado el: lunes, 04 de agosto de 2003 18:28 Para: Fernando Papa CC: pgsql-performance@postgresql.org Asunto: Re: [PERFORM] I can't wait too much: Total runtime 432478.44 msec=20 "Fernando Papa" writes: > -> Nested Loop (cost=3D0.00..1828.46 rows=3D1 width=3D36= 7)=20 > (actual time=3D7525.51..436843.27 rows=3D40 loops=3D1) > Join Filter: (("inner".id_contenido =3D > "outer".id_contenido) AND ("inner".id_instalacion =3D > "outer".id_instalacion)) > -> Index Scan using jue_conf_pk on juegos_config > (cost=3D0.00..12.19 rows=3D40 width=3D332) (actual time=3D0.38..6.63 rows= =3D40 > loops=3D1) > -> Index Scan using idx_generar_vainilla_ci on=20 > cont_publicacion (cost=3D0.00..45.39 rows=3D1 width=3D35) (actual=20 > time=3D48.81..10917.53 rows=3D97 loops=3D40) > Index Cond:=20 > (upper((generar_vainilla)::text) =3D 'S'::text) > Filter: (subplan) > SubPlan > -> Aggregate (cost=3D15.85..15.85 rows=3D1 > width=3D8) (actual time=3D24.30..24.30 rows=3D0 loops=3D17880) As best I can tell, the problem here is coming from a drastic underestimate of the number of rows selected by "upper(generar_vainilla) =3D 'S'". Evidently there are about 450 such rows (since in 40 repetitions of the inner index scan, the aggregate subplan gets evaluated 17880 times), but the planner seems to think there will be only about two such rows. Had it made a more correct estimate, it would never have picked a plan that required multiple repetitions of the indexscan. One thing I'm wondering is if you've VACUUM ANALYZEd cont_publicacion lately --- the cost estimate seems on the small side, and I'm wondering if the planner thinks the table is much smaller than it really is. But assuming you didn't make that mistake, the only solution I can see is to not use a functional index. The planner is not good about making row count estimates for functional indexes. You could replace the index on=20 upper(generar_vainilla) with a plain index on generar_vainilla, and change the query condition from "upper(generar_vainilla) =3D 'S'" to "generar_vainilla IN ('S', 's')". I think the planner would have a lot better chance at understanding the statistics that way. regards, tom lane From pgsql-performance-owner@postgresql.org Mon Aug 4 19:31:03 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 A270ED1CA0F for ; Mon, 4 Aug 2003 22:30:58 +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 52476-09 for ; Mon, 4 Aug 2003 19:29:44 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 6F748D1CA0E for ; Mon, 4 Aug 2003 19:30:47 -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 h74MUlSa013406; Mon, 4 Aug 2003 18:30:47 -0400 (EDT) To: "Fernando Papa" Cc: pgsql-performance@postgresql.org Subject: Re: I can't wait too much: Total runtime 432478.44 msec In-reply-to: References: Comments: In-reply-to "Fernando Papa" message dated "Mon, 04 Aug 2003 19:01:50 -0300" Date: Mon, 04 Aug 2003 18:30:47 -0400 Message-ID: <13405.1060036247@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/47 X-Sequence-Number: 2864 "Fernando Papa" writes: > Thanks Tom. I vaccumed full every night. Now I drop function index and > change the upper. Nothing change (I know, total time rise because we are > doing other things on database now). > -> Seq Scan on cont_publicacion > (cost=0.00..5329.47 rows=10 width=35) (actual time=41.74..18004.75 > rows=97 loops=40) > Filter: (((generar_vainilla = 'S'::character > varying) OR (generar_vainilla = 's'::character varying)) AND > (fecha_publicacion = (subplan))) > SubPlan > -> Aggregate (cost=11.86..11.86 rows=1 > width=8) (actual time=40.15..40.15 rows=1 loops=17880) Something fishy going on here. Why did it switch to a seqscan, considering it still (mistakenly) thinks there are only going to be 10 or 20 rows matching the generar_vainilla condition? How many rows have generar_vainilla equal to 's' or 'S', anyway? In any case, the real problem is to get rid of the subselect at the Now that I look at your original query, I see that what you really seem to be after is the publications with latest pub date among each group with identical id_instalacion, id_contenido, and generar_vainilla. You would probably do well to reorganize the query using SELECT DISTINCT ON, viz SELECT * FROM (SELECT DISTINCT ON (id_instalacion, id_contenido, generar_vainilla) ... FROM ... WHERE ... ORDER BY id_instalacion, id_contenido, generar_vainilla, fecha_publicacion DESC) AS ss ORDER BY fecha_publicacion desc LIMIT 10 OFFSET 0 See the "weather reports" example in the SELECT reference page for motivation. regards, tom lane From pgsql-general-owner@postgresql.org Mon Aug 4 19:54:53 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 02685D1CA16; Mon, 4 Aug 2003 22:54:38 +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 55439-06; Mon, 4 Aug 2003 19:53:23 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id D525FD1C9DE; Mon, 4 Aug 2003 19:54:26 -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 h74MrXPB003385; Mon, 4 Aug 2003 16:53:33 -0600 (MDT) Date: Mon, 4 Aug 2003 16:40:11 -0600 (MDT) From: "scott.marlowe" To: Jenny Zhang Cc: , , , , Subject: Re: [osdldbt-general] Re: [PERFORM] OSDL Database Test Suite 3 is In-Reply-To: <1060037335.2144.1086.camel@ibm-a> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/193 X-Sequence-Number: 46610 On 4 Aug 2003, Jenny Zhang wrote: > On Mon, 2003-08-04 at 06:33, Manfred Koizar wrote: > > | effective_cache_size | 1000 > > > > With 4GB of memory this is definitely too low and *can* (note that I > > don't say *must*) lead the planner to wrong decisions. > > > I changed the default to effective_cache_size=393216 as calculated by > Scott. Another way to check the execution plan is to go to the results > dir: > http://khack.osdl.org/stp/276917/results > There is a 'power_plan.out' file to record the execution plan. I am > running a test with the changed effective_cache_size, I will see how it > affect the plan. > > > | shared_buffers | 15200 > > > > ... looks reasonable. Did you test with other values? > I have only one with shared_buffers=1200000 at: > http://khack.osdl.org/stp/276847/ > The performance degraded. Well, that's truly huge, even for a machine with lots-o-ram. Most tests find that once the shared_buffers are big enough to use more than about 25 to 33% of RAM, they're too big, as you get little return. > > | sort_mem | 524288 > > > > This is a bit high, IMHO, but might be ok given that DBT3 is not run > > with many concurrent sessions (right?). > > http://khack.osdl.org/stp/276912/results/plot/vmstat_swap.png shows > > some swapping activity towards the end of the run which could be > > caused by a too high sort_mem setting. > Right, I run only 4 streams. Setting this parameter lower caused more > reading/writing to the pgsql/tmp. I guess the database has to do it if > it can not do sorting in memory. Note that IF your sortmem really is 1/2 gig, then you'll likely have LESS than 3 gigs left for OS system cache. About how big does top show buff and cached to be on that box under load? Not that it's a big deal if you get the effective cache size off by a little bit, it's more of a rubber mallet setting than a jeweler's screw driver setting. Thanks a bunch for all the great testing. It's a very nice tool to have for convincing the bosses to go with Postgresql. From pgsql-general-owner@postgresql.org Mon Aug 4 23:32:39 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 83E20D1C9ED; Mon, 4 Aug 2003 22:48:56 +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 56766-07; Mon, 4 Aug 2003 19:47:42 -0300 (ADT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by svr1.postgresql.org (Postfix) with ESMTP id 8BDF6D1C91C; Mon, 4 Aug 2003 19:48:44 -0300 (ADT) Received: from bullpen.pdx.osdl.net (bullpen.pdx.osdl.net [172.20.1.53]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h74MmeI31462; Mon, 4 Aug 2003 15:48:40 -0700 Subject: Re: [osdldbt-general] Re: [PERFORM] OSDL Database Test Suite 3 is From: Craig Thomas To: shridhar_daithankar@persistent.co.in Cc: pgsql-performance@postgresql.org, pgsql-general@postgresql.org, osdldbt-general@lists.sourceforge.net In-Reply-To: <3F2ED997.25642.6C9A5E@localhost> References: <1059761051.1535.396.camel@ibm-a> <3F2ED997.25642.6C9A5E@localhost> Content-Type: text/plain Organization: Message-Id: <1060037311.24401.155.camel@bullpen.pdx.osdl.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 04 Aug 2003 15:48:31 -0700 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/201 X-Sequence-Number: 46618 On Mon, 2003-08-04 at 09:39, Shridhar Daithankar wrote: > On 4 Aug 2003 at 15:33, Manfred Koizar wrote: > > > On 01 Aug 2003 11:04:10 -0700, Jenny Zhang wrote: > > >A sample OSDL-DBT3 test result report can be found at: > > >http://khack.osdl.org/stp/276912/ > > > > > >Your comments are welcome, > > I could not get postgresql .conf so I will combine the comments. > > 1. Effective cache size, already mentioned > 2. Sort memory already mentioned. > 3. Was WAL put on different drive? > 4. Can you try with autovacuum daemon and 7.4beta when it comes out.. > 5. What was the file system? Ext2/Ext3/reiser/XFS? > > > > Is there any comparison available for other databases.. Could be interesting to > see..:-) OSDL has run workloads using the SAP DB and PostgreSQL. However, each of the workloads have been tweaked to work around deficiencies of each database with respect to the TPC benchmarks from with the DBT workloads are derrived. Since there are extensive modifications to each workload an that the fact that each workload operates under different situations (SAP uses raw disk, PostgreSQL uses a file system), it is not beneficial to compare numbers between different databases. Remember, the intent is to provide a tool kit that can be used to benefit the community. From other postings, it appears that these workloads we have available can be used to help the PostgreSQl community develop a better database; one that is better able to handle the kinds of stress these workloads can produce when scaled to large database sizes. We have been using these kits to characterize the abilities of the Linux kernel. To show that these workloads work with two different databases implies that Linux is capable of supporting these two databases. The other tool kits, by the way, are being ported to PostgreSQL as well. Help is needed to tune the workloads to exercise PostgreSQL better. It would be great if you could get involved with the porting efforts and assist with the tuning of the PostgreSQL kit. > > > > Thanks for the good work. I understand it must have been quite an effort to run > it.. > > Keep it up.. > > Bye > Shridhar > > -- > Fourth Law of Revision: It is usually impractical to worry beforehand about > interferences -- if you have none, someone will make one for you. > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > osdldbt-general mailing list > osdldbt-general@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/osdldbt-general -- Craig Thomas craiger@osdl.org From pgsql-general-owner@postgresql.org Mon Aug 4 19:42:09 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 95C50D1CA0E; Mon, 4 Aug 2003 22:42: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 53565-07; Mon, 4 Aug 2003 19:40:45 -0300 (ADT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by svr1.postgresql.org (Postfix) with ESMTP id 0DCE0D1CA13; Mon, 4 Aug 2003 19:41:48 -0300 (ADT) Received: from ibm-a.pdx.osdl.net (ibm-a.pdx.osdl.net [172.20.1.50]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h74MfUI30462; Mon, 4 Aug 2003 15:41:30 -0700 Subject: Re: [osdldbt-general] Re: [PERFORM] OSDL Database Test Suite 3 is From: Jenny Zhang To: shridhar_daithankar@persistent.co.in, scott.marlowe@ihs.com, mkoi-pg@aon.at Cc: pgsql-performance@postgresql.org, pgsql-general@postgresql.org, osdldbt-general@lists.sourceforge.net In-Reply-To: <3F2ED997.25642.6C9A5E@localhost> References: <1059761051.1535.396.camel@ibm-a> <3F2ED997.25642.6C9A5E@localhost> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.5 Date: 04 Aug 2003 15:48:55 -0700 Message-Id: <1060037335.2144.1086.camel@ibm-a> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/192 X-Sequence-Number: 46609 Thanks all for your feedback. I think I should explain more about how to use this test kit. The main purpose of putting the test kit on Scalability Test Platform(STP) is that testers can run the workload against the database with different parameters and Linux kernels to see performance differences. Though the test kit picks up default parameters if they are not provided, the command line parameters overwrite the default ones. Currently, the following parameters are supported: -s -n -d '' -r <{0|1}> -x <{0|1}> where: -s is tpc-h database scale factor, right now, only SF=1 is available. -n is the number of throughput test streams, which corresponds number of simultaneous database connections during throughput test. -d is the database parameters used when starting postmaster. for example: -B 120000 -c effective_cache_size=393216 -c sort_mem=524288 -c stats_command_string=true -c stats_row_level=true -c stats_block_level=true -r {0|1}: indicates if the database dir base//pgsql_tmp is put on a separate disk drive -x {0|1}: indicates if the WAL is put on a separate disk drive. The other comments are in-lined: On Mon, 2003-08-04 at 06:33, Manfred Koizar wrote: > | effective_cache_size | 1000 > > With 4GB of memory this is definitely too low and *can* (note that I > don't say *must*) lead the planner to wrong decisions. > I changed the default to effective_cache_size=393216 as calculated by Scott. Another way to check the execution plan is to go to the results dir: http://khack.osdl.org/stp/276917/results There is a 'power_plan.out' file to record the execution plan. I am running a test with the changed effective_cache_size, I will see how it affect the plan. > | shared_buffers | 15200 > > ... looks reasonable. Did you test with other values? I have only one with shared_buffers=1200000 at: http://khack.osdl.org/stp/276847/ The performance degraded. > > | sort_mem | 524288 > > This is a bit high, IMHO, but might be ok given that DBT3 is not run > with many concurrent sessions (right?). > http://khack.osdl.org/stp/276912/results/plot/vmstat_swap.png shows > some swapping activity towards the end of the run which could be > caused by a too high sort_mem setting. Right, I run only 4 streams. Setting this parameter lower caused more reading/writing to the pgsql/tmp. I guess the database has to do it if it can not do sorting in memory. On 4 Aug 2003 at 15:33, Manfred Koizar wrote: > > I could not get postgresql .conf so I will combine the comments. It is under database monitor data: database parameters > > 1. Effective cache size, already mentioned > 2. Sort memory already mentioned. > 3. Was WAL put on different drive? That run did not put WAL on different drive. I changed it this morning so that it is configurable. Also I changed the result page so that the testers can tell from the result page. > 4. Can you try with autovacuum daemon and 7.4beta when it comes out.. I'd be happy to run it. We would like to improve out Patch Life Management(PLM) system so that it can accept PG patches and run performance tests on those patches. Right now PLM only manages Linux Kernel patches. I would like to ask the PostgreSQL community if this kind of tools is of interest. > 5. What was the file system? Ext2/Ext3/reiser/XFS? > > > It is Ext2. Yeah, it is not reported on the page. > Is there any comparison available for other databases.. Could be interesting to > see..:-) > > > Let me know if you have any suggestions about how to improve the test kit (parameters, reported information, etc.), or how to make it more useful to PG community. Thanks, -- Jenny Zhang Open Source Development Lab Inc 12725 SW Millikan Way Suite 400 Beaverton, OR 97005 (503)626-2455 ext 31 From pgsql-performance-owner@postgresql.org Mon Aug 4 20:36: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 0E3BDD1C911 for ; Mon, 4 Aug 2003 23:36:25 +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 59171-02 for ; Mon, 4 Aug 2003 20:35:11 -0300 (ADT) Received: from email04.aon.at (WARSL402PIP5.highway.telekom.at [195.3.96.90]) by svr1.postgresql.org (Postfix) with SMTP id D879BD1C4E1 for ; Mon, 4 Aug 2003 20:36:13 -0300 (ADT) Received: (qmail 233882 invoked from network); 4 Aug 2003 23:36:16 -0000 Received: from m170p001.dipool.highway.telekom.at (HELO cantor) ([62.46.11.33]) (envelope-sender ) by qmail4rs.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 4 Aug 2003 23:36:16 -0000 From: Manfred Koizar To: Manfred Koizar Cc: "Fernando Papa" , Subject: Re: I can't wait too much: Total runtime 432478.44 msec Date: Tue, 05 Aug 2003 01:36:27 +0200 Message-ID: <95rtivs8a4oqhc52ej0gq2k9o0c3nm29pl@4ax.com> References: In-Reply-To: X-Mailer: Forte Agent 1.93/32.576 English (American) 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: 200308/51 X-Sequence-Number: 2868 On Mon, 04 Aug 2003 16:10:18 +0200, I wrote: >SELECT DISTINCT ON ( > cp.id_instalacion, > cp.id_contenido, > cp.generar_vainilla, > cp.fecha_publicacion > ) Cut'n'paste error! fecha_publicacion should not be in the DISTINCT ON list. The same error is in my second suggestion (FROM (subselect)). Servus Manfred From pgsql-performance-owner@postgresql.org Tue Aug 5 03:23:51 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 8BE88D1C914 for ; Tue, 5 Aug 2003 06:23:49 +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 88383-05 for ; Tue, 5 Aug 2003 03:22:32 -0300 (ADT) Received: from mail.shcom.de (unknown [193.99.50.2]) by svr1.postgresql.org (Postfix) with ESMTP id 91DECD1CA05 for ; Tue, 5 Aug 2003 03:23:37 -0300 (ADT) content-class: urn:content-classes:message Subject: Re: I can't wait too much: Total runtime 432478.44 msec MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Tue, 5 Aug 2003 08:22:58 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PERFORM] I can't wait too much: Total runtime 432478.44 msec Thread-Index: AcNbGhA60HskNo/HTMqOKi9eBP3atA== From: "Volker Helm" To: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/52 X-Sequence-Number: 2869 Sorry Guy, was just a little tired yesterday. > Err... you're right... one of us say the same thing when I show the > Volker mail... Try to make a group by in the inline-view, so you will get something like this: >=20 > On Mon, 4 Aug 2003 12:02:46 -0300, "Fernando Papa" > wrote: > > FROM=20 > > cont_contenido=20=20=20 > > ,juegos_config=20=20=20=20 > > ,cont_publicacion=20 > > ,(SELECT id_instalacion, id_contenido, generar_vainilla, max(cp1.fecha_publicacion) as max_pub=20=20 FROM cont_publicacion cp1 GROUP BY id_instalacion,id_contenido,generar_vainilla) a=20=20 where=20 ... AND a.id_instalacion =3D cont_publicacion.id_instalacion AND a.id_contenido =3D cont_publicacion.id_contenido AND a.generar_vainilla =3D cont_publicacion.generar_vainilla AND a.max_pub =3D cont_publicacion.fecha_publicacion=20 Sorry for this missing group. Bye, Volker From pgsql-performance-owner@postgresql.org Tue Aug 5 06:45: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 4CD77D1C97F for ; Tue, 5 Aug 2003 09:40:21 +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 97760-02 for ; Tue, 5 Aug 2003 06:39:05 -0300 (ADT) Received: from lassen.berkeley.edu (lassen.Berkeley.EDU [128.32.25.102]) by svr1.postgresql.org (Postfix) with ESMTP id 0C0FCD1C932 for ; Tue, 5 Aug 2003 06:40:10 -0300 (ADT) Received: from uclink4.berkeley.edu (localhost [127.0.0.1]) by lassen.berkeley.edu (8.12.9/8.12.9) with ESMTP id h759eAIm008680 for ; Tue, 5 Aug 2003 02:40:11 -0700 (PDT) Received: from ara (66-215-20-38.gln-mres.charterpipeline.net [66.215.20.38]) by uclink4.berkeley.edu (8.12.9/8.12.3) with ESMTP id h759e5Ur083791 for ; Tue, 5 Aug 2003 02:40:07 -0700 (PDT) Message-ID: <000501c35b34$9c945660$6401a8c0@charterpipeline.net> Reply-To: "Ara Anjargolian" From: "Ara Anjargolian" To: Subject: query/table design help Date: Tue, 5 Aug 2003 02:33:17 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/53 X-Sequence-Number: 2870 I have a table permissions with the fields (party_id integer, permission varchar, key_name varchar, key_value integer) for which I need to a query to see if a person has permission to carry out a particular action. The query looks like: SELECT 1 FROM permissions WHERE party_id in (4, 7, 11, 26) AND permission = 'permission8' AND ((key_name = 'keyname8' AND key_value = 223) OR (key_name = 'keyname1' AND key_value = 123) OR (key_name = 'keyname5' AND key_value = 212) OR (key_name = 'keyname7' AND key_value = 523) OR (key_name = 'keyname0' AND key_value = 123) OR (key_name = 'keyname10' AND key_value = 400)); would a permissions(party_id, permission) index work best here? or should I index all 4 columns? Also, Another alternative is to combine the key_name and key_value fields into a varchar field key (e. g. 'keyname8=223'), in which case the equilalent query would just check 1 field 6 times instead of having 6 ANDstatements. I expect the table to have about 1 million rows at the most, and I need this query to run as fast as possible since it will be run many, many times. So, from a design standpoint, what is the the best way to go, should I have two fields key_name, and key_value, or just one field key. And how should I index this table best. I guess the fundamental question here is, is it faster to check a varchar(60) field for equality, or to check two check an integer and then a varchar(30). Or does having one varchar field replace an integer and a varchar field, allow for some nice optimization not practical otherwise (i.e a 3-column index). I'd greatly appreciate any insight into this matter. -Ara Anjargolian From pgsql-performance-owner@postgresql.org Tue Aug 5 06: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 E1AA1D1C932 for ; Tue, 5 Aug 2003 09:56: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 95614-09 for ; Tue, 5 Aug 2003 06:54:55 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 12CCED1CA01 for ; Tue, 5 Aug 2003 06:56:00 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h759uEfZ031662 for ; Tue, 5 Aug 2003 15:26:14 +0530 Received: from daithan.intranet.pspl.co.in (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 h759uDip031636; Tue, 5 Aug 2003 15:26:13 +0530 From: Shridhar Daithankar To: "Ara Anjargolian" Subject: Re: query/table design help Date: Tue, 5 Aug 2003 15:27:50 +0530 User-Agent: KMail/1.5.2 References: <000501c35b34$9c945660$6401a8c0@charterpipeline.net> In-Reply-To: <000501c35b34$9c945660$6401a8c0@charterpipeline.net> Cc: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308051527.50790.shridhar_daithankar@nospam.persistent.co.in> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/54 X-Sequence-Number: 2871 On Tuesday 05 August 2003 15:03, Ara Anjargolian wrote: > I have a table > permissions > with the fields (party_id integer, permission varchar, key_name varchar, > key_value integer) > for which I need to a query to see if a person has permission to carry out > a particular action. > The query looks like: > SELECT 1 > FROM permissions > WHERE party_id in (4, 7, 11, 26) > AND > permission = 'permission8' > AND > ((key_name = 'keyname8' AND key_value = 223) OR > (key_name = 'keyname1' AND key_value = 123) OR > (key_name = 'keyname5' AND key_value = 212) OR > (key_name = 'keyname7' AND key_value = 523) OR > (key_name = 'keyname0' AND key_value = 123) OR > (key_name = 'keyname10' AND key_value = 400)); > > would a permissions(party_id, permission) index work best here? > or should I index all 4 columns? > > Also, > Another alternative is to combine the key_name and key_value fields into a > varchar > field key (e. g. 'keyname8=223'), in which case the equilalent query would > just check > 1 field 6 times instead of having 6 ANDstatements. > > I expect the table to have about 1 million rows at the most, and I need > this query to run as fast > as possible since it will be run many, many times. I would suggest a 3 column table with party id, action and permission. Index on partyid and action. If table is static enough clustering should help. But this is one of many possible ways to design it. There could be other details that can affect this decision. Shridhar From pgsql-performance-owner@postgresql.org Tue Aug 5 09:09:50 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 9E993D1C514 for ; Tue, 5 Aug 2003 12:09:26 +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 02365-04 for ; Tue, 5 Aug 2003 09:08:11 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id C22ABD1C4E0 for ; Tue, 5 Aug 2003 09:09:14 -0300 (ADT) Received: (qmail 68921 invoked from network); 5 Aug 2003 12:09:20 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 5 Aug 2003 12:09:20 -0000 Date: Tue, 5 Aug 2003 08:09:19 -0400 (EDT) From: Jeff To: pgsql-performance@postgresql.org Subject: Some vacuum & tuning help Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/55 X-Sequence-Number: 2872 I've been trying to search through the archives, but it hasn't been successful. We recently upgraded from pg7.0.2 to 7.3.4 and things were happy. I'm trying to fine tune things to get it running a bit better and I'm trying to figure out how vacuum output correlates to tuning parameters. Here's the msot recent vacuum for the "active" table. It gets a few hundred updates/inserts a minute constantly throughout the day. INFO: Pages 27781: Changed 0, Empty 0; Tup 2451648: Vac 0, Keep 0, UnUsed 1003361. Total CPU 2.18s/0.61u sec elapsed 2.78 sec. I see unused is quite high. This morning I bumped max_fsm_pages to 500000. If I'm thinking right you want unused and max_fsm to be closish, right? (Yesterday it was down around.. oh.. 600k?) I'm thinking vacuum full's may be in order. Which stinks because I was hoping to do away with the db essentially down for 10 minutes (includes all the db's on that machine) while it vacuum'd. The upside is: it is performing great. During the vacuum analyze I do get a few multi-second pauses while something occurs. I figured it was a checkpoint, so I bumped checkpoint_timeout to 30 seconds and wal_buffers to 128. (I'm just guessing on wal_buffers). Machine is weenucks 2.2.17 on a dual p3 800, 2gb ram, 18gb drive (mirrored). If you guys need other info (shared_buffers, etc) I'll be happy to funish them. but the issue isn't query slowness.. just want to get this thing oiled). thanks -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Tue Aug 5 09:35:24 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id CE2FAD1C7EF for ; Tue, 5 Aug 2003 12:33:45 +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 05748-05 for ; Tue, 5 Aug 2003 09:32:30 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id E4597D1C4B7 for ; Tue, 5 Aug 2003 09:33:33 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h75CXpar015954 for ; Tue, 5 Aug 2003 18:03:51 +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 h75CXoip015940 for ; Tue, 5 Aug 2003 18:03:51 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Tue, 05 Aug 2003 18:05:26 +0530 MIME-Version: 1.0 Subject: Re: Some vacuum & tuning help Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F2FF1E6.10579.651E89@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: 200308/56 X-Sequence-Number: 2873 On 5 Aug 2003 at 8:09, Jeff wrote: > I've been trying to search through the archives, but it hasn't been > successful. > > We recently upgraded from pg7.0.2 to 7.3.4 and things were happy. I'm > trying to fine tune things to get it running a bit better and I'm trying > to figure out how vacuum output correlates to tuning parameters. > > Here's the msot recent vacuum for the "active" table. It gets a few > hundred updates/inserts a minute constantly throughout the day. I would suggest autovacuum daemon which is in CVS contrib works for 7.3.x as well.. Or schedule a vacuum analyze every 15 minutes or so.. > > INFO: Pages 27781: Changed 0, Empty 0; Tup 2451648: Vac 0, Keep 0, UnUsed > 1003361. > Total CPU 2.18s/0.61u sec elapsed 2.78 sec. > > I see unused is quite high. This morning I bumped max_fsm_pages to 500000. > If I'm thinking right you want unused and max_fsm to be closish, right? > (Yesterday it was down around.. oh.. 600k?) > > I'm thinking vacuum full's may be in order. Which stinks because I was > hoping to do away with the db essentially down for 10 minutes (includes > all the db's on that machine) while it vacuum'd. I think vacuum full is required. > The upside is: it is performing great. During the vacuum analyze I do get > a few multi-second pauses while something occurs. I figured it was a > checkpoint, so I bumped checkpoint_timeout to 30 seconds and wal_buffers > to 128. (I'm just guessing on wal_buffers). If it is couple of tables that are that heavily killed, I would suggest to a pg_dump, drop table and reload table. That should take less time. Your downtime might not be 10 minutes but more like 15 say. That's a rough estimate.. > > Machine is weenucks 2.2.17 on a dual p3 800, 2gb ram, 18gb drive (mirrored). You mean linux? I guess you need a kernel revision for a long time. How about 2.4.21? > If you guys need other info (shared_buffers, etc) I'll be happy to funish > them. but the issue isn't query slowness.. just want to get this thing > oiled). See if this helps.. Bye Shridhar -- QOTD: "I thought I saw a unicorn on the way over, but it was just a horse with one of the horns broken off." From pgsql-performance-owner@postgresql.org Tue Aug 5 10:16:29 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 91888D1C932 for ; Tue, 5 Aug 2003 13:15: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 08056-02 for ; Tue, 5 Aug 2003 10:14:07 -0300 (ADT) Received: from smtp.blueyonder.co.uk (pc-62-30-143-217-gl.blueyonder.co.uk [62.30.143.217]) by svr1.postgresql.org (Postfix) with ESMTP id 5A3DED1C4B7 for ; Tue, 5 Aug 2003 10:15:11 -0300 (ADT) Received: from reddragon.localdomain ([127.0.0.1] helo=localhost) by smtp.blueyonder.co.uk with esmtp (Exim 4.10) id 19k1f6-0002u4-00 for pgsql-performance@postgresql.org; Tue, 05 Aug 2003 14:15:36 +0100 Date: Tue, 5 Aug 2003 14:15:36 +0100 (BST) From: Peter Childs X-X-Sender: peter@RedDragon.Childs Cc: pgsql-performance@postgresql.org Subject: Re: Some vacuum & tuning help In-Reply-To: <3F2FF1E6.10579.651E89@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/57 X-Sequence-Number: 2874 On Tue, 5 Aug 2003, Shridhar Daithankar wrote: > On 5 Aug 2003 at 8:09, Jeff wrote: > > I would suggest autovacuum daemon which is in CVS contrib works for 7.3.x as > well.. Or schedule a vacuum analyze every 15 minutes or so.. I've just got autovacum up and Since we have had a lot of talk about it recently..... I thought some feed back might be useful. It seams to work quite well. But can be rather zelous on its analysing for the first few hours. Curretly its analysig static (ie nothigs changed) tables every 10minites. Vacuums seam to be about right. I think that many vacuums may be slowing does my database.... Peter Childs From pgsql-performance-owner@postgresql.org Tue Aug 5 10:21:21 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 AB4C6D1C932 for ; Tue, 5 Aug 2003 13:18:41 +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 06618-10 for ; Tue, 5 Aug 2003 10:17:26 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id 7FEA9D1C4B7 for ; Tue, 5 Aug 2003 10:18:30 -0300 (ADT) Received: (qmail 69207 invoked from network); 5 Aug 2003 13:18:37 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 5 Aug 2003 13:18:37 -0000 Date: Tue, 5 Aug 2003 09:18:37 -0400 (EDT) From: Jeff To: Shridhar Daithankar Cc: "pgsql-performance@postgresql.org" Subject: Re: Some vacuum & tuning help In-Reply-To: <3F2FF1E6.10579.651E89@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/59 X-Sequence-Number: 2876 On Tue, 5 Aug 2003, Shridhar Daithankar wrote: > > I would suggest autovacuum daemon which is in CVS contrib works for 7.3.x as > well.. Or schedule a vacuum analyze every 15 minutes or so.. > > Good Call. I'll give that a whirl and let you know. > I think vacuum full is required. > D'oh. Would this be a regular thing? I suppose we could do it weekly. As for the pg_dumping of it. I suppose it would work on this table as it is only a couple million rows and not terribly big data-wise. The other tables in this db are rather big and a load is not fast. (It is about 8GB). thanks > You mean linux? I guess you need a kernel revision for a long time. How about > 2.4.21? > Yeah, linux. We're planning on upgrading when we relocate datacenters at the end of August. This machine has actually been up for 486 days (We're hoping to reach linux's uptime wraparound of 496 days :) and the only reason it went down then was because the power supply failed. (That can be read: pg7.0.2 had over a year of uptime. lets hope 7.3 works as good :) -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Tue Aug 5 10:21: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 240A4D1C9CE for ; Tue, 5 Aug 2003 13:19:51 +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 07537-03 for ; Tue, 5 Aug 2003 10:18:36 -0300 (ADT) Received: from lorraine.ipl.co.uk (lorraine.ipl.co.uk [195.112.52.123]) by svr1.postgresql.org (Postfix) with ESMTP id 2EEFCD1C9C9 for ; Tue, 5 Aug 2003 10:19:39 -0300 (ADT) Received: from HFPORT.dmr.co.uk ([195.112.52.21]) by lorraine.ipl.co.uk (8.12.9/8.12.9) with ESMTP id h75DJDD4014804; Tue, 5 Aug 2003 14:19:16 +0100 Message-Id: <5.1.0.14.0.20030805141440.06a69140@mailserver.ipl.co.uk> X-Sender: hf1@mailserver.ipl.co.uk X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Tue, 05 Aug 2003 14:20:01 +0100 To: scott.marlowe@ihs.com From: Hilary Forbes Subject: Fwd: Re: postgresql.conf Cc: "Robert Treat" , pgsql-performance@postgresql.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/58 X-Sequence-Number: 2875 Scott >For example, a dedicated database for a webserver would be tuned >differently from a server that was running both the webserver and the database on >the same machine. This is the situation I'm having fun and games with so I'd be very interested. (Client has made the mistake of putting Mr Gates firewall in between the two to add to my woes!!) Looking forward to seeing the outcome of your documentation immensely. Many thanks Hilary Hilary Forbes ------------- DMR Computer Limited: http://www.dmr.co.uk/ Direct line: 01689 889950 Switchboard: (44) 1689 860000 Fax: (44) 1689 860330 E-mail: hforbes@dmr.co.uk ********************************************************** From pgsql-performance-owner@postgresql.org Tue Aug 5 10:33:25 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 1D9A4D1C9D8 for ; Tue, 5 Aug 2003 13:33:24 +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 10189-02 for ; Tue, 5 Aug 2003 10:32:09 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 4B9F2D1C9C9 for ; Tue, 5 Aug 2003 10:33:12 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h75DXUjg002985 for ; Tue, 5 Aug 2003 19:03:30 +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 h75DXUip002972 for ; Tue, 5 Aug 2003 19:03:30 +0530 From: "Shridhar Daithankar" To: "pgsql-performance@postgresql.org" Date: Tue, 05 Aug 2003 19:05:05 +0530 MIME-Version: 1.0 Subject: Re: Some vacuum & tuning help Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F2FFFE1.6163.9BBBFB@localhost> In-reply-to: References: <3F2FF1E6.10579.651E89@localhost> 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: 200308/60 X-Sequence-Number: 2877 On 5 Aug 2003 at 9:18, Jeff wrote: > As for the pg_dumping of it. I suppose it would work on this table as it > is only a couple million rows and not terribly big data-wise. The other > tables in this db are rather big and a load is not fast. (It is about > 8GB). You need to dump only those table which has unusualy high unused stats. If that is a small table, dump/reload it would be far faster than vacuum.. For others vacuum analyse should do.. > > You mean linux? I guess you need a kernel revision for a long time. How about > > 2.4.21? > > > Yeah, linux. We're planning on upgrading when we relocate datacenters at > the end of August. This machine has actually been up for 486 days (We're > hoping to reach linux's uptime wraparound of 496 days :) and the only > reason it went down then was because the power supply failed. (That can > be read: pg7.0.2 had over a year of uptime. lets hope 7.3 works as good :) Good to know that. AFAIK, the 496 wraparound is fixed in 2.6. So that won't be a complaint any longer.. Bye Shridhar -- Gravity: What you get when you eat too much and too fast. From pgsql-performance-owner@postgresql.org Tue Aug 5 10:46: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 E1031D1C9DE for ; Tue, 5 Aug 2003 13:46: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 07537-05 for ; Tue, 5 Aug 2003 10:45:39 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id F1B0AD1C9D8 for ; Tue, 5 Aug 2003 10:46:41 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h75Dl1is005777 for ; Tue, 5 Aug 2003 19:17:01 +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 h75Dkxir005751 for ; Tue, 5 Aug 2003 19:17:00 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Tue, 05 Aug 2003 19:18:33 +0530 MIME-Version: 1.0 Subject: Re: Some vacuum & tuning help Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F300309.24908.A81164@localhost> In-reply-to: References: <3F2FF1E6.10579.651E89@localhost> 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: 200308/61 X-Sequence-Number: 2878 On 5 Aug 2003 at 14:15, Peter Childs wrote: > On Tue, 5 Aug 2003, Shridhar Daithankar wrote: > > > On 5 Aug 2003 at 8:09, Jeff wrote: > > > > I would suggest autovacuum daemon which is in CVS contrib works for 7.3.x as > > well.. Or schedule a vacuum analyze every 15 minutes or so.. > > I've just got autovacum up and Since we have had a lot of talk > about it recently..... I thought some feed back might be useful. > It seams to work quite well. But can be rather zelous on its > analysing for the first few hours. Curretly its analysig static (ie > nothigs changed) tables every 10minites. Vacuums seam to be about right. > I think that many vacuums may be slowing does my database.... IIRC there is per operation threshold. If update threshold is 5% and table is 2% updatedit, then it should not look at it at all. It's worth mentioning that you should start auto vacuum daemon on a clean database. i.e. no pending vacuum. It is not supposed to start with a database which has lots of clean up pending. The essence of auto vacuum daemon is to maintain a clean database in clean state.. I agree, specifying per table thresholds would be good in autovacuum.. Bye Shridhar -- WYSIWYG: What You See Is What You Get. From pgsql-performance-owner@postgresql.org Tue Aug 5 11:16: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 9C71DD1C9E8 for ; Tue, 5 Aug 2003 14:16:52 +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 07483-08 for ; Tue, 5 Aug 2003 11:15:38 -0300 (ADT) Received: from smtp.blueyonder.co.uk (pc-62-30-143-217-gl.blueyonder.co.uk [62.30.143.217]) by svr1.postgresql.org (Postfix) with ESMTP id B8C2AD1C9C9 for ; Tue, 5 Aug 2003 11:16:41 -0300 (ADT) Received: from reddragon.localdomain ([127.0.0.1] helo=localhost) by smtp.blueyonder.co.uk with esmtp (Exim 4.10) id 19k2cf-0002y5-00 for pgsql-performance@postgresql.org; Tue, 05 Aug 2003 15:17:09 +0100 Date: Tue, 5 Aug 2003 15:17:09 +0100 (BST) From: Peter Childs X-X-Sender: peter@RedDragon.Childs Cc: pgsql-performance@postgresql.org Subject: Re: Some vacuum & tuning help In-Reply-To: <3F300309.24908.A81164@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/62 X-Sequence-Number: 2879 On Tue, 5 Aug 2003, Shridhar Daithankar wrote: > On 5 Aug 2003 at 14:15, Peter Childs wrote: > > > On Tue, 5 Aug 2003, Shridhar Daithankar wrote: > > > > > On 5 Aug 2003 at 8:09, Jeff wrote: > > > > > > I would suggest autovacuum daemon which is in CVS contrib works for 7.3.x as > > > well.. Or schedule a vacuum analyze every 15 minutes or so.. > > > > I've just got autovacum up and Since we have had a lot of talk > > about it recently..... I thought some feed back might be useful. > > It seams to work quite well. But can be rather zelous on its > > analysing for the first few hours. Curretly its analysig static (ie > > nothigs changed) tables every 10minites. Vacuums seam to be about right. > > I think that many vacuums may be slowing does my database.... Sorry typo big time it should read "I think that may analysing may may be slowing down my database. > > IIRC there is per operation threshold. If update threshold is 5% and table is > 2% updatedit, then it should not look at it at all. I left it with debug over night and it improved to that after 5 hours. switch the debug down (to 1) this morning and it has not settled down yet. > > It's worth mentioning that you should start auto vacuum daemon on a clean > database. i.e. no pending vacuum. It is not supposed to start with a database > which has lots of clean up pending. The essence of auto vacuum daemon is to > maintain a clean database in clean state.. > > I agree, specifying per table thresholds would be good in autovacuum.. Peter Childs From pgsql-performance-owner@postgresql.org Tue Aug 5 11:29: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 8F416D1C9CF for ; Tue, 5 Aug 2003 14:29:43 +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 13284-07 for ; Tue, 5 Aug 2003 11:28:29 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id B93F8D1C9C8 for ; Tue, 5 Aug 2003 11:29:32 -0300 (ADT) Received: from dev6.int.libertyrms.com ([10.1.2.212] helo=libertyrms.info) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19k2oY-0007aT-00; Tue, 05 Aug 2003 10:29:26 -0400 Received: by libertyrms.info (Postfix, from userid 1079) id 470F9BBADC; Tue, 5 Aug 2003 10:29:26 -0400 (EDT) To: shridhar_daithankar@persistent.co.in Cc: pgsql-performance@postgresql.org, "Matthew T. O'Connor" Subject: Re: Some vacuum & tuning help From: Christopher Browne Date: Tue, 05 Aug 2003 10:29:26 -0400 Message-ID: <60el00jhyx.fsf@dev6.int.libertyrms.info> User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/63 X-Sequence-Number: 2880 Shridhar Daithankar wrote: > I agree, specifying per table thresholds would be good in autovacuum.. Which begs the question of what the future direction is for pg_autovacuum. There would be some merit to having pg_autovacuum throw in some tables in which to store persistent information, and at that point, it would make sense to add some flags to support the respective notions that: -> Some tables should _never_ be touched; -> Some tables might get "reset" to indicate that they should be considered as having been recently vacuumed, or perhaps that they badly need vacuuming; -> As you suggest, per-table thresholds; -> pg_autovacuum would know when tables were last vacuumed by it... -> You could record vacuum times to tell pg_autovacuum that you vacuumed something "behind its back." -> If the system queued up proposed vacuums by having a "queue" table, you could request that pg_autovacuum do a vacuum on a particular table at the next opportunity. All well and interesting stuff that could be worth implementing. But the usual talk has been about ultimately integrating the functionality into the backend, making it fairly futile to enhance pg_autovacuum terribly much. Unfortunately, the "integrate into the backend" thing has long seemed "just around the corner." I think we should either: a) Decide to enhance pg_autovacuum, or b) Not. In view of how long the "better answers" seem to be taking to emerge, I think it makes sense to add functionality to pg_autovacuum. -- output = reverse("ofni.smrytrebil" "@" "enworbbc") Christopher Browne (416) 646 3304 x124 (land) From pgsql-performance-owner@postgresql.org Tue Aug 5 11:38: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 23D1ED1C932 for ; Tue, 5 Aug 2003 14:38: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 11804-07 for ; Tue, 5 Aug 2003 11:36:51 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 22C46D1C9C8 for ; Tue, 5 Aug 2003 11:37:55 -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 h75EbwSa022365; Tue, 5 Aug 2003 10:37:59 -0400 (EDT) To: Jeff Cc: pgsql-performance@postgresql.org Subject: Re: Some vacuum & tuning help In-reply-to: References: Comments: In-reply-to Jeff message dated "Tue, 05 Aug 2003 08:09:19 -0400" Date: Tue, 05 Aug 2003 10:37:58 -0400 Message-ID: <22364.1060094278@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/64 X-Sequence-Number: 2881 Jeff writes: > Here's the msot recent vacuum for the "active" table. It gets a few > hundred updates/inserts a minute constantly throughout the day. > INFO: Pages 27781: Changed 0, Empty 0; Tup 2451648: Vac 0, Keep 0, UnUsed > 1003361. > Total CPU 2.18s/0.61u sec elapsed 2.78 sec. > I see unused is quite high. This morning I bumped max_fsm_pages to 500000. > If I'm thinking right you want unused and max_fsm to be closish, right? No, they're unrelated. UnUsed is the number of currently-unused tuple pointers in page headers, whereas the FSM parameters are measured in pages. 30000 FSM slots would be more than enough for this table. The above numbers don't seem terribly unreasonable to me, although probably UnUsed would be smaller if you'd been vacuuming more often. If you see UnUsed continuing to increase then you definitely ought to shorten the intervacuum time. VACUUM FULL does not reclaim unused tuple pointers AFAIR, except where it is able to release entire pages at the end of the relation. So if you really wanted to get back down to nil UnUsed, you'd need to do a dump and reload of the table (or near equivalent, such as CLUSTER). Not sure it's worth the trouble. regards, tom lane From pgsql-performance-owner@postgresql.org Tue Aug 5 11:43: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 F344AD1C9CF for ; Tue, 5 Aug 2003 14:41:57 +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 12778-09 for ; Tue, 5 Aug 2003 11:40:43 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id EE6E9D1C9C9 for ; Tue, 5 Aug 2003 11:41:45 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h75Eg5IP018951 for ; Tue, 5 Aug 2003 20:12:05 +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 h75Eg4ip018925; Tue, 5 Aug 2003 20:12:05 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org, "Matthew T. O'Connor" Date: Tue, 05 Aug 2003 20:13:39 +0530 MIME-Version: 1.0 Subject: Re: Some vacuum & tuning help Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F300FF3.7064.DA8047@localhost> In-reply-to: <60el00jhyx.fsf@dev6.int.libertyrms.info> 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: 200308/65 X-Sequence-Number: 2882 On 5 Aug 2003 at 10:29, Christopher Browne wrote: > Shridhar Daithankar wrote: > > I agree, specifying per table thresholds would be good in autovacuum.. > > Which begs the question of what the future direction is for pg_autovacuum. > > There would be some merit to having pg_autovacuum throw in some tables > in which to store persistent information, and at that point, it would > make sense to add some flags to support the respective notions that: Well, the C++ version I wrote quite a while back, which resides on gborg and unmaintained, did that. It was considered as table pollution. However whenever autovacuum stuff goes in backend as such, it is going to need a catalogue. > -> Some tables should _never_ be touched; That can be determined runtime from stats. Not required as a special feature IMHO.. > > -> Some tables might get "reset" to indicate that they should be > considered as having been recently vacuumed, or perhaps that they > badly need vacuuming; Well, stats collector takes care of that. Autovacuum daemon reads that statistics, maintain a periodic snapshot of the same to determine whether or not it needs to vacuum. Why it crawls for a dirty database is as follows. Autovauum daemon starts, read statistics, sets it as base level and let a cycle pass, which is typically few minutes. When it goes again, it finds that lots of things are modified and need vacuum and so it triggers vacuum. Now vacuum goes on cleaning entire table which might be days job continously postponed some one reason or another. Oops.. your database is on it's knees.. > -> As you suggest, per-table thresholds; I would rather put it in terms of pages. If any table wastes 100 pages each, it deserves a vacuum.. > -> pg_autovacuum would know when tables were last vacuumed by > it... If you maintain a table in database, there are lot of things you can maintain. And you need to connect to database anyway to fire vacuum.. > -> You could record vacuum times to tell pg_autovacuum that you > vacuumed something "behind its back." It should notice.. > -> If the system queued up proposed vacuums by having a "queue" > table, you could request that pg_autovacuum do a vacuum on a > particular table at the next opportunity. That won't ever happen if autovacuum is constantly running.. > Unfortunately, the "integrate into the backend" thing has long seemed > "just around the corner." I think we should either: > a) Decide to enhance pg_autovacuum, or > b) Not. In fact, I would say that after we have autovacuum, we should not integrate it. It is a very handy tool of tighting a database. Other database go other way round. They develop maintance functionality built in and then create tool on top of it. Here we have it already done. It's just that it should be triggered by default. That would rock.. Bye Shridhar -- Bubble Memory, n.: A derogatory term, usually referring to a person's intelligence. See also "vacuum tube". From pgsql-performance-owner@postgresql.org Tue Aug 5 12:01:34 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 C2350D1C513 for ; Tue, 5 Aug 2003 15:01:31 +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 15424-03 for ; Tue, 5 Aug 2003 12:00:11 -0300 (ADT) Received: from mail-3.zoominternet.net (mail-3.zoominternet.net [63.67.120.3]) by svr1.postgresql.org (Postfix) with SMTP id B2C06D1C9C9 for ; Tue, 5 Aug 2003 12:01:20 -0300 (ADT) Received: (qmail 18771 invoked from network); 5 Aug 2003 15:01:16 -0000 Received: from acs-24-154-209-142.zoominternet.net (HELO gmod.lajolla) ([24.154.209.142]) (envelope-sender ) by mail-3.zoominternet.net (qmail-ldap-1.03) with SMTP for ; 5 Aug 2003 15:01:16 -0000 Subject: Re: [SQL] EXTERNAL storage and substring on long strings From: Scott Cain To: Joe Conway Cc: Tom Lane , PgSQL Performance ML , pgsql-sql@postgresql.org In-Reply-To: <3F2EC244.9040107@joeconway.com> References: <1059679600.1429.41.camel@localhost.localdomain> <3F297CBA.1080703@joeconway.com> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> <3574.1060012423@sss.pgh.pa.us> <1060014341.1434.53.camel@localhost.localdomain> <3F2EC244.9040107@joeconway.com> Content-Type: text/plain Organization: Cold Spring Harbor Lab Message-Id: <1060095679.1430.1.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 05 Aug 2003 11:01:19 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/66 X-Sequence-Number: 2883 Joe, Good idea, since I may not get around to profiling it this week. I created a dump of the data set I was working with. It is available at http://www.gmod.org/string_dump.bz2 Thanks, Scott On Mon, 2003-08-04 at 16:29, Joe Conway wrote: > Is there a sample table schema and dataset available (external-storage > case) that we can play with? > > Joe -- ------------------------------------------------------------------------ Scott Cain, Ph. D. cain@cshl.org GMOD Coordinator (http://www.gmod.org/) 216-392-3087 Cold Spring Harbor Laboratory From pgsql-performance-owner@postgresql.org Tue Aug 5 12:05:39 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 7C8A8D1C9DE for ; Tue, 5 Aug 2003 15:05:21 +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 15302-05 for ; Tue, 5 Aug 2003 12:04:00 -0300 (ADT) Received: from mail-1.zoominternet.net (mail-1.zoominternet.net [63.67.120.5]) by svr1.postgresql.org (Postfix) with SMTP id 64DFBD1C513 for ; Tue, 5 Aug 2003 12:05:09 -0300 (ADT) Received: (qmail 27782 invoked from network); 5 Aug 2003 15:05:06 -0000 Received: from acs-24-154-209-142.zoominternet.net (HELO gmod.lajolla) ([24.154.209.142]) (envelope-sender ) by mail-1.zoominternet.net (qmail-ldap-1.03) with SMTP for ; 5 Aug 2003 15:05:06 -0000 Subject: Re: [SQL] EXTERNAL storage and substring on long strings From: Scott Cain To: Joe Conway Cc: Tom Lane , PgSQL Performance ML , pgsql-sql@postgresql.org In-Reply-To: <1060095679.1430.1.camel@localhost.localdomain> References: <1059679600.1429.41.camel@localhost.localdomain> <3F297CBA.1080703@joeconway.com> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> <3574.1060012423@sss.pgh.pa.us> <1060014341.1434.53.camel@localhost.localdomain> <3F2EC244.9040107@joeconway.com> <1060095679.1430.1.camel@localhost.localdomain> Content-Type: text/plain Organization: Cold Spring Harbor Lab Message-Id: <1060095908.1431.3.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 05 Aug 2003 11:05:08 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/67 X-Sequence-Number: 2884 Oh, and I forgot to mention: it's highly compressed (bzip2 -9) and is 109M. Scott On Tue, 2003-08-05 at 11:01, Scott Cain wrote: > Joe, > > Good idea, since I may not get around to profiling it this week. I > created a dump of the data set I was working with. It is available at > http://www.gmod.org/string_dump.bz2 > > Thanks, > Scott > > > On Mon, 2003-08-04 at 16:29, Joe Conway wrote: > > Is there a sample table schema and dataset available (external-storage > > case) that we can play with? > > > > Joe -- ------------------------------------------------------------------------ Scott Cain, Ph. D. cain@cshl.org GMOD Coordinator (http://www.gmod.org/) 216-392-3087 Cold Spring Harbor Laboratory From pgsql-performance-owner@postgresql.org Tue Aug 5 12:07:03 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 0F5D9D1C9CF for ; Tue, 5 Aug 2003 15:06:50 +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 13867-08 for ; Tue, 5 Aug 2003 12:05:30 -0300 (ADT) Received: from neuromancer.ctlno.com (unknown [208.13.35.90]) by svr1.postgresql.org (Postfix) with ESMTP id CC417D1C932 for ; Tue, 5 Aug 2003 12:06:38 -0300 (ADT) Received: from hplaptop (ool-4352919e.dyn.optonline.net [67.82.145.158]) by neuromancer.ctlno.com (8.11.6/8.11.2) with SMTP id h75FFKR21918; Tue, 5 Aug 2003 10:15:20 -0500 Message-ID: <000b01c35b63$22d748d0$c202a8c0@hplaptop> From: "Matthew T. O'Connor" To: , "Christopher Browne" Cc: References: <60el00jhyx.fsf@dev6.int.libertyrms.info> Subject: Re: Some vacuum & tuning help Date: Tue, 5 Aug 2003 11:06:22 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/68 X-Sequence-Number: 2885 From: "Christopher Browne" > Shridhar Daithankar wrote: > > I agree, specifying per table thresholds would be good in autovacuum.. > > Which begs the question of what the future direction is for pg_autovacuum. This is a good question. > There would be some merit to having pg_autovacuum throw in some tables > in which to store persistent information As long as pg_autovacuum is either a contrib module, or not integrated into the backend, we can't do this. I don't think we should require that tables are added to your database in order to run pg_autovacuum, I have thought that a "helper table" could be used, this table, if found by pg_autovacuum would use it for per table defaults, exclusion list etc.... That way pg_autovacuum can run without a polluted database, or can be tuned. If pg_autovacuum in made official, moves out of contrib and becomes a core tool, then we can either add columns to some system catalogs to track this information or add a new system table. > All well and interesting stuff that could be worth implementing. > > But the usual talk has been about ultimately integrating the > functionality into the backend, making it fairly futile to enhance > pg_autovacuum terribly much. > > Unfortunately, the "integrate into the backend" thing has long seemed > "just around the corner." I think we should either: > a) Decide to enhance pg_autovacuum, or > b) Not. I have been talking about "integraging it into the backend" for a while, and I used to think it was "just around the corner" unfortunately, work schedule and my C skills have prevented me from getting anything useful working. If you would like to work on it, I would help as much as possible. I chose to leave pg_autovacuum simple and not add too many features because the core team has said that it needs to be integrated into the backend before it can be considered a core tool. ps, please cc me as I'm not subscribed to the list. From pgsql-performance-owner@postgresql.org Tue Aug 5 12:23:41 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 5BA6FD1C9FE; Tue, 5 Aug 2003 15:23:39 +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 18238-03; Tue, 5 Aug 2003 12:22:19 -0300 (ADT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 36D65D1C9ED; Tue, 5 Aug 2003 12:23:28 -0300 (ADT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.0.6) with ESMTP-TLS id 23570; Tue, 05 Aug 2003 07:44:40 -0700 Message-ID: <3F2FCB17.9010608@joeconway.com> Date: Tue, 05 Aug 2003 08:19:51 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Scott Cain Cc: Tom Lane , PgSQL Performance ML , pgsql-sql@postgresql.org Subject: Re: [SQL] EXTERNAL storage and substring on long strings References: <1059679600.1429.41.camel@localhost.localdomain> <3F297CBA.1080703@joeconway.com> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> <3574.1060012423@sss.pgh.pa.us> <1060014341.1434.53.camel@localhost.localdomain> <3F2EC244.9040107@joeconway.com> <1060095679.1430.1.camel@localhost.localdomain> <1060095908.1431.3.camel@localhost.localdomain> In-Reply-To: <1060095908.1431.3.camel@localhost.localdomain> 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: 200308/69 X-Sequence-Number: 2886 Scott Cain wrote: > Oh, and I forgot to mention: it's highly compressed (bzip2 -9) and is > 109M. Thanks. I'll grab a copy from home later today and see if I can find some time to poke at it. Joe From pgsql-performance-owner@postgresql.org Tue Aug 5 12:30:33 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 526D6D1C9EE for ; Tue, 5 Aug 2003 15:30:31 +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 14444-09 for ; Tue, 5 Aug 2003 12:29:11 -0300 (ADT) Received: from neuromancer.ctlno.com (unknown [208.13.35.90]) by svr1.postgresql.org (Postfix) with ESMTP id 2870DD1C9ED for ; Tue, 5 Aug 2003 12:30:20 -0300 (ADT) Received: from hplaptop (ool-4352919e.dyn.optonline.net [67.82.145.158]) by neuromancer.ctlno.com (8.11.6/8.11.2) with SMTP id h75FdAR22159; Tue, 5 Aug 2003 10:39:10 -0500 Message-ID: <001101c35b66$76ba0480$c202a8c0@hplaptop> From: "Matthew T. O'Connor" To: , References: <3F300FF3.7064.DA8047@localhost> Subject: Re: Some vacuum & tuning help Date: Tue, 5 Aug 2003 11:30:12 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/70 X-Sequence-Number: 2887 From: "Shridhar Daithankar" > On 5 Aug 2003 at 10:29, Christopher Browne wrote: > > > Shridhar Daithankar wrote: > > There would be some merit to having pg_autovacuum throw in some tables > > in which to store persistent information, > > Well, the C++ version I wrote quite a while back, which resides on gborg and > unmaintained, did that. It was considered as table pollution. However whenever > autovacuum stuff goes in backend as such, it is going to need a catalogue. right, I think there is a distinction between adding a system catalogue needed for core functionality, and requiring a user to put a table in the users name space of their database just to run a utility. As I mentioned in my other email, I do think that a non-required helper table could be a good idea, the question is should we do this considering autovacuum should be integrated into the backend at which point pg_autovacuum will be scrapped. > > -> Some tables should _never_ be touched; > > That can be determined runtime from stats. Not required as a special feature > IMHO.. > > > > > -> Some tables might get "reset" to indicate that they should be > > considered as having been recently vacuumed, or perhaps that they > > badly need vacuuming; > > Well, stats collector takes care of that. Autovacuum daemon reads that > statistics, maintain a periodic snapshot of the same to determine whether or > not it needs to vacuum. Actually I don't think that pg_autovacuum will notice. The stats that it watches no nothing about when a table is vacuumed outside of pg_autovacuum. I agree this is a deficiency, but I don't know how to get that information without being part of the backend. > Why it crawls for a dirty database is as follows. Autovauum daemon starts, read > statistics, sets it as base level and let a cycle pass, which is typically few > minutes. When it goes again, it finds that lots of things are modified and need > vacuum and so it triggers vacuum. > > Now vacuum goes on cleaning entire table which might be days job continously > postponed some one reason or another. Oops.. your database is on it's knees.. If one table takes days (or even hours) to vacuum, then most probably it requires *a lot* of activity before pg_autovacuum will try to vacuum the table. The thresholds are based on two factors, a base value (default = 1,000), and a multiplier (default = 2) of the total number of tuples. So using the default pg_autovacuum settings, a table with 1,000,000 rows will not be vacuumed until the number of rows updated or deleted = 2,001,000. So, a table shouldn't be vacuumed until it really needs it. This setup works well since a small table of say 100 rows, will be updated every 1,200 (updates or deletes). > > > -> As you suggest, per-table thresholds; > > I would rather put it in terms of pages. If any table wastes 100 pages each, it > deserves a vacuum.. unfortunately I don't know of an efficient method of looking at how many pages have free space without running vacuum or without using the pgstattuple contrib module which in my testing took about 90% as long to run as vacuum. > > -> pg_autovacuum would know when tables were last vacuumed by > > it... pg_autovacuum already does this, but the data does not persist through pg_autovacuum restarts. > If you maintain a table in database, there are lot of things you can maintain. > And you need to connect to database anyway to fire vacuum.. > > > -> You could record vacuum times to tell pg_autovacuum that you > > vacuumed something "behind its back." > > It should notice.. I don't think it does. > > -> If the system queued up proposed vacuums by having a "queue" > > table, you could request that pg_autovacuum do a vacuum on a > > particular table at the next opportunity. That would be a design changes as right now pg_autovacuum doesn't keep a list of tables to vacuum at all, it just decides to vacuum or not vacuum a table as it loops through the database. > > Unfortunately, the "integrate into the backend" thing has long seemed > > "just around the corner." I think we should either: > > a) Decide to enhance pg_autovacuum, or > > b) Not. I have been of the opinion to not enhance pg_autovacuum because it needs to be intgrated, and enhancing it will only put that off. Also, I think many of the real enhancements can only come from being integrated (using the FSM to make decisions, keepting track of external vacuums, modifying system catalogs to keep autovacuum information etc...) > In fact, I would say that after we have autovacuum, we should not integrate it. > It is a very handy tool of tighting a database. Other database go other way > round. They develop maintance functionality built in and then create tool on > top of it. Here we have it already done. I'm not sure I understand your point. > It's just that it should be triggered by default. That would rock.. I agree that if pg_autovacuum becomes a core tool (not contrib and not integrated into backend) then pg_ctl should fire it up and kill it automatically. From pgsql-performance-owner@postgresql.org Tue Aug 5 12:35:24 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 38362D1C4E0 for ; Tue, 5 Aug 2003 15:35:24 +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 16130-07 for ; Tue, 5 Aug 2003 12:34:04 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 5DCD5D1CA07 for ; Tue, 5 Aug 2003 12:35:13 -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 h75FZ6Sa022889; Tue, 5 Aug 2003 11:35:06 -0400 (EDT) To: "Matthew T. O'Connor" Cc: shridhar_daithankar@persistent.co.in, "Christopher Browne" , pgsql-performance@postgresql.org Subject: Re: Some vacuum & tuning help In-reply-to: <000b01c35b63$22d748d0$c202a8c0@hplaptop> References: <60el00jhyx.fsf@dev6.int.libertyrms.info> <000b01c35b63$22d748d0$c202a8c0@hplaptop> Comments: In-reply-to "Matthew T. O'Connor" message dated "Tue, 05 Aug 2003 11:06:22 -0400" Date: Tue, 05 Aug 2003 11:35:05 -0400 Message-ID: <22888.1060097705@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/71 X-Sequence-Number: 2888 "Matthew T. O'Connor" writes: > I chose to leave pg_autovacuum simple and not add too many features because > the core team has said that it needs to be integrated into the backend > before it can be considered a core tool. I think actually it makes plenty of sense to enhance pg_autovacuum while it's still contrib stuff. My guess is it'll be much less painful to whack it around in minor or major ways while it's standalone code. Once it's integrated in the backend, making significant changes will be harder and more ticklish. So, now is precisely the time to be experimenting to find out what works well and what features are needed. regards, tom lane From pgsql-performance-owner@postgresql.org Tue Aug 5 12:45:33 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 17444D1C9ED for ; Tue, 5 Aug 2003 15:45:31 +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 17485-09 for ; Tue, 5 Aug 2003 12:44:11 -0300 (ADT) Received: from neuromancer.ctlno.com (unknown [208.13.35.90]) by svr1.postgresql.org (Postfix) with ESMTP id 1BA50D1C4E0 for ; Tue, 5 Aug 2003 12:45:20 -0300 (ADT) Received: from hplaptop (ool-4352919e.dyn.optonline.net [67.82.145.158]) by neuromancer.ctlno.com (8.11.6/8.11.2) with SMTP id h75Fs2R22304; Tue, 5 Aug 2003 10:54:02 -0500 Message-ID: <004901c35b68$8a9d8010$c202a8c0@hplaptop> From: "Matthew T. O'Connor" To: "Tom Lane" Cc: , "Christopher Browne" , References: <60el00jhyx.fsf@dev6.int.libertyrms.info> <000b01c35b63$22d748d0$c202a8c0@hplaptop> <22888.1060097705@sss.pgh.pa.us> Subject: Re: Some vacuum & tuning help Date: Tue, 5 Aug 2003 11:45:04 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/72 X-Sequence-Number: 2889 From: "Tom Lane" > "Matthew T. O'Connor" writes: > > I chose to leave pg_autovacuum simple and not add too many features because > > the core team has said that it needs to be integrated into the backend > > before it can be considered a core tool. > > I think actually it makes plenty of sense to enhance pg_autovacuum while > it's still contrib stuff. My guess is it'll be much less painful to > whack it around in minor or major ways while it's standalone code. > Once it's integrated in the backend, making significant changes will be > harder and more ticklish. So, now is precisely the time to be > experimenting to find out what works well and what features are needed. Fair point, my only concern is that a backend integrated pg_autovacuum would be radically different from the current libpq based client application. When integrated into the backend you have access to a lot of information that you don't have access to as a client. I know one goal I have for the backend version is to be based on the FSM and not require the stats collector since it has a measurable negative effect on performance. But in the more general sense of learning what features people want (exclusion lists, per table defaults etc) I agree the current version is a sufficient testing ground. From pgsql-performance-owner@postgresql.org Tue Aug 5 12:59:57 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 92AB1D1C9EE for ; Tue, 5 Aug 2003 15:59:56 +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 17332-08 for ; Tue, 5 Aug 2003 12:58:37 -0300 (ADT) Received: from server2.sitesell.com (server2.sitesell.com [216.95.221.3]) by svr1.postgresql.org (Postfix) with SMTP id 91262D1C9FF for ; Tue, 5 Aug 2003 12:59:45 -0300 (ADT) Received: (qmail 15858 invoked from network); 5 Aug 2003 15:59:45 -0000 Received: from modemcable140.9-202-24.mtl.mc.videotron.ca (HELO ?192.168.192.1?) (24.202.9.140) by server2.sitesell.com with SMTP; 5 Aug 2003 15:59:45 -0000 Date: Tue, 5 Aug 2003 11:59:11 -0400 (EDT) From: Trevor Astrope X-X-Sender: astrope@gord.tabbweb.com To: pgsql-performance@postgresql.org Subject: How Many Inserts Per Transactions Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/73 X-Sequence-Number: 2890 I was wondering if anyone found a sweet spot regarding how many inserts to do in a single transaction to get the best performance? Is there an approximate number where there isn't any more performance to be had or performance may drop off? It's just a general question...I don't have any specific scenario, other than there are multiple backends doing many inserts. Thanks, Trevor From pgsql-performance-owner@postgresql.org Tue Aug 5 13:01:49 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 12C05D1C933 for ; Tue, 5 Aug 2003 16:01:49 +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 18318-08 for ; Tue, 5 Aug 2003 13:00:29 -0300 (ADT) Received: from neuromancer.ctlno.com (unknown [208.13.35.90]) by svr1.postgresql.org (Postfix) with ESMTP id A5228D1C9DB for ; Tue, 5 Aug 2003 13:01:37 -0300 (ADT) Received: from hplaptop (ool-4352919e.dyn.optonline.net [67.82.145.158]) by neuromancer.ctlno.com (8.11.6/8.11.2) with SMTP id h75GAKR22438; Tue, 5 Aug 2003 11:10:20 -0500 Message-ID: <004d01c35b6a$d176a320$c202a8c0@hplaptop> From: "Matthew T. O'Connor" To: "Tom Lane" Cc: , "Christopher Browne" , References: <60el00jhyx.fsf@dev6.int.libertyrms.info> <000b01c35b63$22d748d0$c202a8c0@hplaptop> <22888.1060097705@sss.pgh.pa.us> Subject: Re: Some vacuum & tuning help Date: Tue, 5 Aug 2003 12:01:22 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/74 X-Sequence-Number: 2891 From: "Tom Lane" > "Matthew T. O'Connor" writes: > So, now is precisely the time to be experimenting to find out what works well and what features are needed. Another quick question while I have your attention :-) Since pg_autovaccum is a contrib module does that mean I can make functional changes that will be included in point release of 7.4? From pgsql-performance-owner@postgresql.org Tue Aug 5 13:17:31 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 E5B7DD1C9DD for ; Tue, 5 Aug 2003 16:17:29 +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 21469-01 for ; Tue, 5 Aug 2003 13:16:10 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id B476ED1C933 for ; Tue, 5 Aug 2003 13:17:18 -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 h75GGAMY001020; Tue, 5 Aug 2003 10:16:10 -0600 (MDT) Date: Tue, 5 Aug 2003 10:02:45 -0600 (MDT) From: "scott.marlowe" To: Trevor Astrope Cc: Subject: Re: How Many Inserts Per Transactions In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/75 X-Sequence-Number: 2892 On Tue, 5 Aug 2003, Trevor Astrope wrote: > I was wondering if anyone found a sweet spot regarding how many inserts to > do in a single transaction to get the best performance? Is there an > approximate number where there isn't any more performance to be had or > performance may drop off? > > It's just a general question...I don't have any specific scenario, other > than there are multiple backends doing many inserts. I've found that after 1,000 or so inserts, there's no great increase in speed. From pgsql-performance-owner@postgresql.org Tue Aug 5 13:19: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 33F57D1C9EE for ; Tue, 5 Aug 2003 16:19: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 18238-08 for ; Tue, 5 Aug 2003 13:17:45 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 3E529D1C9DD for ; Tue, 5 Aug 2003 13:18:54 -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 h75GIlSa026336; Tue, 5 Aug 2003 12:18:48 -0400 (EDT) To: "Matthew T. O'Connor" Cc: shridhar_daithankar@persistent.co.in, "Christopher Browne" , pgsql-performance@postgresql.org Subject: Re: Some vacuum & tuning help In-reply-to: <004d01c35b6a$d176a320$c202a8c0@hplaptop> References: <60el00jhyx.fsf@dev6.int.libertyrms.info> <000b01c35b63$22d748d0$c202a8c0@hplaptop> <22888.1060097705@sss.pgh.pa.us> <004d01c35b6a$d176a320$c202a8c0@hplaptop> Comments: In-reply-to "Matthew T. O'Connor" message dated "Tue, 05 Aug 2003 12:01:22 -0400" Date: Tue, 05 Aug 2003 12:18:47 -0400 Message-ID: <26335.1060100327@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/76 X-Sequence-Number: 2893 "Matthew T. O'Connor" writes: > Since pg_autovaccum is a contrib module does that mean I can make functional > changes that will be included in point release of 7.4? Well, the bar is lower for contrib stuff than for core, but you'd better get such changes in PDQ, I'd say ... regards, tom lane From pgsql-performance-owner@postgresql.org Tue Aug 5 13:28:23 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 88881D1C9ED for ; Tue, 5 Aug 2003 16:28:21 +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 21978-02 for ; Tue, 5 Aug 2003 13:27:02 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id B5F07D1C4E0 for ; Tue, 5 Aug 2003 13:28:10 -0300 (ADT) Received: from dev6.int.libertyrms.com ([10.1.2.212] helo=libertyrms.info) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19k4fS-0000o4-00; Tue, 05 Aug 2003 12:28:10 -0400 Received: by libertyrms.info (Postfix, from userid 1079) id 31F7BBBADC; Tue, 5 Aug 2003 12:28:10 -0400 (EDT) To: Trevor Astrope Cc: pgsql-performance@postgresql.org Subject: Re: How Many Inserts Per Transactions From: Christopher Browne Date: Tue, 05 Aug 2003 12:28:10 -0400 Message-ID: <60d6fkhxwl.fsf@dev6.int.libertyrms.info> User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/77 X-Sequence-Number: 2894 Trevor Astrope wrote: > I was wondering if anyone found a sweet spot regarding how many > inserts to do in a single transaction to get the best performance? > Is there an approximate number where there isn't any more > performance to be had or performance may drop off? > > It's just a general question...I don't have any specific scenario, > other than there are multiple backends doing many inserts. The ideal should be enough to make the work involved in establishing the transaction context be a small part of the cost of processing the queries. Thus, 2 inserts should be twice as good as 1, by virtue of dividing the cost of the transaction 2 ways. Increasing the number of inserts/updates to 10 means splitting the cost 10 ways. Increasing the number to 1000 means splitting the cost 1000 ways, which, while better than merely splitting the cost 10 ways, probably _isn't_ a stunningly huge further improvement. The benefits of grouping more together drops off; you'll probably NOT notice much difference between grouping 10,000 updates together into a transaction as compared to grouping 15,000 updates together. Fortunately, it doesn't drop off to being downright WORSE. On Oracle, I have seen performance Suck Badly when using SQL*Load; if I grouped too many updates together, it started blowing up the "rollback segment," which was a Bad Thing. And in that kind of context, there will typically be some "sweet spot" where you want to commit transactions before they grow too big. In contrast, pg_dump/pg_restore puts the load of each table into a single COPY statement, so that if there are 15,000,000 entries in the table, that gets grouped into a single (rather enormous) transaction. And doing things that way presents no particular problem. -- output = ("cbbrowne" "@" "libertyrms.info") Christopher Browne (416) 646 3304 x124 (land) From pgsql-performance-owner@postgresql.org Tue Aug 5 13:50: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 90C1AD1C4E0 for ; Tue, 5 Aug 2003 16:50: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 22741-02 for ; Tue, 5 Aug 2003 13:48:50 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 0099AD1C9ED for ; Tue, 5 Aug 2003 13:49:51 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h75Gn1G25462; Tue, 5 Aug 2003 12:49:01 -0400 (EDT) From: Bruce Momjian Message-Id: <200308051649.h75Gn1G25462@candle.pha.pa.us> Subject: Re: Some vacuum & tuning help In-Reply-To: <26335.1060100327@sss.pgh.pa.us> To: Tom Lane Date: Tue, 5 Aug 2003 12:49:01 -0400 (EDT) Cc: "Matthew T. O'Connor" , shridhar_daithankar@persistent.co.in, Christopher Browne , pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/78 X-Sequence-Number: 2895 Tom Lane wrote: > "Matthew T. O'Connor" writes: > > Since pg_autovaccum is a contrib module does that mean I can make functional > > changes that will be included in point release of 7.4? > > Well, the bar is lower for contrib stuff than for core, but you'd better > get such changes in PDQ, I'd say ... The contrib stuff is usually at the control of the author, so you can make changes relatively late. However, the later the changes, the less testing they get, but the decision is mostly yours, rather than core. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Tue Aug 5 14:31: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 777FED1C933 for ; Tue, 5 Aug 2003 17:31: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 24040-08 for ; Tue, 5 Aug 2003 14:29:41 -0300 (ADT) Received: from ns.fairind.com (unknown [65.161.19.65]) by svr1.postgresql.org (Postfix) with ESMTP id 3C508D1C4E0 for ; Tue, 5 Aug 2003 14:30:48 -0300 (ADT) Received: from encounter.fairfield.com by ns.fairind.com via smtpd (for developer.postgresql.org [64.117.224.193]) with ESMTP; Tue, 5 Aug 2003 12:30:49 -0500 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Subject: Odd performance results - more info Date: Tue, 5 Aug 2003 12:30:46 -0500 Message-ID: <906E2C446A276048A1BE283F17BCB12CB137CA@encounter.fairind.fairfield.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Odd performance results - more info Thread-Index: AcNbd0xjo1Vz0MZiEdeZ6QBQBHwzDQ== From: "Medora Schauer" To: "postgresql" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/79 X-Sequence-Number: 2896 I didn't get any helpful responses to my previous email so I thought I would try again, this time with example code. Below is my orignal email and code for a dead simple ASCII menu driven=20 application that demonstrates the problem. The app starts up with a menu of 4 items to create the test databases, to run the float or int test or to quit. The databases created are named "int_db" and "float_db" and contain just 1 table and an index on that table, The tables are populated with 2000 records and the "test" menu options perform an UPDATE on each of the 2000 records. Postmaster is assumed to be running on "localhost". You only need to select the "Create=20 databases" option on the menu once.=20 I would greatly appreciate it if someone could run this code in their environment and let me know if you get results similiar to mine. The INT test results in execution times of 11 - 50+ secs increasing each time the test is run. The FLOAT test execution times are consistently < 3 secs regardless of how many times it is run. I hope this piques someones curiosity. I'd really like to know what is going on here... *********************************************************************** Medora Schauer Sr. Software Engineer Fairfield Industries Sugar Land, Tx 77478-3469 mschauer@fairfield.com *********************************************************************** original email: ***************************************************************************= ********* I have a table with a 3 column key. I noticed that when I update a non-key= field in a record of the table that the update was taking longer than I thought i= t=20 should. After much experimenting I discovered that if I changed the data types of two of the key columns to FLOAT8 that I got vastly improved performance. Orignally the data types of the 3 columns were FLOAT4, FLOAT4 and INT4. My plaform is a PowerPC running Linux. I speculated that the performance improvement might be because the PowePC is a 64 bit processor but when I changed the column data types to INT8, INT8 and INT4 I din't see any improvement. I also ran my test code on a Pentium 4 machine with the same results in all cases. This doesn't make any sense to me. Why would FLOAT8 keys ever result in improved performance? I verified with EXPLAIN that the index is used in every case for the update. My postmaster version is 7.1.3. Any help will be greatly appreciated. ***************************************************************************= ********** test code: #include #include #include #include #include #include #include #ifndef TRUE #define TRUE (1) #define FALSE (0) #endif #define INT_TYPE (0) #define FLOAT_TYPE (1) char buffer[200]; PGconn *fconn =3D NULL, *iconn =3D NULL; PGconn *CreateTestDb(int dtype); void AddRecords(PGconn *conn, int dtype); PGconn *Connect(char *dbname); int DoSql(PGconn *conn, char *query, PGresult **result); long FindExeTime(struct timeval *start_time, struct timeval *end_time); void UpdateTraceCounts(int dtype); =20 int main (int argc, char **argv) { char database[40]; char option[10]; int quit =3D FALSE; char response[100]; while (!quit){ printf ("\n\n\n" \ "c - Create databases.\n" \ "f - Run FLOAT8 test.\n" \ "i - Run INT8 test.\n" \ "q - Quit\n\n" \ "Selection : "); gets(option); =20 switch (option[0]){ case 'c' : printf ("Starting creation of FLOAT8 database...\n"); if ((fconn =3D CreateTestDb(FLOAT_TYPE)) =3D=3D NULL){ printf ("\n#### ERROR #### : Counldn't build FLOAT8 db.\n"); } else { printf ("Adding 2000 records to FLOAT8 database...\n"); AddRecords(fconn, FLOAT_TYPE); printf ("\nFLOAT8 Db created.\n"); }=20 printf ("Starting creation of INT8 database...\n"); if ((iconn =3D CreateTestDb(INT_TYPE)) =3D=3D NULL){ printf ("\n#### ERROR #### : Counldn't build INT8 db.\n"); } else { printf ("Adding 2000 records to INT8 database...\n"); AddRecords(iconn, INT_TYPE); printf ("\nINT8 Db created.\n"); }=20 break; =20=20=20=20=20=20 case 'f' : printf ("Updating 2000 records in FLOAT8 database...\n"); UpdateTraceCounts(FLOAT_TYPE); break; case 'i' : printf ("Updating 2000 records in INT8 database...\n"); UpdateTraceCounts(INT_TYPE); break; case 'q' : quit =3D TRUE; break; default: printf ("Invalid option.\n"); }=20=20=20=20=20=20=20=20=20=20 } if (iconn) PQfinish(iconn); if (fconn) PQfinish(fconn); exit (0); } =20 =20=20=20 void UpdateTraceCounts(int dtype){ int i, last, status; PGresult *result; struct timeval exe_begin, exe_end, exe_begin2, exe_end2; long exe_time, exe_time2; int shotpoint, shotline; PGconn *conn; =20=20=20=20 if (dtype =3D=3D FLOAT_TYPE){ if (fconn =3D=3D NULL){ if ((fconn =3D Connect("float_db")) =3D=3D NULL){ printf ("#### ERROR #### : Cannot connect to float_db datab= ase.\n"); return; } } conn =3D fconn; } else { if (iconn =3D=3D NULL){ if ((iconn =3D Connect("int_db")) =3D=3D NULL){ printf ("#### ERROR #### : Cannot connect to int_db databas= e.\n"); return; }=20 } conn =3D iconn; } last =3D 2000;=20 gettimeofday(&exe_begin2, NULL); =20=20=20=20 if ((status =3D DoSql(conn, "BEGIN TRANSACTION", &result)) !=3D 0){ printf("#### ERROR #### Error starting database transaction.\n");= =20 if (result) PQclear(result); } =20=20=20=20 gettimeofday(&exe_begin, NULL); =20=20=20=20 shotline =3D 1; shotpoint =3D 10001; for (i =3D 0; i < last; i++){ if (dtype =3D=3D INT_TYPE){ snprintf(buffer, sizeof(buffer),=20 "UPDATE shot_record SET trace_count =3D %d " \ "WHERE shot_line_num =3D %d " \ " AND shotpoint =3D %d " \ " AND index =3D %d" , 0, shotline, shotpoint + i, 0); } else { snprintf(buffer, sizeof(buffer), "UPDATE shot_record SET trace_count =3D %d " \ "WHERE shot_line_num =3D %f " \ " AND shotpoint =3D %f " \ " AND index =3D %d" , 0, (float)shotline, (float)shotpoint + (float)i, 0); } status =3D DoSql(conn, buffer, &result); if (status !=3D 0){ printf ("#### ERROR #### : Error updating db.\n"); break; } } =20=20=20=20 gettimeofday(&exe_end, NULL); if ((status =3D DoSql(conn, "COMMIT TRANSACTION", &result)) !=3D 0){ printf("#### ERROR #### : Error commiting database transaction.\n")= ;=20 if (result) PQclear(result); } =20=20=20=20 gettimeofday(&exe_end2, NULL); =20=20=20=20 exe_time =3D FindExeTime(&exe_begin, &exe_end); exe_time2 =3D FindExeTime(&exe_begin2, &exe_end2); printf ("time to complete updates: %ld msec\n", exe_time); printf ("total time: %ld msec\n", exe_time2); } PGconn * CreateTestDb(int dtype){ PGconn *conn; int status; PGresult *result; char *dbname; char *icmd_strings[] =3D {=20 "CREATE TABLE shot_record ( " \ "shot_line_num INT8, " \ "shotpoint INT8, " \ "index INT2, " \ "trace_count INT4, " \ "PRIMARY KEY (shot_line_num, shotpoint, index)) ", NULL};=20=20=20=20 char *fcmd_strings[] =3D { "CREATE TABLE shot_record ( " \ "shot_line_num FLOAT8, " \ "shotpoint FLOAT8, " \ "index INT2, " \ "trace_count INT4, " \ "PRIMARY KEY (shot_line_num, shotpoint, index))",= =20 NULL}; =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20 char **cmdP; if (dtype =3D=3D INT_TYPE){ cmdP =3D icmd_strings; dbname =3D "int_db"; } else { cmdP =3D fcmd_strings; dbname =3D "float_db"; } =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20 /* Open a connection to the template1 database. */ if ((conn =3D Connect("template1")) =3D=3D NULL){ fprintf(stderr, "Database connect query: %s\n", buffer); return(NULL); } /* Create the new database. */ snprintf(buffer, sizeof(buffer), "CREATE DATABASE %s", dbname); result =3D PQexec(conn, buffer); =20=20=20=20 if (!result || PQresultStatus(result) !=3D PGRES_COMMAND_OK){ if (result){ PQclear(result); } fprintf(stderr, "%s\n %s\n", buffer, PQresultErrorMessage(result= )); PQfinish(conn); return(NULL); } =20=20=20=20 PQclear(result);=20 PQfinish(conn); =20=20=20=20 /* Open a connection to the new database. */ if ((conn =3D Connect(dbname)) =3D=3D NULL){ return (NULL); } =20=20=20=20 /* Create the database tables. */ while (*cmdP){ if ((status =3D DoSql(conn, *cmdP, &result)) !=3D 0){ fprintf(stderr,"%s\n%s\n",=20 *cmdP, PQresultErrorMessage(result)); PQfinish(conn); return(NULL); } else { PQclear(result); } ++cmdP; } =20=20=20=20 return(conn); } void AddRecords(PGconn *conn, int dtype){ int num_shots, i; PGresult *result; int shotpoint; =20=20=20=20 /* Add a bunch of records to the table. */ num_shots =3D 2000;=20 =20=20=20=20 shotpoint =3D 10001; for (i =3D 0; i < num_shots; i++){ =20=20=20=20=20=20=20=20 if (dtype =3D=3D INT_TYPE){ sprintf (buffer, "INSERT INTO Shot_Record VALUES (1, %d, 0, 0)", shotpoint + i, shotpoint + i); } else { sprintf (buffer, "INSERT INTO Shot_Record VALUES (1.0, %f, 0, 0= ) ", shotpoint + (float)i, shotpoint + (float)i); } result =3D PQexec(conn, buffer); =20=20=20=20 if (!result || PQresultStatus(result) !=3D PGRES_COMMAND_OK){ if (result){ PQclear(result); } fprintf(stderr, "%s\n %s\n", buffer,PQresultErrorMessage(res= ult)); PQfinish(conn); return; } } } =20=20=20 PGconn * Connect(char *dbname){ char *func =3D "Connect()"; PGconn *conn; snprintf (buffer, sizeof(buffer), "host=3D'localhost' dbname=3D'%s'", d= bname); conn =3D PQconnectdb(buffer); =20=20=20 if (PQstatus(conn) !=3D CONNECTION_OK){ fprintf(stderr, "%s: Database connect query: %s\n", func, buffer); return(NULL); } =20 return (conn); }=20 int DoSql(PGconn *conn, char *query, PGresult **result){ char *func =3D "DoSql()"; int status =3D 0; =20=20=20=20 if (!conn){ return(-1); } =20=20=20=20 *result =3D PQexec(conn, query); if (!*result || ((PQresultStatus(*result) !=3D PGRES_COMMAND_OK)=20 && (PQresultStatus(*result) !=3D PGRES_TUPLES_OK))){ if (*result){ fprintf(stderr, "%s: %s\n%s\n", func, query, PQresultErrorMessa= ge(*result)); PQclear(*result); *result =3D NULL; } /* See if the database connection is valid. */ if (PQstatus(conn) =3D=3D CONNECTION_BAD){ status =3D -1; } else { status =3D -2; } } else { status =3D 0; } =20=20=20=20 return(status); } #define DB_TIME_CONVERT (1000) long FindExeTime(struct timeval *start_time, struct timeval *end_time){ long exe_time; exe_time =3D ((1000000 * end_time->tv_sec) + end_time->tv_usec) - ((1000000 * start_time->tv_sec) + start_time->tv_usec); return(exe_time/DB_TIME_CONVERT); } From pgsql-performance-owner@postgresql.org Tue Aug 5 14:45:32 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 50B0AD1C9DB for ; Tue, 5 Aug 2003 17:45:31 +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 25968-05 for ; Tue, 5 Aug 2003 14:44:12 -0300 (ADT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 34219D1C4E0 for ; Tue, 5 Aug 2003 14:45:20 -0300 (ADT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.0.6) with ESMTP-TLS id 23712; Tue, 05 Aug 2003 10:06:32 -0700 Message-ID: <3F2FEC57.5010201@joeconway.com> Date: Tue, 05 Aug 2003 10:41:43 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Medora Schauer Cc: postgresql Subject: Re: Odd performance results - more info References: <906E2C446A276048A1BE283F17BCB12CB137CA@encounter.fairind.fairfield.com> In-Reply-To: <906E2C446A276048A1BE283F17BCB12CB137CA@encounter.fairind.fairfield.com> 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: 200308/80 X-Sequence-Number: 2897 Medora Schauer wrote: > I would greatly appreciate it if someone could run this code in their > environment and let me know if you get results similiar to mine. > The INT test results in execution times of 11 - 50+ secs increasing > each time the test is run. The FLOAT test execution times are > consistently < 3 secs regardless of how many times it is run. Without actually trying the code, I'd bet that an index is getting used for the float8 case, but not in the int8 case: if (dtype == INT_TYPE){ snprintf(buffer, sizeof(buffer), "UPDATE shot_record SET trace_count = %d " \ "WHERE shot_line_num = %d " \ " AND shotpoint = %d " \ " AND index = %d" , 0, shotline, shotpoint + i, 0); } else { snprintf(buffer, sizeof(buffer), "UPDATE shot_record SET trace_count = %d " \ "WHERE shot_line_num = %f " \ " AND shotpoint = %f " \ " AND index = %d" , 0, (float)shotline, (float)shotpoint + (float)i, 0); } Try running EXPLAIN ANALYZE on these update statements manually. It also might help to run VACUUM ANALYZE after populating the tables. HTH, Joe From pgsql-performance-owner@postgresql.org Tue Aug 5 14:50: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 04266D1C9ED for ; Tue, 5 Aug 2003 17:50:16 +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 27817-03 for ; Tue, 5 Aug 2003 14:48:57 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id 102BED1C933 for ; Tue, 5 Aug 2003 14:50:05 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 7B0EBD640; Tue, 5 Aug 2003 10:50:05 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 70B705C0C; Tue, 5 Aug 2003 10:50:05 -0700 (PDT) Date: Tue, 5 Aug 2003 10:50:05 -0700 (PDT) From: Stephan Szabo To: Medora Schauer Cc: postgresql Subject: Re: Odd performance results - more info In-Reply-To: <906E2C446A276048A1BE283F17BCB12CB137CA@encounter.fairind.fairfield.com> Message-ID: <20030805104546.H62947-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/81 X-Sequence-Number: 2898 On Tue, 5 Aug 2003, Medora Schauer wrote: > I hope this piques someones curiosity. I'd really like to know > what is going on here... I think you're getting caught by the typing of constants preventing index scans. > "UPDATE shot_record SET trace_count = %d " \ > "WHERE shot_line_num = %d " \ > " AND shotpoint = %d " \ > " AND index = %d" , > 0, shotline, shotpoint + i, 0); I believe that the int constants are going to generally be treated as int4. If you're comparing them to an int8 you're not going to get an index scan probably. Try explicitly casting the constants to the appropriate type: CAST(%d AS int8). > snprintf(buffer, sizeof(buffer), > "UPDATE shot_record SET trace_count = %d " \ > "WHERE shot_line_num = %f " \ > " AND shotpoint = %f " \ > " AND index = %d" , > 0, (float)shotline, (float)shotpoint + (float)i, 0); Same general issue here, I think the floats are going to get treated as float8 in 7.1, so you'll probably need an explicit cast. As Joe said, try explain on the queries for more details. From pgsql-performance-owner@postgresql.org Tue Aug 5 14:58:37 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 39FE7D1C9DB for ; Tue, 5 Aug 2003 17:58:34 +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 27853-04 for ; Tue, 5 Aug 2003 14:57:15 -0300 (ADT) Received: from ns.fairind.com (unknown [65.161.19.65]) by svr1.postgresql.org (Postfix) with ESMTP id 1FBE1D1C933 for ; Tue, 5 Aug 2003 14:58:23 -0300 (ADT) Received: from encounter.fairfield.com by ns.fairind.com via smtpd (for developer.postgresql.org [64.117.224.193]) with ESMTP; Tue, 5 Aug 2003 12:58:24 -0500 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Subject: Re: Odd performance results - more info Date: Tue, 5 Aug 2003 12:58:23 -0500 Message-ID: <906E2C446A276048A1BE283F17BCB12CB137D4@encounter.fairind.fairfield.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PERFORM] Odd performance results - more info Thread-Index: AcNbeWUaR6mto2owR9uy0kf/c8ITugAAZYdw From: "Medora Schauer" To: "Joe Conway" Cc: "postgresql" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/82 X-Sequence-Number: 2899 =20 > Medora Schauer wrote: > > I would greatly appreciate it if someone could run this=20 > code in their > > environment and let me know if you get results similiar to mine. > > The INT test results in execution times of 11 - 50+ secs increasing > > each time the test is run. The FLOAT test execution times are > > consistently < 3 secs regardless of how many times it is run. >=20 > Without actually trying the code, I'd bet that an index is=20 > getting used=20 > for the float8 case, but not in the int8 case: >=20 I've already verifed that the index is used in both cases. Medora From pgsql-performance-owner@postgresql.org Tue Aug 5 15:18:41 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 D5F46D1C920 for ; Tue, 5 Aug 2003 18:18:39 +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 25968-10 for ; Tue, 5 Aug 2003 15:17:21 -0300 (ADT) Received: from ns.fairind.com (unknown [65.161.19.65]) by svr1.postgresql.org (Postfix) with ESMTP id F4183D1C91C for ; Tue, 5 Aug 2003 15:18:28 -0300 (ADT) Received: from encounter.fairfield.com by ns.fairind.com via smtpd (for developer.postgresql.org [64.117.224.193]) with ESMTP; Tue, 5 Aug 2003 13:18:30 -0500 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Subject: Re: Odd performance results - more info Date: Tue, 5 Aug 2003 13:18:29 -0500 Message-ID: <906E2C446A276048A1BE283F17BCB12CB137DE@encounter.fairind.fairfield.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PERFORM] Odd performance results - more info Thread-Index: AcNbeWUaR6mto2owR9uy0kf/c8ITugAAZYdwAACndlA= From: "Medora Schauer" To: "Medora Schauer" , "Joe Conway" Cc: "postgresql" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/83 X-Sequence-Number: 2900 >=20 > > Medora Schauer wrote: > > > I would greatly appreciate it if someone could run this=20 > > code in their > > > environment and let me know if you get results similiar to mine. > > > The INT test results in execution times of 11 - 50+ secs=20 > increasing > > > each time the test is run. The FLOAT test execution times are > > > consistently < 3 secs regardless of how many times it is run. > >=20 > > Without actually trying the code, I'd bet that an index is=20 > > getting used=20 > > for the float8 case, but not in the int8 case: > >=20 >=20 > I've already verifed that the index is used in both cases. >=20 I stand corrected. A sequential scan was being used in the INT8 case.=20= =20 When I changed it to INT4 I got better results. I got confused cuz=20 I had changed the types so often. Thanks for your help, Medora From pgsql-performance-owner@postgresql.org Tue Aug 5 18:40: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 61419D1C9E8 for ; Tue, 5 Aug 2003 21:40:25 +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 43736-02 for ; Tue, 5 Aug 2003 18:39:07 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 544F1D1C920 for ; Tue, 5 Aug 2003 18:40:14 -0300 (ADT) Received: from dev6.int.libertyrms.com ([10.1.2.212] helo=libertyrms.info) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19k9XU-0005Mq-00; Tue, 05 Aug 2003 17:40:16 -0400 Received: by libertyrms.info (Postfix, from userid 1079) id A08EDBBADC; Tue, 5 Aug 2003 17:40:16 -0400 (EDT) To: "Matthew T. O'Connor" Cc: pgsql-performance@postgresql.org Subject: Re: Some vacuum & tuning help From: Christopher Browne Date: Tue, 05 Aug 2003 17:40:16 -0400 Message-ID: <60d6fjhjgf.fsf@dev6.int.libertyrms.info> User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/84 X-Sequence-Number: 2901 Matthew T. O'Connor wrote: > Fair point, my only concern is that a backend integrated > pg_autovacuum would be radically different from the current libpq > based client application. Unfortunately, a "configurable-via-tables" pg_autovacuum is also going to be quite different from the current "unconfigurable" version. If we were to make it configurable, I would suggest doing so via specifying a database and schema into which it would then insert a set of tables to provide whatever information was considered worth 'fiddling' with. But at that point, it makes sense to add in quite a bit of "configurable" behaviour, such as: -> Specifying that certain tables should _never_ be automatically vacuumed. -> Establishing a "queue" of tables that pg_autovacuum plans to vacuum, so that users could add in desired vacuums ("after the other stuff being handled, force in a vacuum of app_table_foo"). That way, vacuums can be 'forced in' without introducing the possibility that multiple vacuums might be done at once... -> Making information about what vacuums have been done/planned persistent across runs of pg_autovacuum, and even across shutdowns of the DBMS. This changes behaviour enough that I'm not sure it's the same "program" as the unconfigurable version. Almost every option would be substantially affected by the logic: if (CONFIG_DATA_IN_DB) { /* Logic path that uses data in Vacuum Schema */ } else { /* More banal logic */ } If I can store configuration in the database, then I'd like to also make up a view or two, and possibly even base the logic used on views that combine configuration tables with system views. In effect, that makes for a _third_ radically different option. -- output = reverse("ofni.smrytrebil" "@" "enworbbc") Christopher Browne (416) 646 3304 x124 (land) From pgsql-performance-owner@postgresql.org Tue Aug 5 19:26:21 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 1750AD1C920 for ; Tue, 5 Aug 2003 22:26:19 +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 47680-01 for ; Tue, 5 Aug 2003 19:25:01 -0300 (ADT) Received: from perrin.int.nxad.com (internal.ext.nxad.com [69.1.70.251]) by svr1.postgresql.org (Postfix) with ESMTP id C6E51D1C4BC for ; Tue, 5 Aug 2003 19:26:07 -0300 (ADT) Received: by perrin.int.nxad.com (Postfix, from userid 1001) id D32C320F01; Tue, 5 Aug 2003 15:26:09 -0700 (PDT) Date: Tue, 5 Aug 2003 15:26:09 -0700 From: Sean Chittenden To: Manfred Koizar Cc: pgsql-performance@postgresql.org Subject: Re: Moving postgresql.conf tunables into 2003... Message-ID: <20030805222609.GF94710@perrin.int.nxad.com> References: <20030703190502.GR72567@perrin.int.nxad.com> <2422.1057264735@sss.pgh.pa.us> <20030704000646.GV72567@perrin.int.nxad.com> <4nfiiv850cu7vkp39tv7mk2b3pniim8ccu@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4nfiiv850cu7vkp39tv7mk2b3pniim8ccu@4ax.com> X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/85 X-Sequence-Number: 2902 > >> is some other problem that needs to be solved. (I'd wonder about > >> index correlation myself; we know that that equation is pretty > >> bogus.) > > > >Could be. I had him create a multi-column index on the date and a > >non-unique highly redundant id. > > Tom has already suspected index correlation to be a possible source > of the problem and recommended to CLUSTER on the index. A weakness > of the current planner implementation is that a multi column index > is always thought to have low correlation. In your case even after > CLUSTER the 2-column index on (date, sensorid) is treated like a > single column index with correlation 0.5. Howdy. Well, I got far enough with the guy in the testing to figure out that it wasn't a single vs multi-column index problem, however I haven't heard back from him regarding the use of CLUSTER. Ce est la IRC. :-p > I have an experimental patch lying around somewhere that tries to > work around these problems by offering different estimation methods > for index scans. If you are interested, I'll dig it out. Sure, I'll take a gander... had my head in enough Knuth recently to even hopefully have some kind of a useful response to the patch. > In the meantime have him try with a single column index on date. Been there, done that: no change. > |That's one heck of a poor estimate for the number of rows returned. > | > |> -> Seq Scan on mss_fwevent (cost=0.00..223312.60 rows=168478 width=12) > | (actual time=24253.66..24319.87 rows=320 loops=1) > > > -> Index Scan using mss_fwevent_evtime_sensorid_idx on mss_fwevent > > (cost=0.00..2442524.70 rows=168478 width=12) > > (actual time=68.36..132.84 rows=320 loops=1) > > Index Cond: ((evtime > (now() - '06:00'::interval)) AND (sensorid = 7)) > > Filter: (NOT "action") > > Estimated number of rows being wrong by a factor 500 seems to be the > main problem hiding everything else. With statistics already set to > 1000, does this mean that sensorid, evtime, and action are not > independent? It'd be interesting to know whether the estimation > error comes from "Index Cond" or from "Filter". Hrm... sensorid is sequence and grows proportional with evtime, obviously. Action is a char(1) or something like that (ie: not unique). See the EXPLAIN ANALYZEs that I posted in msgid: 20030704000646.GV72567@perrin.int.nxad.com.. or at the bottom of this msg. Having spent a fair amount of time looking at the two following plans, it seems as though an additional statistic is needed to change the cost of doing an index lookup when the index is linearly ordered. Whether CLUSTER does this or not, I don't know, I never heard back from him after getting the runtime down to a few ms. :-/ Are indexes on linearly ordered data rebalanced somehow? I thought CLUSTER only reordered data on disk. -sc Plan for normal random_page_cost: mss_masterlog=> SHOW random_page_cost; random_page_cost ------------------ 4 (1 row) mss_masterlog=> EXPLAIN ANALYZE SELECT srca, COUNT(srca) FROM mss_fwevent WHERE mss_masterlog-> sensorid = 7 AND evtime > (now() - '6 hours'::INTERVAL) mss_masterlog-> AND NOT action GROUP BY srca ORDER BY COUNT DESC LIMIT 20; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ Limit (cost=240384.69..240384.74 rows=20 width=12) (actual time=24340.04..24340.39 rows=20 loops=1) -> Sort (cost=240384.69..240426.80 rows=16848 width=12) (actual time=24340.02..24340.14 rows=21 loops=1) Sort Key: count(srca) -> Aggregate (cost=237938.36..239201.95 rows=16848 width=12) (actual time=24322.84..24330.73 rows=23 loops=1) -> Group (cost=237938.36..238780.75 rows=168478 width=12) (actual time=24322.57..24328.45 rows=320 loops=1) -> Sort (cost=237938.36..238359.55 rows=168478 width=12) (actual time=24322.55..24324.34 rows=320 loops=1) Sort Key: srca -> Seq Scan on mss_fwevent (cost=0.00..223312.60 rows=168478 width=12) (actual time=24253.66..24319.87 rows=320 loops=1) Filter: ((sensorid = 7) AND (evtime > (now() - '06:00'::interval)) AND (NOT "action")) Total runtime: 24353.67 msec (10 rows) Plan for altered random_page_cost: mss_masterlog=> SET random_page_cost = 0.32; SET mss_masterlog=> EXPLAIN ANALYZE SELECT srca, COUNT(srca) FROM mss_fwevent WHERE mss_masterlog-> sensorid = 7 AND evtime > (now() - '6 hours'::INTERVAL) mss_masterlog-> AND NOT action GROUP BY srca ORDER BY COUNT DESC LIMIT 20; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------- Limit (cost=227274.85..227274.90 rows=20 width=12) (actual time=28.42..28.75 rows=20 loops=1) -> Sort (cost=227274.85..227316.97 rows=16848 width=12) (actual time=28.41..28.52 rows=21 loops=1) Sort Key: count(srca) -> Aggregate (cost=224828.52..226092.11 rows=16848 width=12) (actual time=20.26..28.13 rows=23 loops=1) -> Group (cost=224828.52..225670.91 rows=168478 width=12) (actual time=19.99..25.86 rows=320 loops=1) -> Sort (cost=224828.52..225249.72 rows=168478 width=12) (actual time=19.98..21.76 rows=320 loops=1) Sort Key: srca -> Index Scan using mss_fwevent_evtime_sensorid_idx on mss_fwevent (cost=0.00..210202.76 rows=168478 width=12) (actual time=0.35..17.61 rows=320 loops=1) Index Cond: ((evtime > (now() - '06:00'::interval)) AND (sensorid = 7)) Filter: (NOT "action") Total runtime: 29.09 msec (11 rows) -- Sean Chittenden From pgsql-performance-owner@postgresql.org Tue Aug 5 22:38:16 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 2EFF6D1C7EB for ; Wed, 6 Aug 2003 01:18:15 +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 58817-06 for ; Tue, 5 Aug 2003 22:16:58 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id 273B6D1C910 for ; Tue, 5 Aug 2003 22:18:03 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h761I1Lt063971; Wed, 6 Aug 2003 09:18:01 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <080501c35bb8$d306e3a0$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "Jeff" , References: Subject: Re: Some vacuum & tuning help Date: Wed, 6 Aug 2003 09:19:45 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/86 X-Sequence-Number: 2903 Try the pg_autovacuum daemon in CVS contrib dir. It works fine with 7.3. Chris ----- Original Message ----- From: "Jeff" To: Sent: Tuesday, August 05, 2003 8:09 PM Subject: [PERFORM] Some vacuum & tuning help > I've been trying to search through the archives, but it hasn't been > successful. > > We recently upgraded from pg7.0.2 to 7.3.4 and things were happy. I'm > trying to fine tune things to get it running a bit better and I'm trying > to figure out how vacuum output correlates to tuning parameters. > > Here's the msot recent vacuum for the "active" table. It gets a few > hundred updates/inserts a minute constantly throughout the day. > > INFO: Pages 27781: Changed 0, Empty 0; Tup 2451648: Vac 0, Keep 0, UnUsed > 1003361. > Total CPU 2.18s/0.61u sec elapsed 2.78 sec. > > I see unused is quite high. This morning I bumped max_fsm_pages to 500000. > If I'm thinking right you want unused and max_fsm to be closish, right? > (Yesterday it was down around.. oh.. 600k?) > > I'm thinking vacuum full's may be in order. Which stinks because I was > hoping to do away with the db essentially down for 10 minutes (includes > all the db's on that machine) while it vacuum'd. > > The upside is: it is performing great. During the vacuum analyze I do get > a few multi-second pauses while something occurs. I figured it was a > checkpoint, so I bumped checkpoint_timeout to 30 seconds and wal_buffers > to 128. (I'm just guessing on wal_buffers). > > Machine is weenucks 2.2.17 on a dual p3 800, 2gb ram, 18gb drive (mirrored). > If you guys need other info (shared_buffers, etc) I'll be happy to funish > them. but the issue isn't query slowness.. just want to get this thing > oiled). > > thanks > > -- > Jeff Trout > http://www.jefftrout.com/ > http://www.stuarthamm.net/ > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > From pgsql-performance-owner@postgresql.org Wed Aug 6 01:22:34 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 A785BD1C48E for ; Wed, 6 Aug 2003 04:22:32 +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 74383-08 for ; Wed, 6 Aug 2003 01:21:11 -0300 (ADT) Received: from neuromancer.ctlno.com (unknown [208.13.35.90]) by svr1.postgresql.org (Postfix) with ESMTP id 5A8E5D1C518 for ; Wed, 6 Aug 2003 01:22:21 -0300 (ADT) Received: from tocr (ool-4352919e.dyn.optonline.net [67.82.145.158]) by neuromancer.ctlno.com (8.11.6/8.11.2) with ESMTP id h764UlR30127; Tue, 5 Aug 2003 23:30:47 -0500 Subject: Re: Some vacuum & tuning help From: "Matthew T. O'Connor" To: Bruce Momjian Cc: Tom Lane , shridhar_daithankar@persistent.co.in, Christopher Browne , pgsql-performance@postgresql.org In-Reply-To: <200308051649.h75Gn1G25462@candle.pha.pa.us> References: <200308051649.h75Gn1G25462@candle.pha.pa.us> Content-Type: text/plain Organization: Zeut Tech Message-Id: <1060143711.17472.2.camel@zeutrh9> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 (1.4.3-1) Date: 06 Aug 2003 00:21:51 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/87 X-Sequence-Number: 2904 On Tue, 2003-08-05 at 12:49, Bruce Momjian wrote: > > Well, the bar is lower for contrib stuff than for core, but you'd better > > get such changes in PDQ, I'd say ... > > The contrib stuff is usually at the control of the author, so you can > make changes relatively late. However, the later the changes, the less > testing they get, but the decision is mostly yours, rather than core. Well I don't have anything in the hopper right now, so there is little chance anything would be ready before the release. My really question was can I make large changes to a contrib module to a point release, meaning, 7.4.0 will have what is in beta, but 7.4.1 would have a much improved version. Does that sound possible? Or too radical for a point release? From pgsql-performance-owner@postgresql.org Wed Aug 6 01:32:33 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 3ABE6D1C4ED for ; Wed, 6 Aug 2003 04:32:29 +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 75335-06 for ; Wed, 6 Aug 2003 01:31:08 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 27F47D1C4B7 for ; Wed, 6 Aug 2003 01:32:17 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h764W2i01885; Wed, 6 Aug 2003 00:32:02 -0400 (EDT) From: Bruce Momjian Message-Id: <200308060432.h764W2i01885@candle.pha.pa.us> Subject: Re: Some vacuum & tuning help In-Reply-To: <1060143711.17472.2.camel@zeutrh9> To: "Matthew T. O'Connor" Date: Wed, 6 Aug 2003 00:32:02 -0400 (EDT) Cc: Tom Lane , shridhar_daithankar@persistent.co.in, Christopher Browne , pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/88 X-Sequence-Number: 2905 Matthew T. O'Connor wrote: > On Tue, 2003-08-05 at 12:49, Bruce Momjian wrote: > > > Well, the bar is lower for contrib stuff than for core, but you'd better > > > get such changes in PDQ, I'd say ... > > > > The contrib stuff is usually at the control of the author, so you can > > make changes relatively late. However, the later the changes, the less > > testing they get, but the decision is mostly yours, rather than core. > > Well I don't have anything in the hopper right now, so there is little > chance anything would be ready before the release. My really question > was can I make large changes to a contrib module to a point release, > meaning, 7.4.0 will have what is in beta, but 7.4.1 would have a much > improved version. Does that sound possible? Or too radical for a point > release? Yes, that is possible, but you should try to get lots of testers because there is little testing in minor releases. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Wed Aug 6 01:36:26 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 D4DCAD1C94D for ; Wed, 6 Aug 2003 04:36:24 +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 76666-06 for ; Wed, 6 Aug 2003 01:35:03 -0300 (ADT) Received: from neuromancer.ctlno.com (unknown [208.13.35.90]) by svr1.postgresql.org (Postfix) with ESMTP id 9E13CD1C90E for ; Wed, 6 Aug 2003 01:36:13 -0300 (ADT) Received: from tocr (ool-4352919e.dyn.optonline.net [67.82.145.158]) by neuromancer.ctlno.com (8.11.6/8.11.2) with ESMTP id h764j7R30257; Tue, 5 Aug 2003 23:45:07 -0500 Subject: Re: Some vacuum & tuning help From: "Matthew T. O'Connor" To: Christopher Browne Cc: pgsql-performance@postgresql.org In-Reply-To: <60d6fjhjgf.fsf@dev6.int.libertyrms.info> References: <60d6fjhjgf.fsf@dev6.int.libertyrms.info> Content-Type: text/plain Organization: Zeut Tech Message-Id: <1060144572.17472.18.camel@zeutrh9> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 (1.4.3-1) Date: 06 Aug 2003 00:36:12 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/89 X-Sequence-Number: 2906 On Tue, 2003-08-05 at 17:40, Christopher Browne wrote: > Unfortunately, a "configurable-via-tables" pg_autovacuum is also going > to be quite different from the current "unconfigurable" version. true, however I would like to preserve the "unconfigured" functionality so that it can be run against a totally unmodified database cluster. If it finds configuration information on the server then it uses it, otherwise it just acts as it does now. > But at that point, it makes sense to add in quite a bit of > "configurable" behaviour, such as: > > -> Specifying that certain tables should _never_ be automatically > vacuumed. agreed > -> Establishing a "queue" of tables that pg_autovacuum plans to > vacuum, so that users could add in desired vacuums ("after the > other stuff being handled, force in a vacuum of app_table_foo"). > That way, vacuums can be 'forced in' without introducing the > possibility that multiple vacuums might be done at once... makes sense. > -> Making information about what vacuums have been done/planned > persistent across runs of pg_autovacuum, and even across > shutdowns of the DBMS. good. > This changes behaviour enough that I'm not sure it's the same > "program" as the unconfigurable version. Almost every option would be > substantially affected by the logic: > > if (CONFIG_DATA_IN_DB) { > /* Logic path that uses data in Vacuum Schema */ > } else { > /* More banal logic */ > } I'm not so sure it's that different. In either case we are going to have a threshold and decide to vacuum based on that threshold. The change is only that the data would be persistent, and could be customized on a per table basis. The logic only really changes if running unconfigured uses different data than the configured version, which I don't see as being proposed. > If I can store configuration in the database, then I'd like to also > make up a view or two, and possibly even base the logic used on views > that combine configuration tables with system views. In effect, that > makes for a _third_ radically different option. Not sure I see what all you are implying here. Please expand on this if you deem it worthy. I guess I'll start coding again. I'll send an email to the hackers list tomorrow evening with as much info / design as I can think of. Matthew From pgsql-performance-owner@postgresql.org Wed Aug 6 01:39:37 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 71FD2D1C94D for ; Wed, 6 Aug 2003 04:39:36 +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 77275-06 for ; Wed, 6 Aug 2003 01:38:15 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id 68082D1C517 for ; Wed, 6 Aug 2003 01:39:24 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h764dFLt066261; Wed, 6 Aug 2003 12:39:16 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <0a5701c35bd4$f43eda20$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "Matthew T. O'Connor" , "Christopher Browne" Cc: References: <60d6fjhjgf.fsf@dev6.int.libertyrms.info> <1060144572.17472.18.camel@zeutrh9> Subject: Re: Some vacuum & tuning help Date: Wed, 6 Aug 2003 12:41:06 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/90 X-Sequence-Number: 2907 > On Tue, 2003-08-05 at 17:40, Christopher Browne wrote: > > Unfortunately, a "configurable-via-tables" pg_autovacuum is also going > > to be quite different from the current "unconfigurable" version. You don't need to create actual tables - just use 'virtual' tables, like the pg_settings one. That's all based off a set-returning-function. You can use updates and inserts to manipulate internal data structures or something... Chris From pgsql-performance-owner@postgresql.org Wed Aug 6 01:46: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 13F3FD1C48E for ; Wed, 6 Aug 2003 04:46: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 75648-04 for ; Wed, 6 Aug 2003 01:44:45 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 16361D1C517 for ; Wed, 6 Aug 2003 01:45:55 -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 h764jYSa015809; Wed, 6 Aug 2003 00:45:34 -0400 (EDT) To: "Matthew T. O'Connor" Cc: Bruce Momjian , shridhar_daithankar@persistent.co.in, Christopher Browne , pgsql-performance@postgresql.org Subject: Re: Some vacuum & tuning help In-reply-to: <1060143711.17472.2.camel@zeutrh9> References: <200308051649.h75Gn1G25462@candle.pha.pa.us> <1060143711.17472.2.camel@zeutrh9> Comments: In-reply-to "Matthew T. O'Connor" message dated "06 Aug 2003 00:21:51 -0400" Date: Wed, 06 Aug 2003 00:45:34 -0400 Message-ID: <15808.1060145134@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/91 X-Sequence-Number: 2908 "Matthew T. O'Connor" writes: > ... My really question > was can I make large changes to a contrib module to a point release, > meaning, 7.4.0 will have what is in beta, but 7.4.1 would have a much > improved version. Does that sound possible? For core code, the answer would be a big NYET. We do not do feature additions in point releases, only bug fixes. While contrib code is more under the author's control than the core committee's control, I'd still say that you'd be making a big mistake to not follow that basic guideline. People expect release x.y.z+1 to be the same as x.y.z except for bug fixes. Introducing any new bugs into x.y.z+1 would cause a large loss in your credibility. (speaking as one who's introduced new bugs into a point-release recently, and is still embarrassed about it, even though the intent was only to fix older bugs...) regards, tom lane From pgsql-performance-owner@postgresql.org Wed Aug 6 02:36: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 84355D1C92D for ; Wed, 6 Aug 2003 05:36:03 +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 76647-06 for ; Wed, 6 Aug 2003 02:34:43 -0300 (ADT) Received: from home.samurai.com (home.samurai.com [205.207.28.66]) by svr1.postgresql.org (Postfix) with ESMTP id A7BB8D1C91C for ; Wed, 6 Aug 2003 02:35:52 -0300 (ADT) Received: by home.samurai.com (Postfix, from userid 1014) id C206726228; Wed, 6 Aug 2003 01:35:52 -0400 (EDT) Date: Wed, 6 Aug 2003 01:35:52 -0400 From: Neil Conway To: Tom Lane Cc: "Matthew T. O'Connor" , Bruce Momjian , shridhar_daithankar@persistent.co.in, Christopher Browne , pgsql-performance@postgresql.org Subject: Re: Some vacuum & tuning help Message-ID: <20030806053552.GA10408@home.samurai.com> References: <200308051649.h75Gn1G25462@candle.pha.pa.us> <1060143711.17472.2.camel@zeutrh9> <15808.1060145134@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15808.1060145134@sss.pgh.pa.us> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/92 X-Sequence-Number: 2909 On Wed, Aug 06, 2003 at 12:45:34AM -0400, Tom Lane wrote: > For core code, the answer would be a big NYET. We do not do feature > additions in point releases, only bug fixes. While contrib code is more > under the author's control than the core committee's control, I'd still > say that you'd be making a big mistake to not follow that basic > guideline. People expect release x.y.z+1 to be the same as x.y.z except > for bug fixes. Introducing any new bugs into x.y.z+1 would cause a > large loss in your credibility. ... and since contrib packages are distributed along with PG, it would also be a loss to PG's credibility. IMHO, core should disallow feature additions in point releases for contrib modules, as well as the core code, except for very unusual situations. If contrib authors don't like this facet of our release engineering process, they can always distribute their code via some other outlet (gborg, SF, etc.). -Neil From pgsql-performance-owner@postgresql.org Wed Aug 6 03:48: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 809C3D1C4E1 for ; Wed, 6 Aug 2003 06:48: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 93887-01 for ; Wed, 6 Aug 2003 03:47:28 -0300 (ADT) Received: from fuji.krosing.net (silmet.estpak.ee [194.126.97.78]) by svr1.postgresql.org (Postfix) with ESMTP id CC9A9D1C4C1 for ; Wed, 6 Aug 2003 03:48:36 -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 h766gYaB004687; Wed, 6 Aug 2003 09:42:34 +0300 Received: (from hannu@localhost) by fuji.krosing.net (8.12.8/8.12.8/Submit) id h766gXc6004685; Wed, 6 Aug 2003 09:42:33 +0300 X-Authentication-Warning: fuji.krosing.net: hannu set sender to hannu@tm.ee using -f Subject: Re: How Many Inserts Per Transactions From: Hannu Krosing To: Trevor Astrope Cc: pgsql-performance@postgresql.org In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1060152153.4517.9.camel@fuji.krosing.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 06 Aug 2003 09:42:33 +0300 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/93 X-Sequence-Number: 2910 Trevor Astrope kirjutas T, 05.08.2003 kell 18:59: > I was wondering if anyone found a sweet spot regarding how many inserts to > do in a single transaction to get the best performance? Is there an > approximate number where there isn't any more performance to be had or > performance may drop off? > > It's just a general question...I don't have any specific scenario, other > than there are multiple backends doing many inserts. I did test on huge (up to 60 million rows) simple table (5 fields with primary key) and found that at that size many inserts per transaction was actually a little slower than single inserts. It probably had to do with inserting/checking new index entries and moving index pages from/to disk. With small sizes or no index ~100 inserts/transaction was significantly faster though. I did run several (10-30) backends in parallel. The computer was quad Xeon with 2GB RAM and ~50 MB/sec RAID. ------------------ Hannu From pgsql-performance-owner@postgresql.org Wed Aug 6 04:35:37 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 997F6D1C50B for ; Wed, 6 Aug 2003 07:35: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 93887-08 for ; Wed, 6 Aug 2003 04:34:15 -0300 (ADT) Received: from fw.wubn.net (unknown [213.156.64.226]) by svr1.postgresql.org (Postfix) with ESMTP id A76E1D1C4BD for ; Wed, 6 Aug 2003 04:35:13 -0300 (ADT) Received: from (172.24.4.34) by fw.wubn.net (8.12.9/8.11.3) with ESMTP id h767Z8Pt089881 for ; Wed, 6 Aug 2003 10:35:12 +0300 (EEST) (envelope-from yamazurak@Lviv.Bank.Gov.UA) Received: from (172.24.4.57) by MTA (8.11.5/8.11.2) with ESMTP id h767Z8f10476 for ; Wed, 6 Aug 2003 10:35:08 +0300 Message-ID: <3F30AF9E.2080607@lviv.bank.gov.ua> Date: Wed, 06 Aug 2003 10:34:54 +0300 From: Yaroslav Mazurak Organization: National Bank of Ukraine Lviv OU User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: uk, ru, en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: PostgreSQL performance problem -> tuning Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms010302040000060805040208" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/94 X-Sequence-Number: 2911 This is a cryptographically signed message in MIME format. --------------ms010302040000060805040208 Content-Type: multipart/mixed; boundary="------------000904080005000201080507" This is a multi-part message in MIME format. --------------000904080005000201080507 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi All! I have installed PostgreSQL 7.3.2 on FreeBSD 4.7, running on PC with CPU Pentium II 400MHz and 384Mb RAM. Problem is that SQL statement (see below) is running too long. With current WHERE clause 'SUBSTR(2, 2) IN ('NL', 'NM') return 25 records. With 1 record, SELECT time is about 50 minutes and takes approx. 120Mb RAM. With 25 records SELECT takes about 600Mb of memory and ends after about 10 hours with error: "Memory exhausted in AllocSetAlloc(32)". *** How can I speed up processing? Why query (IMHO not too complex) executes so long? :( *** Information about configuration, data structures and table sizes see below. Model picture attached. Current postgresql.conf settings (some) are: === Cut === max_connections = 8 shared_buffers = 8192 max_fsm_relations = 256 max_fsm_pages = 65536 max_locks_per_transaction = 16 wal_buffers = 256 sort_mem = 131072 vacuum_mem = 16384 checkpoint_segments = 4 checkpoint_timeout = 300 commit_delay = 32000 commit_siblings = 4 fsync = false enable_seqscan = false effective_cache_size = 65536 === Cut === SELECT statement is: SELECT showcalc('B00204', dd, r020, t071) AS s04 FROM v_file02wide WHERE a011 = 3 AND inrepdate(data) AND SUBSTR(ncks, 2, 2) IN ('NL', 'NM') AND r030 = 980; Query plan is: QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=174200202474.99..174200202474.99 rows=1 width=143) -> Hash Join (cost=174200199883.63..174200202474.89 rows=43 width=143) Hash Cond: ("outer".id_k041 = "inner".id_k041) -> Hash Join (cost=174200199880.57..174200202471.07 rows=43 width=139) Hash Cond: ("outer".id_r030 = "inner".id_r030) -> Hash Join (cost=174200199865.31..174200202410.31 rows=8992 width=135) Hash Cond: ("outer".id_r020 = "inner".id_r020) -> Hash Join (cost=174200199681.91..174200202069.55 rows=8992 width=124) Hash Cond: ("outer".id_dd = "inner".id_dd) -> Merge Join (cost=174200199676.04..174200201906.32 rows=8992 width=114) Merge Cond: ("outer".id_v = "inner".id_v) Join Filter: (("outer".data >= CASE WHEN ("inner".dataa IS NOT NULL) THEN "inner".dataa WHEN ("outer".data IS NOT NULL) THEN "outer".data ELSE NULL::date END) AND ("outer".data <= CASE WHEN ("inner".datab IS NOT NULL) THEN "inner".datab WHEN ("outer".data IS NOT NULL) THEN "outer".data ELSE NULL::date END)) -> Sort (cost=42528.39..42933.04 rows=161858 width=65) Sort Key: filexxr.id_v -> Hash Join (cost=636.25..28524.10 rows=161858 width=65) Hash Cond: ("outer".id_obl = "inner".id_obl) -> Hash Join (cost=632.67..25687.99 rows=161858 width=61) Hash Cond: ("outer".id_r = "inner".id_r) -> Index Scan using index_file02_k041 on file02 (cost=0.00..18951.63 rows=816093 width=32) -> Hash (cost=615.41..615.41 rows=6903 width=29) -> Index Scan using index_filexxr_a011 on filexxr (cost=0.00..615.41 rows=6903 width=29) Index Cond: (id_a011 = 3) Filter: inrepdate(data) -> Hash (cost=3.47..3.47 rows=43 width=4) -> Index Scan using kod_obl_pkey on kod_obl obl (cost=0.00..3.47 rows=43 width=4) -> Sort (cost=174200157147.65..174200157150.57 rows=1167 width=49) Sort Key: dov_tvbv.id_v -> Merge Join (cost=0.00..174200157088.20 rows=1167 width=49) Merge Cond: ("outer".id_bnk = "inner".id_bnk) -> Index Scan using dov_bank_pkey on dov_bank (cost=0.00..290100261328.45 rows=1450 width=13) Filter: (subplan) SubPlan -> Materialize (cost=100000090.02..100000090.02 rows=29 width=11) -> Seq Scan on dov_bank (cost=100000000.00..100000090.02 rows=29 width=11) Filter: ((substr((box)::text, 2, 2) = 'NL'::text) OR (substr((box)::text, 2, 2) = 'NM'::text)) -> Index Scan using index_dov_tvbv_bnk on dov_tvbv (cost=0.00..142.42 rows=2334 width=36) -> Hash (cost=5.83..5.83 rows=16 width=10) -> Index Scan using ek_pok_r_pkey on ek_pok_r epr (cost=0.00..5.83 rows=16 width=10) -> Hash (cost=178.15..178.15 rows=2100 width=11) -> Index Scan using kl_r020_pkey on kl_r020 (cost=0.00..178.15 rows=2100 width=11) -> Hash (cost=15.26..15.26 rows=1 width=4) -> Index Scan using kl_r030_pkey on kl_r030 r030 (cost=0.00..15.26 rows=1 width=4) Filter: ((r030)::text = '980'::text) -> Hash (cost=3.04..3.04 rows=4 width=4) -> Index Scan using kl_k041_pkey on kl_k041 (cost=0.00..3.04 rows=4 width=4) (45 rows) Function showcalc definition is: CREATE OR REPLACE FUNCTION showcalc(VARCHAR(10), VARCHAR(2), VARCHAR(4), NUMERIC(16)) RETURNS NUMERIC(16) LANGUAGE SQL AS ' -- Parameters: code, dd, r020, t071 SELECT COALESCE( (SELECT sc.koef * $4 FROM showing AS s NATURAL JOIN showcomp AS sc WHERE s.kod LIKE $1 AND NOT SUBSTR(acc_mask, 1, 1) LIKE ''['' AND SUBSTR(acc_mask, 1, 4) LIKE $3 AND SUBSTR(acc_mask, 5, 1) LIKE SUBSTR($2, 1, 1)), (SELECT SUM(sc.koef * COALESCE(showcalc(SUBSTR(acc_mask, 2, LENGTH(acc_mask) - 2), $2, $3, $4), 0)) FROM showing AS s NATURAL JOIN showcomp AS sc WHERE s.kod LIKE $1 AND SUBSTR(acc_mask, 1, 1) LIKE ''[''), 0) AS showing; '; View v_file02wide is: CREATE VIEW v_file02wide AS SELECT id_a011 AS a011, data, obl.ko, obl.nazva AS oblast, b030, banx.box AS ncks, banx.nazva AS bank, epr.dd, r020, r030, a3, r030.nazva AS valuta, k041, -- Sum equivalent in national currency t071 * get_kurs(id_r030, data) AS t070, t071 FROM v_file02 AS vf02 JOIN kod_obl AS obl USING(id_obl) JOIN (dov_bank NATURAL JOIN dov_tvbv) AS banx ON banx.id_v = vf02.id_v AND data BETWEEN COALESCE(banx.dataa, data) AND COALESCE(banx.datab, data) JOIN ek_pok_r AS epr USING(id_dd) JOIN kl_r020 USING(id_r020) JOIN kl_r030 AS r030 USING(id_r030) JOIN kl_k041 USING(id_k041); Function inrepdate is: CREATE OR REPLACE FUNCTION inrepdate(DATE) RETURNS BOOL LANGUAGE SQL AS ' -- Returns true if given date is in repdate SELECT (SELECT COUNT(*) FROM repdate WHERE $1 BETWEEN COALESCE(data1, CURRENT_DATE) AND COALESCE(data2, CURRENT_DATE)) > 0; '; Table sizes (records) filexxr 34712 file02 816589 v_file02 816589 kod_obl 43 banx 2334 ek_pok_r 16 kl_r020 2100 kl_r030 208 kl_r041 4 v_file02wide showing 2787 showcomp 13646 repdate 1 Table has indexes almost for all selected fields. showcalc in this query selects and uses 195 rows. Total query size is 8066 records (COUNT(*) executes about 33 seconds and uses 120Mb RAM). With best regards Yaroslav Mazurak. --------------000904080005000201080507 Content-Type: image/gif; name="model.gif" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="model.gif" R0lGODlhOwS6AvkAAAD/AP///wAAAAAAgCwAAAAAOwS6AkEC/4SPqcvtD6Oc tNoqrt68+w+G4kiW5omm6sq2Lpm98kzX9o3Xcc73/s8TBIbEovGITCqXRYFz KEw6n02m9Ypl7oDcrnfrDYvH5PILbE6r17Ro9g2XQucBt9Bdr8b3fCKaDRg4 8SdYaHiImEKYyNhYiNcXKTlJWblYAlmpuckZeany6Sg6SnoYWkqR2bnK2hp3 aoIXZaek6no060dXN5VL1+t76+diK6xHK5enayRrjAUbiyo9TZ0GXc1Q7Pz8 uzv79H237akzbn5O3qKNzj5+DYMdLz/fRm+x3p6vX1e+jIyE7F+rYAR7eYNi UJmzdx2aKSwWTOGyXX0IHuyGURk+Sf8MRXS0BzKkyAQf5TnkJZEZyom6Tnqa Q2WKHyoIH9IUd66kh437et7Sec+nUGFAG448ijRpNqUN7AB7CjWq1Kccp1q9 Cgxd0Q0OBaqUeNJlxYtOZT5EaJanJWLH9LhNSRSuxa9yL7KEq8XGVqZ8+wLa Kw0SuJnhCLMbjDax4qHM+jF+TJQt5MmUAF+w7Dez5i6YSZXFKtUd6KmUOw9q S/Gr2Dyr98z9/Dqh2sqSyU7EiXdg3bN0M72uEnaJ6UGbixtPNNxRWNy4wDpn lSvmTZooy7bU6piydk3JF8zeDh6K3uPky6/pzgj2aNCr1runmjP7XIA338K0 D+c32pj+ZLv/Mw8CMKOgB2CBBl5mXDPUmcXaN/6stNh3KtXXjXRN1IcbgxF5 lV924X34yoGYICdiiZiAiCI/ABDIQgY7gDHFAe9ImKJuyVREkhMrdOWWKjRW 9mBGAfmX0V0CcdiEAjqaGAKL8DAJ5U6uzDdfc7xVmVpua634g4A9BHelRtRt c8c/0Tlo2H3WFenjc7U0uWQE781JZ5123omnBnFGmYoYTvKp2Y81xselkjHK 2ItJg/akDURW/OlAojeYNhykCAL6gKWRYsrpaUFqWVioY4Vpm5BZchKDpp3y 6aKMJBmQ6j17ZlporbDeautOoKgxK6aqqmqGoC/dyJ1yi4IX66rK/+7KxaG5 ngApsMt+gJ60ZAgqC4bZTidmmjg2wiNGSG7CnKm9WemVYB0+O227fQaySKu4 IvqiBNaGIeyxjLKrZ2b5hnfvifqWNq+7BnsHrjpbVLsUwpPuw5yjRxapJaFK 9usXmAHdhl9+n2LZGLg92pVhe7txiHKp93H8Jr8Hcxows5Nm2ms0Hg6M4jWh xPwFzo8a6/Njyb4cJc8yGF1wgDW/u2OP5Y4cnLocwVTYYtV5+3SxRrma8cik 8lYxN+aOKx7RgiBtdhlP2eNll0HUnJx6eI7Gx9zsQTfC0En9i2za8JLHd9D5 oH004RcHi4CzqUDNeMc2iklL1Q1eGDleZP9Lkfemfm+eMeCT+RLOglaeKlR3 gb/C3VCGy3mZ4HER+0zmGHBOO0irc2Z37rrvzvva0Gp3OpkuIw7BcqBedxdr jotdZoQLZojhQLLrWnuJwbseGdDiQnS9xytR+Utswv+e/Ea+jbrowukpif0V l/80fb/1Jo7r7dXj0L37boIMkJu7Yac94cDnWAyCGArCdTxzuUZlG/vep6Cj OO/Yz17M0BbLeJG/G0kOJxqCEAavs6H9CQdWW7HUBO93s/Z9ThThEp9G+lOT sGUBTeDr1pUyCJADwk6GjFogkdZVvBMWTws7VCFd9DdC4tAKfygMifEaxR+W nG9qk/ug1RBjReX/4S2ARqQPDkNEPgaSCYZg008UwbY8zC2RGjBaWubmRy+u DcKNJJwgHcfTxGnIrXdQqRsfB9gJIQaFjA1E40JiWMj3WUxggqNRmaZzxpax jo2SYqLSOhNBm9EsCDn6oyc/+cnAVDCE5XNHfyqXxeZhTYvneoMgg5iQLn7I dF6LJJioaEMzleqMIbxlDpmWMHvVQ5NtuCP9AjSDL4rthXIQ3YTSOL5SKNN1 jgLizOBYRzl6BzVjahxFpjisKOoyl2Q0xis5YExpPmInvoNWJUfkJ0QpAjPT lKVrREm5b+Knnizr4AY96M+USG2GLHQfIAdVQH2c8zLvpMcr0QDKiEq0/3db awhgZhUvImp0ZRzl4QK3s9DW2TN1RcxLAEFnC0VCcGw0JAvoHihQ/+EiMEpZ 3Sf4KRyYerMurVnkpYo5oxgtp5u30ZBRiepKl3rrahGCHyoEY0GSIdVk4UOl P7cFQn36cqZclMJBR1rS0UlyQJ3Do6fAyhigCJI0Yo2YTEuDOgQS9KkbPSJa Z7OOkK7oEi2sJjk9+lFx9hOR5cweWTfzJ53ktRZHdGtPJ4HTb3HlEU6D5GfM kS1mNtUbHCyqM+eaR3WwkVoGzYq+Ejo4dSYIngGqrF9DR5jLhrOcBcRiB6dU 0b/UlVhujSF0+hZa0aqtVjCqH5QyCSi9WnKysf+wj4KAA83Soc63gB0GOinr 2dcedaCjGtJSbUsh6QW3RV9Q7qWclSy9tQi5JjIvJ4XZtH5uN7aYvZBmU1lU zXK3uipiLrxymjyExhU1rhwveQuH2DG4123tddjR0CpWbjxXpyH7yIKhCrnI Psq+GwqvU/RL3wAn0cCKiF+B9Lrg5TIpZlCN3H5R+xMOf9PDMwHxfkJMurK9 Cr7/hTB/WQnkiPySxAe0V4oVbIgjH816DSPyGTTXY6lm+EhZA1KNOzxOpppp viLWsZMxkc5ONTTJqwUQNJQs5h0H66s51jCA+wcZNPfljvZzs4+H7BF/AS63 Z20HOAVoWRwrdFJGC3P/4kb5YTQxddGBNKoNs5jaLyduL3UeHGE5mtKD8Eel W4RWTQPFWgoq1C7oIrA+DTizpFGrWmFtlCnDOmjaCTVa+MoZm0F6YJHIGZm5 ztSdUW1WNefIBy1OtG8RE8v2OFrRMPZpJycK7WhDhdi1fvOvH+Sb92lq18C0 XaqbQuBqumRi3f3YD0Mn5EAykY7c1oE0c+JZGdciqj+mzZeqfe0ZJnXEycRG u3lM7Wzk28/unGS3j9M2kQ0ct/fumZH2+VaITffYHMnBv49ZjYey74G+xCn0 eDk62abLrj+b45P8W+YB7Xbl+bOzNVUMBJeDlLHpaLhynkpmWC1cK4YONfX0 /+wZ1wIax9hS6hU/3uUtvZczK0+60wGGaVPjOeCIaLfVV1RLjmE1LiIvJWdB 7pythizYJj7KxbH+dBBJqLdrp3qzdo7EZaoRX+uU9F6ljfe8RwXmnh7J2W/Z 7BhfecZZRnZ2ozt2ixsFm4VSr6+tvWGSoypF57Spi+hMOEJofrTNYm8qzg5w 4c7j70Zce9ilztWlvx2sMk+8gQzd8yczZaGx1/XBSH9BZMcys/niPeFz39mv yzbH/VW8w2Vp+glTzKR0Z3x6bf6Fp+p9+tT/y5Kdb9yq233O+IY74tNu3Zy7 ffx0HfXyW6J8Ke6LDXUO5vY/fXzJE/91cMa1+8n+bf9FeT+avCLe2d4/e923 f07FQvhHDEixWHUlZI+FSwTDftZ3HgAIf0xXfxEmfyRVgQ6Icwcoe7MndBrE ZRjUe0YHaeDFaZLVf+KHP5d3U6AngVC2egNoWJxXZDKDgBBVgQv4fRLnMXIV Ow94fwhmZC/oUCLignoBPPK3Gq3nPm/TEB8ogoJmTvK2dWUUfFN2gl5mDRuo ekTobQmGfY23YjJIcLEQLU3HJqcHfhOngSlIg8PkhU50IEeIhF4XZ42EATYF hbgAWyIoHVPFPLT1PDaRhfcEhKO3ZHEoh6+nLAjkV4chRtujMuZUezF4VwOG POeXJId4Hjy4PNyVWRHnbIr/qERmtixLGHdriD44g2Ythn52FXiTN3hgQWM1 QSUhWDHKZV5MOHB0WFaA007JFW40Z2NTEonMBHaR5YsG2BTLmIjsB3E7lGzC 14A14owBaB5jxirRqAUhOI2rODDXyIzPJo42yCvDmAykxHGzpUAoNYntQYoY UxtkiFnXgo5w5oMMqG9f00DJ+B/uknC3F2VygVrDhyw+lBaGGI+zcwaWNjYJ dDLYtn5+wo2ANnzfWDd46HfUx5EdWYn3MJAv9XCi+FvhQzK7pB+k1oQLyZDz SI/8F3/8k4bpxzcp2Y8paU5mpzoURjUQp4+jeHKdaIcWSXSxuG/pw5ItqQ5O czz0/1aIG1aLqvQ8lbMmMXVquWiPQ0ly37hfH+Uz5bhxL/mPJaZbH0NzNEmS +5ZIQeKPDJeUoRdffvhH3OGR7jFWMamS3ORcF7iPaymJX5OTwqYjnkdCZUmM h+lYO+g91rgjncduFbmVBcmXcseYbwmXoAAc6piJ9eaV/+SZVSgOAyV2d0mB fPiHtVV6G7Ut6ZZ62XBmC/ORDXl4IHiap0lF3nV0hKiKWmMooGFwQqlApSZT XTldfomMOAmPlvmbLSKWGYiGc9d9pJRpWmGWZRSJhURql3NC2tgkOaiG8ydd iwkhgcMiu9iNgChgcZWQYKSca7SU+fVaIqSZxfk9kCRv+P/FT2BZHOuBHHsn Ix8IHxhpjLMImvCZlz+5kmQJjTCEoPVlktZJKm2Zl8zXnk3xYHf2lJ0GL6PR axgnbESWgLOElOZoDfnmSFF4YzKkn353oZyVi5Y1TWfiPL7XVPmZlVA3mQDE Qiy4SRIUQUMFRbBhI7hZgkgHnsmpoMAZoSnzoI/TUtd5affVW1hZoTDInBi6 m+JFkZ44chAKbGtGmLDHECGKmKnRoGyYM41ZpWvaoXFZRc3kYhc0eVFZn/mk JqvkNRMafrISkB7RnHXTo81ImAU1m/W3e7gYWIJIo/gFlGXHpo/qqIrwp5D3 nFroKmHoeH5anYaqmPhobus5ZUf/WnNmhqU9+Ba2BJ7lCamr6nNuqkqbxZlW BjnIc1V2qjxoiYLxN6k/eGKj9IrOhZ4YqGW2umU2dlAGmVdqyqrLSi0tuquP qJDRualf9HEgs2VgN5KgRarOmaWPY4HAo6zMKq7y+J5pokuPZJSyOKsrU6ur VC7johZCxIvYs6JPSDnGNp7QE6uPsmzHFqxlmKTjKrClWK7PepQJKq3tSIs1 SYjWOpvYOaWNMoetRqkDyq1t2HcDq7HLubFvU5cfaycTe68Eiq8Cagn9mq/z Cp0Z27EtezguC7Mxe1gyC7P1SrPgtqszeLMgubMta7M9SxJJiIybeaaRBrRK ebTj+rNJ/4t2OeuWOwKyUUtR7sa0Aru0SUumakd5Lkmdmvim/7OvqDKOVcum VxspOCpiuGp/ybRwKnuGTqt0/Ua24mq2ODtz+mWfS7W2znqxW+mQase1Oaq2 /wqOcTa2c1uhdStwcLsQKQRhbjuPBtkbiPovLlSkuimqudqBiLuqirtNmyqc WTKl7FiMg5WjWsq339pYzVG0XjlLgTu4KkuZcfdZ2vqMnAupnhuWjEuAqetj kFuwF5lQbkajBeqiWEKc/Ha7uFu2CZJ1CuugxtqtOuq70YWKrYumwHWlj4uJ HcWamwiHzNu8+8m7gcm2vegTb+uuL0a4kEWFxGqgVhhoSWctuv8rvjMbKPdo gX8mi8Zpup1KLo7bZaDIugA8u3s7LYOqffc7vohVvjobuNw7kWajwJzIwIQm tRnsHqo2Z89bjCIpvehjkzqFnWmYuVMXuVepadcWHQGWV/Z7uEh2wRZnsVXJ aKpRn1WjtsmpZKkSJ883PJ/7wKgLS631wHhFoc1YOxo3w/gzxCVnOtwZLPfI msRbneMETunWJvcaXivrTjoTvs0aqfknkDHXxE5csaealoUrNBx6xpREaTwa KZRWgwoGw3kWw7YzUtwGpGc5lbepqPd5W+J1x8u6eQ52SZNmcnhMomuWZm26 NyJ8xV6XZdFadQcstEdZuz9YyLnrhpD/HLBb6Hw/XB6U4i97fFIM1L7DYou/ J2XIe7qb2MlJeWR8lU3Zl6lN5mmYysGy+bcDvLo1JswTHMTFc8qC/Id6W7lG elQonGSpaapEO3+5/MZUe3PXFJti/DDmd1+txJWxbL4WSrAeaE987Ks9CazX U7zwe7xSNb/ER83VfEC+WGhckc26XLBPbMnjrE3kPItW1Myq+wzMnLeu17Oz vMQVvKN9msdwcmaYCbo4HHamdcLpGNGAWdHsuWrHjHxVi9BEc8/KEdJ1jDsj fWj6rLl8VszyDKKec4cGDLhhhNJ7KsNzrHl6iX7JpmFX6LAPeSqFSE+XydLB hdCy27Y6RBSy/4GefmmU+eleOjPTgMrIPzXU91PUkLmTQRPFGszVU9HPf7O4 wSnR1wvTPv0/Wty72qwncqzEVY1OXbuPqfhh9nUYhCrWZW0Jx+iOGJ3WecNN 4rbXgQXCN0mCSNrL/6dzUa3Ras1Qi+zWegLXNmyyWja8Ag3BpnDORm3ZWyvT 80bRabXK6pY0QHw2HoxK4Oy+I+zNkyzN8CzOSMuBj91nis2r6YHTTD2tec2P bImcfa2pD6poNXxDRudCW8xfN6VHHOt/d+fIHmp8sr27MnkW47bZSOS/7xi2 Jadw1Z3VBITUO2fcBWbM/sbQ8IReuMynlajQJF2Y5CfPmv24dr2khf99SH9Z ycTs1/Jl1iMYdQ4E3MQdYqNJ0+5ZgK8dxrwGCiZtYffiIrRd2yqndWqM2kCi 2qadndzNxVZRolp5nl1ZuRrZXJQa2geZil6s3BCIIOu91uX9c8S2J6YD0Q5J NvMZZPjdVQ6uvFR73mI4PI7ox/7Dv4kKvU/azb4NLiYN1hEIAyrOp6D83IHq EYqF49oddBGuftM7NRX+v7DcqVaH1RJMjFuMD3/H4v4WT2E95UnMs/NszwHp 4xZdStiLjljM2kQs32lOmph90Xjtvvtd58gZ3hKrWtj45GdrfjNuwtCF5QF8 XSWtjfBdzvik15YzRloOpTOZp87Mfi/y5Yf/mdFxzYpcyBe/Atl4ruawfY7r +EyLHs36e6ATCtRWyzYz4uoWnt1nmdt/VeRPe80Jxt6lfteZSNaLXuGqrUxq hV2m3pqG7MiDiuRdqDDt8tErLdRvrex5fnCpHuyJfuWkW0O4zeus+lCvKcr9 vOMKw+QIx4hrLtMlE+d8nlRTxKQRaaYTjuylfe0G3blOOIFmzCpMZqUxnu8V 1OgD2enwJu92mPA/vZvT3ussm3LX0mDH9dUprLAZmtqhm8Uar1WZvuwzkuwD X3zMvtbJleTZSPGHnc8iP/IfisgL+uo79elQyfGtNOeKrqeWuu+GYjBlvty+ vu4G7rJ/cGEsr/Pt//ninPPs7k3oEc/Ps53v0hLPFheMTWtIux7kuk3vV9+o 79cRldZD6qo6EI+A+9kkgyTjwPxWowuw7hYtF2X0LZ9HS+/cXfK3NcRbuRdr ocw2v0hMjxdnt8bZ+Pf1v+LxWJ/zuLTwXF+PFDxty2v3Rk9rX2h2cgv4FLv2 a8zGacV3cSSAUW/oU440YL/tQOakk+6H2E3AaQks4rii9Wy3v9v2UOvyAV/K dP8l8AahiG7WY1nokc/yDJ5xJlHTJ83t3iui3sP2CGvPKIfqGVP1l5zmo5+w NS6nLdewMZ/9u4/XsI+/g76Fxt+c0Mr88hSuBQ9qVV764C7kH3zpdt7Qbf8Q 94aza39HIlbPet1r/clKxgje9DdOAPExdbn9YZQzCHBx1pt3z61PHElRQM7q SBc2dQ1Bpto1ttVbl3k9Z3FBIKwRKh2RpuSSyTQ2oVGllFo1PYAo2pbbjWSx WGv0OdaUzWl1B712k4Y5H9grOYFfQaEi79P6vy54BgkLDQ8H4aQsjNoyHNnq JCcpK2kg35owM6s2OY8YMcpCSD9Np041PVVTWz1WzWBdW2VnOy1xc3XtbF97 S+Lk6OaI5er6flYGiwkBd1F+NaN9G88Er6dRs7drTwlBu7dTw2PFac3Xgo0B YfCO15Odif6I4tSHY9DJx5/7/f9XoGMDoNqHfen/BBpMmPCgtIKieGBbONGa q1ASB1Jc0lCjIIAfQV7Sp/Geshl67pjEd0lYD2F8hLisp6Ukr443fZHESWVl SJ8/W+zcwFGoOKJFkSaNdvRNT6BPfzI1OpKqUjJQ6elJgAxeSq1QpVrEGXap VbNndVKsWUEmCpdsT1Kat6zlW6xb0eb8RVZa3kV3AYO1yvcTYW9+ESe2ZdiK 08CPcTGeOkuyNsVQgs2DaczrDXVckIXGMXPHv8pN0Z4ud5l1azWqMf+py5Wu Zklz28agC7mCaxCHx/luzJu4P9ivFR+nJqpiKeHPoWeciIh6devXsWfXvp17 In3FwYNUvlFWZprnv/br/zz6q+14XWXbTDr+nED60fFXze+EkQwT91tzDKs+ XljmMwEBo8+/18JrsBIAecIPwkf2q3C/CYVaEA4ME+vOww9BDFFE7jrh0Dxn 2NOKtndeavE90eDJhcO+KgRwRgtx5OTGwXLkJ8W4+EBwlwJLY0Y3ZoS8jY0d gXHQyWN4HOzJKb1gsseyrlwky8K+KIRKB+xKsEPZYFTBPePgc3GPrYy0Ya2g lLISiSSHBBKft05cMTA5txSrTyf+zCTPO4/8gc4tiHzxRxiBNG3MLyEVI06z RqzU0ksxNSTQHPm86ZtN03DMkEhbaPSuTlkrT0NQO6E0K7aKKJIYPbtItEwC Gf89dAJUWXWDV5J+9WvQItZz57MqC711h1xDChaxQgyKqNcIpYRgVFK3MtUn Z6dtjDLIdI3xC96cFdVLbN0KVxduL9PwIoKaw6hbhaotsiRaTXNzNGYVhZUz O0WaFzoFE8QTYGLt9Io0cZsd61Vtj7znpGNrTbaYeCbet+E+1UW3QdXYHcpj sGpAVOCBvx1ZZbw87bIZlcM89c+OZbx4szcpFrMwVxclljOT/KDZUFlJy3hZ 405+juAUGV6YwHWZVjbN91REKb2AWu6Zgaf3yIJmWy/GFcmNtxR65cdA5hmL c0eOedukhVv67JXLdXk3j90WTKGHsHFuvlebDprNn5H/bXGuNqkmW1BBsxvq kEceJpTqdgZn0ejDhzbc7K3h9k3ulyguttl+3XPaZjXP5DxrWQmPb1uuM79c Y9Irv+Ng1fdatZfN5x7QlJDPsDtvSIf/CPjOQUm597YdXj4qO6wFdju9ImF6 HXzzdUfN0/udXK7f1Xax+KcoP1pzoi0G+uoikA9Q+e5vFtzLnHdFXPvEGR6y fUX4htf/J7yzv985j3k7qxcBn0GHQx1PgPSiBQLR1YbpcQmCvmsgQQAnueuh yXBrMl3+1AO+A8qOHbNa3yTKF7vZ8csFueEeNC4orPeVaTPb4+AHySSPt63u VFUjGldk5pp3jaJvG6kgqdJ2/8AjWkJATmFgDIfyviU+SXcL4d0U5UOZACLl RIH7mT1cx5IO2g9xO9QRFNGYRsrMcH0fBGJkohY2HbKuhIJDEdYcR5AqnmEf 1RFFGMg1JVJYp1dXxGICRahGRS4SIRY5pCCXBA5BQdCQu4phTQ6XugSmqXTt 4V7RcgimRDKSlKXEDBvR55kE0W6OrDTUbtRVN+gJElGqPCHuBFjJR0ZmlKb0 5S8tM8BdOkiWd5yiBi15wTfRsZU1myPmwJNEYE6TmhRyZMlSojBmAkSbqQwl Dm2mST40b3l0El0Xcbk/XQ7zewas5juB+UR4LgWQNTybkHoiT26EEnAZ3OQz 1xTNXv/Ok6Bq1GdBEZrQ4LEzPNJU6EPVCVGJTpSiHKvoRbt1UIxKiKEN3eiz PhpSi4r0o+uUS+VQmgeTMpGkZ9FoS2GahJfGNDlO4lozDkSlmW50pzT1qXR+ +tCVdhQ0Qc2QUZHaoaQqNFNNdepTP/RAouptd0u1KqWuWtDQEbOcUu0hSreG njkMNZlVzepZd9JTxkGVrW116+N2FzmfDSh9mAOb+YznVbrSz3spJReW0BpY tcCNrFOt1V78Gdav4lBsYxSPXkm2zbHG5W4gNONiBJtZKxJWkDMIjdFsaUzi QMhcL2sbxMgHWcM+di+ada051NoUndoLTPYkJmI9aS3bDqn/qz5a7WXX+Frh AlZghf0tBUgrV8Vebqh3tWv6MpdX37YkcLez2m08U6AWDqEzeLJslYg7XPEG J2nGPW4Wr+nNGtLwn4w138Kk643EYjOMfK2fY+/3xpVOKLbjFSpna1tPM4n1 uyzCG27XZlq8oRYoytnuW3UF4RC21r8Vdmdx5xs/T9r3vu7Fr2gdFdfcJvjB KnlQb+V7Xtaa1cItbuTJJIbaEuuGsuPr8Ozg4pa63BJpIrbXnUTHJg7PkoRj BG2i4ivM7NY3jBx8pb5yvGT1DdhrYI0ehV2c5TH0Nx0q/quP4Tc4dLbOcnH8 cRm5qVfskdl4rswvGV2XJP5qmc6t/yqvYks22lghEcFgYtuCzSupFHt5tzwe J5brnOiNAPiTKAq0DaX2sT7fz881trTZHj3hQRNa05hV9KfnxGgatzC6niWf wUrNYLRNGq9Bap0LCwzIIheNX0mm4JRtF1Abo3Bf5fNuwii3omWyjMWgNrYD McxpnS0mw2ImcJCx++EzO9bWOvpm1/KsHjevF85gDCicin1scVcExgLONrS3 BbM+I6yy2Nr1ipWMZysfEZ+C9vS48c2cO5sZm6bO8ToZ5UEzZzofYKa0lWFp MFXrtndcns6F8h1x/5U7JjKmcbrydb6LK2PHIO4xs7VG31eDNtb99mZj62Fc h0tv5SuX+P8lRa3s1Br8hbSFcmhLruHuodx6aUaoppLzcny7fMtfjSDhOpZc a/05ggtX3M/llReiCz2i++62wCHt8QBvO5XwZZ04rwzyIE1MwQTnZj25S/J0 TvSlU2+x2Y8Z9cH0ZxN71KO0PKJrymIdN/hDbsUj7d3JAr7Ju8L7dPF18GbB zlaMr2vP22HdQ+sRo/J0u4VNKmfQyBvd65L7pPrnnG7AXeZ1t/tfrPdGrfO2 61jnepXtmD9MXH4sXKQ6F9GEyTa2KeUK8zciJ+6pLQpCVTItvLI7z3GPN+T0 IyA9zGYpSklCtFy3L0rmK54uyTnN0hgPsY2GP51n85t8A3d9wGv/9/vU2ztU RFHQarZsH9ozZLDWT6vMUfh5mYb/WfysjfefZ7ICb+8GrwB9CMTAD6iCC/4Y UP60yj7s7/7wD0rgxY84ZgKpSh/UijGCpflIaUbmb/8gbAQ/paZiorrGr2LM RLumDFa26+Y8L/giUGkmru6czwP3Rt8gon/I4IwyJATvbQELCYtiq4uQqZnE CJzQLOdMRgZn0HNqMF6cUATpBe9ET/8A5cKuL578ZFrCxfciT8deMMrI8LDa RSUyBTTeasKA8Amn4fDIzQcHyvZKyaFY5QtHDP3CDLzOEAPNsA2Fjl3gEDXq g1Lo7j86hwPnRZeeD48epTTIjgWdTBIH/4wMcw3XKvEAbQIQx+2JIME/BpGP FMELSbAUTbFxGhBUGjHETLD1bKhm9PDNpE0TA2EK3TBKXGo55OUKgWFneDAO wcwPeQkLkyej5G3edOzEjpF9+vC4jrAWOZHOdmr2im8HqQchQq+I3nBPei6H 7gUZZ86aaGQIv22bhgztdK50UkUYi8oWbzEt2mV3cLBGuPEVbS677mYVe+Ma R9ELs6XGUo3N1BAgkcxtivAf3QSa3m1clsXX9g7Y9EXY+AlOolG8Wi4bJGge Q2Ub2VFGerEfyXGJDvL8YNDQoCcWuU3avK3mCq4iNcvtbqQWQjH+xK4jH2TR +HFThuEZryvasv9N+lpxGVcvUupN+lwyq0KQSZhiJnFyun4yzuIjYZzstk4J GFVxIs0RHBmSk8pxH+3vKH3qFyWE/nSEHGDDCGNFM2BnKPfMw9yIFbXEHS9Q +ziuILNJwRAF1exSgWYQLFsKri6kBGErd5xvkggPz7Tr4L5mbDYuYjDx4xrD LxdKJPvyHb2BKQNTI4MQtgCoy2ySpRhQMi0TChPxM4GvRzQz3HQiNV8BKlGC u4iylsasFmkyikbTtUTTIIhJ7QhIMvSx4Y7KcWBhJfNEK3lLezoJoBzNJB3R zpDtNq8qN1uzoe4xhTLR6TKQQcpPGcFlPsChEb4pZmAv3eoyaAiQum7/xS7k bCOLETqTSjqrJ5qqEwa7y6YMM+Mwxs9ccSWwU0lwERRM8yZT8SPdMyyR5zen yjfb7B5LZT+3zlEOajjNzTVxLvm4kyprsyoLlKTgEwQCNAZ9BVzmZyDbrcfa 7grIT8h6kj7L7OSuDjKdc0Nd6hRptEahZR0flHj4TLY+FHemMT5nY89eacbg IukYswx/T/A6LUYBJfTcRUa1s0f5sBn3kDnbK2r+ryF5E0ZDZUKfspIQFNyI 0Tv/SEqn1Ft68O70jRehtOgaLPvKE2Fib2oaLEAMaxUVNEWvjS2d7YdcKDFV bxhRJkzFQzZTMJ/YEzja1E0D8LmMyTq3Kjv7/89M2ylEEcjsnFQsr29PQcdK mYgrWwk512/YYAgi0rQLF/UqKLUdqXQ8kWhHLXVVR21NtdGlEFLKVKQ/L9Tf 0k7vdk7h7MsTNBNDOvTnZLUJW/XH/hTOmHC5sHRZizRQT9Mzd4tQC21CpZUZ FVDqjjVg9m9bES1Vnc9LOU/5zJX17BNHiQpP73MWs8fEsk4AT8dVaRNchegV TgMUPTA17Y41CZNPijWemi2scso4GdItzY9LhaVbzzRKE1RIy+o5afDu/LVJ dVAbRw8z8wgCx3QzxTXv5NVnEhPheE3jkLS7znNaHxEcw5QnBYpHj3U4JeRG f6caRVBjb9BjxZEbPv8WZBk27IISN0iuRPFzxh4MQfO0nAyVRUGoPMbSKnX2 VNOhYkEyZzGyTH9WWz3nQUktGb/EnJAOWYMya9GrS0myQnU1LeE1OYOU2qCN P2WKNCW2EBN1HKhWLjeEnlbJYFcyE5sVRLe2Bgr2+DZJVEM1He1pPYWT/zaE RHiCbL2VWoXyb6nzvrSWQEGqKWkBZzX3DZuPL+7WiFaJr9bMQutUabJlSEk2 AB3zXxSym4Y0Zet1cQvjEKNFN3OUayuUcrfya9fKRoEXU7JQ6shAMKeWcZmU IUJ3+hw2svwuZIsUXvdkYCCX/VorG/8Hd9Vr7NBN8WoJv7I0dvnUP5UmGi3/ LxaQNzLztSMcgXNZ4XGrd/ICt1wLxWADSYz8ZXxj0mY99GFXrXyXl3i3cK0Y h7zIkgoHdFzjl9jmV0VXlHcrxnCnRoLpVXGpdIEvN1XS92k9pX8xmIGHd8sC WF/3SGKqa6vOsS39ReHEEBMBjnpbOHqj0nld0DxfN8zoFWhX9inPS6VcDQFR RifrD0hp+FH9qm8bkSPGw313MIDQ0lk3jHAZTgmpbXwjV4g+WH5Xlr0IjHVR Ukv1UBPXrFTlNlCsZBWez3Svk8lSGC5DGCN15xOP1q1qZQ1V1k47CmyRGIjV 9TOLMoPjsZAmAw7q8Xk159Kkd9nGUXkB01rpDYaZ/7U+35SCUzKx9li0itCR h8nlOpS0RDeLm7Nz/yYh2ViKP7UhoezXelWVFMhTic5rHrKC07ZkW3eVxQd2 iTQfgTJOJIhclzHTNFlM3WcRUdX4QDmU49ZW18+BrTiCmfVszwTstBiPj9kr ha9J9BSatQ18ofVlzOsiYWwOjXmsvMhvjcWUA+wSWThOLRGCd/mNR3kCXfad s2z+7jaY8VORUyURCRF+t/dhStlT+3QPvc6drTeZwweDAzaICSt4HdpGy7i8 6vYWRo0E65iO7xihR4idYULyBPJ71bn72PnXlrSejypTL1aA5ZGaFhpqRXk4 qtma4Rn3svnrErdkqbig9/9L0QSR+AqCTcfCdvF1c5k4lxroIJK2U6NYoFXw yWxJlQEwm8DKghc5nomQqQW0zqqPBrHXby5zg48a5kLt1vJzqZt5876YU9kr hw96rBN6gVs6bg44MJk3aqEoru3VpWPVD+cZkN1aiQwSbXotlWM5qv22K9sa 85YCPn8FrwszjT5RirL4XV56U7sST7lOrV9ImkHYpC+Tn2sPshWJiIIRqsNm lgvHqSvRtBtTqr8IK4nNLFODryG2bF3MMAIYNelQrA0Kb+PNvVq5UNNam22a VENZJmcblB17mBdhuXOyg5Vpkbw6GK8Vn6HGcteuY32bfWnClnFqsK9btcGQ lF3/2HuMu+C0mjxMKULDWrR39thsUJkj2YE5e2lzOmHNG7bJWMtMb5rAOrQP 9K6f+9MiW77x74+z++3e+53+O61A26gfO+LQIEKP2bmfhbJ/LrfnOqMgvD3z rTPVAhGwtnWjbJ0bs046zsSDyCLbV6jAmcMDvKqxebLLAmAboV81W3xY0ieH e3oza1hJosJ9BcbDmVrGma5Ydk5318fDS4tUlcatKnR5BbOb2n5Pd8jvsMgz lJALhnTnVC3/F0sqQ8Mn84MtnDAT2CiMLuA0CJdx7sr7eaS8MM4VGMqJ6yjI vM5JXCZEegWNA2UpcSEVlqLyPK/3SbkVNUty0w6j5aEd/x2qrtY2rZbVXNFd 4ajSf/PM1bfB05wbHv3Tm8qAr0Qyl5jLkXBrgDWRN6+AmlwHC51RzZygjFc1 v2PERBIddc6v6bxGzDhcPRhjti+gz1qFdJzYo0t/3lAUF5y3qZlhlTLIQ652 uMnxVpjaZ62OmDbB5ZDXFZ1ntbdKbXqDsBrTtaagPVIeNVLTrRGLWTf6enfY GzbZ1WJg0fmkyP3evS64MdnXJ5ZTNhxylg4viQe1QbMsB9zQi4vTaTrddM+I Kx245F38Ap5o6c3dtT3R+53bN+vX6XLUVN2mVt0eE/t9Pfyvy4tmx3ZBO87j 5ZTlDVpsI13i5SHVXV7PvleykP8r5jM+Ora6zEv3o9FVko/s8d5rqq/4O5PX 5CW6gbv12edd+ZJPjVNb6FmIMS/ZDHWeuRk6OEdcT1z1m1eIuIeeQm1b2bE8 Lpee3X/W6WVeqemojfH3rlQSuigtlvQjkHd+gH32wHkYaF89wo2cmBuY1Piz sM9apQJdKsfwsAXV29vey/Q93rNehuRapa370lki4ba0s4UQTed88FnyLVXw vplppwfz6U/d0Kw7n15z8/d7kDN3n+MRk6x93KOP6q0+91n+vGXartFeFeMG DTGFRNmqpFsdtpSrQYk9W5eu65wr7KsYzPf94WJfqYSI9r/c9i1X7kV/7K8e biP+7Gf/Jvizlu2tiN5fNJbwW/RdKZxOqLFVmqZYP3U32eKF2fe3fNTJ/7QD rfcIOwwJIBZayLYqO2/SAy5AegvsPxiKXzeaJ5peUfVwSRvLM13bM4vTpdr7 Ku8nHKaCxKOvwzOCmMgndOSMUlfTauaK3Qq1XC83DAWLyySXJO24sVuMCAsO ocTVcjUaX7tyzB4yyV8GhlGJ4Z+GSE6Ons4EY9tc5CRlG6AfEKbm5pASYeBg KOeoIGkSAhaq6WqT6SWr3yvsEWSl7S2uZEUtzmwr0lRwUh4c71pxmjEbskNd 8sFds3Kui++PLKfnComqqPU3uFQ4d/fp+Dd2Vfp5J3sqNXy8/3zkuli95qJd jDN/bvS/JGb95u1zd+KePStLtoVCGMvgLIep+pgoB9GaRGAXw2Q0mA8GtDgb joW0xQ/km5ISQC5A2SDayzxrdo3ryHHPC4I6NeicZHPjqp8PgcISigJVoooW iYYzypSVU3D5nulDA7BSSpJaZV4duJKrjKjtIE7raZaOz5Yoec7cA1Sbt4YM 0TEV+/QoKbiGtB26e85uCL2g+vpVVPja2cTxysp0U/PiojvOAs6ZbLJywK6S M9thO7Vt2LeGAzfdCBij4tSqb53m6Gr0r8OxZdOu7a41kc+SLVdlyZrz1q7Q elsFawO3GeQ9lCexPWz1LrSOqOoCDf/dwmHmy53P5u79ezbI18en3WPpu/aK t8EXIV+8+iM8Wb/CJ59+jGjv99nz97v/qBvuTSegSez998lj/QFIoFfSqSXS Wr65d2BudXFHoYIZrkcWMcIR1whWw2k1GWOrYbjFgRieCBWBLV63YnN3wXiN hjXaGKNHxgkEHDP+UNZSVdYJOKM6EWF044IuKpkYkUVkJ1uTSEqJSZQZLHml WVXiF5SRUx7E1XxosRSmfJe9VAyELszHVkw7QVmblt15OWeGVfJSooM7YUmP jcxpF2dQxNT3YyNh4hndiPU1COJib9oGKJ2R3mhnhx+OCNNvQCYapJKQbrkJ cp4GGtILpZr/euqplKC6Kqs5ufmkfnQthMisktpKG6W67NbbVT5SBQOJWIr6 aXLh3aqIIXsq2yis6Pmy16x9DXsstbkue22BNWG7LbNELfWHVR/leaiZ0tSB ZmWRnWsdbzs4yh+R01I7byn0jmWvOtt6tg+bI+nLzrdJNtMYfYwSlJVXkCTM qcLnNdsfjPLiW+3EFReF7WYkfTbolfsF3Am3LRpD7gLvaqiixSl7pPIntSqE IMvtXZvxuoRye1pSZZAcMsYm15hizEEfGTO0CEortMA8K70MiunpRiYECWxc sJDHrYSuSsOlSbU8EkusEVRIi/3a2KCUDcTSaTOd24pTtWuzZVNb/2Jpw9Rx DI/Xkf55Nt/F9v11XQMqvfOQR33clNohGsykzzIm/vgjfcf6t+QyUzcyg3T7 e9K+qgVxuGmQP543lCLnGd8jbOqqeuGVPyo54N6Kjgvh88QOrprnBpt1T5xj pla6uWMGk6F3l/ywf6ZvJR3xv8s93u2VR1+U61/Ofv3xF+qoK7tMDny5gx5+ T/XbEDT+VO14c4p684Ia73n1cFIevxSCB4i6fWlPb2VY92O/wzJ6gTzHLatU /8MO/QqzP7IlsAnuq9rCziI+DvCqc6lZIFnM0cB6KfCA+tugf8r2AhASwoP0 6BQJ5SQF0MEOV/aDz8aARTD1/SuF3jrbBv9syD8Tqg2DkAFCzhr4NbfdrV/u a5+qNGdBNMkwSzrMz9iCSMJplEVuxcvSB5/YMi2MUIgu5OEN0scaLf4wL606 IxrTqMY1srGNZ5QdoTA3E93MsDwJ21xmLKgYH5KFImQ0WwfBeLM/riwvgsxi 6A4JQBfxETI5E4x6Wlg6GDamiYvr2AnZxydCAswVDFqTJe+kqay9YXcTgqMi Q9bItxzCZXKJiwi/SMojlumCx1hi+KIWSkRVzTGc/IsnJxRHrm0PfOM75Vte iD/QXLF3iLyVGFMJPyrJUpq028cmf1kaQ1qzhok0JqKsOEdf3RGXD8KUBOcV zcWcjpdtIp+w8FH/zW6iUJvbHMU66dk7VOrzfdM8Vj6p0UzmEQyJ9RxKdpRZ STHVkZ3etOfQ8KlQxgRUWFGrDjojl8x+KmuViFnSosAELAo+aE84q2avCKqo cV5zU+esoCVfBdGIZuOBchyfHCrKPZdGMKSMiJvxAEVFbC70osR06ODUydGO ynOSS+1lOmdKU1CJdGRGBKdAV7fLzpjyqhhVnTKEalN+AfWYUDUPT/GYDLVe UIpz0ulTadfUhMa1dVLtkkTrelDxxBWuqjqIKArRDa+BCYKjZCZLk3gmUo4J lDX7p9/+csaJLjMyv9PTQ+/KJW7qQVyXPWunMjlKIoaRn3q162geyRDC/yRv mPejI0bNFMFiNjSqQ0kjqLxAWgi65Ec/bWk5t0pSv1ZDs9TjrMZmOFAJInZ5 68Mp/mDrlo3a7bdHlWZOB0VFfLoVNaRyoxpVBd40QuekTl0qcadr3M3mlVS6 hBB8y6umY3pVJNCtJFhLS136ajd/xtzdcG3W2dgubkbdTc5pGTnXQCa4vOsN G3IbDD3TSniRVguNAg9sOFddTbmJZe5aa2bExq7Ls5c8zoJbi9b/kaxuLX4w e2vaP//VUkTP81VSWTneHfO4xz5uIxVwm1tofWu3y7vxwe7brp7m0avZQiiD 3btMRt5yq8YpqXOfK0AY4zOYWI1PWTN24hnPdv+CY8bbBiEpjicIWWioqjCN p4yVFBMQznGubUG43GXkxtd/TAwf6zJ5El3Od2ugRbPF2rwNVx5Nz/Wz84vo jD5I79HRxmovpS/I3TdaGqCFDWuEJETDUjLWsoaGmm0jG2V9tnicRqZJp6kZ 4Xaq8pkcyrRPYDdWP/sTuK6lba9tJ+nA7RTLZeqznvq8ZK2K751ZLm6sVU3V X+cSz6P+tZkPLVAKz4zWDKpTYMkBs+XQs3zIhLKKcX3mS3o0aH6qalhCnV7X RqjQhF63P7j9IgLzztwOdpbRBrvauZBb3ZWWdXZ+rPCFM3y80UY3Pgx+8G9K XL018SPAPo3NMTUX3wT/HamhgXRqbW8b4Q8/eZ+8DFqKptK+tdxuYDAelIbT vOY+To7MtUdtTa4UyWid7U7r9m+Io7zoBlK5uZk8bybTzVKUrHFYcZ7zLHxM nPKFHBNaRa95W9TjjDO50cMOcEwnvb5axrGyi232WeKX43luBaMF3onJ+vam 1lVsEwFsY+DIFIcVT7XOxC74scv4730vhWpfKZbd2j3YZMb2Wp1+MF0Lr8NB CrTt8ug8l5B4eLxE2JV9SfTBk15GSC+3aEc7xv2S1V8mFTVkRUjbx1rbR9me PcNyxxPpil7apf+9hfgMea4D0MUrLdTla5xr1s9YX+V5trv+pkzigzRTGB49 //CzvyGyg7W3JE/yRYnnffumVPnZ5OveNRXTrl12R5FXMqbujmLpG/7wCdE+ /suI6fp3C/3qTz4WvZ/e/Ur5yZ/FyZ69qUS/dF7vOFapzcyw5Z8EPovK2ZH+ iJb3mdWW+R/1dZQ76RffwFaZnV1LKZnjnZvvTaAKHhfZMRToaaD3GB/yzSBv uBz0wRrFYc/OlFKonVi7xQL/TR7YrSARMlDh9VvQiYiJJKC6qN0LtoW6+JxG UdygmaDXRdel8Mp//YMe+dsPIlgQdk0EFiEZpiAQhmH/3ZoWfpi/hRGPJCEB Ol0zRR39hd+9LaDuZIkDAg/vxNMQliEgBl4grlo7wf8e1l3Y9fkdHN4XI7Lf f52gfYzhIE4im1GiJcZPB6qbeV0iJ1ZiJ34iKKbMF4ZiAo0iKZ4iKsJGKq4i B7FiotkcLMaiLLpiFJgiLcbSLSYaGqZhLtJIL6aiLf4i2uxiyQmjLxpjKAYj MlYExsgZ1GXiky2jk0jjJyojNTpQAUkNVykfNM7ZNeLFN16iNYbjCjTj99Ce FO4VOarQOhbhOJJjN87NOVZW7SlYO5LGPQbiO4ZjPAYQTvVgPYpMPrLjQErg Pn5jP9rZQdrQQhbkpDjkpBBjMUacRK4NhEHkCjakNCYknIVKRVpkjGGkQYrk yXzk6k3bkHhb6gAkJDoRC5L/ZP5p5DIOVQ/Z2hmmpDPSoyZxJB3gFUzin0wi 49MYFkfmFNbwodbcm7O5JEoK0w1qo1bl5IS95E9mX1Ayo0lOpPA9ZebwFL0J GODd5IS4XTh5WEvuE1VW5e9d5aNlpVyxyM4FpDN5JRZ23MRRJE4m3bEVlT1e pFoCH1sqAs/o0UoiW2a1oJR94L5lYb/t4fedJF665duF5F+SXmAGRq01lIk9 5lSOyjmRF/TIoqYdobBwmOh4TGVapZtlppiB0i2p0sVI5vlRiSzWpm26kU+m 5uBdJjY63zm63vEdJmnK5gGKJXFOIWXqZtjx5hnczK+0Hwn6oWfemWLyJE8u X1MK/128seQVSiVspqVyGh1z4s5xYufpJSW/vCbxGeUD2uEsdaBHNh9R0SBn uqFwXlp4it14llB5mudW6uWXgd8I0iU0xmccusEc+kY0ud8ACtfS5WZ+Ft1+ KsRtVqiFOhxcBugirmfT1aV2fl12kqBBmZ8FXg5bMVFG8eKeRehyrmZ/ziZi Gtsu4CGHMiZSipxSFihiAuhmpuMiDaj7waCK4ieLotyE7pBdtt57LSmOmdB9 wJeP6WEsjmZTol4kgmeRxtqR0qR8NoyPlkviPOmLFicY4oBpLg3mxV5eZKl4 uuiBzmhidSE5tWbdrWGkZeiYTiaV5Kn5YCmbOtqW7lpZ9v+cXD6eiZpTgF3p dCrmuLhaoT7fYO4fk8poffqXPN5gIhrhn2qpmzYiz8HTlzoCkKafkN7lVuJo gJDlZ60TeyJl91XZZzFlZPIbZVznpdrncpEpkW6qpQVqXzEVnpbfA0EhiZYo I2abjh4hVG7jo1rfmpAqg75hQTmMX/Jqr3Zq66Xp4BjitwWriEIdX8pWXPqU ieyoWXZniKTdDFZZAXonDiantcKYr/KprkamYUaXZwyXtspjFd7osjoZiNrr XtKqLQnghhrsgD0qasZrp82ru3Ydi8XmZ8Iia4imqRonpN0UCMIrwxqXw9aW rapkyFJrBdIrtM0qpdXCDkJox67/l8MGaa/EI8wCYAFJrMki557S68K2LJe9 LLPJx75iFrtyFbcKJJ4yKj32KIjlWJViV1q4Hlvp6ZrybM926kA46GL+Js0C 63SS38aJU6g+HsgpJaq6aqWSbM5aaQApLVTtLNW6LLbe7Lv+ZxGRaK4aa8x2 aLKGKMICHfi908z+H2Oqa3S67dtq1sfKbU96K1d+GDz5WoCSq5qWKV06W9Bm FeEKXeYObOGy7OFCVOIq7smeKnDiK0uWruL066uO3OTqjI4YVBtmFcISKLRy LqYa7ufOlM9K5Z8l5t86qcRWaMVO6cVSLtKO7B75o9SuaO5KVehaG9te3ejY rOga6J0V/y0PlUgVeW7zctLu9ghDoedhOWLewSHWdmbJym2oXCj7tq+GSWL3 atH31q2cpdcEneh3oetbLqrIJu176K98ficZvS94HGn8CiLRCGr4eir5Qp40 SF65Mm7Z5hLYNqugjG1jwup1CZv3spBzGPABu4a71RXyjq65GsyzEupZfqXe gqWs/tHUTU4Ia9PzFubl6gv2Kup58qjdOi6/jitY7u0vdVEBz7A91XD12uy9 vu7p3rChPnAGsy6V0nAOHZ0RD3HcWt+KeWD/RO1fZSj7ihfxBiwVe3AIXbH3 ZrHnHOKrwehwqu+DLRAIo3EtWi2dqh/N3HH6lK8A6rEeT+rZiv+p6PZpHMsw Hcuv1bLwppAIYV7q7aEoBCPRHiux+VkWR9lgG+Ms3L7OIZejbLLWxJBUC3/I 1aYoIj7yKM9jsflne+1euAJwuurdSFVeTEjx2UWdGacxrnSyJ0smKO+yK81G FWNmEGosduZyLQ7r2yQk09Gu3SSs6hUYIHns+Rjx0t2qd4oa1DqxN06Pmg0c LFlPMSMtSNIK5baPKEGPIkuuBt4d7y1uE8wx9mUQL1+z8t7zQoXtJnlzuCEe wVnOIGsysqDIfBlbOmft5jJrcGTgHOXX8iLCJgdfJ9tzg8oRHz/Wvz5oOHvL 56hiKwpMCSvP13KrKZtwESAzMfPfocD/3DTeFaTIc7QtHVkKKwsv28Nmi50M swQb3N1Gc6bOHTaE9FMFNUyjCBQdMkUf7Gv5FnRiar5ttBmh9AkP7gqbhB+n XxV6iA3+b9t+gVSv2a6CTZABk+7qH1IT5y/rjE4TGxJWVw5n3iPCVLOBiAyy Wyx8NVSbYYUYtWSBbiFN9OuJMpr+cy0ScLrlbXAgdIdaoRV6IfRG9UE4zReI cF/TcCfVs/tmds0RNiHwwVoriFAPZgDXnseUw38YBWo7Ehbf01l/MsGtCjSh YatFHzoYtgIhsEcUNS1IBS8j6Yd2CHemXg9R6Kmok2YfN3JHiW3fEG7T8wBP Fb6EthgaiELZ/65fSXdx6bY7KgHoHA5eC0IwT7NYUzYrPbefVgt2wcsRYY7X KqGg3bHW2qgQajcRfjPVjVtkB3U/Gw1n77Ve/zVDVmt0q3PrwokC169K/mgc 4e9Lne100XdG7jc414MH23ejjfUfmgaEA9bU6mLWJvgXF/CB/y9N46oDBy7X pXVvj0XiXTibFZlH4zexNDf6bDhYw6+t1M757krlTjJ1H1JR9veKX8MlfHdk 8zaowImNEyRfe/jzJeqxLhHqlrPOmalgd9Rbv8qSq2DbLEVr4MaWW/F/e5pi UfUiI3aIowdaC/mQ40gf5XWT47g4jnls/263inhQYTeI89oVqnibZ/+C6S33 bnf4k4T3R6uMUzAncSGvD2nvBf6wPh9PmJeekQv4PN9foeO3i7vZZItictOc ektricsu4Nau4Gb1lJGLn/85Pg5Qy8i4eMe4UqmvTSh6ev94XMfubyT0lTH4 0+nXpLeo/BgGo4EzON71fSuFd93sqrt5KFOnfTZpmuvHro06DUHxAMZ3Dd50 drM6hw87sWu6sR974MWdoUvqh6MwHQSaAaKWQ9g6OYeVg4Ps/OF5ghnzg3u7 rLs6rG/0K9iFhY/70RI4vYcr54FUrDv7gEvrsVpwpfQ4PKu5hKns8gU7pxKe PXj5bcndpvPvYvJwnBKrOrL5t1eMdEUtcIr/ESOHEuo2+prDeT3DC2TDPDAU eYqIjKquJIHFH8Lve8k/u/lqhsMH/dYikMRn79PSqA+SPFJDzLNUeh2jg/KA /NS0Owq2OqA7OZCHOtLPDdvCnMUXMmjTlKDH+cDnKRkUOaLfur2bud8qTqkL LravIeHeLtPPcLtRiGczr8d3ypnOjtqTO9ArkssrteVmuXnwuhMKF1d74d3H 7xfqPRABxpN+uuVvtsIn/KzvOYIi/mi78aO8LjdW9eeZemM32xxiWNj79UMi OZHTOMqi/b0wOZn37xbDPednz9FDu56X+e0v7urrspS0zYvX+nkWvO6dzoKe 5qBrPnozPJpXNYqv/7LRU/toe/7gIGKeBb95ewnxT0TUNy3v6qQSotq1Q+B4 07yknHwXOjTcZ27Lw8vlz/8aPX7HvmPEqDWF8y348hwdWT0BxMc0WQ5378C2 ZlVZ7wn8B0MRFL5yRFN1ZVv3FSPJmgWKtmlu1+98BsoWMGLReEQmlUtm6NSE RqVTatVqtJWeVy42m+3CtlawOCy7ARXZSzut423S82+vwVbH9YhxUhsGpBLa Iyw0jOsLVFxkZExshIyUnFz6sqFstHyM3LwqW+lkQrPT8OFLEBo0nCOtwYh4 O+QJLaLF5JTN1c21vfX9hewFHiYu9tMUNvb6Gk4WvExxFtulrtZVtZ6V+v9T xs3+/pbuHidnES9HT+dkVt9mb/799Dg3R9QEx5/9yUfcNmnvgkzgQIIFDR5E CA3gQoYkGj6ECOhdRCXygNELCA0jCmz8PH70uDGGE4olTZ5EaSZllYQtXb6E GVOmzJUvFBYTKfFmxVOo8PRsAzJbRw4M6uTRk9PhyJpNnT5FpxQqAKJCrV6l JnXhTmJauZywSGQUUDX7jGKtVjXDoFj9omzyOlXuXLot4jZVi1bv3qKeZv4F HFiwpnJ9uILq+QZWnrxDLyx+wCoyDjeK9yHd4TXU3bqdPU/lvLLx3lR8sYam alq1UNRT4B4mwcdsYjiYP569IxkoLDyQUQVN6s//3GfixY2raH1yNFo2dHxL xr26lCfp1fElF27OMO2yv8lehfzjOSkI0HcX0mzz+Hr2nrGXXM6ccpDHp3xb X0Odb/yi+Ie0c+Yo/wZcQ45VsnPhvfYWZDCTBqMh0I35fhvlvghR40+Wnyy0 D43ZarOPta2wiLBE4E4M7i0sHmSxRYAUjChDq0y5IyjzTHxAP5DCs81G8noE kR/YyAkQRyPTQlAsF5dkEqcm5zkySmswnLFAIHmcjygZV4FREJu+65GtDce8 7JAtrUvPjyfXZNORNc+UMk4qZ/wwzMkmqLMjOPfghqFeqtLTOxCjA/KaKNOs qE1FF/XyyT3jPHJOEx/V/wssiGgZqzwDXbFRPDAJ0ZRT+mqAjtLpVGQ0VVUn 6fIhUyEtUVJYjbQ0RuS4C7NOpAg988bIeqsM2NuSXLVYYz15M7NZg6RVx2Un /cdWjnANVFQJKvyUzx+39XRCIYlV8onNjiXXiWfPRSWlsSYL9FX0LBDPrMty 4G0xd+VwFt0Bt2iVjBHuhRXgFKHYqM8xau233KcE1hc8dandVDVfsRS1rWHJ UHYWK8FheKil4DNXH0sa/mk/cM0QlySq5lFY4Y4jTgrUkneV+GEJmS2UtW1p 9hbnfGTl7cro6OUF3vLqlS2I2Rg+WLnYGj4X0SMeobrlcl8u5d2YJcTWtIS/ 2v9t5mxPIw9pPJXm8GKWIM56wi0nvrlin5FcGEqozcRbwKPUktpqvzEmrRUf qr2WLLZqRqnel7werCCHAXc7Yt1W2fnwnnPe5WtHsJ6U8q4v90kqGDX/W7n9 5o1by+YM35g0m+/WF2g8ywxd8aJHlddDtFHkONpoLj3vTrirhLeysiMXfnbF eO/AdyRaJb30GPcTvBUriQbOcpMTh51kHRsX2x7wBQrJ+ZXPj76S4MfzkPP6 crNecGGt5ZX5/5w4J+H0pd+q+1n338Z33Hed/+XLf14zH8KA56PkZc9+PzPe qORGqp0VjoGn4kiAJAFA/kUFUsiI3etWtzujMdAooUr/Swl/Nbukmc2CIoLc ARH3MZU1BFBtk2F/tNUXu9giehzsYDfGN0QiFrElr+PU8CiWNrzhzoSpm1vv YgimARrqXZk6kFxu6JMcImJrPLRJJ/YHxCB2pYuHQiKNtDc8zHnRiYOK2wOv ky/ssYt4pLJXjVSox8Kpgon4+p1JjDhIQhbyef+KRxlZtC451k5QjdQYusgo Cu648Dnz+6PWwuNCO/KxirJDns4sxyFSxq87oAIFaEAxyQQZZkgXSdlFFMmg LbqRMp+DYKSQeEZBVRGMglgfJFPIxieGkmd8Go4qY/DKJhgslWF8DSvx56RZ rgeLd1rL++Cgvdt1azwUxF3H/6TpB15+kI5kGqDuLPPNTm5Sb+hJphZNEBYv xTJatYJmK1mphUmOs5oSYVspRrjN1mmocnsLVrfKx71ySklWDcVhQd3yTC1a QiLnwyjL0FcLeiKHmYrgFxn9+U9nTc47dTzl2Ha4xJsp1GLh2KX9fGlLicbK gBBVG0UXRpgzcMSnYrHo1D7qr39xcKQkdQ1OI1qpXdaxN7ljHAnJdKGbKvVn CaroRGKk1ecNlWCr9MVRkdpM8QkoarRjThpRZLGZllKCM81MVSXpuRDFcS3q gUrK0ic6jbqmNcIY49OsKh2xknOw+CnsNIo5wTaGA4oSpOoUN4TNS+7Jne+b 7LyWRv+/lGpJJXj56QZdk5G+9ZASYDksYReWmZlx81B5mx8qGaq8s6EQpacZ EzhXSCBQMnZojh3lWoX7xuJd8K54rYkYWdWoQHgVOWraIFwfGcVf2Q5+aFot zCiAy9dqDVfInG1q/dNb3RBKmP0hZuUqWD+faVBdWA0GUTcnjZw4N4CErekj D8fIGSb3PIx07Y60GapNIk+hwQNvNOxbCZiETLzjPae9SiMbSqlzm3mqrfxy x990KclpnwUpsk7rw7d0SboBXQN7d8vh7eHFkQDOb0jQZtK3YnK68REXQajy Em88GLFyZdaJCbhDQIJYWh7OKEt4erJ1JIIzC55adUpWLQ7/q3g1iY2y8WA8 3TsSeLGDq16MMbhjgaijlpHsQSrEWcAp+nhKKzqyUKHMUa42Uxka+cpDqQfZ k9a1uNSFoYvdTGQxj1m09gztv8ImtOUN14on9KRmSfjCHeUVy0yOyjGC6peO 2lmInf5qUgedVqcIeVl+NNMtnLkUfCr6scraskq3xlID27XSOyXOpWuoaVCL oteiECL+MCQ6HIEQaroWy6hbvFxEbzTJDmbsxqwcYMoRd41wPI2li4PsuNS5 xNgZ52bmbBcGF9Lc5/5LduXQWuWhNVZN5PPAlotIek+rU+6uwNEmLGs3FpiP ndxtY+mGl3ELEkBkKHgrL0pNffo1/8vKnpG6s8m1iTu02laWN3wOm0lSEzzh cSZSTxEeYnh0VXRFcnRR0ElbK0ZN4nl0IJdvM+BXRLBUtdl3xiliamUjG5of B7kxnAxxpkLX10oJqb1hFtH98tuguiz1i1nndI7N2JSVNWnOJypIovc3cZvO 9Tio1vVsG92vBQO73bKkJxXHtlc1fysObr5QQcs9pXeXj93j/kaX3hie4a14 14PGxbn5HLnH8SdcpBxjMW2Y5VJO1BmgXGYToLjPwmXxSlOHULnH9qpRJ/tS qc4HteYbh9KF9I/iReH6WNLvmb9fche0T8TgV+Y4pyLeEWh2kAYoqNe0U3dw +XZrt9RX3/8CfegDf17Sh5fG2gxcrdVL3BMB/0p1m33Jb2X7P9IozY1WLe+D YV+zKvXEhk+Q8gPN9VcX6PyP/ea1j/n9yRZZ9tlPZD0IizqB3qfpzKe7qemK HBs7kSm/D8K3iEu+wcqQE3K8nEE/pbO6pauUeysvFtKw6gs8zwKtBgms9OM+ mfKW+oG9jhPAO1sytVM/Kao7BqQr6Hup5jGdFaRAHbK/93qQH1IsGvy8QxI6 HUuNtVi567I4z/E8nXM+m5s+nfkzL9O7ubOudeHAGeTBW7s/DxStZJuUe+ie gtmK8Kky3esc77I1bVhAWqO08JGxKHQ0NhzBzvqlS9GCKlw/HMz/wfiiM3TT wz08IvEzsxYKG/ATsCaEO3CCQtYDwAjUv+O5O46ruif8Mkh8QymMwxc5mIz5 IgCcEja7wjtchPyhwznyw3Swvv8DtGFiObeawLRxxA5rweXTxGMDlbgaEQkM GtWRsFicNeGBqgzzJIG7hg5skdExLGyDRb0ZwttxuVH0oDgiwdFLIUksPkN0 xkSUuGPkOa/JREMTO0yxvGACnU2cxgmiGAUUDSZ5j4LBxIIKwxJsuWKLPD/h QcJJsOTiw3vEx4EojB2Mtl6qoEdEw8XSRQ0RRhdJDpG4JnzzPqmCxuvxPizp O2zqwROUx3mExa0bK07ojDmTQjWMNF0B/8gICjiAq7/HOUd0FDH1ab/QiTk/ A8bLqxjOw6MDm0g4q8hQzIqMPK2K4gkXPEUrtMMleTKC+caWckmM06RXAzPq q8lacJXcM8DH+0nRCxidnLcmycZBU8REQ0lMqwUfO7947B8b1K7reclZhDqr xEO1fK5M2EqxYxOt6Lay8kg5ScA6dEobqiS266wysSy4i79CRKGmZMuFC7lm YwqQccsOesvm8rT7wsk3Y8bCKMo31K+sOCgbq64YlMzC/MRMazYFMpZfW5XG dEyxfAsqSsYDLDZ4a8X8mEwiqUzOirVuUkpp5MyB88zTPMwE0ijTjC6gM0hF wYjeIigKaUiJuf84MaRFH7xJqwrL3SS5kKu3XYNLxLRO0gLO/GuT/AEbo7y3 42TCF3JCagwn3GtIL9RLA6xLWrlLoJTOgLDKVbunvtIJb1OV7eTNw1sbDNQ9 pFzDVGxDAUVPa4xNsYvMnIxPw8QJ/SSJ0PzN+SLNuEyVZEjHSjpK5hQSJZy+ 8tQ6HENNAGGt95QT2KJJJFxQ5ooHB+VK83HRjLDPY2FRkYungAhFekRR/hTR bYyaavuuHE1RVFG1GVVMciFS+dQpG73RizRD5xzLDEQTmmsg8/S39knPIEXS 6PJEhhvN0mxLkErQKSnOp6QwaqMeNzwmNEW1qTzS4VzLLeVSLy2WqnH/BPFq wOoiUB7yzvW0O3fMO/OcRg8VTxDF0pTUia4Mti5VVBoC09Tij2csw+Z7NnLj U/XDUYwsVK9spjYNNbicUxll1E9cn4c0pQ0lxCl1wirN03iT1ElN0h2lwTX9 u0xVUYfrTlL8VFB11eYCR/qwUrJRU2nL0+WhxBt0r+cM0yyi1dFyh/w0MzmV 0R8aVfFkVRnDTfgTTIIqVm7c1cR8Upy6U2Q8UdhcVk0No1x9Vkbh1EM9rXVM TlkktOPy1i/9Voh6VOH7UXIt104VKiP1E3X1124FKLLEgI3jUX3Nzup8kaTp R1Z4TbQkz2xtIFW9rm2V1319TCS7GhtalHU1/1SB1c58FFl8pNcW/cMLMqvP YU3MDFZ/rNhqtFiExdgQ9ai/iUCPzViATdiZxTT0K1bbElaJdKxrlb6IHL4H wllaolS/mVBPfRNo3Vme5deopcxYhVhuldq8LCrGTLuDe9oKfdWsndoXJcUq bAy+EVvUFM64xE9cdRSwDdu0BbZ5hdVkVVa5zcu1Jc6mdVqh1Nkaxdup9Tk1 zEp3dajA5aiMbNsXwUriNDLEndsYbVBkCELGG68axC7IjaekhaXt5FyNbVzQ FYORJV09XMvEo9zK41DfKtVoNFrj2j3NXSa6nSW91b5FolCb1EK7vdvPBNl1 IDOu2FaZxFMifMRVbP83yJNdspXcFS3d5yWkWsW/0KXI3eVd2QLeFaVdFYTI QxRax1i7MLsy2R2qcLve3h1b9vhcrXXSL7G9sSHWDFXeLGQVUDxf7E3bBTPf +61Hc91I6qXZ2ruySB0omvFTc8zeTwS6wgXX/N1TnEAsZby98GMJLHTTnLWL xYM9QeSs+dXIdNQM/u3fZV3gO9s/hgySgTqLiFw2Zp1eOMVgAVbOau3gRsxc +n2y0MAGGfmkU9tXuTThGSbH4LMgHhGyv3phC3bhDH7fGIyXJ34qEkXgNz25 M6DK9vrTQvO6BbVd5sWEI8ZWwsENIx7fr2iP9Y3bGIYQEcZUNwnV0RXV1b3/ wCkFSDbiOTSmTvkyoyubKqTFuneFqSw1Djw2Wf+tXDauRDd+45oNBgQjXpkU mD+esTtWy6Sj0T1G5ESWXvdQYjNm4ky+QQdRWGH7YnA02ueLxiSa4zJGqhRk 0GYAZU3e5Log5EWu4E+OZZlV5HntYkrK5YutXcrbT1j+ZV3W4/89411eY8yl Tfkdsma5yqLa32Ju1TJyZd+FYGquZkGm5WQW5e1LM9soYFM8S645Gv8kyc1C PvolgVYbQOiFZyJSpMWdTky+Yug8G8IrFOj5jFrWHG9cye+asAPeFDRUIvj8 Ztio5ciNKf41qiAO5x0eSG3BsGsZzMyatA/V0BzB/+ZuHuSdBOd+FOiWLGfp S1NjXOcELtmO7eWwiuWHFrrZNC9THeIOtbWc42BXrOe5QGMAEqNA5Mvi5cKV 1Ty9G0mnAklRVGAvplqsbGlVi754NVy4gulsNibkHE87Nsa22DcuvL5vlqew Cytw3kMNMbcAzLNRXuk34duTzWKaQrOJ5gXutGfruufjbdmMDs8CnTqsveS8 Emu6hjZt/qtxEV2nbutmzLvA/F4TWsiyUzWInokdieeDCOWdLjVOjlPV1ebY IxjA0l1Hoed6pZOfFUGTNkGQturOJh1OTdpws0VtdeZI8VH+w9+KEIcHRuzR rlvwCLPuw1bXGeuY7mzPBv/rglSmO3O1FWpHQK7tXzznPQq4Ffa7207cAw2k 3BWNlxbsixCgDCXot6appJ5Vdj7JsM5jzq5hy6yS4Npqs+RrYKQvIMZub95u h/JqaBnu1U695pbriovuIl6aX+2j2UbfNw1K7NtHaAO/2hSw9ApUDbxS05rl xx1Gj6vsDO/DyCZuO+CvnEZFmJS/gALxEdbITszsdFVvKM4NFs9i7CHwS2rY CfbrHePm6r3ghr7fqq5rGCRpgBnjgKY1dyrJVOPw80Zut1VB5bvUJp0nzMZx 3PWvlIvrqXTuG/5iiC5eoR6ZLX/mdkLEGhPp8AbmaP6wJFfyQybsedAfIZXy +2b/5mPMJWg+cnuGuCa3bjMvUiSvRTWnZh10805OQt0KWm/qJlIN3/NEaz2P h+I2btXe88RRTAa+I4qWX0CBdDW2phZE5Qh/uiWC5Ba38vLOdO929H46c0mf dJbco8rKauiG7hgvYmeewhM3ZI+Gc5GOxJLWakDNTQWtc2Jm5rygdNf0v8Lb bI5NcFsxbQ//71l075MWcdmGXZ1G8EDf9CnvougMdlOPaAMZ8Gqn6MBcPf+k 7l9EMBrm6K6I9KCDj2b3VSYFriXc9XJsO1ke5ltPbh2vnfaUMilO6VJv9ICu 95K26YO3lgKNWWuXJXdXdtFQs1wUIIDPHEAsi4oGc/qT/8pav3Z9V3B+v14e F3ZdP3jiq2mmRPmuTndj3u9/NbgFZNJit9aD3WZlrnBkznWZf7orOsI2tvUe N15HonfvymvX+z4JN16OZ/eHz1SdPyNAv3HNzvku9NFIxXfergQtZ/KrLfPb ZdxuJDOwQvNmAOGxv3n0Lj126jJFp1iK/TccQ4hXTtxeIz9HX3fldvlgC02F INKRemo23/eopwsWJXB1h6C8RlnNdNn+1cdyA58HTSC+58c1T++Woc8I/d1L QcFuw1kT2zZOF1+yIdqafl1xx3fA/2unhFBnWyZji3OJehmnr/GGtxqwkHxn O9JwW9u/r3y5R3vAA8vX7/qfh/+zTxBNC100XHyMh9Wh/u5F04P1KU5UeMBO W1Zpsf9456WHxObzfA98Khw1Wc1z4r9uCgfBq+7VX++32/R0k1xwWVp9d156 xCP7tub9vLd5wNZ2RBZ5byf59ieA+JgaYu0wosfkoSvrfYH/YCiOZGmewqmu LJimHvzBdGvfKK7vfC/3wJBgSFwNg8ikUrjE/ZpQ5TNKZWE42Kx2y7lqG0RK 2JKZVo3nIEZM3LQd7wq3LHkML3e8nJHfz/8OaVRmgiaEh4U7hImMTo1Si4+S OpGJlZNnl5hJXoCen19/YBN+dl2bI5qbnaCtrgpir6+qqLW2j7S3uLoqR7y/ OcDCTbn/wygTpntXyRWxnrHOedHJ03Vvaxduv8W4st7f4N7ckkdFhuODxiTo 6sTkADKL5u3t7DzlviX59Fb8PqTW+pRSFgfQKDjSsiVwxidhBGzYyCzcVi+c xYsYT9F7MUNIPnvu/IH0h2TkDY4xXNSAR9KYyZMsU6qM1xJNzZMA5dhhqFAn qy3VlCmMBqeOhYNGNbzkVDGj01BzkDYD+HPB0iooY3aMeRVI13Q3VzXKOm/l 17A+3tF0IfMsJre8qj6dy0XuQo264JYkJTBOGKQ77UL1CQ1htr59RjGb2lNw oI0xPraVeUsvU7QtHNPdzBkWZsupIq81izl0aSOdU0cdrJSi/7qIfsgUvjsr ts6ejWElhZhTM2g1tPbV+n3vdGbVyJNPREtcZebmgqBP+ku9uvXr2LNr3869 u/cwrl32Thr7IE9Q5ofi3q3+Id/xX4xTDj9M+irlEgWPQSitoHL7lwkDYHTy FWggKgNaAR8fhCWGjG2frJEeHgyxcVtAbPQFlIEJ6vPagb3gZ5tdES2T03+f 1QOiViu26OISHYYo4oy0sYZFjDACg6NpL6YiIjM/3QHRfrChyBxkB+7Y45I6 NkXjkxkpGWBlAjLpI34FBXmUbkUmJyVMSBb4pZVkvuUklGiCM6YacTVZpgs/ kqfbQLyth9ya/fCDJyVv9ukniwLSIf/onUqladWKSn65ZyGaGeooXjctKoKk ef5p6ZKSLgNYfxki02gWQlJo2KhQUsqnLVKamsmj1T1aV4otqWrIpbS+mOmC 7dVoZ4R2ArmrkYiimlet8Hxn7LHIJqtssrDGepqsxEbby5lEuceeRLxaeyGE NEILpljDSfupq+R2cGSkpXkr7bqTntmQhTvpAe83+zEYL6lPqmtDhzHqO8iJ 2MLiF5H+iVKuNueG5a+/7LJ768EQg4qpmQg63MWNVOk6ro2GMswwoCI1LHJN D0dschlMApjgx/+2J9BCUoFBJMCrMbhttQ75FGWzCZPE8si0lnzy0OZOvMt0 I5f467YjDpT/bbXv+hp1wOLw3DPQWGddaX2Dztm1RVqW+/PWjCKddMZULxaz 089cK5TOb2/86tVWa2333fMF+mCnDYkKwcuuhDrqwHLvbKV0iGddONFLP+Ux h8Ou5SHelFtCba/YSl1bfuQtDnaZzSWuOKjUMV4wZ49DLqzkk4Fc+eshiZdb 3LOfh16umqc5dmaW966154wDi26Sq2+11UqwJx87157Oa7O9/Kk5MNx9o7k7 7wSWnfQPrNT7V/QQbyxzznMr3CK/66Sv/PpT6h380GMuK//89NevbKSHWIU2 bsDTNa4Xi4kP3cTEvgK+SWjvi1j8EsjAx9RDOFcqypCuQbOLzAZu/0GRGvlm t6EBErBKBgxhSUJ4PeY18H17guAxctW0LkWJIDkDYGMoKBtdScyDH6SPCHfo CAOW0H0dsyH/2OYoRbFDaYd5T+PCkcHauUxznfhU6nqkKB5asYdX5GH/LCg4 vrlwixjBkQqdcMIXfu2G5ktZm7LIxmC0kYSuooZRugTGML6lK3Uso9cqeKO6 uShRbwxku+5GFjf6MI7WMhEHyQWdMe5Fj2Lz4x+pJMhKui5pWnkCaUSYRzVp i3CBOV2p0uBIYtBMP6CkkOc6iTpJ2ipclhTkD7GSSSZwZYeshORczlLKlhVK UF8kIr0iicNXgiuWb5wlWAbJzEPqEn6QQP8Q2gDHQhm6sC5FudkTd5NLBw6v TytDZiCVKc7oPBOaPkjU/sJWJJ4sToOq1ODMDJdGPw2InOWkJPvwmZdznmwc vZzOOn+JxCE+DXfbpB09v/kn+/AznxXbpywvBr9/Psdd/hTiZqaoMPt59KMg XRZEdQi7h1amN1K5Szcx1ozA+E2CL02pHfUBLVR+j2ii9J8r9ZTROI50jesz KaoGesbOwNNtR9WpR5jTU93tdCNNLeJPhyXRcRJVf/9BqtcCyC0LRsY4Kw2i wbxHQ4TVU2Fx0mgN+ae2GQnVbm+lpVVnSE2q+Y+bL4UeqcK6HDFFlY9uoNP+ UFZMqGKJhTVa29//tvSjqepTeXG9D3++c6eQlm6XSYKPQ6AW1gveq4lxA1JZ 30bYs0YqTtdcLGPluESlOjaiQZ3oX33KIc3mRkJ8Zcy75NS5srYVNlXh6GkP S9o5/fZ7qTXqa2EJ2UrmdrYRymzt2rrIMA4FiteK4ZaAa1aGDjer2toq+FBa 19REFmvnXV4b5aKfPZrXorUNLFaj2ij2PhWj0BXect8RW9lao6t6DbB1W7pX xMAwiZiN7y8fBF3HkOi+r8lvvvZ7zOSlV6AIHVTuLKjVT7otwWKyrIhHTGII y07CjaWw2ZrrX21qmLdg67Bt1epV5+7rwmNJF4rdquIVV646ySRvcFPp/xR5 5lVw1QMwE2MZHBwz4mPsXTBjs5ncVjwXPT3m7+uoM9eo0S9KJC6vmpj8HCdr j6kz7OoFhULdthE4yVna1JrHnOUcWxg8Qd7xKMlshHlcEcpX5ZJBWWtXlnI2 w1CrcZ19t2U/s/HKekajjfsc0P6i2cPA3C5yAQsqGTuRxrIw87pEfY9KO1PK XVtblTenQHFq4i+P1jFdw9agreYUKkFJcoD9UuRFPzmopGYUStX8vBZyGih/ cym+kMzr5wZ7LI72CJ6tCOjJhvnWbrj2TH2dPQtbsqDsBFibb6fQcicVxM6d tiG1KOtI34nbZ36yu7slkkDThrsGtbKnP1xoOv8zWd3lrPa8zQvvbst74Fiq 96wXTLCGb9HIy5Zza+kV8LK8oJemVly7y3Mi8kGa3NgsaAcLLtexdCtbBqM3 T61NYitrG93/pgnrijVzb39mPNwdtxkJg+Bm4zaJUZz4BEieCXKc3M0p5/HK Ee4liJqjkGy5ZQEFrlsk6vyFMiwujDcMY0gRXb3C9hKVEcytzV43kSk2LNPf 7XSzSEbqz07LzV3Gl00LvTZJzbqLbaf1Pn49Cg4F796JjSFufry0+D22YMmu 5MDBN1qHX3vRij53w+u9XneV11Ec9F8oZikqfwe80cWOaQDj7KiR7+vlYEoH DalU8Z1+M+H2FtPGh3r/1JJnOyk3nnsa/y/0UAh875W7dBdjNZirxnWGBx9e x+E+X+4tA5F3a714f3f42wZ++8IevssyUFXgJugphenmQyeWcxt9/tEVj3zY t9Lg18f+57QvBXJc+/7496jCC6/h6WOe3LkWZwfWbxQnLqXSdazHOclHfLtX eUWlMYtHgCDHKvRXf90gf67lJPm3Si/nfAaYL653fB2XbyrXgJdGEMQWgozX P6bAKUcmcao1fxXIJheIfvMlXzhFUaUwWogXYRgIc0FzgH1XTWslgekHfyRj b4NlTe5HUebHfEwjgzModyaHg9F3g3rUgoPmdSf2gwtVK6kneb9BdVxHhK93 /3fy9YSf1oTPMIU0WIWJFCTUwFqdZHYP8Vl4BYVywneT54OoJm4dJyE7Fz7q F0fed0JjuHEZQmtklRjYhmyh9YIDaHtY5oZUeHClJ16hxUrmVyGTxW8cN2XB tX8oyIhsk1LA04LKpmvM5iDONmobGIuy+B3Wl4T5xYdAaIn7MnqZeH4KVYeI toZ5V4T41oNdWIYxaHWgpnylN4yUeHsf6IVfuExoJY3+potYhInWaIRKBn5K SHeHcVPcmGm9WG5oGDgzkHGIMn434n+PqINllIgOuI3oiI2nAofZJo6R5mB+ p3YwZIrUB4j6FokRN4mQVglQNznV+Id7xITnCInoZP+C24AdMwCPNtROgjhg tGWP36KN9FiAajeLz9CBvTYrM7dJC3kh5YVkxvaQVEFop5eH7yeRCEKLwCVT t4Vzyxh7MlNggsg3urVkHNmRlnBK7ihm1mMQbLVB/Zh4H2llOXCSrZOSyMg0 xfiMIvhJ89QgXJWLwecE3ZFO0RYD35iM07SThrZ8zthZQ0mU3BeKCsiGggeJ gDFYTemHT1k1s8IjtkSVCGiVRYiVxqWWdwiKXnlj3HGCVUloLYV5qbhv5jiO otCWu1iDNqNY1bOArFaXl3l2exdA7nR33miGbIViFrJaXAh46siLDWY91gF2 sSJkDDde6/GYBMmKMCiYk0n/mWTzlmvmkJLJK4u4dQundaFphKPZN+10hbv0 PETRH54CdLWHK5x2T6u5Ku2ojybzjgxIeSf4V7jogbw5LZb5mxGomyCHhx2m nnB5lakJRG0WdKrRicIIiorknI2TKGP5lnk5C7UYm/1ZieO5bvwpf/VVPqsn cnIpDsFon4jVntSpejpynYogfY54oWGYdNj0oNGFhAAaoG04oARqTtbIjwiK l5zCh6lXIb5FVxzEa4Gogp4RKxQqIxB4hsE5nxrKefVIk7aYalk4VnYpaSLK l0UJov5ZfNt4oN3FHPiQmJNCe5ijmY5nlp1ZmJ+5XQt6KB7qMzAjn+u3iubh ij+3/1hgKkVFupf4qHfR93//OJANlJxIKqBPFpZgKRz7CQ9LiCtXJmdcx6La FV4s+J9eioXoiXWDaYNZx3fhyaVpaqQF6ns3OnYuGXut9qiZYKcu8ZpwYob3 eahIx570eaVNU6kSSo3XZzsZqj/OOGPGF6Hv+ajCF4fid4qA+TQwmVC5Jp5a dHEI2UjeYSnZQZYYSGtQ2aWkqFdu6lZSWqak1UXFOY5xFzSsuZg8qpJTppTm tpWh1JXZh0u1NBPGI23bEXOrGj6G2qE++qE/aKwChKl9qY2LKaj3tqUN+ovn xqtVlRJSKXVfd64DJ4/fOafvCq/jeqQ7BrAMAE7Bqgiicf88U0l0wZSUkCSw KUmwBWuwl4SdXXCIOIWUMzmhUDqRF/V3UaZApkOoyTpb/3Oe3tqHBjurGGsQ wDGydzqLOGtZUzdNAGmqPJmrtHqbR7iuhZps0fmJ07BSSdtzZHq0U/FbsAqz 8CqzbEqxcQpkOjKzC7tPZVlcnYVU3PqJoEqnJeeXNjhHzBlqpaqqmGOOmDmK GnuwkWqvxHWp/jin02oF+jivf8mg5qarHKqvqPqjf1tDVYl3kDmqgOmepzq1 1Yql8/WpA2aH+CqTgmtCYpO2TfdKNRevACcEpll9yFp8LMqVpfm1mreDnsh6 gDqc+Rm3ckui5bhIzga2LTo1Y7v/m3frJRgKTyA7tOcTrhC7sfpAOtqpQL/b nWUbfwa6oa0Bu8TrS6/qi7m7oU84h4b5rV1IehDKuLoXvP2KPMehtTQ7urtL vsbouJYpYQorp9x7HtildOkCcIgAqTZaqh3bu7SprVmostD7v+SJj0rhsfCT vIe5Dd2iv5uosFu7EZ8rTVYIpHBZvQ9ITEQLwBiskB6JvkS6vUiqn3kKn5Ar MHSylWOrnqsrqtkUssubwS6sPmtqqRGcgziIWy/bAVgbF1oLrCHMrnzbfj6b d2GLu5FnsS98xPGKsLbXXhmlhajZpDQFaxsMonj0wOu4fIkag0H5TjKGvZGZ gS2MxEhM/7Uvu1l0GEZAC51Zqode+7rBZ2oYt8NRPAVSfCkMjDqie8FinMFU uzSdaMD826rd6qB86sZ1Ch45XJEzPJdSlY6cejbZuawHw50sPLh7/MJ9nDYN 2k2K28n8dpymlz6dG3U3mx3DNmSLWDiq6JNSCmcUbKHlCskcPHLeecljzJpL 6rzpyxLhmzemhMXUm6OYlsL3qmiQdYtK6aauqx/+a8vQK7MCc7z7yDEz2i69 HL1e0bWrC4DA/MVsybWtWTOB+MRQLHrOfMvrO8vvWb/NFHyyOcCpfFCQK4BA +c1BpVlp7LOWypmBSrnsqZO2Ws5fec5HnMn0xb9RWL4h+VEGQf+S12hhrvqb gCycqkSc/Ae/Z1ld1VzLBI3BBt1ULasHwuxNeIm3Oztd2dqoaoulxBy025zF Qzh05tvR6rumQBuU72Wl/ZzGUBvEK0vFJ82QrzzJcPq8ekzTNS2vWHyufmrR b/qs2aq7Tqm50CfOMtrBW2aRxXbQSCfQsInUGmvQ2MXUntnSKvmndNvAl+OK b8ZhdzgbPue0inGRoAfO6ozVAw3W/wvNzVvBGXuMhGldi9q2a1ubaCnT95yu uoOIzazXRcrXfX3YXo3A9TnSGNOqlY3Rcpm3ZKTYQ12lnt0xje3YAwrZd+2o a926jtOscp1mGya5d1lSL9nFfQuAgtz/yEdN2qWNyxA50cyadDYsraR4xxsl 1JNNSAtiwo2YS6r9j8QttXmt2zHL2zXz3Fqdlox6oh4M1HZduQR5L0wEuLW9 ubkt3ZQp1lDNmM2p0xDX3uf3eX+NuSbd3adt1Bxt3mkKzc3GGOrdnMtM2P9N jFGL2iX9fUK6goXG2ThR37GaI/id1Eq8zTijoyyd2ZQKoRpt3yUd171lmzyn Why+V/ytRH2r4PvC4A1ugQ8uq9Q9fEwa3yLcjDHdNoOtqFnc0yUe1JK946Cd QEa84rudzpF93cfdT5WN05Y94uXoyS5ryMfs2cGFx37tVDMN5NjoUDmb5Vpe o+sb4rLh26k2hCEi3nkd7rp2ZeLjW+EyTqqeRKrxS+XlbeWWiOb7dbJUvZ26 TOCy/aKjNcThfdHxhNv3LedtSefLZd0opOMx+d36PJsYlOHyO+iEzpGGPukz iOi3ONqWXoGVvunah+kNpumeDnydPuomu+WoPouibur/yuqubuWl/uo+I+u0 Lt2xjjUFAAA7 --------------000904080005000201080507-- --------------ms010302040000060805040208 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEH AQAAoIIGUjCCAxIwggJ7oAMCAQICAwmhhDANBgkqhkiG9w0BAQQFADCBkjEL MAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJ Q2FwZSBUb3duMQ8wDQYDVQQKEwZUaGF3dGUxHTAbBgNVBAsTFENlcnRpZmlj YXRlIFNlcnZpY2VzMSgwJgYDVQQDEx9QZXJzb25hbCBGcmVlbWFpbCBSU0Eg MjAwMC44LjMwMB4XDTAzMDQwMTA5MDYxNVoXDTA0MDMzMTA5MDYxNVowTDEf MB0GA1UEAxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjEpMCcGCSqGSIb3DQEJ ARYaeWFtYXp1cmFrQGx2aXYuYmFuay5nb3YudWEwggEiMA0GCSqGSIb3DQEB AQUAA4IBDwAwggEKAoIBAQC2KQYjqR5t4kSI8h5CVPC8s+NNE80YXKNUCosu VbjaKPm1/M/QzzP+jqfPqI0fSsS9LZWF3ypuDtduU+gCnuOktDl8ygOohCNk eXXX6DTCMAoO6VpYf3/QqEB1MMa9O90sZrYfL1PTwNQ8KDddfEUuIO1pznRl JCUzSUpgzNH3CHu9z0zwUfOeGNmzTgzVgY5N8QUU9UouKFfTVHEJWtAr+/ZU 96RIEMNp+E8N3uMXoKdXRmGuhqMW9gHq9a4lZIk7wsCoKSyfVWCk2w515Z0X 2zN2ITTFtvAxzBLZDbSSJU6FnPQzDgD2Der0aDd2inxu646HM85qdVnv+MXg Y1wtAgMBAAGjNzA1MCUGA1UdEQQeMByBGnlhbWF6dXJha0Bsdml2LmJhbmsu Z292LnVhMAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQEEBQADgYEAK+ak7q4u l9palI2Lq6jZ+5/ljdeWhU0oI+Utu1MfaZQzthKfbQ/CYMJDf7x8cTIbRrqT L5axjDikuzcXwGe0H0O8Jlm68pgjcOOEZNs/PXE7Pd9A7D+Z46qij7Js0RXa 39FSYYxnLwF+/u2eb8v1ORvyQULWJMzNSZ7c8XKaOj0wggM4MIICoaADAgEC AhBmRXK3zHT1z2N2RYTQLpEBMA0GCSqGSIb3DQEBBAUAMIHRMQswCQYDVQQG EwJaQTEVMBMGA1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRv d24xGjAYBgNVBAoTEVRoYXd0ZSBDb25zdWx0aW5nMSgwJgYDVQQLEx9DZXJ0 aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMSQwIgYDVQQDExtUaGF3dGUg UGVyc29uYWwgRnJlZW1haWwgQ0ExKzApBgkqhkiG9w0BCQEWHHBlcnNvbmFs LWZyZWVtYWlsQHRoYXd0ZS5jb20wHhcNMDAwODMwMDAwMDAwWhcNMDQwODI3 MjM1OTU5WjCBkjELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2Fw ZTESMBAGA1UEBxMJQ2FwZSBUb3duMQ8wDQYDVQQKEwZUaGF3dGUxHTAbBgNV BAsTFENlcnRpZmljYXRlIFNlcnZpY2VzMSgwJgYDVQQDEx9QZXJzb25hbCBG cmVlbWFpbCBSU0EgMjAwMC44LjMwMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB iQKBgQDeMzKmY8cJJUU+0m54J2eBxdqIGYKXDuNEKYpjNSptcDz63K737nRv MLwzkH/5NHGgo22Y8cNPomXbDfpL8dbdYaX5hc1VmjUanZJ1qCeu2HL5ugL2 17CR3hzpq+AYA6h8Q0JQUYeDPPA5tJtUihOH/7ObnUlmAC0JieyUa+mhaQID AQABo04wTDApBgNVHREEIjAgpB4wHDEaMBgGA1UEAxMRUHJpdmF0ZUxhYmVs MS0yOTcwEgYDVR0TAQH/BAgwBgEB/wIBADALBgNVHQ8EBAMCAQYwDQYJKoZI hvcNAQEEBQADgYEAMbFLR135AXHl9VNsXXnWPZjAJhNigSKnEvgilegbSbcn ewQ5uvzm8iTrkfq97A0qOPdQVahs9w2tTBu8A/S166JHn2yiDFiNMUIJEWyw GmnRKxKyQF1q+XnQ6i4l3Yrk/NsNH50C81rbyjz2ROomaYd/SJ7OpZ/nhNjJ YmKtBcYxggJ2MIICcgIBATCBmjCBkjELMAkGA1UEBhMCWkExFTATBgNVBAgT DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMQ8wDQYDVQQKEwZU aGF3dGUxHTAbBgNVBAsTFENlcnRpZmljYXRlIFNlcnZpY2VzMSgwJgYDVQQD Ex9QZXJzb25hbCBGcmVlbWFpbCBSU0EgMjAwMC44LjMwAgMJoYQwCQYFKw4D AhoFAKCBsTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJ BTEPFw0wMzA4MDYwNzM0NTVaMCMGCSqGSIb3DQEJBDEWBBQFmlQLJwepawex dQcrD12aoT3s6TBSBgkqhkiG9w0BCQ8xRTBDMAoGCCqGSIb3DQMHMA4GCCqG SIb3DQMCAgIAgDANBggqhkiG9w0DAgIBQDAHBgUrDgMCBzANBggqhkiG9w0D AgIBKDANBgkqhkiG9w0BAQEFAASCAQCYJG+Q7FoELMZFP1y+KwEt2U3LXGmV 1uFOZ8aWb/oM7cgKFYnnkif8kRyTBVnaecOysV46ma4V6icVKEkbFFhylRq0 xSe1xTFldURSvxelbZOcVuuDOLki6Ai0SoD4T1uRKDbBq9w7kLeuHq41sGLK +3eWhJyfOEB1GRifGuLTOzcZOtQGkAI9PvhZNUS2qfNocKfCu3qOj5RYDU56 hXxKrHQH1tCmJxA+RJfhqbctEnn1x5p6CVBROjNKqRhO+lqY2njEm+uaR5/S kPFns7AcBIc/MP6KbOEkXHOLmqJVMzxceOMKK+4zbtTNdNhfXqzB2G7gbM4M FSoVNiMmCZzCAAAAAAAA --------------ms010302040000060805040208-- From pgsql-performance-owner@postgresql.org Wed Aug 6 06:31:04 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 A52E1D1C910 for ; Wed, 6 Aug 2003 09:30:52 +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 02529-06 for ; Wed, 6 Aug 2003 06:29:33 -0300 (ADT) Received: from anchor-post-39.mail.demon.net (anchor-post-39.mail.demon.net [194.217.242.80]) by svr1.postgresql.org (Postfix) with ESMTP id 64848D1C916 for ; Wed, 6 Aug 2003 06:30:41 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-39.mail.demon.net with esmtp (Exim 3.36 #2) id 19kKcy-0004oE-0U; Wed, 06 Aug 2003 10:30:40 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id F0364168FC; Wed, 6 Aug 2003 10:30:37 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 59686168FB; Wed, 6 Aug 2003 10:30:37 +0100 (BST) From: Richard Huxton To: Yaroslav Mazurak , pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning Date: Wed, 6 Aug 2003 10:30:36 +0100 User-Agent: KMail/1.5 References: <3F30AF9E.2080607@lviv.bank.gov.ua> In-Reply-To: <3F30AF9E.2080607@lviv.bank.gov.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308061030.36610.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/95 X-Sequence-Number: 2912 On Wednesday 06 August 2003 08:34, Yaroslav Mazurak wrote: > Hi All! > > > I have installed PostgreSQL 7.3.2 on FreeBSD 4.7, running on PC with > CPU Pentium II 400MHz and 384Mb RAM. Version 7.3.4 is just out - probably worth upgrading as soon as it's convenient. > Problem is that SQL statement (see below) is running too long. With > current WHERE clause 'SUBSTR(2, 2) IN ('NL', 'NM') return 25 records. > With 1 record, SELECT time is about 50 minutes and takes approx. 120Mb > RAM. With 25 records SELECT takes about 600Mb of memory and ends after > about 10 hours with error: "Memory exhausted in AllocSetAlloc(32)". [snip] > > Current postgresql.conf settings (some) are: > > === Cut === > max_connections = 8 > > shared_buffers = 8192 > max_fsm_relations = 256 > max_fsm_pages = 65536 > max_locks_per_transaction = 16 > wal_buffers = 256 > > sort_mem = 131072 This sort_mem value is *very* large - that's 131MB for *each sort* that gets done. I'd suggest trying something in the range 1,000-10,000. What's probably happening with the error above is that PG is allocating ridiculous amounts of memory, the machines going into swap and everything eventually grinds to a halt. > vacuum_mem = 16384 > > checkpoint_segments = 4 > checkpoint_timeout = 300 > commit_delay = 32000 > commit_siblings = 4 > fsync = false I'd turn fsync back on - unless you don't mind losing your data after a crash. > enable_seqscan = false Don't tinker with these in a live system, they're only really for testing/debugging. > effective_cache_size = 65536 So you typically get about 256MB cache usage in top/free? > === Cut === > > SELECT statement is: > > SELECT showcalc('B00204', dd, r020, t071) AS s04 > FROM v_file02wide > WHERE a011 = 3 > AND inrepdate(data) > AND SUBSTR(ncks, 2, 2) IN ('NL', 'NM') > AND r030 = 980; Hmm - mostly views and function calls, OK - I'll read on. > (cost=174200202474.99..174200202474.99 rows=1 width=143) -> Hash Join ^^^^^^^ This is a BIG cost estimate and you've got lots more like them. I'm guessing it's because of the sort_mem / enable_seqscan settings you have. The numbers don't make sense to me - it sounds like you've pushed the cost estimator into a very strange corner. > Function showcalc definition is: > > CREATE OR REPLACE FUNCTION showcalc(VARCHAR(10), VARCHAR(2), VARCHAR(4), > NUMERIC(16)) RETURNS NUMERIC(16) > LANGUAGE SQL AS ' > -- Parameters: code, dd, r020, t071 > SELECT COALESCE( > (SELECT sc.koef * $4 > FROM showing AS s NATURAL JOIN showcomp AS sc > WHERE s.kod LIKE $1 > AND NOT SUBSTR(acc_mask, 1, 1) LIKE ''['' > AND SUBSTR(acc_mask, 1, 4) LIKE $3 > AND SUBSTR(acc_mask, 5, 1) LIKE SUBSTR($2, 1, 1)), Obviously, you could use = for these 3 rather than LIKE ^^^ Same below too. > (SELECT SUM(sc.koef * COALESCE(showcalc(SUBSTR(acc_mask, 2, > LENGTH(acc_mask) - 2), $2, $3, $4), 0)) > FROM showing AS s NATURAL JOIN showcomp AS sc > WHERE s.kod LIKE $1 > AND SUBSTR(acc_mask, 1, 1) LIKE ''[''), > 0) AS showing; > '; > > View v_file02wide is: > > CREATE VIEW v_file02wide AS > SELECT id_a011 AS a011, data, obl.ko, obl.nazva AS oblast, b030, > banx.box AS ncks, banx.nazva AS bank, > epr.dd, r020, r030, a3, r030.nazva AS valuta, k041, > -- Sum equivalent in national currency > t071 * get_kurs(id_r030, data) AS t070, > t071 > FROM v_file02 AS vf02 > JOIN kod_obl AS obl USING(id_obl) > JOIN (dov_bank NATURAL JOIN dov_tvbv) AS banx > ON banx.id_v = vf02.id_v > AND data BETWEEN COALESCE(banx.dataa, data) > AND COALESCE(banx.datab, data) > JOIN ek_pok_r AS epr USING(id_dd) > JOIN kl_r020 USING(id_r020) > JOIN kl_r030 AS r030 USING(id_r030) > JOIN kl_k041 USING(id_k041); You might want to rewrite the view so it doesn't use explicit JOIN statements, i.e FROM a,b WHERE a.id=b.ref rather than FROM a JOIN b ON id=ref At the moment, this will force PG into making the joins in the order you write them (I think this is changed in v7.4) > Function inrepdate is: > > CREATE OR REPLACE FUNCTION inrepdate(DATE) RETURNS BOOL > LANGUAGE SQL AS ' > -- Returns true if given date is in repdate > SELECT (SELECT COUNT(*) FROM repdate > WHERE $1 BETWEEN COALESCE(data1, CURRENT_DATE) > AND COALESCE(data2, CURRENT_DATE)) > > > 0; You can probably replace this with: SELECT true FROM repdate WHERE $1 ... You'll need to look at where it's used though. [snip table sizes] > Table has indexes almost for all selected fields. That's not going to help you for the SUBSTR(...) stuff, although you could use functional indexes (see manuals/list archives for details). First thing is to get those two configuration settings somewhere sane, then we can tune properly. You might like the document at: http://www.varlena.com/varlena/GeneralBits/Tidbits/perf.html -- Richard Huxton Archonet Ltd From pgsql-performance-owner@postgresql.org Wed Aug 6 07:14:28 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 8D9BAD1C916 for ; Wed, 6 Aug 2003 10:14:26 +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 02577-08 for ; Wed, 6 Aug 2003 07:13:07 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 9BB39D1C7EB for ; Wed, 6 Aug 2003 07:14:14 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h76AEkU0002102 for ; Wed, 6 Aug 2003 15:44:46 +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 h76AEjip002074 for ; Wed, 6 Aug 2003 15:44:45 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Wed, 06 Aug 2003 15:46:06 +0530 MIME-Version: 1.0 Subject: Re: How Many Inserts Per Transactions Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F3122BE.10716.137B9C@localhost> In-reply-to: <60d6fkhxwl.fsf@dev6.int.libertyrms.info> 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: 200308/96 X-Sequence-Number: 2913 On 5 Aug 2003 at 12:28, Christopher Browne wrote: > On Oracle, I have seen performance Suck Badly when using SQL*Load; if > I grouped too many updates together, it started blowing up the > "rollback segment," which was a Bad Thing. And in that kind of > context, there will typically be some "sweet spot" where you want to > commit transactions before they grow too big. > > In contrast, pg_dump/pg_restore puts the load of each table into a > single COPY statement, so that if there are 15,000,000 entries in the > table, that gets grouped into a single (rather enormous) transaction. > And doing things that way presents no particular problem. Well, psotgresql recycles WAL files and use data files as well to store uncommitted transaction. Correct me if I am wrong. Oracle does not do this. What does this buy? Oracle has constant time commits. I doubt if postgresql has them with such a design. For what hassle that is worth, I would buy expand-on-disk as you go approach of postgresql rather than spending time designing rollback segments for each application. It's not nice when customer reports rollback segment overflow. Tablespaces over file is royal pain when it does not work. Just a thought.. Bye Shridhar -- boss, n: According to the Oxford English Dictionary, in the Middle Ages the words "boss" and "botch" were largely synonymous, except that boss, in addition to meaning "a supervisor of workers" also meant "an ornamental stud." From pgsql-performance-owner@postgresql.org Wed Aug 6 08:49:28 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 7C081D1C7EB for ; Wed, 6 Aug 2003 11:49:25 +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 12543-09 for ; Wed, 6 Aug 2003 08:48:07 -0300 (ADT) Received: from pns.mm.eutelsat.org (pns.mm.eutelsat.org [194.214.173.227]) by svr1.postgresql.org (Postfix) with ESMTP id 00402D1C91D for ; Wed, 6 Aug 2003 08:49:13 -0300 (ADT) Received: from nts-03.mm.eutelsat.org (localhost [127.0.0.1]) by pns.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id h76BqYU26791; Wed, 6 Aug 2003 13:52:36 +0200 Received: from gmendola (gmendola.mm.eutelsat.org [194.214.173.50]) by nts-03.mm.eutelsat.org (8.11.6/linuxconf) with SMTP id h76BjOR06400; Wed, 6 Aug 2003 13:45:24 +0200 Message-ID: <006801c35c10$9b55cef0$32add6c2@mm.eutelsat.org> From: "Mendola Gaetano" To: Cc: "Yaroslav Mazurak" References: <3F30AF9E.2080607@lviv.bank.gov.ua> Subject: Re: PostgreSQL performance problem -> tuning Date: Wed, 6 Aug 2003 13:48:06 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/97 X-Sequence-Number: 2914 "Yaroslav Mazurak" > Problem is that SQL statement (see below) is running too long. With > current WHERE clause 'SUBSTR(2, 2) IN ('NL', 'NM') return 25 records. > With 1 record, SELECT time is about 50 minutes and takes approx. 120Mb > RAM. With 25 records SELECT takes about 600Mb of memory and ends after > about 10 hours with error: "Memory exhausted in AllocSetAlloc(32)". Did you try to use a functional index on that field ? create or replace function my_substr(varchar) returns varchar AS' begin return substr($1,2,2); end; ' language 'plpgsql' IMMUTABLE; create index idx on ( my_substr() ); and after you should use in your where: where my_substr() = 'NL' From pgsql-performance-owner@postgresql.org Wed Aug 6 09:43:29 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 6DA0CD1C4C1 for ; Wed, 6 Aug 2003 12:43:24 +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 18465-08 for ; Wed, 6 Aug 2003 09:42:05 -0300 (ADT) Received: from fw.wubn.net (unknown [213.156.64.226]) by svr1.postgresql.org (Postfix) with ESMTP id 0F381D1C4BD for ; Wed, 6 Aug 2003 09:43:07 -0300 (ADT) Received: from (172.24.4.34) by fw.wubn.net (8.12.9/8.11.3) with ESMTP id h76Ch7Pt002774 for ; Wed, 6 Aug 2003 15:43:08 +0300 (EEST) (envelope-from yamazurak@Lviv.Bank.Gov.UA) Received: from (172.24.4.57) by MTA (8.11.5/8.11.2) with ESMTP id h76Ch6f18473 for ; Wed, 6 Aug 2003 15:43:06 +0300 Message-ID: <3F30F7CF.6090900@lviv.bank.gov.ua> Date: Wed, 06 Aug 2003 15:42:55 +0300 From: Yaroslav Mazurak Organization: National Bank of Ukraine Lviv OU User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: uk, ru, en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning References: <3F30AF9E.2080607@lviv.bank.gov.ua> <200308061030.36610.dev@archonet.com> In-Reply-To: <200308061030.36610.dev@archonet.com> Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms000008090800050008060007" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/98 X-Sequence-Number: 2915 This is a cryptographically signed message in MIME format. --------------ms000008090800050008060007 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi All! First, thanks for answers. Richard Huxton wrote: > On Wednesday 06 August 2003 08:34, Yaroslav Mazurak wrote: > Version 7.3.4 is just out - probably worth upgrading as soon as it's > convenient. Has version 7.3.4 significant performance upgrade relative to 7.3.2? I've downloaded version 7.3.4, but not installed yet. >>sort_mem = 131072 > This sort_mem value is *very* large - that's 131MB for *each sort* that gets > done. I'd suggest trying something in the range 1,000-10,000. What's probably > happening with the error above is that PG is allocating ridiculous amounts of > memory, the machines going into swap and everything eventually grinds to a > halt. What mean "each sort"? Each query with SORT clause or some internal (invisible to user) sorts too (I can't imagine: indexed search or whatever else)? I'm reduced sort_mem to 16M. >>fsync = false > I'd turn fsync back on - unless you don't mind losing your data after a crash. This is temporary performance solution - I want get SELECT query result first, but current performance is too low. >>enable_seqscan = false > Don't tinker with these in a live system, they're only really for > testing/debugging. This is another strange behavior of PostgreSQL - he don't use some created indexes (seq_scan only) after ANALYZE too. OK, I'm turned on this option back. >>effective_cache_size = 65536 > So you typically get about 256MB cache usage in top/free? No, top shows 12-20Mb. I'm reduced effective_cache_size to 4K blocks (16M?). >> SELECT statement is: >> >>SELECT showcalc('B00204', dd, r020, t071) AS s04 >>FROM v_file02wide >>WHERE a011 = 3 >> AND inrepdate(data) >> AND SUBSTR(ncks, 2, 2) IN ('NL', 'NM') >> AND r030 = 980; > Hmm - mostly views and function calls, OK - I'll read on. My data are distributed accross multiple tables to integrity and avoid redundancy. During SELECT query these data rejoined to be presented in "human-readable" form. :) "SUBSTR" returns about 25 records, I'm too lazy for write 25 numbers. :) I'm also worried for errors. >>(cost=174200202474.99..174200202474.99 rows=1 width=143) -> Hash Join > ^^^^^^^ > This is a BIG cost estimate and you've got lots more like them. I'm guessing > it's because of the sort_mem / enable_seqscan settings you have. The numbers > don't make sense to me - it sounds like you've pushed the cost estimator into > a very strange corner. I think that cost estimator "pushed into very strange corner" by himself. >> Function showcalc definition is: >>CREATE OR REPLACE FUNCTION showcalc(VARCHAR(10), VARCHAR(2), VARCHAR(4), >>NUMERIC(16)) RETURNS NUMERIC(16) >>LANGUAGE SQL AS ' >>-- Parameters: code, dd, r020, t071 >> SELECT COALESCE( >> (SELECT sc.koef * $4 >> FROM showing AS s NATURAL JOIN showcomp AS sc >> WHERE s.kod LIKE $1 >> AND NOT SUBSTR(acc_mask, 1, 1) LIKE ''['' >> AND SUBSTR(acc_mask, 1, 4) LIKE $3 >> AND SUBSTR(acc_mask, 5, 1) LIKE SUBSTR($2, 1, 1)), > Obviously, you could use = for these 3 rather than LIKE ^^^ > Same below too. >> (SELECT SUM(sc.koef * COALESCE(showcalc(SUBSTR(acc_mask, 2, >>LENGTH(acc_mask) - 2), $2, $3, $4), 0)) >> FROM showing AS s NATURAL JOIN showcomp AS sc >> WHERE s.kod LIKE $1 >> AND SUBSTR(acc_mask, 1, 1) LIKE ''[''), >> 0) AS showing; >>'; OK, all unnecessary "LIKEs" replaced by "=", JOIN removed too: CREATE OR REPLACE FUNCTION showcalc(VARCHAR(10), VARCHAR(2), VARCHAR(4), NUMERIC(16)) RETURNS NUMERIC(16) LANGUAGE SQL AS ' -- Parameters: code, dd, r020, t071 SELECT COALESCE( (SELECT sc.koef * $4 FROM showing AS s, showcomp AS sc WHERE sc.kod = s.kod AND s.kod LIKE $1 AND NOT SUBSTR(acc_mask, 1, 1) = ''['' AND SUBSTR(acc_mask, 1, 4) = $3 AND SUBSTR(acc_mask, 5, 1) = SUBSTR($2, 1, 1)), (SELECT SUM(sc.koef * COALESCE(showcalc(SUBSTR(acc_mask, 2, LENGTH(acc_mask) - 2), $2, $3, $4), 0)) FROM showing AS s, showcomp AS sc WHERE sc.kod = s.kod AND s.kod = $1 AND SUBSTR(acc_mask, 1, 1) = ''[''), 0) AS showing; '; >> View v_file02wide is: >>CREATE VIEW v_file02wide AS >>SELECT id_a011 AS a011, data, obl.ko, obl.nazva AS oblast, b030, >>banx.box AS ncks, banx.nazva AS bank, >> epr.dd, r020, r030, a3, r030.nazva AS valuta, k041, >> -- Sum equivalent in national currency >> t071 * get_kurs(id_r030, data) AS t070, >> t071 >>FROM v_file02 AS vf02 >> JOIN kod_obl AS obl USING(id_obl) >> JOIN (dov_bank NATURAL JOIN dov_tvbv) AS banx >> ON banx.id_v = vf02.id_v >> AND data BETWEEN COALESCE(banx.dataa, data) >> AND COALESCE(banx.datab, data) >> JOIN ek_pok_r AS epr USING(id_dd) >> JOIN kl_r020 USING(id_r020) >> JOIN kl_r030 AS r030 USING(id_r030) >> JOIN kl_k041 USING(id_k041); > You might want to rewrite the view so it doesn't use explicit JOIN statements, > i.e FROM a,b WHERE a.id=b.ref rather than FROM a JOIN b ON id=ref > At the moment, this will force PG into making the joins in the order you write > them (I think this is changed in v7.4) I think this is a important remark. Can "JOIN" significantly reduce performance of SELECT statement relative to ", WHERE"? OK, I'm changed VIEW to this text: CREATE VIEW v_file02 AS SELECT filenum, data, id_a011, id_v, id_obl, id_dd, id_r020, id_r030, id_k041, t071 FROM filexxr, file02 WHERE file02.id_r = filexxr.id_r; CREATE VIEW v_file02wide AS SELECT id_a011 AS a011, data, obl.ko, obl.nazva AS oblast, b030, banx.box AS ncks, banx.nazva AS bank, epr.dd, r020, vf02.id_r030 AS r030, a3, kl_r030.nazva AS valuta, k041, -- Sum equivalent in national currency t071 * get_kurs(vf02.id_r030, data) AS t070, t071 FROM v_file02 AS vf02, kod_obl AS obl, v_banx AS banx, ek_pok_r AS epr, kl_r020, kl_r030, kl_k041 WHERE obl.id_obl = vf02.id_obl AND banx.id_v = vf02.id_v AND data BETWEEN COALESCE(banx.dataa, data) AND COALESCE(banx.datab, data) AND epr.id_dd = vf02.id_dd AND kl_r020.id_r020 = vf02.id_r020 AND kl_r030.id_r030 = vf02.id_r030 AND kl_k041.id_k041 = vf02.id_k041; Now (with configuration and view definition changed) "SELECT COUNT(*) FROM v_file02wide;" executes about 6 minutes and 45 seconds instead of 30 seconds (previous). Another annoying "feature" is impossibility writing "SELECT * FROM..." - duplicate column names error. In NATURAL JOIN joined columns hiding automatically. :-| >> Function inrepdate is: >>CREATE OR REPLACE FUNCTION inrepdate(DATE) RETURNS BOOL >>LANGUAGE SQL AS ' >> -- Returns true if given date is in repdate >> SELECT (SELECT COUNT(*) FROM repdate >> WHERE $1 BETWEEN COALESCE(data1, CURRENT_DATE) >> AND COALESCE(data2, CURRENT_DATE)) >> >> > 0; > You can probably replace this with: > SELECT true FROM repdate WHERE $1 ... > You'll need to look at where it's used though. Hmm... table repdate contain date intervals. For example: data1 data2 2003-01-01 2003-01-10 2003-05-07 2003-05-24 ... I need single value (true or false) about given date as parameter - report includes given date or not. COUNT used as aggregate function for this. Can you write this function more simpler? BTW, I prefer SQL language if possible, then PL/pgSQL. This may be mistake? >> Table has indexes almost for all selected fields. > That's not going to help you for the SUBSTR(...) stuff, although you could use > functional indexes (see manuals/list archives for details). Yes, I'm using functional indexes, but not in this case... now in this case too! :) > First thing is to get those two configuration settings somewhere sane, then we > can tune properly. You might like the document at: > http://www.varlena.com/varlena/GeneralBits/Tidbits/perf.html Thanks, it's interesting. Current query plan: QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=188411.98..188411.98 rows=1 width=151) -> Hash Join (cost=186572.19..188398.39 rows=5437 width=151) Hash Cond: ("outer".id_obl = "inner".id_obl) -> Hash Join (cost=186570.65..188301.70 rows=5437 width=147) Hash Cond: ("outer".id_dd = "inner".id_dd) -> Hash Join (cost=186569.45..188205.34 rows=5437 width=137) Hash Cond: ("outer".id_k041 = "inner".id_k041) -> Hash Join (cost=186568.40..188109.14 rows=5437 width=133) Hash Cond: ("outer".id_r020 = "inner".id_r020) -> Hash Join (cost=186499.15..187944.74 rows=5437 width=122) Hash Cond: ("outer".id_r030 = "inner".id_r030) -> Merge Join (cost=186493.55..187843.99 rows=5437 width=118) Merge Cond: ("outer".id_v = "inner".id_v) Join Filter: (("outer".data >= CASE WHEN ("inner".dataa IS NOT NULL) THEN "inner".dataa WHEN ("outer".data IS NOT NULL) THEN "outer".data ELSE NULL::date END) AND ("outer".data <= CASE WHEN ("inner".datab IS NOT NULL) THEN "inner".datab WHEN ("outer".data IS NOT NULL) THEN "outer".data ELSE NULL::date END)) -> Sort (cost=29324.30..29568.97 rows=97870 width=61) Sort Key: filexxr.id_v -> Hash Join (cost=632.67..21211.53 rows=97870 width=61) Hash Cond: ("outer".id_r = "inner".id_r) -> Seq Scan on file02 (cost=0.00..16888.16 rows=493464 width=32) Filter: (id_r030 = 980) -> Hash (cost=615.41..615.41 rows=6903 width=29) -> Index Scan using index_filexxr_a011 on filexxr (cost=0.00..615.41 rows=6903 width=29) Index Cond: (id_a011 = 3) Filter: inrepdate(data) -> Sort (cost=157169.25..157172.17 rows=1167 width=57) Sort Key: v.id_v -> Hash Join (cost=1.18..157109.80 rows=1167 width=57) Hash Cond: ("outer".id_oz = "inner".id_oz) -> Merge Join (cost=0.00..157088.20 rows=1167 width=53) Merge Cond: ("outer".id_bnk = "inner".id_bnk) -> Index Scan using dov_bank_pkey on dov_bank b (cost=0.00..261328.45 rows=1450 width=17) Filter: (subplan) SubPlan -> Materialize (cost=90.02..90.02 rows=29 width=11) -> Seq Scan on dov_bank (cost=0.00..90.02 rows=29 width=11) Filter: ((dov_bank_box_22(box) = 'NL'::character varying) OR (dov_bank_box_22(box) = 'NM'::character varying)) -> Index Scan using index_dov_tvbv_bnk on dov_tvbv v (cost=0.00..142.42 rows=2334 width=36) -> Hash (cost=1.14..1.14 rows=14 width=4) -> Seq Scan on ozkb o (cost=0.00..1.14 rows=14 width=4) -> Hash (cost=5.08..5.08 rows=208 width=4) -> Seq Scan on kl_r030 (cost=0.00..5.08 rows=208 width=4) -> Hash (cost=64.00..64.00 rows=2100 width=11) -> Seq Scan on kl_r020 (cost=0.00..64.00 rows=2100 width=11) -> Hash (cost=1.04..1.04 rows=4 width=4) -> Seq Scan on kl_k041 (cost=0.00..1.04 rows=4 width=4) -> Hash (cost=1.16..1.16 rows=16 width=10) -> Seq Scan on ek_pok_r epr (cost=0.00..1.16 rows=16 width=10) -> Hash (cost=1.43..1.43 rows=43 width=4) -> Seq Scan on kod_obl obl (cost=0.00..1.43 rows=43 width=4) (49 rows) Now (2K shared_buffers blocks, 16K effective_cache_size blocks, 16Mb sort_mem) PostgreSQL uses much less memory, about 64M... it's not good, I want using all available RAM if possible - PostgreSQL is the main task on this PC. May set effective_cache_size to 192M (48K blocks) be better? I don't understand exactly: effective_cache_size tells PostgreSQL about OS cache size or about available free RAM? With best regards Yaroslav Mazurak. --------------ms000008090800050008060007 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEH AQAAoIIGUjCCAxIwggJ7oAMCAQICAwmhhDANBgkqhkiG9w0BAQQFADCBkjEL MAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJ Q2FwZSBUb3duMQ8wDQYDVQQKEwZUaGF3dGUxHTAbBgNVBAsTFENlcnRpZmlj YXRlIFNlcnZpY2VzMSgwJgYDVQQDEx9QZXJzb25hbCBGcmVlbWFpbCBSU0Eg MjAwMC44LjMwMB4XDTAzMDQwMTA5MDYxNVoXDTA0MDMzMTA5MDYxNVowTDEf MB0GA1UEAxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjEpMCcGCSqGSIb3DQEJ ARYaeWFtYXp1cmFrQGx2aXYuYmFuay5nb3YudWEwggEiMA0GCSqGSIb3DQEB AQUAA4IBDwAwggEKAoIBAQC2KQYjqR5t4kSI8h5CVPC8s+NNE80YXKNUCosu VbjaKPm1/M/QzzP+jqfPqI0fSsS9LZWF3ypuDtduU+gCnuOktDl8ygOohCNk eXXX6DTCMAoO6VpYf3/QqEB1MMa9O90sZrYfL1PTwNQ8KDddfEUuIO1pznRl JCUzSUpgzNH3CHu9z0zwUfOeGNmzTgzVgY5N8QUU9UouKFfTVHEJWtAr+/ZU 96RIEMNp+E8N3uMXoKdXRmGuhqMW9gHq9a4lZIk7wsCoKSyfVWCk2w515Z0X 2zN2ITTFtvAxzBLZDbSSJU6FnPQzDgD2Der0aDd2inxu646HM85qdVnv+MXg Y1wtAgMBAAGjNzA1MCUGA1UdEQQeMByBGnlhbWF6dXJha0Bsdml2LmJhbmsu Z292LnVhMAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQEEBQADgYEAK+ak7q4u l9palI2Lq6jZ+5/ljdeWhU0oI+Utu1MfaZQzthKfbQ/CYMJDf7x8cTIbRrqT L5axjDikuzcXwGe0H0O8Jlm68pgjcOOEZNs/PXE7Pd9A7D+Z46qij7Js0RXa 39FSYYxnLwF+/u2eb8v1ORvyQULWJMzNSZ7c8XKaOj0wggM4MIICoaADAgEC AhBmRXK3zHT1z2N2RYTQLpEBMA0GCSqGSIb3DQEBBAUAMIHRMQswCQYDVQQG EwJaQTEVMBMGA1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRv d24xGjAYBgNVBAoTEVRoYXd0ZSBDb25zdWx0aW5nMSgwJgYDVQQLEx9DZXJ0 aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMSQwIgYDVQQDExtUaGF3dGUg UGVyc29uYWwgRnJlZW1haWwgQ0ExKzApBgkqhkiG9w0BCQEWHHBlcnNvbmFs LWZyZWVtYWlsQHRoYXd0ZS5jb20wHhcNMDAwODMwMDAwMDAwWhcNMDQwODI3 MjM1OTU5WjCBkjELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2Fw ZTESMBAGA1UEBxMJQ2FwZSBUb3duMQ8wDQYDVQQKEwZUaGF3dGUxHTAbBgNV BAsTFENlcnRpZmljYXRlIFNlcnZpY2VzMSgwJgYDVQQDEx9QZXJzb25hbCBG cmVlbWFpbCBSU0EgMjAwMC44LjMwMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB iQKBgQDeMzKmY8cJJUU+0m54J2eBxdqIGYKXDuNEKYpjNSptcDz63K737nRv MLwzkH/5NHGgo22Y8cNPomXbDfpL8dbdYaX5hc1VmjUanZJ1qCeu2HL5ugL2 17CR3hzpq+AYA6h8Q0JQUYeDPPA5tJtUihOH/7ObnUlmAC0JieyUa+mhaQID AQABo04wTDApBgNVHREEIjAgpB4wHDEaMBgGA1UEAxMRUHJpdmF0ZUxhYmVs MS0yOTcwEgYDVR0TAQH/BAgwBgEB/wIBADALBgNVHQ8EBAMCAQYwDQYJKoZI hvcNAQEEBQADgYEAMbFLR135AXHl9VNsXXnWPZjAJhNigSKnEvgilegbSbcn ewQ5uvzm8iTrkfq97A0qOPdQVahs9w2tTBu8A/S166JHn2yiDFiNMUIJEWyw GmnRKxKyQF1q+XnQ6i4l3Yrk/NsNH50C81rbyjz2ROomaYd/SJ7OpZ/nhNjJ YmKtBcYxggJ2MIICcgIBATCBmjCBkjELMAkGA1UEBhMCWkExFTATBgNVBAgT DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMQ8wDQYDVQQKEwZU aGF3dGUxHTAbBgNVBAsTFENlcnRpZmljYXRlIFNlcnZpY2VzMSgwJgYDVQQD Ex9QZXJzb25hbCBGcmVlbWFpbCBSU0EgMjAwMC44LjMwAgMJoYQwCQYFKw4D AhoFAKCBsTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJ BTEPFw0wMzA4MDYxMjQyNTVaMCMGCSqGSIb3DQEJBDEWBBRzpeGWs9A5dsXs o0yJWonTue5xWDBSBgkqhkiG9w0BCQ8xRTBDMAoGCCqGSIb3DQMHMA4GCCqG SIb3DQMCAgIAgDANBggqhkiG9w0DAgIBQDAHBgUrDgMCBzANBggqhkiG9w0D AgIBKDANBgkqhkiG9w0BAQEFAASCAQBQPuzOte9gd9BXiI8gPdiDfywbWvfa NuhlbTESyB0yvFl0jq5/uZgTaTdtH48OfSOG2DymB6kbPanQEhaKgcYKrw/V xhsacZQ/LJxg4ANVz9+eJvKpiEmXvGcKVCS8NHx2Y76Im3Dz5VZ3wp+ZIEFf 3+j1A+nDr1sXE0n8uYHpZV/Lq2au3DmlIdajgbVfym7qe6DSCaeL9aSFH9a6 QOP188f47EUPaoa8e2LEn1cjrBxqSlt8KbSLqAntS9jbePkPb3takp16HlwG PJqIOa8Ysg/DSumUAEmIEAH+qjeEELnO8i785f5Or9Gs+3Gy5oYXkiXysGr5 5siBXhonYzU8AAAAAAAA --------------ms000008090800050008060007-- From pgsql-performance-owner@postgresql.org Wed Aug 6 09:52: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 6FBE5D1C4BF for ; Wed, 6 Aug 2003 12:51:59 +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 20284-09 for ; Wed, 6 Aug 2003 09:50:41 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 651C3D1C48E for ; Wed, 6 Aug 2003 09:51:47 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h76CqM0F019989 for ; Wed, 6 Aug 2003 18:22:22 +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 h76CqLip019976; Wed, 6 Aug 2003 18:22:22 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org, Yaroslav Mazurak Date: Wed, 06 Aug 2003 18:23:40 +0530 MIME-Version: 1.0 Subject: Re: PostgreSQL performance problem -> tuning Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F3147AC.10040.A3BF40@localhost> In-reply-to: <3F30F7CF.6090900@lviv.bank.gov.ua> References: <200308061030.36610.dev@archonet.com> 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: 200308/99 X-Sequence-Number: 2916 On 6 Aug 2003 at 15:42, Yaroslav Mazurak wrote: > >>sort_mem = 131072 > > This sort_mem value is *very* large - that's 131MB for *each sort* that gets > > done. I'd suggest trying something in the range 1,000-10,000. What's probably > > happening with the error above is that PG is allocating ridiculous amounts of > > memory, the machines going into swap and everything eventually grinds to a > > halt. > > What mean "each sort"? Each query with SORT clause or some internal > (invisible to user) sorts too (I can't imagine: indexed search or > whatever else)? > I'm reduced sort_mem to 16M. Good call. I would say start with 4M if you time to experiment. > >>enable_seqscan = false > > > Don't tinker with these in a live system, they're only really for > > testing/debugging. > > This is another strange behavior of PostgreSQL - he don't use some > created indexes (seq_scan only) after ANALYZE too. OK, I'm turned on > this option back. At times it thinks correct as well. An index scan might be costly. It does not hurt leaving this option on. If your performance improves by turning off this option, usually the problem is somewhere else.. > > >>effective_cache_size = 65536 > > > So you typically get about 256MB cache usage in top/free? > > No, top shows 12-20Mb. > I'm reduced effective_cache_size to 4K blocks (16M?). Are you on linux?( I lost OP). Don't trust top. Use free to find out how much true free memory you have.. Look at second line of free.. HTH Bye Shridhar -- millihelen, n.: The amount of beauty required to launch one ship. From pgsql-performance-owner@postgresql.org Wed Aug 6 09:55:03 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 02527D1C4C1 for ; Wed, 6 Aug 2003 12:54:59 +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 23684-03 for ; Wed, 6 Aug 2003 09:53:41 -0300 (ADT) Received: from neuromancer.ctlno.com (unknown [208.13.35.90]) by svr1.postgresql.org (Postfix) with ESMTP id 9F947D1C4BF for ; Wed, 6 Aug 2003 09:54:32 -0300 (ADT) Received: from tocr (ool-4352919e.dyn.optonline.net [67.82.145.158]) by neuromancer.ctlno.com (8.11.6/8.11.2) with ESMTP id h76D32R02231; Wed, 6 Aug 2003 08:03:02 -0500 Subject: Re: Some vacuum & tuning help From: "Matthew T. O'Connor" To: Tom Lane Cc: Bruce Momjian , shridhar_daithankar@persistent.co.in, Christopher Browne , pgsql-performance@postgresql.org In-Reply-To: <15808.1060145134@sss.pgh.pa.us> References: <200308051649.h75Gn1G25462@candle.pha.pa.us> <1060143711.17472.2.camel@zeutrh9> <15808.1060145134@sss.pgh.pa.us> Content-Type: text/plain Organization: Zeut Tech Message-Id: <1060174448.19347.0.camel@zeutrh9> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 (1.4.3-1) Date: 06 Aug 2003 08:54:09 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/100 X-Sequence-Number: 2917 On Wed, 2003-08-06 at 00:45, Tom Lane wrote: > For core code, the answer would be a big NYET. We do not do feature > additions in point releases, only bug fixes. While contrib code is more > under the author's control than the core committee's control, I'd still > say that you'd be making a big mistake to not follow that basic > guideline. People expect release x.y.z+1 to be the same as x.y.z except > for bug fixes. Introducing any new bugs into x.y.z+1 would cause a > large loss in your credibility. > > (speaking as one who's introduced new bugs into a point-release > recently, and is still embarrassed about it, even though the intent > was only to fix older bugs...) Right, OK, that is basically the answer I was expecting, but thought I would ask. Matthew From pgsql-general-owner@postgresql.org Wed Aug 6 12:20:01 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 9F30DD1C48E for ; Wed, 6 Aug 2003 13:50:25 +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 32159-08 for ; Wed, 6 Aug 2003 10:49:07 -0300 (ADT) Received: from smtp011.mail.yahoo.com (smtp011.mail.yahoo.com [216.136.173.31]) by svr1.postgresql.org (Postfix) with SMTP id 3865ED1C4C1 for ; Wed, 6 Aug 2003 10:50:14 -0300 (ADT) Received: from unknown (HELO notebook) (wgalafassijr@200.180.192.112 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 6 Aug 2003 13:50:17 -0000 Message-ID: <009d01c35c21$ba3a1270$70c0b4c8@notebook> From: "Wilson A. Galafassi Jr." To: Subject: Postgresql slow on XEON 2.4ghz/1gb ram Date: Wed, 6 Aug 2003 10:50:38 -0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_009A_01C35C08.92ACD580" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.6 tagged_above=0.0 required=5.0 tests=HTML_30_40 X-Spam-Level: X-Archive-Number: 200308/287 X-Sequence-Number: 46704 This is a multi-part message in MIME format. ------=_NextPart_000_009A_01C35C08.92ACD580 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello. I have this problem: i'm running the postgre 7.3 on a windows 2000 server w= ith P3 1GHZ DUAL/1gb ram with good performance. For best performance i hav= e change the server for a XEON 2.4/1gb ram and for my suprise the perform= ance decrease 80%. anybody have a similar experience? does exist any specia= l configuration to postgre running on a Xeon processor? Any have any idea t= o help-me? Excuse-me my bad english. Very Thanks Wilson icq 77032308 msn wgalafassijr@hotmail.com ------=_NextPart_000_009A_01C35C08.92ACD580 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello.
I have this problem: i'm running = ;the=20 postgre 7.3 on a windows 2000 server with  P3 1GHZ DUAL= /1gb=20 ram with good performance. For best performance i = have=20 change the server for a  XEON 2.4/1gb ram and for  my= =20 suprise the performance decrease 80%. anybody have a similar=20 experience? does exist any special configuration to postgre runni= ng on=20 a Xeon processor? Any have any idea to help-me? Excuse-me my bad=20 english.
Very Thanks
Wilson
icq 77032308
msn=20 wgalafassijr@hotmail.com
 
------=_NextPart_000_009A_01C35C08.92ACD580-- From pgsql-performance-owner@postgresql.org Wed Aug 6 12:39:16 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 AC57BD1C4C1 for ; Wed, 6 Aug 2003 15:38:40 +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 45755-04 for ; Wed, 6 Aug 2003 12:37:17 -0300 (ADT) Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by svr1.postgresql.org (Postfix) with ESMTP id 2024FD1C4BD for ; Wed, 6 Aug 2003 12:38:29 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-31.mail.demon.net with esmtp (Exim 3.35 #1) id 19kQMs-000PhY-0V; Wed, 06 Aug 2003 16:38:26 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 6C63317B1C; Wed, 6 Aug 2003 16:38:25 +0100 (BST) Received: from mainbox.archonet.com (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with SMTP id B259017B19; Wed, 6 Aug 2003 16:38:24 +0100 (BST) Received: from 192.168.1.32 (SquirrelMail authenticated user dev) by mainbox.archonet.com with HTTP; Wed, 6 Aug 2003 16:38:24 +0100 (BST) Message-ID: <49274.192.168.1.32.1060184304.squirrel@mainbox.archonet.com> In-Reply-To: <3F30F7CF.6090900@lviv.bank.gov.ua> References: <3F30AF9E.2080607@lviv.bank.gov.ua> <200308061030.36610.dev@archonet.com> <3F30F7CF.6090900@lviv.bank.gov.ua> Date: Wed, 6 Aug 2003 16:38:24 +0100 (BST) Subject: Re: PostgreSQL performance problem -> tuning From: "Richard Huxton" To: "Yaroslav Mazurak" Cc: pgsql-performance@postgresql.org User-Agent: SquirrelMail/1.4.0 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 X-Priority: 3 Importance: Normal X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/102 X-Sequence-Number: 2919 >> On Wednesday 06 August 2003 08:34, Yaroslav Mazurak wrote: > >> Version 7.3.4 is just out - probably worth upgrading as soon as it's >> convenient. > > Has version 7.3.4 significant performance upgrade relative to 7.3.2? > I've downloaded version 7.3.4, but not installed yet. No, but there are some bug fixes. >>>sort_mem = 131072 > >> This sort_mem value is *very* large - that's 131MB for *each sort* that > What mean "each sort"? Each query with SORT clause or some internal > (invisible to user) sorts too (I can't imagine: indexed search or > whatever else)? > I'm reduced sort_mem to 16M. It means each sort - if you look at your query plan and see three "sort" clauses that means that query might allocate 48MB to sorting. Now, that's good because sorting items on disk is much slower. It's bad because that's 48MB less for everything else that's happening. >>>fsync = false > >> I'd turn fsync back on - unless you don't mind losing your data after a >> crash. > > This is temporary performance solution - I want get SELECT query result > first, but current performance is too low. > >>>enable_seqscan = false > >> Don't tinker with these in a live system, they're only really for >> testing/debugging. > > This is another strange behavior of PostgreSQL - he don't use some > created indexes (seq_scan only) after ANALYZE too. OK, I'm turned on > this option back. Fair enough, we can work on those. With 7.3.x you can tell PG to examine some tables more thouroughly to get better plans. >>>effective_cache_size = 65536 > >> So you typically get about 256MB cache usage in top/free? > > No, top shows 12-20Mb. > I'm reduced effective_cache_size to 4K blocks (16M?). Cache size is in blocks of 8KB (usually) - it's a way of telling PG what the chances are of disk blocks being already cached by Linux. >>> SELECT statement is: >>> >>>SELECT showcalc('B00204', dd, r020, t071) AS s04 >>>FROM v_file02wide >>>WHERE a011 = 3 >>> AND inrepdate(data) >>> AND SUBSTR(ncks, 2, 2) IN ('NL', 'NM') >>> AND r030 = 980; > >> Hmm - mostly views and function calls, OK - I'll read on. > > My data are distributed accross multiple tables to integrity and avoid > redundancy. During SELECT query these data rejoined to be presented in > "human-readable" form. :) > "SUBSTR" returns about 25 records, I'm too lazy for write 25 numbers. > :) I'm also worried for errors. Sounds like good policy. > >>>(cost=174200202474.99..174200202474.99 rows=1 width=143) -> Hash Join > >> ^^^^^^^ >> This is a BIG cost estimate and you've got lots more like them. I'm >> guessing >> it's because of the sort_mem / enable_seqscan settings you have. The >> numbers >> don't make sense to me - it sounds like you've pushed the cost estimator >> into >> a very strange corner. > > I think that cost estimator "pushed into very strange corner" by himself. > >>> Function showcalc definition is: > >>>CREATE OR REPLACE FUNCTION showcalc(VARCHAR(10), VARCHAR(2), VARCHAR(4), >>>NUMERIC(16)) RETURNS NUMERIC(16) >>>LANGUAGE SQL AS ' >>>-- Parameters: code, dd, r020, t071 >>> SELECT COALESCE( >>> (SELECT sc.koef * $4 >>> FROM showing AS s NATURAL JOIN showcomp AS sc >>> WHERE s.kod LIKE $1 >>> AND NOT SUBSTR(acc_mask, 1, 1) LIKE ''['' >>> AND SUBSTR(acc_mask, 1, 4) LIKE $3 >>> AND SUBSTR(acc_mask, 5, 1) LIKE SUBSTR($2, 1, 1)), > >> Obviously, you could use = for these 3 rather than LIKE ^^^ >> Same below too. > >>> (SELECT SUM(sc.koef * COALESCE(showcalc(SUBSTR(acc_mask, 2, >>>LENGTH(acc_mask) - 2), $2, $3, $4), 0)) >>> FROM showing AS s NATURAL JOIN showcomp AS sc >>> WHERE s.kod LIKE $1 >>> AND SUBSTR(acc_mask, 1, 1) LIKE ''[''), >>> 0) AS showing; >>>'; > > OK, all unnecessary "LIKEs" replaced by "=", JOIN removed too: > CREATE OR REPLACE FUNCTION showcalc(VARCHAR(10), VARCHAR(2), VARCHAR(4), > NUMERIC(16)) RETURNS NUMERIC(16) > LANGUAGE SQL AS ' > -- Parameters: code, dd, r020, t071 > SELECT COALESCE( > (SELECT sc.koef * $4 > FROM showing AS s, showcomp AS sc > WHERE sc.kod = s.kod > AND s.kod LIKE $1 > AND NOT SUBSTR(acc_mask, 1, 1) = ''['' > AND SUBSTR(acc_mask, 1, 4) = $3 > AND SUBSTR(acc_mask, 5, 1) = SUBSTR($2, 1, 1)), > (SELECT SUM(sc.koef * COALESCE(showcalc(SUBSTR(acc_mask, 2, > LENGTH(acc_mask) - 2), $2, $3, $4), 0)) > FROM showing AS s, showcomp AS sc > WHERE sc.kod = s.kod > AND s.kod = $1 > AND SUBSTR(acc_mask, 1, 1) = ''[''), > 0) AS showing; > '; > >>> View v_file02wide is: > >>>CREATE VIEW v_file02wide AS >>>SELECT id_a011 AS a011, data, obl.ko, obl.nazva AS oblast, b030, >>>banx.box AS ncks, banx.nazva AS bank, >>> epr.dd, r020, r030, a3, r030.nazva AS valuta, k041, >>> -- Sum equivalent in national currency >>> t071 * get_kurs(id_r030, data) AS t070, >>> t071 >>>FROM v_file02 AS vf02 >>> JOIN kod_obl AS obl USING(id_obl) >>> JOIN (dov_bank NATURAL JOIN dov_tvbv) AS banx >>> ON banx.id_v = vf02.id_v >>> AND data BETWEEN COALESCE(banx.dataa, data) >>> AND COALESCE(banx.datab, data) >>> JOIN ek_pok_r AS epr USING(id_dd) >>> JOIN kl_r020 USING(id_r020) >>> JOIN kl_r030 AS r030 USING(id_r030) >>> JOIN kl_k041 USING(id_k041); > >> You might want to rewrite the view so it doesn't use explicit JOIN >> statements, >> i.e FROM a,b WHERE a.id=b.ref rather than FROM a JOIN b ON id=ref >> At the moment, this will force PG into making the joins in the order you >> write >> them (I think this is changed in v7.4) > > I think this is a important remark. Can "JOIN" significantly reduce > performance of SELECT statement relative to ", WHERE"? > OK, I'm changed VIEW to this text: It can sometimes. What it means is that PG will follow whatever order you write the joins in. If you know joining a to b to c is the best order, that can be a good thing. Unfortunately, it means the planner can't make a better guess based on its statistics. > CREATE VIEW v_file02 AS > SELECT filenum, data, id_a011, id_v, id_obl, id_dd, id_r020, id_r030, > id_k041, t071 > FROM filexxr, file02 > WHERE file02.id_r = filexxr.id_r; > > CREATE VIEW v_file02wide AS > SELECT id_a011 AS a011, data, obl.ko, obl.nazva AS oblast, b030, > banx.box AS ncks, banx.nazva AS bank, > epr.dd, r020, vf02.id_r030 AS r030, a3, kl_r030.nazva AS valuta, k041, > -- Sum equivalent in national currency > t071 * get_kurs(vf02.id_r030, data) AS t070, t071 > FROM v_file02 AS vf02, kod_obl AS obl, v_banx AS banx, > ek_pok_r AS epr, kl_r020, kl_r030, kl_k041 > WHERE obl.id_obl = vf02.id_obl > AND banx.id_v = vf02.id_v > AND data BETWEEN COALESCE(banx.dataa, data) > AND COALESCE(banx.datab, data) > AND epr.id_dd = vf02.id_dd > AND kl_r020.id_r020 = vf02.id_r020 > AND kl_r030.id_r030 = vf02.id_r030 > AND kl_k041.id_k041 = vf02.id_k041; > > Now (with configuration and view definition changed) "SELECT COUNT(*) > FROM v_file02wide;" executes about 6 minutes and 45 seconds instead of > 30 seconds (previous). OK - don't worry if it looks like we're going backwards, we should be able to get everything running nicely soon. > Another annoying "feature" is impossibility writing "SELECT * FROM..." > - duplicate column names error. In NATURAL JOIN joined columns hiding > automatically. :-| > >>> Function inrepdate is: > >>>CREATE OR REPLACE FUNCTION inrepdate(DATE) RETURNS BOOL >>>LANGUAGE SQL AS ' >>> -- Returns true if given date is in repdate >>> SELECT (SELECT COUNT(*) FROM repdate >>> WHERE $1 BETWEEN COALESCE(data1, CURRENT_DATE) >>> AND COALESCE(data2, CURRENT_DATE)) >>> >>> > 0; > >> You can probably replace this with: >> SELECT true FROM repdate WHERE $1 ... >> You'll need to look at where it's used though. > > Hmm... table repdate contain date intervals. For example: > data1 data2 > 2003-01-01 2003-01-10 > 2003-05-07 2003-05-24 > ... > I need single value (true or false) about given date as parameter - > report includes given date or not. COUNT used as aggregate function for > this. Can you write this function more simpler? > BTW, I prefer SQL language if possible, then PL/pgSQL. This may be > mistake? No - not really. You can do things in plpgsql that you can't in sql, but I use both depending on the situation. >>> Table has indexes almost for all selected fields. > >> That's not going to help you for the SUBSTR(...) stuff, although you >> could use >> functional indexes (see manuals/list archives for details). > > Yes, I'm using functional indexes, but not in this case... now in this > case too! :) > >> First thing is to get those two configuration settings somewhere sane, >> then we >> can tune properly. You might like the document at: > >> http://www.varlena.com/varlena/GeneralBits/Tidbits/perf.html > > Thanks, it's interesting. > > Current query plan: > > > QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ > Aggregate (cost=188411.98..188411.98 rows=1 width=151) > -> Hash Join (cost=186572.19..188398.39 rows=5437 width=151) > Hash Cond: ("outer".id_obl = "inner".id_obl) > -> Hash Join (cost=186570.65..188301.70 rows=5437 width=147) [snip] Well the cost estimates look much more plausible. You couldn't post EXPLAIN ANALYSE could you? That actually runs the query. > Now (2K shared_buffers blocks, 16K effective_cache_size blocks, 16Mb > sort_mem) PostgreSQL uses much less memory, about 64M... it's not good, > I want using all available RAM if possible - PostgreSQL is the main task > on this PC. Don't forget that any memory PG is using the operating-system can't. The OS will cache frequently accessed disk blocks for you, so it's a question of finding the right balance. > May set effective_cache_size to 192M (48K blocks) be better? I don't > understand exactly: effective_cache_size tells PostgreSQL about OS cache > size or about available free RAM? It needs to reflect how much cache the system is using - try the "free" command to see figures. If you could post the output of EXPLAIN ANALYSE rather than EXPLAIN, I'll take a look at it this evening (London time). There's also plenty of other people on this list who can help too. HTH - Richard Huxton From pgsql-admin-owner@postgresql.org Wed Aug 6 15:14:22 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 98BD6D1C9E0 for ; Wed, 6 Aug 2003 18:03:32 +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 60788-05 for ; Wed, 6 Aug 2003 15:02:10 -0300 (ADT) Received: from smtp013.mail.yahoo.com (smtp013.mail.yahoo.com [216.136.173.57]) by svr1.postgresql.org (Postfix) with SMTP id DE72CD1C4C1 for ; Wed, 6 Aug 2003 15:03:20 -0300 (ADT) Received: from unknown (HELO notebook) (juniorlist@200.180.192.112 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 6 Aug 2003 18:03:20 -0000 Message-ID: <01dd01c35c45$141a42b0$70c0b4c8@notebook> From: "Wilson A. Galafassi Jr." To: <"Undisclosed-Recipient:;"@svr1.postgresql.org> Subject: PostgreSql under Linux Date: Wed, 6 Aug 2003 15:03:41 -0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01DA_01C35C2B.EC176090" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.7 tagged_above=0.0 required=5.0 tests=HTML_40_50 X-Spam-Level: X-Archive-Number: 200308/83 X-Sequence-Number: 9806 This is a multi-part message in MIME format. ------=_NextPart_000_01DA_01C35C2B.EC176090 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello people. I'm installing Postgresql under linux for better performance and i want to = know how is the best configuration. My server is a dual pentium3 1ghz/1gb ram/36gb scsi. running only postgresq= l. My question is: 1. What is the best linux distribuition for better performance? 2. Does exists any compilation options to better performance on this machin= e? Thanks Wilson Galafassi ------=_NextPart_000_01DA_01C35C2B.EC176090 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello people.
 
I'm installing Postgresql under linux for = better=20 performance and i want to know how is the best configuration.
 
My server is a dual pentium3 1ghz/1gb ram/= 36gb=20 scsi. running only postgresql. My question is:
1. What is the best linux distribuition fo= r better=20 performance?
2. Does exists any compilation options to = better=20 performance on this machine?
 
Thanks
 
Wilson Galafassi
------=_NextPart_000_01DA_01C35C2B.EC176090-- From pgsql-performance-owner@postgresql.org Wed Aug 6 15:33:25 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 81FDBD1C9EE for ; Wed, 6 Aug 2003 18:13:37 +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 64849-01 for ; Wed, 6 Aug 2003 15:12:15 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 9BB64D1CA00 for ; Wed, 6 Aug 2003 15:13:26 -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 h76IDJSa001567; Wed, 6 Aug 2003 14:13:20 -0400 (EDT) To: Yaroslav Mazurak Cc: pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning In-reply-to: <3F30AF9E.2080607@lviv.bank.gov.ua> References: <3F30AF9E.2080607@lviv.bank.gov.ua> Comments: In-reply-to Yaroslav Mazurak message dated "Wed, 06 Aug 2003 10:34:54 +0300" Date: Wed, 06 Aug 2003 14:13:19 -0400 Message-ID: <1566.1060193599@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/105 X-Sequence-Number: 2922 Yaroslav Mazurak writes: > Current postgresql.conf settings (some) are: > max_locks_per_transaction = 16 This strikes me as a really bad idea --- you save little space by reducing it from the default, and open yourself up to unexpected failures. > wal_buffers = 256 That is almost certainly way more than you need. > sort_mem = 131072 People have already told you that one's a bad idea. > commit_delay = 32000 I'm unconvinced that setting this nonzero is a good idea. Have you done experiments to prove that you get a benefit? > enable_seqscan = false This is the cause of the bizarre-looking cost estimates. I don't recommend setting it false as a system-wide setting. If you want to nudge the planner towards indexscans, reducing random_page_cost a little is probably a better way. regards, tom lane From pgsql-performance-owner@postgresql.org Wed Aug 6 15:17: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 6FB3CD1C4BD for ; Wed, 6 Aug 2003 18:17:03 +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 63735-06 for ; Wed, 6 Aug 2003 15:15:41 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 2BAABD1C980 for ; Wed, 6 Aug 2003 15:16:52 -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 h76IGlSa001625; Wed, 6 Aug 2003 14:16:47 -0400 (EDT) To: Yaroslav Mazurak Cc: pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning In-reply-to: <3F30F7CF.6090900@lviv.bank.gov.ua> References: <3F30AF9E.2080607@lviv.bank.gov.ua> <200308061030.36610.dev@archonet.com> <3F30F7CF.6090900@lviv.bank.gov.ua> Comments: In-reply-to Yaroslav Mazurak message dated "Wed, 06 Aug 2003 15:42:55 +0300" Date: Wed, 06 Aug 2003 14:16:47 -0400 Message-ID: <1624.1060193807@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/104 X-Sequence-Number: 2921 Yaroslav Mazurak writes: >>> fsync = false >> I'd turn fsync back on - unless you don't mind losing your data after a crash. > This is temporary performance solution - I want get SELECT query result > first, but current performance is too low. Disabling fsync will not help SELECT performance one bit. It would only affect transactions that modify the database. regards, tom lane From pgsql-performance-owner@postgresql.org Wed Aug 6 15:56: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 505AED1C513 for ; Wed, 6 Aug 2003 18:56:26 +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 66314-03 for ; Wed, 6 Aug 2003 15:55:04 -0300 (ADT) Received: from mercury.elitra.com (unknown [12.35.196.84]) by svr1.postgresql.org (Postfix) with ESMTP id 34FC9D1C92B for ; Wed, 6 Aug 2003 15:56:15 -0300 (ADT) Received: from moebius.elitra.com ([192.168.201.111]) by mercury.elitra.com with Microsoft SMTPSVC(5.5.1877.197.19); Wed, 6 Aug 2003 12:02:25 -0700 Date: Wed, 6 Aug 2003 14:56:14 -0400 (EDT) From: Sebastien Lemieux To: Postgresql-performance Subject: How to efficiently duplicate a whole schema? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/106 X-Sequence-Number: 2923 Hi, I'm running on Redhat 7.2 with postgresql 7.3.2 and I have two schema in the same database 'db' and 'db_dev'. Both contain a set of >20 tables for a total of less than 50 Mb of data each (on the order of 50k rows in total). Once in a while (often these days!), I need to synchronize the dev version from the production 'db'. Currently, I do this by setting constraints to deferred, deleting everything in db_dev, then issue a serie of insert ... select ... to copy data from each table in db to the equivalent table in db_dev. This approach used to run in less than 30 seconds in MySQL, but in PostgreSQL it currently takes around 30 minutes. The postmaster process is running at 100% cpu all the time. I enclosed all the delete statement in one transaction and all the insert statements in a second transaction. All the time is taken at the commit of both transaction. Is there a more straightforward way to synchronize a development database to a production one? Is there anyway to increase the performance of this delete/insert combination? I've got indexes and constraints on most tables, could that be the problem? At some point in the future, I will also need to make a copy of a whole schema ('db' into 'db_backup'), what would be an efficient way to do that? These are the parameters I've adjusted in the postgresql.conf: max_connections = 16 shared_buffers = 3000 max_fsm_relations = 2000 max_fsm_pages = 20000 sort_mem = 20000 vacuum_mem = 20000 effective_cache_size = 15000 And this is the memory state of the machine: slemieux@neptune> free total used free shared buffers cached Mem: 2059472 2042224 17248 24768 115712 1286572 -/+ buffers/cache: 639940 1419532 Swap: 2096440 490968 1605472 thanks, -- Sebastien Lemieux Bioinformatics, post-doc Elitra-canada From pgsql-performance-owner@postgresql.org Wed Aug 6 16:29: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 258D1D1C513 for ; Wed, 6 Aug 2003 19:24:33 +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 65050-08 for ; Wed, 6 Aug 2003 16:23:11 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 1E0E5D1C975 for ; Wed, 6 Aug 2003 16:24:22 -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 h76JNLMY024290; Wed, 6 Aug 2003 13:23:21 -0600 (MDT) Date: Wed, 6 Aug 2003 13:09:47 -0600 (MDT) From: "scott.marlowe" To: Tom Lane Cc: Sebastien Lemieux , Postgresql-performance Subject: Re: How to efficiently duplicate a whole schema? In-Reply-To: <7235.1060197229@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/109 X-Sequence-Number: 2926 On Wed, 6 Aug 2003, Tom Lane wrote: > Sebastien Lemieux writes: > > All the time is taken at the commit of both transaction. > > Sounds like the culprit is foreign-key checks. > > One obvious question is whether you have your foreign keys set up > efficiently in the first place. As a rule, the referenced and > referencing columns should have identical datatypes and both should > be indexed. (PG will often let you create foreign key constraints > that don't meet these rules ... but performance will suffer.) Is this one of those things that should spit out a NOTICE when it happens? I.e. when a table is created with a references and uses a different type than the parent, would it be a good idea to issue a "NOTICE: parent and child fields are not of the same type" From pgsql-performance-owner@postgresql.org Wed Aug 6 16:11:20 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 AC204D1C513 for ; Wed, 6 Aug 2003 19:11:16 +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 64986-06 for ; Wed, 6 Aug 2003 16:09:55 -0300 (ADT) Received: from shire.ontko.com (shire.ontko.com [199.164.165.1]) by svr1.postgresql.org (Postfix) with ESMTP id 94188D1C7F5 for ; Wed, 6 Aug 2003 16:11:05 -0300 (ADT) Received: from nick (bilbo.ontko.com [199.164.165.101]) by shire.ontko.com (8.12.3/8.12.3/Debian-6.4) with SMTP id h76JB40P014975; Wed, 6 Aug 2003 14:11:05 -0500 Reply-To: From: "Nick Fankhauser" To: "Sebastien Lemieux" , "Postgresql-performance" Subject: Re: How to efficiently duplicate a whole schema? Date: Wed, 6 Aug 2003 14:09:48 -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: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/107 X-Sequence-Number: 2924 Sebastien- I have a similar nightly process to keep our development system synched with production. I just do a complete pg_dump of production, do a dropdb & createdb to empty the database for development, and then restore the whole db from the pg_dump file. Our database is about 12 GB currently, and it takes less than one hour to dump & restore back into dev if I go through a file. I can go even faster by piping the data to eliminate one set of reads & writes to the disk: dropdb dev createdb dev pg_dump prod | psql dev This of course only works if you haven't changed your data structure in the development area, but it is very simple and reasonably quick. in situations where the data structure has changed, I run a more complex system that deletes data rather than drop the whole db, but I always drop the indexes in development before restoring data and recreate them afterwards. -Nick > -----Original Message----- > From: pgsql-performance-owner@postgresql.org > [mailto:pgsql-performance-owner@postgresql.org]On Behalf Of Sebastien > Lemieux > Sent: Wednesday, August 06, 2003 1:56 PM > To: Postgresql-performance > Subject: [PERFORM] How to efficiently duplicate a whole schema? > > > Hi, > > I'm running on Redhat 7.2 with postgresql 7.3.2 and I have two schema in > the same database 'db' and 'db_dev'. Both contain a set of >20 tables for > a total of less than 50 Mb of data each (on the order of 50k rows in > total). Once in a while (often these days!), I need to synchronize the > dev version from the production 'db'. Currently, I do this by setting > constraints to deferred, deleting everything in db_dev, then issue a serie > of insert ... select ... to copy data from each table in db to the > equivalent table in db_dev. > > This approach used to run in less than 30 seconds in MySQL, but in > PostgreSQL it currently takes around 30 minutes. The postmaster process > is running at 100% cpu all the time. I enclosed all the delete statement > in one transaction and all the insert statements in a second > transaction. > All the time is taken at the commit of both transaction. > > Is there a more straightforward way to synchronize a development > database to a production one? Is there anyway to increase the > performance > of this delete/insert combination? I've got indexes and constraints on > most tables, could that be the problem? At some point in the future, I > will also need to make a copy of a whole schema ('db' into 'db_backup'), > what would be an efficient way to do that? > > These are the parameters I've adjusted in the postgresql.conf: > > max_connections = 16 > shared_buffers = 3000 > max_fsm_relations = 2000 > max_fsm_pages = 20000 > sort_mem = 20000 > vacuum_mem = 20000 > effective_cache_size = 15000 > > And this is the memory state of the machine: > > slemieux@neptune> free > total used free shared buffers cached > Mem: 2059472 2042224 17248 24768 115712 1286572 > -/+ buffers/cache: 639940 1419532 > Swap: 2096440 490968 1605472 > > thanks, > > -- > Sebastien Lemieux > Bioinformatics, post-doc > Elitra-canada > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > From pgsql-performance-owner@postgresql.org Wed Aug 6 16:14: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 4A3BFD1C50B for ; Wed, 6 Aug 2003 19:14: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 65925-06 for ; Wed, 6 Aug 2003 16:12:43 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 21641D1C92B for ; Wed, 6 Aug 2003 16:13:54 -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 h76JDnSa007236; Wed, 6 Aug 2003 15:13:49 -0400 (EDT) To: Sebastien Lemieux Cc: Postgresql-performance Subject: Re: How to efficiently duplicate a whole schema? In-reply-to: References: Comments: In-reply-to Sebastien Lemieux message dated "Wed, 06 Aug 2003 14:56:14 -0400" Date: Wed, 06 Aug 2003 15:13:49 -0400 Message-ID: <7235.1060197229@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/108 X-Sequence-Number: 2925 Sebastien Lemieux writes: > All the time is taken at the commit of both transaction. Sounds like the culprit is foreign-key checks. One obvious question is whether you have your foreign keys set up efficiently in the first place. As a rule, the referenced and referencing columns should have identical datatypes and both should be indexed. (PG will often let you create foreign key constraints that don't meet these rules ... but performance will suffer.) Also, what procedure are you using to delete all the old data? What I'd recommend is ANALYZE table; TRUNCATE table; INSERT new data; The idea here is to make sure that the planner's statistics reflect the "full" state of the table, not the "empty" state. Otherwise it may pick plans for the foreign key checks that are optimized for small tables. regards, tom lane From pgsql-performance-owner@postgresql.org Wed Aug 6 16:29: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 0327BD1C975 for ; Wed, 6 Aug 2003 19:29:46 +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 68346-04 for ; Wed, 6 Aug 2003 16:28:24 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 0DCE9D1C92F for ; Wed, 6 Aug 2003 16:29: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 h76JTOSa007407; Wed, 6 Aug 2003 15:29:24 -0400 (EDT) To: "scott.marlowe" Cc: Sebastien Lemieux , Postgresql-performance Subject: Re: How to efficiently duplicate a whole schema? In-reply-to: References: Comments: In-reply-to "scott.marlowe" message dated "Wed, 06 Aug 2003 13:09:47 -0600" Date: Wed, 06 Aug 2003 15:29:23 -0400 Message-ID: <7406.1060198163@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/110 X-Sequence-Number: 2927 "scott.marlowe" writes: > On Wed, 6 Aug 2003, Tom Lane wrote: >> One obvious question is whether you have your foreign keys set up >> efficiently in the first place. As a rule, the referenced and >> referencing columns should have identical datatypes and both should >> be indexed. (PG will often let you create foreign key constraints >> that don't meet these rules ... but performance will suffer.) > Is this one of those things that should spit out a NOTICE when it happens? > I.e. when a table is created with a references and uses a different type > than the parent, would it be a good idea to issue a "NOTICE: parent and > child fields are not of the same type" I could see doing that for unequal data types, but I'm not sure if it's reasonable to do it for lack of index. Usually you won't have created the referencing column's index yet when you create the FK constraint, so any warning would just be noise. (The referenced column's index *is* checked for, since we require it to be unique.) regards, tom lane From pgsql-performance-owner@postgresql.org Wed Aug 6 17:15: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 49556D1C7F5 for ; Wed, 6 Aug 2003 20:15: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 71654-05 for ; Wed, 6 Aug 2003 17:13:40 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 49B4AD1C4EC for ; Wed, 6 Aug 2003 17:14:50 -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 h76KEXbS028736; Wed, 6 Aug 2003 14:14:33 -0600 (MDT) Date: Wed, 6 Aug 2003 14:00:59 -0600 (MDT) From: "scott.marlowe" To: Tom Lane Cc: Sebastien Lemieux , Postgresql-performance Subject: Re: How to efficiently duplicate a whole schema? In-Reply-To: <7406.1060198163@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/112 X-Sequence-Number: 2929 On Wed, 6 Aug 2003, Tom Lane wrote: > "scott.marlowe" writes: > > On Wed, 6 Aug 2003, Tom Lane wrote: > >> One obvious question is whether you have your foreign keys set up > >> efficiently in the first place. As a rule, the referenced and > >> referencing columns should have identical datatypes and both should > >> be indexed. (PG will often let you create foreign key constraints > >> that don't meet these rules ... but performance will suffer.) > > > Is this one of those things that should spit out a NOTICE when it happens? > > I.e. when a table is created with a references and uses a different type > > than the parent, would it be a good idea to issue a "NOTICE: parent and > > child fields are not of the same type" > > I could see doing that for unequal data types, but I'm not sure if it's > reasonable to do it for lack of index. Usually you won't have created > the referencing column's index yet when you create the FK constraint, > so any warning would just be noise. (The referenced column's index *is* > checked for, since we require it to be unique.) Sure. I wasn't thinking of the index issue anyway, just the type mismatch. From pgsql-performance-owner@postgresql.org Wed Aug 6 17:24: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 9F009D1C4EC for ; Wed, 6 Aug 2003 20:23:59 +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 69550-07 for ; Wed, 6 Aug 2003 17:22:38 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 6EC9FD1C4BF for ; Wed, 6 Aug 2003 17:23:48 -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 h76KMmbS029457; Wed, 6 Aug 2003 14:22:48 -0600 (MDT) Date: Wed, 6 Aug 2003 14:09:14 -0600 (MDT) From: "scott.marlowe" To: "Wilson A. Galafassi Jr." Cc: Subject: Re: partitioning for postgresql In-Reply-To: <02da01c35c56$b9235830$70c0b4c8@notebook> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/113 X-Sequence-Number: 2930 On Wed, 6 Aug 2003, Wilson A. Galafassi Jr. wrote: > hello!!! > what is suggested partitioning schema for postgresql?? > the size of my db is 5BG and i have 36GB scsi disk! The first recommendation is to run Postgresql on a RAID set for reliability. I'm assuming you're building a machine and need to put both the OS and Postgresql database on that one disk. If that's the case, just put the OS on however you like (lotsa different ways to partition for the OS) and leave about 30 gig for Postgresql to run in, then just put the whole database $PGDATA directory on that partition. I'd recommend running ext3 with meta data journaling only for speed, security, and ease of setup and use. XFS is the next choice, which is a little harder to setup, as it's not included in most distros, but is definitely faster than ext3 at most stuff. From pgsql-performance-owner@postgresql.org Wed Aug 6 17:09:51 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 18084D1C96F for ; Wed, 6 Aug 2003 20:09:49 +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 70624-07 for ; Wed, 6 Aug 2003 17:08:28 -0300 (ADT) Received: from smtp013.mail.yahoo.com (smtp013.mail.yahoo.com [216.136.173.57]) by svr1.postgresql.org (Postfix) with SMTP id B96B8D1C92F for ; Wed, 6 Aug 2003 17:09:37 -0300 (ADT) Received: from unknown (HELO notebook) (juniorlist@200.180.192.112 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 6 Aug 2003 20:09:38 -0000 Message-ID: <02da01c35c56$b9235830$70c0b4c8@notebook> From: "Wilson A. Galafassi Jr." To: Subject: partitioning for postgresql Date: Wed, 6 Aug 2003 17:09:59 -0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_02D7_01C35C3D.917A7CF0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=HTML_50_60 X-Spam-Level: X-Archive-Number: 200308/111 X-Sequence-Number: 2928 This is a multi-part message in MIME format. ------=_NextPart_000_02D7_01C35C3D.917A7CF0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable hello!!! what is suggested partitioning schema for postgresql?? the size of my db is 5BG and i have 36GB scsi disk! thanks wilson ------=_NextPart_000_02D7_01C35C3D.917A7CF0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
hello!!!
what is suggested partitioning schema for= =20 postgresql??
the size of my db is 5BG and i have 36GB s= csi=20 disk!
thanks
wilson
------=_NextPart_000_02D7_01C35C3D.917A7CF0-- From pgsql-performance-owner@postgresql.org Wed Aug 6 17:39: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 1A280D1C91A for ; Wed, 6 Aug 2003 20:39:16 +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 68575-09 for ; Wed, 6 Aug 2003 17:37:55 -0300 (ADT) Received: from smtp017.mail.yahoo.com (smtp017.mail.yahoo.com [216.136.174.114]) by svr1.postgresql.org (Postfix) with SMTP id AA14DD1C4BF for ; Wed, 6 Aug 2003 17:39:04 -0300 (ADT) Received: from unknown (HELO notebook) (juniorlist@200.180.192.112 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 6 Aug 2003 20:39:05 -0000 Message-ID: <034201c35c5a$d5f3c2c0$70c0b4c8@notebook> From: "Wilson A. Galafassi Jr." To: Subject: ext3 block size Date: Wed, 6 Aug 2003 17:34:39 -0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0337_01C35C41.037A1D30" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=HTML_60_70 X-Spam-Level: X-Archive-Number: 200308/115 X-Sequence-Number: 2932 This is a multi-part message in MIME format. ------=_NextPart_000_0337_01C35C41.037A1D30 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable hello. my database size is 5GB. what is the block size recommend? thanks wilson ------=_NextPart_000_0337_01C35C41.037A1D30 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
hello.
my database size is 5GB. what is the block= size=20 recommend?
thanks
wilson
 
------=_NextPart_000_0337_01C35C41.037A1D30-- From pgsql-performance-owner@postgresql.org Wed Aug 6 17:36: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 35AB9D1C92F for ; Wed, 6 Aug 2003 20:36:45 +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 69550-09 for ; Wed, 6 Aug 2003 17:35:24 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id A10EDD1C4E3 for ; Wed, 6 Aug 2003 17:36:33 -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 h76KaVSa007897; Wed, 6 Aug 2003 16:36:32 -0400 (EDT) To: Scott Cain Cc: pgsql-performance@postgresql.org Subject: Re: EXTERNAL storage and substring on long strings In-reply-to: <1059679600.1429.41.camel@localhost.localdomain> References: <1059679600.1429.41.camel@localhost.localdomain> Comments: In-reply-to Scott Cain message dated "31 Jul 2003 15:26:40 -0400" Date: Wed, 06 Aug 2003 16:36:31 -0400 Message-ID: <7896.1060202191@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/114 X-Sequence-Number: 2931 Scott Cain writes: > A few days ago, I asked for advice on speeding up substring queries on > the GENERAL mailing list. Joe Conway helpfully pointed out the ALTER > TABLE STORAGE EXTERNAL documentation. After doing the alter, > the queries got slower! Here is the background: Ah-hah, I've sussed it ... you didn't actually change the storage representation. You wrote: > Now, I'll change the storage: > alter table feature alter column residues set storage external; > To make sure that really happens, I run an update on feature: > update feature set residues = residues where feature_id<8; > and then VACUUM ANALYZE again. This sounds good --- in fact, I think we all just accepted it when we read it --- but in fact *that update didn't decompress the toasted data*. The tuple toaster sees that the same toasted value is being stored back into the row, and so it just re-uses the existing toasted data; it does not stop to notice that the column storage preference has changed. To actually get the storage to change, you need to feed the value through some function or operator that will decompress it. Then it won't get recompressed when it's stored. One easy way (since this is a text column) is update feature set residues = residues || '' where feature_id<8; To verify that something really happened, try doing VACUUM VERBOSE on the table before and after. The quoted number of tuples in the toast table should rise substantially. I did the following comparisons on the test data you made available, using two tables in which one has default storage and one has "external" (not compressed) storage: scott=# \timing Timing is on. scott=# select length (dna) from edna; length ----------- 245203899 (1 row) Time: 1.05 ms scott=# select length (dna) from ddna; length ----------- 245203899 (1 row) Time: 1.11 ms scott=# select length(substring(dna from 1000000 for 20000)) from edna; length -------- 20000 (1 row) Time: 30.43 ms scott=# select length(substring(dna from 1000000 for 20000)) from ddna; length -------- 20000 (1 row) Time: 37383.02 ms scott=# So it looks like the external-storage optimization for substring() does work as expected, once you get the data into the right format ... regards, tom lane From pgsql-performance-owner@postgresql.org Wed Aug 6 17:52:03 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 2582CD1C96A for ; Wed, 6 Aug 2003 20:51:59 +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 76414-02 for ; Wed, 6 Aug 2003 17:50:38 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id DA02DD1C7F5 for ; Wed, 6 Aug 2003 17:51:47 -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 h76Kp9bS002033; Wed, 6 Aug 2003 14:51:09 -0600 (MDT) Date: Wed, 6 Aug 2003 14:37:34 -0600 (MDT) From: "scott.marlowe" To: "Wilson A. Galafassi Jr." Cc: Subject: Re: ext3 block size In-Reply-To: <034201c35c5a$d5f3c2c0$70c0b4c8@notebook> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/117 X-Sequence-Number: 2934 On Wed, 6 Aug 2003, Wilson A. Galafassi Jr. wrote: > hello. > my database size is 5GB. what is the block size recommend? Well, the biggest block size currently supported by stock linux distros is 4k, so I'd go with that. Postgresql's default block size of 8k is fine also. Note that linux page/system/file block sizes are NOT related to Postgresql block sizes. From pgsql-performance-owner@postgresql.org Wed Aug 6 17:51:19 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 75E64D1C96A for ; Wed, 6 Aug 2003 20:51: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 71474-07 for ; Wed, 6 Aug 2003 17:49:56 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 66B16D1C4BF for ; Wed, 6 Aug 2003 17:51:06 -0300 (ADT) Received: from dev6.int.libertyrms.com ([10.1.2.212] helo=libertyrms.info) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19kVFT-0000lq-00; Wed, 06 Aug 2003 16:51:07 -0400 Received: by libertyrms.info (Postfix, from userid 1079) id A9BB5BBADC; Wed, 6 Aug 2003 16:51:07 -0400 (EDT) To: "Wilson A. Galafassi Jr." Cc: pgsql-performance@postgresql.org Subject: Re: partitioning for postgresql From: Christopher Browne Date: Wed, 06 Aug 2003 16:51:07 -0400 Message-ID: <60n0em8q84.fsf@dev6.int.libertyrms.info> User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/116 X-Sequence-Number: 2933 > what is suggested partitioning schema for postgresql?? > the size of my db is 5BG and i have 36GB scsi disk! The interesting forms of partitioning kind of assume that you have multiple disk drives. If you only have one drive, then there is not terribly much reason to prefer anything much over simply having one big partition, and letting the data fall where it will. If you had two drives, then it would make sense to have data on one drive and WAL on the other. With three drives, having other I/O (such as database logging) on a third drive would have merit. But none of those approaches are useful if you only have one disk drive. -- "cbbrowne","@","libertyrms.info" Christopher Browne (416) 646 3304 x124 (land) From pgsql-performance-owner@postgresql.org Wed Aug 6 17:56:36 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 7E3CCD1C97F for ; Wed, 6 Aug 2003 20:55: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 71654-09 for ; Wed, 6 Aug 2003 17:53:50 -0300 (ADT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id C23DDD1C96F for ; Wed, 6 Aug 2003 17:54:59 -0300 (ADT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.0.6) with ESMTP-TLS id 24927; Wed, 06 Aug 2003 13:15:56 -0700 Message-ID: <3F316A41.6020403@joeconway.com> Date: Wed, 06 Aug 2003 13:51:13 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Scott Cain , pgsql-performance@postgresql.org Subject: Re: EXTERNAL storage and substring on long strings References: <1059679600.1429.41.camel@localhost.localdomain> <7896.1060202191@sss.pgh.pa.us> In-Reply-To: <7896.1060202191@sss.pgh.pa.us> 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: 200308/118 X-Sequence-Number: 2935 Tom Lane wrote: > Scott Cain writes: > >>A few days ago, I asked for advice on speeding up substring queries on >>the GENERAL mailing list. Joe Conway helpfully pointed out the ALTER >>TABLE STORAGE EXTERNAL documentation. After doing the alter, >>the queries got slower! Here is the background: > > Ah-hah, I've sussed it ... you didn't actually change the storage > representation. You wrote: Yeah, I came to the same conclusion this morning (update longdna set dna = dna || '';), but it still seems that the chunked table is very slightly faster than the substring on the externally stored column: dna=# explain analyze select pdna from dna where foffset > 6000000 and foffset < 6024000; QUERY PLAN ------------------------------------------------------------------------------------------------------------------ Index Scan using foffset_idx on dna (cost=0.00..4.22 rows=14 width=32) (actual time=0.06..0.16 rows=11 loops=1) Index Cond: ((foffset > 6000000) AND (foffset < 6024000)) Total runtime: 0.27 msec (3 rows) dna=# explain analyze select pdna from dna where foffset > 6000000 and foffset < 6024000; QUERY PLAN ------------------------------------------------------------------------------------------------------------------ Index Scan using foffset_idx on dna (cost=0.00..4.22 rows=14 width=32) (actual time=0.07..0.16 rows=11 loops=1) Index Cond: ((foffset > 6000000) AND (foffset < 6024000)) Total runtime: 0.25 msec (3 rows) dna=# explain analyze select substr(dna,6002000,20000) from longdna; QUERY PLAN ------------------------------------------------------------------------------------------------ Seq Scan on longdna (cost=0.00..1.01 rows=1 width=32) (actual time=0.46..0.47 rows=1 loops=1) Total runtime: 0.58 msec (2 rows) dna=# explain analyze select substr(dna,6002000,20000) from longdna; QUERY PLAN ------------------------------------------------------------------------------------------------ Seq Scan on longdna (cost=0.00..1.01 rows=1 width=32) (actual time=0.23..0.24 rows=1 loops=1) Total runtime: 0.29 msec (2 rows) I ran each command twice after starting psql to observe the effects of caching. However with the provided sample data, longdna has only one row, and dna has 122,540 rows, all of which are chunks of the one longdna row. I would tend to think that if you had 1000 or so longdna records indexed on some id column, versus 122,540,000 dna chunks indexed on both an id and segment column, the substring from longdna would win. Joe From pgsql-performance-owner@postgresql.org Wed Aug 6 18:08:37 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 E6F2DD1C9C8 for ; Wed, 6 Aug 2003 21:08: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 71365-10 for ; Wed, 6 Aug 2003 18:07:14 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 0F81ED1C4EC for ; Wed, 6 Aug 2003 18:08:24 -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 h76L8LSa008178; Wed, 6 Aug 2003 17:08:21 -0400 (EDT) To: Joe Conway Cc: Scott Cain , pgsql-performance@postgresql.org Subject: Re: EXTERNAL storage and substring on long strings In-reply-to: <3F316A41.6020403@joeconway.com> References: <1059679600.1429.41.camel@localhost.localdomain> <7896.1060202191@sss.pgh.pa.us> <3F316A41.6020403@joeconway.com> Comments: In-reply-to Joe Conway message dated "Wed, 06 Aug 2003 13:51:13 -0700" Date: Wed, 06 Aug 2003 17:08:21 -0400 Message-ID: <8177.1060204101@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/119 X-Sequence-Number: 2936 Joe Conway writes: > Tom Lane wrote: >> Ah-hah, I've sussed it ... you didn't actually change the storage >> representation. You wrote: > Yeah, I came to the same conclusion this morning (update longdna set dna > = dna || '';), but it still seems that the chunked table is very > slightly faster than the substring on the externally stored column: > dna=# explain analyze select pdna from dna where foffset > 6000000 and > foffset < 6024000; > QUERY PLAN > ------------------------------------------------------------------------------------------------------------------ > Index Scan using foffset_idx on dna (cost=0.00..4.22 rows=14 > width=32) (actual time=0.07..0.16 rows=11 loops=1) > Index Cond: ((foffset > 6000000) AND (foffset < 6024000)) > Total runtime: 0.25 msec > (3 rows) > dna=# explain analyze select substr(dna,6002000,20000) from longdna; > QUERY PLAN > ------------------------------------------------------------------------------------------------ > Seq Scan on longdna (cost=0.00..1.01 rows=1 width=32) (actual > time=0.23..0.24 rows=1 loops=1) > Total runtime: 0.29 msec > (2 rows) This isn't a totally fair comparison, though, since the second case is actually doing the work of assembling the chunks into a single string, while the first is not. Data-copying alone would probably account for the difference. I would expect that the two would come out to essentially the same cost when fairly compared, since the dna table is nothing more nor less than a hand implementation of the TOAST concept. The toaster's internal fetching of toasted data segments ought to be equivalent to the above indexscan. The toaster would have a considerable edge on Scott's implementation when it came to assembling the chunks, since it's working in C and not in plpgsql, but the table access costs ought to be just about the same. regards, tom lane From pgsql-performance-owner@postgresql.org Wed Aug 6 18:23: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 75ED6D1C97F for ; Wed, 6 Aug 2003 21:22:15 +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 75105-09 for ; Wed, 6 Aug 2003 18:20:54 -0300 (ADT) Received: from mercury.elitra.com (unknown [12.35.196.84]) by svr1.postgresql.org (Postfix) with ESMTP id 64BF1D1C4E3 for ; Wed, 6 Aug 2003 18:22:04 -0300 (ADT) Received: from moebius.elitra.com ([192.168.201.111]) by mercury.elitra.com with Microsoft SMTPSVC(5.5.1877.197.19); Wed, 6 Aug 2003 14:28:16 -0700 Date: Wed, 6 Aug 2003 17:22:05 -0400 (EDT) From: Sebastien Lemieux To: Tom Lane Cc: Postgresql-performance Subject: Re: How to efficiently duplicate a whole schema? In-Reply-To: <7235.1060197229@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/120 X-Sequence-Number: 2937 On Wed, 6 Aug 2003, Tom Lane wrote: > Sebastien Lemieux writes: > > All the time is taken at the commit of both transaction. > > Sounds like the culprit is foreign-key checks. > > One obvious question is whether you have your foreign keys set up > efficiently in the first place. As a rule, the referenced and > referencing columns should have identical datatypes and both should > be indexed. (PG will often let you create foreign key constraints > that don't meet these rules ... but performance will suffer.) I've checked and all the foreign keys are setup between 'serial' (the primary key of the referenced table) and 'integer not null' (the foreign key field). Would that be same type? A couple of my foreign keys are not indexed, I'll fix that. The latter seems to do the job, since I can now synchronize in about 75 seconds (compared to 30 minutes), which seems good enough. > Also, what procedure are you using to delete all the old data? What > I'd recommend is > ANALYZE table; > TRUNCATE table; > INSERT new data; > The idea here is to make sure that the planner's statistics reflect the > "full" state of the table, not the "empty" state. Otherwise it may pick > plans for the foreign key checks that are optimized for small tables. I added the 'analyze' but without any noticable gain in speed. I can't use 'truncate' since I need to 'set constraints all deferred'. I guess the bottom line is that I really need to first drop all constraints and indexes, synchronize and then rebuild indexes and check constraints. But for that I'll need to reorganize my code a little bit! In the meantime, how bad a decision would it be to simply remove all foreign key constraints? Because, currently I think they are causing more problems than they are avoiding... thanks, -- Sebastien Lemieux Bioinformatics, post-doc Elitra-canada From pgsql-performance-owner@postgresql.org Wed Aug 6 18:36:21 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 B772ED1C92D for ; Wed, 6 Aug 2003 21:33:10 +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 85552-01 for ; Wed, 6 Aug 2003 18:31:50 -0300 (ADT) Received: from home.samurai.com (home.samurai.com [205.207.28.66]) by svr1.postgresql.org (Postfix) with ESMTP id C5018D1C91E for ; Wed, 6 Aug 2003 18:32:59 -0300 (ADT) Received: by home.samurai.com (Postfix, from userid 1014) id B66F026219; Wed, 6 Aug 2003 17:33:01 -0400 (EDT) Date: Wed, 6 Aug 2003 17:33:01 -0400 From: Neil Conway To: "Wilson A. Galafassi Jr." Cc: pgsql-performance@postgresql.org Subject: Re: PostgreSql under Linux Message-ID: <20030806213301.GA28017@home.samurai.com> References: <01dd01c35c45$141a42b0$70c0b4c8@notebook> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01dd01c35c45$141a42b0$70c0b4c8@notebook> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/121 X-Sequence-Number: 2938 On Wed, Aug 06, 2003 at 03:03:41PM -0300, Wilson A. Galafassi Jr. wrote: > I'm installing Postgresql under linux for better performance and i want to know how is the best configuration. > 1. What is the best linux distribuition for better performance? The Linux distribution itself isn't that important, IMHO. Spend some time selecting the right filesystem (check the archives for threads on this topic), the right kernel (and perhaps compiling your own from scratch), perhaps some kernel tuning (I/O scheduler, etc.), and so forth. > 2. Does exists any compilation options to better performance on this machine? Not compilation options, but there are plenty of configuration settings you should be tweaking to ensure good performance. You can find a list of configuration options here: http://www.postgresql.org/docs/7.3/static/runtime-config.html -Neil From pgsql-admin-owner@postgresql.org Wed Aug 6 18:50:31 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 62991D1C9C8 for ; Wed, 6 Aug 2003 21:36:38 +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 83339-09 for ; Wed, 6 Aug 2003 18:35:17 -0300 (ADT) Received: from zooty.lancs.ac.uk (zooty.lancs.ac.uk [148.88.16.231]) by svr1.postgresql.org (Postfix) with ESMTP id 4C882D1C91D for ; Wed, 6 Aug 2003 18:36:27 -0300 (ADT) Received: from mail.lancs.ac.uk ([148.88.1.10] helo=marl.lancs.ac.uk) by zooty.lancs.ac.uk with esmtp (Exim 4.20) id 19kVxM-0004Vk-RY for pgsql-admin@postgresql.org; Wed, 06 Aug 2003 22:36:28 +0100 Received: from faa034000015.lancs.ac.uk ([148.88.81.14] helo=short.lancs.ac.uk) by marl.lancs.ac.uk with esmtp (Exim 3.36 #1) id 19kVxM-0004GT-00 for pgsql-admin@postgresql.org; Wed, 06 Aug 2003 22:36:28 +0100 Date: Wed, 6 Aug 2003 22:39:52 +0100 (BST) From: Sam Barnett-Cormack X-X-Sender: sdb@short.lancs.ac.uk To: PostgreSQL Administrators Mailing List Subject: Re: PostgreSql under Linux In-Reply-To: <01dd01c35c45$141a42b0$70c0b4c8@notebook> Message-ID: References: <01dd01c35c45$141a42b0$70c0b4c8@notebook> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/90 X-Sequence-Number: 9813 On Wed, 6 Aug 2003, Wilson A. Galafassi Jr. wrote: > Hello people. > > I'm installing Postgresql under linux for better performance and i want to know how is the best configuration. > > My server is a dual pentium3 1ghz/1gb ram/36gb scsi. running only postgresql. My question is: > 1. What is the best linux distribuition for better performance? LFS (http://www.linuxfromscratch.org/) if you have the time. WARNING: it is a major undertaking, but for a machine dedicated to one task, where virtually everything can be well-optimised for the machine, it has major performance and admin benefits. Only try it if you have a lot of time and/or already know linux well. If you have a *lot* of time, you will gain the knowledge as you go. If you decide to, I'll see you on *that* mailing list. Also, I recommend slackware as an LFS base. -- Sam Barnett-Cormack Software Developer | Student of Physics & Maths UK Mirror Service (http://www.mirror.ac.uk) | Lancaster University From pgsql-performance-owner@postgresql.org Wed Aug 6 18:56:38 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 1A278D1C923 for ; Wed, 6 Aug 2003 21:41: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 86456-02 for ; Wed, 6 Aug 2003 18:40:32 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id C9DA5D1C90E for ; Wed, 6 Aug 2003 18:41:41 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id C7BDED6A0; Wed, 6 Aug 2003 14:41:43 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id BD4EF5C0F; Wed, 6 Aug 2003 14:41:43 -0700 (PDT) Date: Wed, 6 Aug 2003 14:41:43 -0700 (PDT) From: Stephan Szabo To: Sebastien Lemieux Cc: Tom Lane , Postgresql-performance Subject: Re: How to efficiently duplicate a whole schema? In-Reply-To: Message-ID: <20030806143746.J7786-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/123 X-Sequence-Number: 2940 On Wed, 6 Aug 2003, Sebastien Lemieux wrote: > On Wed, 6 Aug 2003, Tom Lane wrote: > > > Sebastien Lemieux writes: > > > All the time is taken at the commit of both transaction. > > > > Sounds like the culprit is foreign-key checks. > > > > One obvious question is whether you have your foreign keys set up > > efficiently in the first place. As a rule, the referenced and > > referencing columns should have identical datatypes and both should > > be indexed. (PG will often let you create foreign key constraints > > that don't meet these rules ... but performance will suffer.) > > I've checked and all the foreign keys are setup between 'serial' (the > primary key of the referenced table) and 'integer not null' (the foreign > key field). Would that be same type? A couple of my foreign keys are not > indexed, I'll fix that. The latter seems to do the job, since I can now > synchronize in about 75 seconds (compared to 30 minutes), which seems good > enough. Another thing might be the management of the trigger queue. I don't think 7.3.2 had the optimization for limiting the scans of the queue when you have lots of deferred triggers. It looks like 7.3.4 may though. From pgsql-performance-owner@postgresql.org Wed Aug 6 18: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 1D7DCD1C910 for ; Wed, 6 Aug 2003 21:47:51 +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 86388-04 for ; Wed, 6 Aug 2003 18:46:30 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 72ED4D1C91D for ; Wed, 6 Aug 2003 18:47:39 -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 h76LlaSa009141; Wed, 6 Aug 2003 17:47:36 -0400 (EDT) To: Sebastien Lemieux Cc: Postgresql-performance Subject: Re: How to efficiently duplicate a whole schema? In-reply-to: References: Comments: In-reply-to Sebastien Lemieux message dated "Wed, 06 Aug 2003 17:22:05 -0400" Date: Wed, 06 Aug 2003 17:47:36 -0400 Message-ID: <9140.1060206456@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/122 X-Sequence-Number: 2939 Sebastien Lemieux writes: > On Wed, 6 Aug 2003, Tom Lane wrote: >> The idea here is to make sure that the planner's statistics reflect the >> "full" state of the table, not the "empty" state. Otherwise it may pick >> plans for the foreign key checks that are optimized for small tables. > I added the 'analyze' but without any noticable gain in speed. I can't > use 'truncate' since I need to 'set constraints all deferred'. What are you using, exactly? regards, tom lane From pgsql-performance-owner@postgresql.org Wed Aug 6 19:07: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 38B35D1C916 for ; Wed, 6 Aug 2003 22:07:12 +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 86307-10 for ; Wed, 6 Aug 2003 19:05:51 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 3CF3CD1C910 for ; Wed, 6 Aug 2003 19:07:01 -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 h76M6qSa009347; Wed, 6 Aug 2003 18:06:53 -0400 (EDT) To: Stephan Szabo Cc: Sebastien Lemieux , Postgresql-performance Subject: Re: How to efficiently duplicate a whole schema? In-reply-to: <20030806143746.J7786-100000@megazone.bigpanda.com> References: <20030806143746.J7786-100000@megazone.bigpanda.com> Comments: In-reply-to Stephan Szabo message dated "Wed, 06 Aug 2003 14:41:43 -0700" Date: Wed, 06 Aug 2003 18:06:52 -0400 Message-ID: <9346.1060207612@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/124 X-Sequence-Number: 2941 Stephan Szabo writes: > Another thing might be the management of the trigger queue. I don't think > 7.3.2 had the optimization for limiting the scans of the queue when you > have lots of deferred triggers. It looks like 7.3.4 may though. Good point. We put that in in 7.3.3, according to the CVS logs. regards, tom lane From pgsql-performance-owner@postgresql.org Thu Aug 7 04:05: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 7CE08D1C4CB for ; Thu, 7 Aug 2003 07:05:52 +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 43181-05 for ; Thu, 7 Aug 2003 04:04:29 -0300 (ADT) Received: from fw.wubn.net (unknown [213.156.64.226]) by svr1.postgresql.org (Postfix) with ESMTP id D91BAD1C4EC for ; Thu, 7 Aug 2003 04:05:37 -0300 (ADT) Received: from (172.24.4.34) by fw.wubn.net (8.12.9/8.11.3) with ESMTP id h7775ZPt042146 for ; Thu, 7 Aug 2003 10:05:37 +0300 (EEST) (envelope-from yamazurak@Lviv.Bank.Gov.UA) Received: from (172.24.4.57) by MTA (8.11.5/8.11.2) with ESMTP id h7775Zf06072 for ; Thu, 7 Aug 2003 10:05:35 +0300 Message-ID: <3F31FA33.1050009@lviv.bank.gov.ua> Date: Thu, 07 Aug 2003 10:05:23 +0300 From: Yaroslav Mazurak Organization: National Bank of Ukraine Lviv OU User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: uk, ru, en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning References: <3F30AF9E.2080607@lviv.bank.gov.ua> <200308061030.36610.dev@archonet.com> <3F30F7CF.6090900@lviv.bank.gov.ua> <49274.192.168.1.32.1060184304.squirrel@mainbox.archonet.com> In-Reply-To: <49274.192.168.1.32.1060184304.squirrel@mainbox.archonet.com> 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: 200308/125 X-Sequence-Number: 2942 Hi All! Richard Huxton wrote: >>>On Wednesday 06 August 2003 08:34, Yaroslav Mazurak wrote: >>>>sort_mem = 131072 >>>This sort_mem value is *very* large - that's 131MB for *each sort* that It's not TOO large *for PostgreSQL*. When I'm inserting a large amount of data into tables, sort_mem helps. Value of 192M speeds up inserting significantly (verified :))! >> What mean "each sort"? Each query with SORT clause or some internal >>(invisible to user) sorts too (I can't imagine: indexed search or >>whatever else)? >> I'm reduced sort_mem to 16M. > It means each sort - if you look at your query plan and see three "sort" > clauses that means that query might allocate 48MB to sorting. Now, that's > good because sorting items on disk is much slower. It's bad because that's > 48MB less for everything else that's happening. OK, I'm preparing to fix this value. :) IMHO this is PostgreSQL's lack of memory management. I think that PostgreSQL can finally allocate enough memory by himself! :-E >> This is another strange behavior of PostgreSQL - he don't use some >>created indexes (seq_scan only) after ANALYZE too. OK, I'm turned on >>this option back. > Fair enough, we can work on those. With 7.3.x you can tell PG to examine > some tables more thouroughly to get better plans. You might EXPLAIN ANALYZE? >>>>effective_cache_size = 65536 >>>So you typically get about 256MB cache usage in top/free? >> No, top shows 12-20Mb. >> I'm reduced effective_cache_size to 4K blocks (16M?). > Cache size is in blocks of 8KB (usually) - it's a way of telling PG what > the chances are of disk blocks being already cached by Linux. PostgreSQL is running on FreeBSD, memory block actually is 4Kb, but in most cases documentation says about 8Kb... I don't know exactly about real disk block size, but suspect that it's 4Kb. :) >> I think this is a important remark. Can "JOIN" significantly reduce >>performance of SELECT statement relative to ", WHERE"? >> OK, I'm changed VIEW to this text: > It can sometimes. What it means is that PG will follow whatever order you > write the joins in. If you know joining a to b to c is the best order, > that can be a good thing. Unfortunately, it means the planner can't make a > better guess based on its statistics. At this moment this don't helps. :( > Well the cost estimates look much more plausible. You couldn't post > EXPLAIN ANALYSE could you? That actually runs the query. >> Now (2K shared_buffers blocks, 16K effective_cache_size blocks, 16Mb >>sort_mem) PostgreSQL uses much less memory, about 64M... it's not good, >>I want using all available RAM if possible - PostgreSQL is the main task >>on this PC. > Don't forget that any memory PG is using the operating-system can't. The > OS will cache frequently accessed disk blocks for you, so it's a question > of finding the right balance. PostgreSQL is the primary task for me on this PC - I don't worry about other tasks except OS. ;) >> May set effective_cache_size to 192M (48K blocks) be better? I don't >>understand exactly: effective_cache_size tells PostgreSQL about OS cache >>size or about available free RAM? > It needs to reflect how much cache the system is using - try the "free" > command to see figures. I'm not found "free" utility on FreeBSD 4.7. :( > If you could post the output of EXPLAIN ANALYSE rather than EXPLAIN, I'll > take a look at it this evening (London time). There's also plenty of other > people on this list who can help too. I'm afraid that this may be too long. :-((( Yesterday I'm re-execute my query with all changes... after 700 (!) minutes query failed with: "ERROR: Memory exhausted in AllocSetAlloc(104)". I don't understand: result is actually 8K rows long only, but PostgreSQL failed! Why?!! Function showcalc is recursive, but in my query used with level 1 depth only (I know exactly). Again: I think that this is PostgreSQL's lack of quality memory management. :-( > - Richard Huxton With best regards Yaroslav Mazurak. From pgsql-performance-owner@postgresql.org Thu Aug 7 04:36: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 E4375D1C4BD for ; Thu, 7 Aug 2003 07:35:57 +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 43139-08 for ; Thu, 7 Aug 2003 04:34:35 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id AC712D1C4CB for ; Thu, 7 Aug 2003 04:35:45 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h777aVfM002434 for ; Thu, 7 Aug 2003 13:06:31 +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 h777aUqx002421; Thu, 7 Aug 2003 13:06:30 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org, Yaroslav Mazurak Date: Thu, 07 Aug 2003 13:07:36 +0530 MIME-Version: 1.0 Subject: Re: PostgreSQL performance problem -> tuning Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F324F18.6307.4A8BB7A@localhost> In-reply-to: <3F31FA33.1050009@lviv.bank.gov.ua> References: <49274.192.168.1.32.1060184304.squirrel@mainbox.archonet.com> 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: 200308/126 X-Sequence-Number: 2943 On 7 Aug 2003 at 10:05, Yaroslav Mazurak wrote: > > It needs to reflect how much cache the system is using - try the "free" > > command to see figures. > > I'm not found "free" utility on FreeBSD 4.7. :( Grr.. I don't like freeBSD for it's top output.Active/inactive/Wired.. Grr.. why can't it be shared buffered and cached? Same goes for HP-UX top. Looking at it one gets hardly any real information.. Anyway that's just me.. Top on freeBSD seems pretty unintuituive em but if you find any documentation on that, that would help you. ( Haven't booted in freeBSD in ages so no data out of my head..) You can try various sysctls on freeBSD. Basicalyl idea is to find out how much of memory is used and how much is cached. FreeBSD must be providing that one in some form.. IIRC there is a limit on filesystem cache on freeBSD. 300MB by default. If that is the case, you might have to raise it to make effective_cache_size really effective.. HTH Bye Shridhar -- Another war ... must it always be so? How many comrades have we lostin this way? ... Obedience. Duty. Death, and more death ... -- Romulan Commander, "Balance of Terror", stardate 1709.2 From pgsql-performance-owner@postgresql.org Thu Aug 7 04:42: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 A8C65D1C4CB for ; Thu, 7 Aug 2003 07:42: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 44128-10 for ; Thu, 7 Aug 2003 04:40:44 -0300 (ADT) Received: from fw.wubn.net (unknown [213.156.64.226]) by svr1.postgresql.org (Postfix) with ESMTP id 28FE9D1C4BD for ; Thu, 7 Aug 2003 04:41:53 -0300 (ADT) Received: from (172.24.4.34) by fw.wubn.net (8.12.9/8.11.3) with ESMTP id h777fTPt043742 for ; Thu, 7 Aug 2003 10:41:34 +0300 (EEST) (envelope-from yamazurak@Lviv.Bank.Gov.UA) Received: from (172.24.4.57) by MTA (8.11.5/8.11.2) with ESMTP id h777fTf06858 for ; Thu, 7 Aug 2003 10:41:29 +0300 Message-ID: <3F32029D.6080704@lviv.bank.gov.ua> Date: Thu, 07 Aug 2003 10:41:17 +0300 From: Yaroslav Mazurak Organization: National Bank of Ukraine Lviv OU User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: uk, ru, en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning References: <3F30AF9E.2080607@lviv.bank.gov.ua> <200308061030.36610.dev@archonet.com> <3F30F7CF.6090900@lviv.bank.gov.ua> <1624.1060193807@sss.pgh.pa.us> In-Reply-To: <1624.1060193807@sss.pgh.pa.us> 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: 200308/127 X-Sequence-Number: 2944 Hi All! Tom Lane wrote: > Yaroslav Mazurak writes: >>>>fsync = false >>>I'd turn fsync back on - unless you don't mind losing your data after a crash. >> This is temporary performance solution - I want get SELECT query result >>first, but current performance is too low. > Disabling fsync will not help SELECT performance one bit. It would only > affect transactions that modify the database. Fixed. But at this moment primary tasks are *get result* (1st) from SELECT in *reasonable* time (2nd). :) > regards, tom lane With best regards Yaroslav Mazurak. From pgsql-performance-owner@postgresql.org Thu Aug 7 05:11: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 DEC9AD1C4BF for ; Thu, 7 Aug 2003 08:11: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 49743-04 for ; Thu, 7 Aug 2003 05:09:49 -0300 (ADT) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by svr1.postgresql.org (Postfix) with ESMTP id 9D9F9D1C4EE for ; Thu, 7 Aug 2003 05:11:00 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-32.mail.demon.net with esmtp (Exim 3.35 #1) id 19kfrR-0003q4-0W; Thu, 07 Aug 2003 09:11:01 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 2465717C37; Thu, 7 Aug 2003 09:11:00 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 67C5A16384; Thu, 7 Aug 2003 09:10:59 +0100 (BST) From: Richard Huxton To: Yaroslav Mazurak , pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning Date: Thu, 7 Aug 2003 09:10:58 +0100 User-Agent: KMail/1.5 References: <3F30AF9E.2080607@lviv.bank.gov.ua> <49274.192.168.1.32.1060184304.squirrel@mainbox.archonet.com> <3F31FA33.1050009@lviv.bank.gov.ua> In-Reply-To: <3F31FA33.1050009@lviv.bank.gov.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308070910.58624.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/128 X-Sequence-Number: 2945 On Thursday 07 August 2003 08:05, Yaroslav Mazurak wrote: > Hi All! > > Richard Huxton wrote: > >>>On Wednesday 06 August 2003 08:34, Yaroslav Mazurak wrote: > >>>>sort_mem = 131072 > >>> > >>>This sort_mem value is *very* large - that's 131MB for *each sort* that > > It's not TOO large *for PostgreSQL*. When I'm inserting a large amount > of data into tables, sort_mem helps. Value of 192M speeds up inserting > significantly (verified :))! And what about every other operation? > >> What mean "each sort"? Each query with SORT clause or some internal > >>(invisible to user) sorts too (I can't imagine: indexed search or > >>whatever else)? > >> > >> I'm reduced sort_mem to 16M. > > > > It means each sort - if you look at your query plan and see three "sort" > > clauses that means that query might allocate 48MB to sorting. Now, that's > > good because sorting items on disk is much slower. It's bad because > > that's 48MB less for everything else that's happening. > > OK, I'm preparing to fix this value. :) > IMHO this is PostgreSQL's lack of memory management. I think that > PostgreSQL can finally allocate enough memory by himself! :-E But this parameter controls how much memory can be allocated to sorts - I don't see how PG can figure out a reasonable maximum by itself. > >> This is another strange behavior of PostgreSQL - he don't use some > >>created indexes (seq_scan only) after ANALYZE too. OK, I'm turned on > >>this option back. > > > > Fair enough, we can work on those. With 7.3.x you can tell PG to examine > > some tables more thouroughly to get better plans. > > You might EXPLAIN ANALYZE? No - I meant altering the number of rows used to gather stats (ALTER TABLE...SET STATISTICS) - this controls how many rows PG looks at when deciding the "shape" of the data in the table. [snip] > > Don't forget that any memory PG is using the operating-system can't. The > > OS will cache frequently accessed disk blocks for you, so it's a question > > of finding the right balance. > > PostgreSQL is the primary task for me on this PC - I don't worry about > other tasks except OS. ;) You still want the OS to cache your database files. If you try and allocate too much memory to PG you will only hurt performance. > >> May set effective_cache_size to 192M (48K blocks) be better? I don't > >>understand exactly: effective_cache_size tells PostgreSQL about OS cache > >>size or about available free RAM? > > > > It needs to reflect how much cache the system is using - try the "free" > > command to see figures. > > I'm not found "free" utility on FreeBSD 4.7. :( Sorry - I don't know what the equivalent is in FreeBSD. > > If you could post the output of EXPLAIN ANALYSE rather than EXPLAIN, I'll > > take a look at it this evening (London time). There's also plenty of > > other people on this list who can help too. > > I'm afraid that this may be too long. :-((( > Yesterday I'm re-execute my query with all changes... after 700 (!) > minutes query failed with: "ERROR: Memory exhausted in > AllocSetAlloc(104)". I don't understand: result is actually 8K rows long > only, but > PostgreSQL failed! Why?!! Function showcalc is recursive, but in my > query used with level 1 depth only (I know exactly). I must say I'm puzzled as to how this can happen. In fact, if the last EXPLAIN output was accurate, it couldn't run out of memory, not with the settings you've got now. > Again: I think that this is PostgreSQL's lack of quality memory > management. :-( If it's allocating all that memory (do you see the memory usage going up in top) then there's something funny going on now. Well sir, I can only think of two options now: 1. simplify the query until it works and then build it back up again - that should identify where the problem is. 2. If you can put together a pg_dump with a small amount of sample data, I can take a look at it here. -- Richard Huxton Archonet Ltd From pgsql-performance-owner@postgresql.org Thu Aug 7 05:23:40 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 EBECCD1C517 for ; Thu, 7 Aug 2003 08:23: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 47188-09 for ; Thu, 7 Aug 2003 05:22:08 -0300 (ADT) Received: from zigo.dhs.org (as2-4-3.an.g.bonet.se [194.236.34.191]) by svr1.postgresql.org (Postfix) with ESMTP id 70DCDD1C4BC for ; Thu, 7 Aug 2003 05:23:19 -0300 (ADT) Received: from zigo.dhs.org (zigo [127.0.0.1]) by zigo.dhs.org (8.12.8/8.12.8) with ESMTP id h778N5WK026304; Thu, 7 Aug 2003 10:23:05 +0200 Received: from localhost (db@localhost) by zigo.dhs.org (8.12.8/8.12.8/Submit) with ESMTP id h778N4O8026300; Thu, 7 Aug 2003 10:23:05 +0200 Date: Thu, 7 Aug 2003 10:23:04 +0200 (CEST) From: =?ISO-8859-1?Q?Dennis_Bj=F6rklund?= To: Richard Huxton Cc: Yaroslav Mazurak , Subject: Re: PostgreSQL performance problem -> tuning In-Reply-To: <200308070910.58624.dev@archonet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/129 X-Sequence-Number: 2946 On Thu, 7 Aug 2003, Richard Huxton wrote: > But this parameter controls how much memory can be allocated to sorts - I > don't see how PG can figure out a reasonable maximum by itself. One could have one setting for the total memory usage and pg could use statistics or some heuristics to use the memory for different things in a good way. Then that setting could have an auto setting so it uses 40% of all memory or something like that. Not perfect but okay for most people. -- /Dennis From pgsql-performance-owner@postgresql.org Thu Aug 7 05:25: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 66603D1C4CA for ; Thu, 7 Aug 2003 08:24:49 +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 51584-01 for ; Thu, 7 Aug 2003 05:23:26 -0300 (ADT) Received: from fw.wubn.net (unknown [213.156.64.226]) by svr1.postgresql.org (Postfix) with ESMTP id 20A48D1C50B for ; Thu, 7 Aug 2003 05:24:35 -0300 (ADT) Received: from (172.24.4.34) by fw.wubn.net (8.12.9/8.11.3) with ESMTP id h778OTPt045602 for ; Thu, 7 Aug 2003 11:24:34 +0300 (EEST) (envelope-from yamazurak@Lviv.Bank.Gov.UA) Received: from (172.24.4.57) by MTA (8.11.5/8.11.2) with ESMTP id h778OTf08176 for ; Thu, 7 Aug 2003 11:24:29 +0300 Message-ID: <3F320CB1.7040000@lviv.bank.gov.ua> Date: Thu, 07 Aug 2003 11:24:17 +0300 From: Yaroslav Mazurak Organization: National Bank of Ukraine Lviv OU User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: uk, ru, en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning References: <49274.192.168.1.32.1060184304.squirrel@mainbox.archonet.com> <3F324F18.6307.4A8BB7A@localhost> In-Reply-To: <3F324F18.6307.4A8BB7A@localhost> 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: 200308/130 X-Sequence-Number: 2947 Hi All! Shridhar Daithankar wrote: > On 7 Aug 2003 at 10:05, Yaroslav Mazurak wrote: >>>It needs to reflect how much cache the system is using - try the "free" >>>command to see figures. >> I'm not found "free" utility on FreeBSD 4.7. :( > > Grr.. I don't like freeBSD for it's top output.Active/inactive/Wired.. Grr.. > why can't it be shared buffered and cached? Same goes for HP-UX top. Looking at > it one gets hardly any real information.. Anyway that's just me.. > Grr... I don't like PostgreSQL for it's memory usage parameters. In Sybase ASA, I say for example: "use 64Mb RAM for cache". I don't worry about data in this cache - this may be queries, sort areas, results etc. I think that server know better about it's memory requirements. I know that Sybase *use*, and use *only this* memory and don't trap with "Memory exhausted" error. I'm not remember 700 minutes queries (more complex that my query), following with "memory exhausted" error, on Sybase. Advertising, he? :( > Top on freeBSD seems pretty unintuituive em but if you find any documentation > on that, that would help you. (Haven't booted in freeBSD in ages so no data > out of my head..) > You can try various sysctls on freeBSD. Basicalyl idea is to find out how much > of memory is used and how much is cached. FreeBSD must be providing that one in > some form.. > IIRC there is a limit on filesystem cache on freeBSD. 300MB by default. If that > is the case, you might have to raise it to make effective_cache_size really > effective.. "Try various sysctls" says nothing for me. I want use *all available RAM* (of course, without needed for OS use) for PostgreSQL. While idle time top says: Mem: 14M Active, 1944K Inact, 28M Wired, 436K Cache, 48M Buf, 331M Free Swap: 368M Total, 17M Used, 352M Free, 4% Inuse After 1 minute of "EXPLAIN ANALYZE SELECT SUM(showcalc('B00204', dd, r020, t071)) FROM v_file02wide WHERE a011 = 3 AND inrepdate(data) AND b030 IN (SELECT b030 FROM dov_bank WHERE dov_bank_box_22(box) IN ('NL', 'NM')) AND r030 = 980;" executing: Mem: 64M Active, 17M Inact, 72M Wired, 436K Cache, 48M Buf, 221M Free Swap: 368M Total, 3192K Used, 365M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 59063 postgres 49 0 65560K 55492K RUN 1:06 94.93% 94.63% postgres After 12 minutes of query executing: Mem: 71M Active, 17M Inact, 72M Wired, 436K Cache, 48M Buf, 214M Free Swap: 368M Total, 3192K Used, 365M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 59063 postgres 56 0 73752K 62996K RUN 12:01 99.02% 99.02% postgres I suspect that swap-file size is too small for my query... but query isn't too large, about 8K rows only. :-| > Shridhar With best regards Yaroslav Mazurak. From pgsql-performance-owner@postgresql.org Thu Aug 7 05:27: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 1FB18D1C4BF for ; Thu, 7 Aug 2003 08:26:57 +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 47962-09 for ; Thu, 7 Aug 2003 05:25:34 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 5DE2ED1C7EB for ; Thu, 7 Aug 2003 05:26:45 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h778RWVY016490 for ; Thu, 7 Aug 2003 13:57:32 +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 h778RW7f016475 for ; Thu, 7 Aug 2003 13:57:32 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Thu, 07 Aug 2003 13:58:37 +0530 MIME-Version: 1.0 Subject: Simple filesystem benchmark on Linux 2.6 Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F325B0D.25941.4D77005@localhost> 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: 200308/131 X-Sequence-Number: 2948 http://kerneltrap.org/node/view/715 Might be interesting for people running 2.6. Last I heard, the anticipatory scheduler did not yield it's maximum throughput for random reads. So they said database guys would not want it right away. Anybody using it for testing? Couple of guys are running it here in my company on a moderate desktop-cum-server. So far it's good.. In fact far better.. Bye Shridhar -- Wedding, n: A ceremony at which two persons undertake to become one, one undertakes to become nothing and nothing undertakes to become supportable. -- Ambrose Bierce From pgsql-general-owner@postgresql.org Thu Aug 7 04:52:16 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 09C1BD1C91E for ; Thu, 7 Aug 2003 07:51: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 49236-01 for ; Thu, 7 Aug 2003 04:49:55 -0300 (ADT) Received: from mxout3.netvision.net.il (mxout3.netvision.net.il [194.90.9.24]) by svr1.postgresql.org (Postfix) with ESMTP id 0365CD1C914 for ; Thu, 7 Aug 2003 04:51:07 -0300 (ADT) Received: from mikislap ([217.132.27.49]) by mxout3.netvision.net.il (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) with SMTP id <0HJ80092TOH62P@mxout3.netvision.net.il> for pgsql-general@postgresql.org; Thu, 07 Aug 2003 10:51:07 +0300 (IDT) Date: Thu, 07 Aug 2003 10:51:03 +0200 From: Ben-Nes Michael Subject: Re: PostgreSql under Linux To: "Wilson A. Galafassi Jr." , postgresql Message-id: <003201c35cc1$09798bf0$0400000a@mikislap> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Mailer: Microsoft Outlook Express 6.00.2800.1158 Content-type: multipart/alternative; boundary="Boundary_(ID_N3aY3V49E4O82SHd/NmIYA)" X-Priority: 3 X-MSMail-priority: Normal References: <01dd01c35c45$141a42b0$70c0b4c8@notebook> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/332 X-Sequence-Number: 46749 This is a multi-part message in MIME format. --Boundary_(ID_N3aY3V49E4O82SHd/NmIYA) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT I say go for GENTOO :) You can compile all the system exactly for your mechine / cpu. -------------------------- Canaan Surfing Ltd. Internet Service Providers Ben-Nes Michael - Manager Tel: 972-4-6991122 Fax: 972-4-6990098 http://www.canaan.net.il -------------------------- ----- Original Message ----- From: Wilson A. Galafassi Jr. To: "Undisclosed-Recipient:;"@svr1.postgresql.org Sent: Wednesday, August 06, 2003 8:03 PM Subject: [GENERAL] PostgreSql under Linux Hello people. I'm installing Postgresql under linux for better performance and i want to know how is the best configuration. My server is a dual pentium3 1ghz/1gb ram/36gb scsi. running only postgresql. My question is: 1. What is the best linux distribuition for better performance? 2. Does exists any compilation options to better performance on this machine? Thanks Wilson Galafassi --Boundary_(ID_N3aY3V49E4O82SHd/NmIYA) Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: 7BIT
I say go for GENTOO :)
 
You can compile all the system exactly for your mechine / cpu.
--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
Fax: 972-4-6990098
http://www.canaan.net.il
--------------------------
----- Original Message -----
Sent: Wednesday, August 06, 2003 8:03 PM
Subject: [GENERAL] PostgreSql under Linux

Hello people.
 
I'm installing Postgresql under linux for better performance and i want to know how is the best configuration.
 
My server is a dual pentium3 1ghz/1gb ram/36gb scsi. running only postgresql. My question is:
1. What is the best linux distribuition for better performance?
2. Does exists any compilation options to better performance on this machine?
 
Thanks
 
Wilson Galafassi
--Boundary_(ID_N3aY3V49E4O82SHd/NmIYA)-- From pgsql-sql-owner@postgresql.org Thu Aug 7 12:08:33 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 71DA9D1C4E1 for ; Thu, 7 Aug 2003 09:30: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 50508-09 for ; Thu, 7 Aug 2003 06:28:56 -0300 (ADT) Received: from svana.org (svana.org [203.20.62.76]) by svr1.postgresql.org (Postfix) with ESMTP id 2BFAFD1C4BD for ; Thu, 7 Aug 2003 06:30:07 -0300 (ADT) Received: from kleptog by svana.org with local (Exim 3.35 #1 (Debian)) id 19kh5z-00054d-00; Thu, 07 Aug 2003 19:30:07 +1000 Date: Thu, 7 Aug 2003 19:30:07 +1000 From: Martijn van Oosterhout To: "Wilson A. Galafassi Jr." Cc: pgsql-sql@postgresql.org Subject: Re: [GENERAL] Postgresql slow on XEON 2.4ghz/1gb ram Message-ID: <20030807093006.GA19280@svana.org> Reply-To: Martijn van Oosterhout References: <009d01c35c21$ba3a1270$70c0b4c8@notebook> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <009d01c35c21$ba3a1270$70c0b4c8@notebook> User-Agent: Mutt/1.3.28i X-PGP-Key-ID: Length=1024; ID=0x0DC67BE6 X-PGP-Key-Fingerprint: 295F A899 A81A 156D B522 48A7 6394 F08A 0DC6 7BE6 X-PGP-Key-URL: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/64 X-Sequence-Number: 14680 --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 06, 2003 at 10:50:38AM -0300, Wilson A. Galafassi Jr. wrote: > Hello. > I have this problem: i'm running the postgre 7.3 on a windows 2000 server > with P3 1GHZ DUAL/1gb ram with good performance. For best performance i > have change the server for a XEON 2.4/1gb ram and for my suprise the > performance decrease 80%. anybody have a similar experience? does exist > any special configuration to postgre running on a Xeon processor? Any have > any idea to help-me? Excuse-me my bad english. I assume you've done the vacuums, analyze, configured the wal and shmem option appropriate for that size machine. But in any case, without specific examples about what you're seeing we can't help you. --=20 Martijn van Oosterhout http://svana.org/kleptog/ > "All that is needed for the forces of evil to triumph is for enough good > men to do nothing." - Edmond Burke > "The penalty good people pay for not being interested in politics is to be > governed by people worse than themselves." - Plato --EVF5PPMfhYS0aIcm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE/MhweY5Twig3Ge+YRAgW0AJ0W2btR+4tPSCwn/S7ShvUUkPKkdQCdHuxY xi5GBlEAGk8Sji9hPb8/dcc= =GA98 -----END PGP SIGNATURE----- --EVF5PPMfhYS0aIcm-- From pgsql-performance-owner@postgresql.org Thu Aug 7 11:50: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 D41D4D1C4BC for ; Thu, 7 Aug 2003 14:44: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 88026-03 for ; Thu, 7 Aug 2003 11:43:10 -0300 (ADT) Received: from email04.aon.at (WARSL402PIP5.highway.telekom.at [195.3.96.90]) by svr1.postgresql.org (Postfix) with SMTP id 314D7D1C48E for ; Thu, 7 Aug 2003 11:44:19 -0300 (ADT) Received: (qmail 246698 invoked from network); 7 Aug 2003 14:44:22 -0000 Received: from m154p026.dipool.highway.telekom.at (HELO cantor) ([62.46.9.58]) (envelope-sender ) by qmail4rs.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 7 Aug 2003 14:44:22 -0000 From: Manfred Koizar To: Sean Chittenden Cc: pgsql-performance@postgresql.org Subject: Re: Moving postgresql.conf tunables into 2003... Date: Thu, 07 Aug 2003 16:44:41 +0200 Message-ID: References: <20030703190502.GR72567@perrin.int.nxad.com> <2422.1057264735@sss.pgh.pa.us> <20030704000646.GV72567@perrin.int.nxad.com> <4nfiiv850cu7vkp39tv7mk2b3pniim8ccu@4ax.com> <20030805222609.GF94710@perrin.int.nxad.com> In-Reply-To: <20030805222609.GF94710@perrin.int.nxad.com> X-Mailer: Forte Agent 1.93/32.576 English (American) 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: 200308/132 X-Sequence-Number: 2949 On Tue, 5 Aug 2003 15:26:09 -0700, Sean Chittenden wrote: >> I have an experimental patch lying around somewhere that tries to >> work around these problems by offering different estimation methods >> for index scans. If you are interested, I'll dig it out. > >Sure, I'll take a gander... had my head in enough Knuth recently to >even hopefully have some kind of a useful response to the patch. Sean, the patch is at http://www.pivot.at/pg/16-correlation-732.diff. A short description of its usage can be found at http://archives.postgresql.org/pgsql-performance/2002-11/msg00256.php. If you are interested how the different interpolation methods work, read the source - it shouldn't be too hard to find. You might also want to read the thread starting at http://archives.postgresql.org/pgsql-hackers/2002-10/msg00072.php. >> does this mean that sensorid, evtime, and action are not >> independent? > >Hrm... sensorid is sequence and grows proportional with evtime, >obviously. So a *low* sensorid (7) is quite uncommon for a *late* evtime? This would help understand the problem. Unfortunately I have no clue what to do about it. :-( >Having spent a fair amount of time looking at the two following plans, >it seems as though an additional statistic is needed to change the >cost of doing an index lookup when the index is linearly ordered. I'm not sure I understand what you mean by "index is linearly ordered", but I guess correlation is that statistic you are talking about. However, it is calculated per column, not per index. >Whether CLUSTER does this or not, I don't know, If you CLUSTER on an index and then ANALYSE, you get a correlation of 1.0 (== optimum) for the first column of the index. > I never heard back >from him after getting the runtime down to a few ms. :-/ Pity! I'd have liked to see EXPLAIN ANALYSE for SELECT * FROM mss_fwevent WHERE sensorid = 7 AND evtime > (now() - '6 hours'::INTERVAL) AND NOT action; SELECT * FROM mss_fwevent WHERE sensorid = 7 AND evtime > (now() - '6 hours'::INTERVAL); SELECT * FROM mss_fwevent WHERE evtime > (now() - '6 hours'::INTERVAL); SELECT * FROM mss_fwevent WHERE sensorid = 7; > Are indexes >on linearly ordered data rebalanced somehow? I thought CLUSTER only >reordered data on disk. -sc AFAIK CLUSTER re-creates all indices belonging to the table. Servus Manfred From pgsql-performance-owner@postgresql.org Thu Aug 7 11:53: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 112F1D1C4EB for ; Thu, 7 Aug 2003 14:53: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 87910-07 for ; Thu, 7 Aug 2003 11:51:39 -0300 (ADT) Received: from anchor-post-39.mail.demon.net (anchor-post-39.mail.demon.net [194.217.242.80]) by svr1.postgresql.org (Postfix) with ESMTP id 0862ED1C4E1 for ; Thu, 7 Aug 2003 11:52:49 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-39.mail.demon.net with esmtp (Exim 3.36 #2) id 19km8J-0006uf-0U; Thu, 07 Aug 2003 15:52:52 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 93B1916C74; Thu, 7 Aug 2003 15:52:50 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id B105B166BC; Thu, 7 Aug 2003 15:52:49 +0100 (BST) From: Richard Huxton To: Yaroslav Mazurak , pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning Date: Thu, 7 Aug 2003 15:52:48 +0100 User-Agent: KMail/1.5 References: <49274.192.168.1.32.1060184304.squirrel@mainbox.archonet.com> <3F324F18.6307.4A8BB7A@localhost> <3F320CB1.7040000@lviv.bank.gov.ua> In-Reply-To: <3F320CB1.7040000@lviv.bank.gov.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308071552.48868.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/133 X-Sequence-Number: 2950 On Thursday 07 August 2003 09:24, Yaroslav Mazurak wrote: > > IIRC there is a limit on filesystem cache on freeBSD. 300MB by default. > > If that is the case, you might have to raise it to make > > effective_cache_size really effective.. > > "Try various sysctls" says nothing for me. I want use *all available > RAM* (of course, without needed for OS use) for PostgreSQL. PG will be using the OS' disk caching. > While idle time top says: > > Mem: 14M Active, 1944K Inact, 28M Wired, 436K Cache, 48M Buf, 331M Free > Swap: 368M Total, 17M Used, 352M Free, 4% Inuse > > After 1 minute of "EXPLAIN ANALYZE SELECT SUM(showcalc('B00204', dd, > r020, t071)) FROM v_file02wide WHERE a011 = 3 AND inrepdate(data) AND > b030 IN (SELECT b030 FROM dov_bank WHERE dov_bank_box_22(box) IN ('NL', > 'NM')) AND r030 = 980;" executing: > > Mem: 64M Active, 17M Inact, 72M Wired, 436K Cache, 48M Buf, 221M Free > Swap: 368M Total, 3192K Used, 365M Free > > PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU > COMMAND 59063 postgres 49 0 65560K 55492K RUN 1:06 94.93% 94.63% > postgres > > After 12 minutes of query executing: > > Mem: 71M Active, 17M Inact, 72M Wired, 436K Cache, 48M Buf, 214M Free > Swap: 368M Total, 3192K Used, 365M Free > > PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU > COMMAND 59063 postgres 56 0 73752K 62996K RUN 12:01 99.02% 99.02% > postgres > > I suspect that swap-file size is too small for my query... but query > isn't too large, about 8K rows only. :-| Looks fine - PG isn't growing too large and your swap usage seems steady. We can try upping the sort memory later, but given the amount of data you're dealing with I'd guess 64MB should be fine. I think we're going to have to break the query down a little and see where the issue is. What's the situation with: EXPLAIN ANALYZE SELECT FROM v_file02wide WHERE a011 = 3 AND inrepdate(data) AND b030 IN (SELECT b030 FROM dov_bank WHERE dov_bank_box_22(box) IN ('NL', 'NM')) AND r030 = 980; and: EXPLAIN ANALYZE SELECT SUM(showcalc()) FROM Hopefully one of these will run in a reasonable time, and the other will not. Then we can examine the slow query in more detail. Nothing from your previous EXPLAIN (email of yesterday 13:42) looks unreasonable but something must be going wild in the heart of the query, otherwise you wouldn't be here. -- Richard Huxton Archonet Ltd From pgsql-performance-owner@postgresql.org Thu Aug 7 12:05: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 27A24D1C4DB for ; Thu, 7 Aug 2003 15:04:56 +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 88335-09 for ; Thu, 7 Aug 2003 12:03:30 -0300 (ADT) Received: from mercury.elitra.com (unknown [12.35.196.84]) by svr1.postgresql.org (Postfix) with ESMTP id DED36D1C4EC for ; Thu, 7 Aug 2003 12:04:44 -0300 (ADT) Received: from moebius.elitra.com ([192.168.201.111]) by mercury.elitra.com with Microsoft SMTPSVC(5.5.1877.197.19); Thu, 7 Aug 2003 08:10:56 -0700 Date: Thu, 7 Aug 2003 11:04:40 -0400 (EDT) From: Sebastien Lemieux To: Tom Lane Cc: Postgresql-performance Subject: Re: How to efficiently duplicate a whole schema? In-Reply-To: <9140.1060206456@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/134 X-Sequence-Number: 2951 > >> The idea here is to make sure that the planner's statistics reflect the > >> "full" state of the table, not the "empty" state. Otherwise it may pick > >> plans for the foreign key checks that are optimized for small tables. > > > I added the 'analyze' but without any noticable gain in speed. I can't > > use 'truncate' since I need to 'set constraints all deferred'. > > What are you using, exactly? What I want to do: let t be the list of tables for t in tables: delete from db_dev.t; for t in tables: insert into db_dev.t (...) select ... from db.t; Some of my foreign keys are creating references loops in my schema, thus there is no correct order to do the deletes and inserts so that the constraints are satisfied at all time. I have to enclose those two loops in a 'set constraints all deferred' to avoid complaints from the constraints. I tried dropping the indexes first, doing the transfer and recreating the indexes: no gain. So computing the indexes doesn't take significant time. I then tried removing all the foreign keys constraints, replacing delete by truncate and it now runs in about 25 seconds. Downside is that I lose the foreign keys integrity verification, but because of this reference loop in my schema it has caused me more problem than it has avoided until now. So I can live with that! Thanks all! -- Sebastien Lemieux Bioinformatics, post-doc Elitra-canada From pgsql-performance-owner@postgresql.org Thu Aug 7 13:41:12 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 56B8AD1C4BC for ; Thu, 7 Aug 2003 16:29: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 99386-02 for ; Thu, 7 Aug 2003 13:28:22 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 27171D1C4EB for ; Thu, 7 Aug 2003 13:29:36 -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 h77GT1bS007841; Thu, 7 Aug 2003 10:29:01 -0600 (MDT) Date: Thu, 7 Aug 2003 10:15:20 -0600 (MDT) From: "scott.marlowe" To: Yaroslav Mazurak Cc: Subject: Re: PostgreSQL performance problem -> tuning In-Reply-To: <3F31FA33.1050009@lviv.bank.gov.ua> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/137 X-Sequence-Number: 2954 On Thu, 7 Aug 2003, Yaroslav Mazurak wrote: > Hi All! > > > Richard Huxton wrote: > > >>>On Wednesday 06 August 2003 08:34, Yaroslav Mazurak wrote: > > >>>>sort_mem = 131072 > > >>>This sort_mem value is *very* large - that's 131MB for *each sort* that > > It's not TOO large *for PostgreSQL*. When I'm inserting a large amount > of data into tables, sort_mem helps. Value of 192M speeds up inserting > significantly (verified :))! If I remember right, this is on a PII-400 with 384 Megs of RAM. On a machine that small, 128Meg is probably too big for ensuring there are no swap storms. Once you force the box to swap you loose. > >>>>effective_cache_size = 65536 > > >>>So you typically get about 256MB cache usage in top/free? > > >> No, top shows 12-20Mb. > >> I'm reduced effective_cache_size to 4K blocks (16M?). > > > Cache size is in blocks of 8KB (usually) - it's a way of telling PG what > > the chances are of disk blocks being already cached by Linux. > > PostgreSQL is running on FreeBSD, memory block actually is 4Kb, but in > most cases documentation says about 8Kb... I don't know exactly about > real disk block size, but suspect that it's 4Kb. :) FYI effective cache size and shared_buffers are both measured in Postgresql sized blocks, which default to 8k but can be changed upon compile. So, effective_cache size for a machine that shows 128 Meg kernel cache and 20 meg buffers would be (138*2^20)/(8*2^10) -> (138*2^10)/8 -> 17664. > I'm afraid that this may be too long. :-((( > Yesterday I'm re-execute my query with all changes... after 700 (!) > minutes query failed with: "ERROR: Memory exhausted in AllocSetAlloc(104)". > I don't understand: result is actually 8K rows long only, but > PostgreSQL failed! Why?!! Function showcalc is recursive, but in my > query used with level 1 depth only (I know exactly). > Again: I think that this is PostgreSQL's lack of quality memory > management. :-( Can you run top while this is happening and see postgresql's memory usage climb or df the disks to see if they're filling up? could be swap is filling even. How much swap space do you have allocated, by the way? Also, you have to restart postgresql to get the changes to postgresql.conf to take effect. Just in case you haven't. Do a show all; in psql to see if the settings are what they should be. From pgsql-performance-owner@postgresql.org Thu Aug 7 13:35: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 44FC7D1C4DB for ; Thu, 7 Aug 2003 16:35:03 +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 95684-08 for ; Thu, 7 Aug 2003 13:33:38 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 1BF71D1C48E for ; Thu, 7 Aug 2003 13:34:52 -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 h77GY7bS008241; Thu, 7 Aug 2003 10:34:07 -0600 (MDT) Date: Thu, 7 Aug 2003 10:20:26 -0600 (MDT) From: "scott.marlowe" To: Yaroslav Mazurak Cc: Subject: Re: PostgreSQL performance problem -> tuning In-Reply-To: <3F320CB1.7040000@lviv.bank.gov.ua> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/135 X-Sequence-Number: 2952 On Thu, 7 Aug 2003, Yaroslav Mazurak wrote: > Hi All! > > Shridhar Daithankar wrote: > > > On 7 Aug 2003 at 10:05, Yaroslav Mazurak wrote: > > >>>It needs to reflect how much cache the system is using - try the "free" > >>>command to see figures. > > >> I'm not found "free" utility on FreeBSD 4.7. :( > > > > > Grr.. I don't like freeBSD for it's top output.Active/inactive/Wired.. Grr.. > > why can't it be shared buffered and cached? Same goes for HP-UX top. Looking at > > it one gets hardly any real information.. Anyway that's just me.. > > > > Grr... I don't like PostgreSQL for it's memory usage parameters. In > Sybase ASA, I say for example: "use 64Mb RAM for cache". I don't worry > about data in this cache - this may be queries, sort areas, results etc. > I think that server know better about it's memory requirements. I know > that Sybase *use*, and use *only this* memory and don't trap with > "Memory exhausted" error. > I'm not remember 700 minutes queries (more complex that my query), > following with "memory exhausted" error, on Sybase. > Advertising, he? :( > > > Top on freeBSD seems pretty unintuituive em but if you find any documentation > > on that, that would help you. (Haven't booted in freeBSD in ages so no data > > out of my head..) > > > You can try various sysctls on freeBSD. Basicalyl idea is to find out how much > > of memory is used and how much is cached. FreeBSD must be providing that one in > > some form.. > > > IIRC there is a limit on filesystem cache on freeBSD. 300MB by default. If that > > is the case, you might have to raise it to make effective_cache_size really > > effective.. > > "Try various sysctls" says nothing for me. I want use *all available > RAM* (of course, without needed for OS use) for PostgreSQL. That's a nice theory, but it doesn't work out that way. About every two months someone shows up wanting postgresql to use all the memory in their box for caching and we wind up explaining that the kernel is better at caching than postgresql is, and how it's better not to push the usage of the memory right up to the limit. The reason you don't want to use every bit for postgresql is that, if you use add load after that you may make the machine start to swap out and slow down considerably. My guess is that this is exactly what's happening to you, you're using so much memory that the machine is running out and slowing down. Drop shared_buffers to 1000 to 4000, sort_mem to 8192 and start over from there. Then, increase them each one at a time until there's no increase in speed, or stop if it starts getting slower and back off. bigger is NOT always better. From pgsql-performance-owner@postgresql.org Thu Aug 7 13:37:45 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 548C0D1C4EE for ; Thu, 7 Aug 2003 16:31:19 +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 96580-04 for ; Thu, 7 Aug 2003 13:29:53 -0300 (ADT) Received: from fw.wubn.net (unknown [213.156.64.226]) by svr1.postgresql.org (Postfix) with ESMTP id 9E422D1C4DB for ; Thu, 7 Aug 2003 13:31:04 -0300 (ADT) Received: from (172.24.4.34) by fw.wubn.net (8.12.9/8.11.3) with ESMTP id h77GV1Pt065773 for ; Thu, 7 Aug 2003 19:31:03 +0300 (EEST) (envelope-from yamazurak@Lviv.Bank.Gov.UA) Received: from (172.24.4.57) by MTA (8.11.5/8.11.2) with ESMTP id h77GV1f18261 for ; Thu, 7 Aug 2003 19:31:01 +0300 Message-ID: <3F327EB9.5020707@lviv.bank.gov.ua> Date: Thu, 07 Aug 2003 19:30:49 +0300 From: Yaroslav Mazurak Organization: National Bank of Ukraine Lviv OU User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: uk, ru, en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning References: <49274.192.168.1.32.1060184304.squirrel@mainbox.archonet.com> <3F324F18.6307.4A8BB7A@localhost> <3F320CB1.7040000@lviv.bank.gov.ua> <200308071552.48868.dev@archonet.com> In-Reply-To: <200308071552.48868.dev@archonet.com> 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: 200308/136 X-Sequence-Number: 2953 Hi All! First, thanks for answers! Richard Huxton wrote: > On Thursday 07 August 2003 09:24, Yaroslav Mazurak wrote: >>>IIRC there is a limit on filesystem cache on freeBSD. 300MB by default. >>>If that is the case, you might have to raise it to make >>>effective_cache_size really effective.. >> "Try various sysctls" says nothing for me. I want use *all available >>RAM* (of course, without needed for OS use) for PostgreSQL. > PG will be using the OS' disk caching. I think all applications using OS disk caching. ;) Or you want to say that PostgreSQL tuned for using OS-specific cache implementation? Do you know method for examining real size of OS filesystem cache? If I understood right, PostgreSQL dynamically use all available RAM minus shared_buffers minus k * sort_mem minus effective_cache_size? I want configure PostgreSQL for using _maximum_ of available RAM. > Looks fine - PG isn't growing too large and your swap usage seems steady. We > can try upping the sort memory later, but given the amount of data you're > dealing with I'd guess 64MB should be fine. > I think we're going to have to break the query down a little and see where the > issue is. > What's the situation with: > EXPLAIN ANALYZE SELECT FROM v_file02wide WHERE a011 = 3 AND > inrepdate(data) AND b030 IN (SELECT b030 FROM dov_bank WHERE > dov_bank_box_22(box) IN ('NL', 'NM')) AND r030 = 980; > and: > EXPLAIN ANALYZE SELECT SUM(showcalc()) FROM > Hopefully one of these will run in a reasonable time, and the other will not. > Then we can examine the slow query in more detail. Nothing from your previous > EXPLAIN (email of yesterday 13:42) looks unreasonable but something must be > going wild in the heart of the query, otherwise you wouldn't be here. Yes, you're right. I've tested a few statements and obtain interesting results. SELECT * FROM v_file02wide WHERE... executes about 34 seconds. SELECT showcalc(...); executes from 0.7 seconds (without recursion) up to 6.3 seconds if recursion is used! :( This mean, that approximate execute time for fully qualified SELECT with about 8K rows is... about 13 hours! :-O Hence, problem is in my function showcalc: CREATE OR REPLACE FUNCTION showcalc(VARCHAR(10), VARCHAR(2), VARCHAR(4), NUMERIC(16)) RETURNS NUMERIC(16) LANGUAGE SQL STABLE AS ' -- Parameters: code, dd, r020, t071 SELECT COALESCE( (SELECT sc.koef * $4 FROM showing AS s NATURAL JOIN showcomp AS sc WHERE s.kod = $1 AND NOT SUBSTR(acc_mask, 1, 1) = ''['' AND SUBSTR(acc_mask, 1, 4) = $3 AND SUBSTR(acc_mask, 5, 1) = SUBSTR($2, 1, 1)), (SELECT SUM(sc.koef * COALESCE(showcalc(SUBSTR(acc_mask, 2, LENGTH(acc_mask) - 2), $2, $3, $4), 0)) FROM showing AS s NATURAL JOIN showcomp AS sc WHERE s.kod = $1 AND SUBSTR(acc_mask, 1, 1) = ''[''), 0) AS showing; '; BTW, cross join "," with WHERE clause don't improve performance relative to NATURAL JOIN. Additionally, with user-defined function beginchar (SUBSTR(..., 1, 1)), used for indexing, showcalc executes about 16 seconds. With function SUBSTR the same showcalc executes 6 seconds. Table showing contain information about showing: showing id (id_show), code (kod) and description (opys). Table showcomp contain information about showing components (accounts): showing id (id_show), coefficient (koef) and account_mask (acc_mask). Account mask is 4-char balance account mask || 1-char account characteristics or another showing in square bracket. Example: showing =========+==========+=========== id_show | kod | opys =========+==========+=========== 1 | 'A00101' | 'Received' 2 | 'A00102' | 'Sent' 3 | 'A00103' | 'Total' =========+==========+=========== showcomp =========+======+=========== id_show | koef | acc_mask =========+======+=========== 1 | 1.0 | '60102' 1 | 1.0 | '60112' 2 | 1.0 | '70011' 2 | 1.0 | '70021' 3 | 1.0 | '[A00101]' 3 | -1.0 | '[A00102]' =========+======+=========== This mean that: A00101 includes accounts 6010 and 6011 with characteristics 2, A00102 includes accounts 7001 and 7002 with characteristics 1, and A00103 = A00102 - A00101. In almost all cases recursion depth not exceed 1 level, but I'm not sure. :) View v_file02wide contain account (r020) and 2-char characteristics (dd). Using showcalc I want to sum numbers (t071) on accounts included in appropriate showings. I.e SELECT SUM(showcalc('A00101', dd, r020, t071)) FROM ... must return sum on accounts 6010 and 6011 with characteristics 2 etc. Now I think about change function showcalc or/and this data structures... :) Anyway, 600Mb is too low for PostgreSQL for executing my query - DBMS raise error after 11.5 hours (of estimated 13?). :( With best regards Yaroslav Mazurak. From pgsql-performance-owner@postgresql.org Thu Aug 7 14:04:39 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 7919ED1C4E3 for ; Thu, 7 Aug 2003 17:04:37 +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 01955-01 for ; Thu, 7 Aug 2003 14:03:12 -0300 (ADT) Received: from fw.wubn.net (unknown [213.156.64.226]) by svr1.postgresql.org (Postfix) with ESMTP id B7126D1C4EB for ; Thu, 7 Aug 2003 14:04:23 -0300 (ADT) Received: from (172.24.4.34) by fw.wubn.net (8.12.9/8.11.3) with ESMTP id h77H4GPt067030 for ; Thu, 7 Aug 2003 20:04:20 +0300 (EEST) (envelope-from yamazurak@Lviv.Bank.Gov.UA) Received: from (172.24.4.57) by MTA (8.11.5/8.11.2) with ESMTP id h77H4Ff18920 for ; Thu, 7 Aug 2003 20:04:15 +0300 Message-ID: <3F328683.7050008@lviv.bank.gov.ua> Date: Thu, 07 Aug 2003 20:04:03 +0300 From: Yaroslav Mazurak Organization: National Bank of Ukraine Lviv OU User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: uk, ru, en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning 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: 200308/138 X-Sequence-Number: 2955 scott.marlowe wrote: > On Thu, 7 Aug 2003, Yaroslav Mazurak wrote: >>Shridhar Daithankar wrote: > That's a nice theory, but it doesn't work out that way. About every two > months someone shows up wanting postgresql to use all the memory in their > box for caching and we wind up explaining that the kernel is better at > caching than postgresql is, and how it's better not to push the usage of > the memory right up to the limit. I'm reading this mailing list just few days. :))) > The reason you don't want to use every bit for postgresql is that, if you > use add load after that you may make the machine start to swap out and > slow down considerably. What kind of load? PostgreSQL or another? I say that for this PC primary task and critical goal is DBMS and it's performance. > My guess is that this is exactly what's happening to you, you're using so > much memory that the machine is running out and slowing down. > Drop shared_buffers to 1000 to 4000, sort_mem to 8192 and start over from > there. Then, increase them each one at a time until there's no increase > in speed, or stop if it starts getting slower and back off. > bigger is NOT always better. Let I want to use all available RAM with PostgreSQL. Without executing query (PostgreSQL is running) top say now: Mem: 71M Active, 23M Inact, 72M Wired, 436K Cache, 48M Buf, 208M Free Swap: 368M Total, 2852K Used, 366M Free It's right that I can figure that I can use 384M (total RAM) - 72M (wired) - 48M (buf) = 264M for PostgreSQL. Hence, if I set effective_cache_size to 24M (3072 8K blocks), reasonable value (less than 240M, say 48M) for sort_mem, some value for shared_buffers (i.e. 24M, or 6144 4K blocks (FreeBSD), or 3072 8K blocks (PostgreSQL)), and rest of RAM 264M (total free with OS cache) - 24M (reserved for OS cache) - 48M (sort) - 24M (shared) = 168M PostgreSQL allocate dynamically by himself? With best regards Yaroslav Mazurak. From pgadmin-hackers-owner@postgresql.org Thu Aug 7 15:47:07 2003 X-Original-To: pgadmin-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5A5C7D1C914; Thu, 7 Aug 2003 18:12: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 11026-06; Thu, 7 Aug 2003 15:11:05 -0300 (ADT) Received: from news.hub.org (news.hub.org [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 6B67BD1C50B; Thu, 7 Aug 2003 15:12:19 -0300 (ADT) Received: from news.hub.org (news.hub.org [64.117.224.194]) by news.hub.org (8.12.9/8.12.9) with ESMTP id h77ICI1u039492; Thu, 7 Aug 2003 18:12:19 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h77Hninm030372; Thu, 7 Aug 2003 17:49:44 GMT From: "Marc G. Fournier" X-Newsgroups: comp.databases.postgresql.general Subject: Testing gateway Date: Thu, 7 Aug 2003 17:49:43 +0000 (UTC) Organization: Hub.Org Networking Services Lines: 3 Message-ID: X-Complaints-To: usenet@news.hub.org User-Agent: tin/1.6.0-20030714 ("Vatersay") (UNIX) (FreeBSD/4.8-STABLE (i386)) To: "pgadmin-devteam@postgresql.org.pgadmin-hackers@postgresql.org.pgadmin-support@postgresql.org.pgsql-admin@postgresql.org.pgsql-advocacy@postgresql.org.pgsql-announce@postgresql.org.pgsql-benchmarks@postgresql.org.pgsql-bugs@postgresql.org.pgsql-chat"@ X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=USER_AGENT X-Spam-Level: X-Archive-Number: 200308/87 X-Sequence-Number: 2355 In theory, the news2mail gateway is back in place ... From pgsql-performance-owner@postgresql.org Thu Aug 7 15:06:24 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2EC48D1C4BC for ; Thu, 7 Aug 2003 18:06: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 11031-05 for ; Thu, 7 Aug 2003 15:04:57 -0300 (ADT) Received: from wight.ymogen.net (unknown [217.27.240.153]) by svr1.postgresql.org (Postfix) with SMTP id 70043D1C488 for ; Thu, 7 Aug 2003 15:06:10 -0300 (ADT) Received: (qmail 25808 invoked from network); 7 Aug 2003 18:06:09 -0000 Received: from dsl-217-155-239-50.zen.co.uk (217.155.239.50) by wight.ymogen.net with SMTP; 7 Aug 2003 18:06:09 -0000 Subject: Re: PostgreSQL performance problem -> tuning From: matt To: Yaroslav Mazurak Cc: pgsql-performance@postgresql.org In-Reply-To: <3F328683.7050008@lviv.bank.gov.ua> References: <3F328683.7050008@lviv.bank.gov.ua> Content-Type: text/plain Organization: Message-Id: <1060279564.23083.164.camel@gibraltar.mattclark.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 07 Aug 2003 19:06:05 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/139 X-Sequence-Number: 2956 > Mem: 71M Active, 23M Inact, 72M Wired, 436K Cache, 48M Buf, 208M Free > Swap: 368M Total, 2852K Used, 366M Free > > It's right that I can figure that I can use 384M (total RAM) - 72M > (wired) - 48M (buf) = 264M for PostgreSQL. > Hence, if I set effective_cache_size to 24M (3072 8K blocks), > reasonable value (less than 240M, say 48M) for sort_mem, some value for > shared_buffers (i.e. 24M, or 6144 4K blocks (FreeBSD), or 3072 8K blocks > (PostgreSQL)), and rest of RAM 264M (total free with OS cache) - 24M > (reserved for OS cache) - 48M (sort) - 24M (shared) = 168M PostgreSQL > allocate dynamically by himself? Totally, utterly the wrong way around. Start with 384M, subtract whatever is in use by other processes, excepting kernel disk cache, subtract your PG shared buffers, subtract (PG proc size + PG sort mem)*(max number of PG processes you need to run - should be same as max_connections if thinking conservatively), leave some spare room so you can ssh in without swapping, and *the remainder* is what you should set effective_cache_size to. This is all in the docs. The key thing is: set effective_cache_size *last*. Note that Postgres assumes your OS is effective at caching disk blocks, so if that assumption is wrong you lose performance. Also, why on _earth_ would you need 48MB for sort memory? Are you seriously going to run a query that returns 48M of data and then sort it, on a machine with 384M of RAM? M From pgsql-performance-owner@postgresql.org Thu Aug 7 16:16: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 A5FC4D1C4E0 for ; Thu, 7 Aug 2003 19:06:52 +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 20865-01 for ; Thu, 7 Aug 2003 16:05:28 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 6261FD1C48E for ; Thu, 7 Aug 2003 16:06:41 -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 h77J5pbS020929; Thu, 7 Aug 2003 13:05:51 -0600 (MDT) Date: Thu, 7 Aug 2003 12:52:09 -0600 (MDT) From: "scott.marlowe" To: Yaroslav Mazurak Cc: Subject: Re: PostgreSQL performance problem -> tuning In-Reply-To: <3F328683.7050008@lviv.bank.gov.ua> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/143 X-Sequence-Number: 2960 On Thu, 7 Aug 2003, Yaroslav Mazurak wrote: > scott.marlowe wrote: > > > On Thu, 7 Aug 2003, Yaroslav Mazurak wrote: > > >>Shridhar Daithankar wrote: > > > That's a nice theory, but it doesn't work out that way. About every two > > months someone shows up wanting postgresql to use all the memory in their > > box for caching and we wind up explaining that the kernel is better at > > caching than postgresql is, and how it's better not to push the usage of > > the memory right up to the limit. > > I'm reading this mailing list just few days. :))) We all get started somewhere. Glad to have you on the list. > > The reason you don't want to use every bit for postgresql is that, if you > > use add load after that you may make the machine start to swap out and > > slow down considerably. > > What kind of load? PostgreSQL or another? I say that for this PC > primary task and critical goal is DBMS and it's performance. Just Postgresql. Imagine that you set up the machine with 64 Meg sort_mem setting, and it has only two or three users right now. If the number of users jumps up to 16 or 32, then it's quite possible that all those connections can each spawn a sort or two, and if they are large sorts, then poof, all your memory is gone and your box is swapping out like mad. > > My guess is that this is exactly what's happening to you, you're using so > > much memory that the machine is running out and slowing down. > > > Drop shared_buffers to 1000 to 4000, sort_mem to 8192 and start over from > > there. Then, increase them each one at a time until there's no increase > > in speed, or stop if it starts getting slower and back off. > > > bigger is NOT always better. > > Let I want to use all available RAM with PostgreSQL. > Without executing query (PostgreSQL is running) top say now: > > Mem: 71M Active, 23M Inact, 72M Wired, 436K Cache, 48M Buf, 208M Free > Swap: 368M Total, 2852K Used, 366M Free > > It's right that I can figure that I can use 384M (total RAM) - 72M > (wired) - 48M (buf) = 264M for PostgreSQL. > Hence, if I set effective_cache_size to 24M (3072 8K blocks), > reasonable value (less than 240M, say 48M) for sort_mem, some value for > shared_buffers (i.e. 24M, or 6144 4K blocks (FreeBSD), or 3072 8K blocks > (PostgreSQL)), and rest of RAM 264M (total free with OS cache) - 24M > (reserved for OS cache) - 48M (sort) - 24M (shared) = 168M PostgreSQL > allocate dynamically by himself? It's important to understand that effective_cache_size is simply a number that tells the query planner about how big the kernel cache is for postgresql. Note that in your top output, it shows 48 M buffer, and 208M free, and 436k cache. Adding those up comes to about 256 Megs of available cache to the OS. But that's assuming postgresql isn't gonna use some of that for sorts or buffers, so assuming some of the memory will get used for that, then it's likely that effective_cache_size will really be about 100 to 150 Meg. Like someone else said, you set effective cache size last. First set buffers to a few thousand (1000 to 5000 is usually a good number) and set sort_mem to 8 to 32 meg to start, and adjust it as you test the database under parallel load. Then, take the numbers you get for free/buffer/cache from top to figure out effective_cache_size. Again, I'll repeat what I said in an earlier post on this, the size of buffers and effective_cache_size are set in POSTGRESQL blocks. i.e. your kernel page block size is meaningless here. If you have 100 Meg left over, then you need to do the math as: 100*2^20 --------- 8*2^10 becomes 100*2^10 --------- 8 becomes 12800 (8k blocks.) Reading your other response I got the feeling you may have been under the impression that this is set in OS blocks, so I just wanted to make sure it was clear it's not. From pgsql-performance-owner@postgresql.org Thu Aug 7 16:13:03 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 87A57D1C4CA for ; Thu, 7 Aug 2003 18:59:24 +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 19075-05 for ; Thu, 7 Aug 2003 15:58:00 -0300 (ADT) Received: from lakemtao03.cox.net (lakemtao03.cox.net [68.1.17.242]) by svr1.postgresql.org (Postfix) with ESMTP id A092CD1C488 for ; Thu, 7 Aug 2003 15:59:13 -0300 (ADT) Received: from [192.168.1.1] ([68.11.66.83]) by lakemtao03.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030807185916.CFTY23518.lakemtao03.cox.net@[192.168.1.1]> for ; Thu, 7 Aug 2003 14:59:16 -0400 Subject: Re: PostgreSQL performance problem -> tuning From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <3F328683.7050008@lviv.bank.gov.ua> References: <3F328683.7050008@lviv.bank.gov.ua> Content-Type: text/plain Message-Id: <1060282754.12221.50.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 07 Aug 2003 13:59:14 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/142 X-Sequence-Number: 2959 On Thu, 2003-08-07 at 12:04, Yaroslav Mazurak wrote: > scott.marlowe wrote: > > > On Thu, 7 Aug 2003, Yaroslav Mazurak wrote: > > >>Shridhar Daithankar wrote: > [snip] > > My guess is that this is exactly what's happening to you, you're using so > > much memory that the machine is running out and slowing down. > > > Drop shared_buffers to 1000 to 4000, sort_mem to 8192 and start over from > > there. Then, increase them each one at a time until there's no increase > > in speed, or stop if it starts getting slower and back off. > > > bigger is NOT always better. > > Let I want to use all available RAM with PostgreSQL. > Without executing query (PostgreSQL is running) top say now: You're missing the point. PostgreSQL is not designed like Oracle, Sybase, etc. They say, "Give me all the RAM; I will cache everything myself." PostgreSQL says "The kernel programmers have worked very hard on disk caching. Why should I duplicate their efforts?" Thus, give PG only a "little" RAM, and let the OS' disk cache hold the rest. -- +---------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "Man, I'm pretty. Hoo Hah!" | | Johnny Bravo | +---------------------------------------------------------------+ From pgsql-performance-owner@postgresql.org Thu Aug 7 16:12:19 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 8668ED1C4B7 for ; Thu, 7 Aug 2003 19:07:04 +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 19853-02 for ; Thu, 7 Aug 2003 16:05:40 -0300 (ADT) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by svr1.postgresql.org (Postfix) with ESMTP id 12292D1C4E1 for ; Thu, 7 Aug 2003 16:06:53 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-32.mail.demon.net with esmtp (Exim 3.35 #1) id 19kq68-000JFn-0W; Thu, 07 Aug 2003 20:06:52 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 681EB161EB; Thu, 7 Aug 2003 20:06:51 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id C45CD15917; Thu, 7 Aug 2003 20:06:50 +0100 (BST) From: Richard Huxton To: Yaroslav Mazurak , pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning Date: Thu, 7 Aug 2003 20:06:34 +0100 User-Agent: KMail/1.5 References: <49274.192.168.1.32.1060184304.squirrel@mainbox.archonet.com> <200308071552.48868.dev@archonet.com> <3F327EB9.5020707@lviv.bank.gov.ua> In-Reply-To: <3F327EB9.5020707@lviv.bank.gov.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308072006.35087.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/141 X-Sequence-Number: 2958 On Thursday 07 August 2003 17:30, Yaroslav Mazurak wrote: > Hi All! > > > First, thanks for answers! > > Richard Huxton wrote: > > On Thursday 07 August 2003 09:24, Yaroslav Mazurak wrote: > >>>IIRC there is a limit on filesystem cache on freeBSD. 300MB by default. > >>>If that is the case, you might have to raise it to make > >>>effective_cache_size really effective.. > >> > >> "Try various sysctls" says nothing for me. I want use *all available > >>RAM* (of course, without needed for OS use) for PostgreSQL. > > > > PG will be using the OS' disk caching. > > I think all applications using OS disk caching. ;) > Or you want to say that PostgreSQL tuned for using OS-specific cache > implementation? > Do you know method for examining real size of OS filesystem cache? If I > understood right, PostgreSQL dynamically use all available RAM minus > shared_buffers minus k * sort_mem minus effective_cache_size? > I want configure PostgreSQL for using _maximum_ of available RAM. PG's memory use can be split into four areas (note - I'm not a developer so this could be wrong). 1. Shared memory - vital so that different connections can communicate with each other. Shouldn't be too large, otherwise PG spends too long managing its shared memory rather than working on your queries. 2. Sort memory - If you have to sort results during a query it will use up to the amount you define in sort_mem and then use disk if it needs any more. This is for each sort. 3. Results memory - If you're returning 8000 rows then PG will assemble these and send them to the client which also needs space to store the 8000 rows. 4. Working memory - to actually run the queries - stack and heap space to keep track of its calculations etc. Your best bet is to start off with some smallish reasonable values and step them up gradually until you don't see any improvement. What is vital is that the OS can cache enough disk-space to keep all your commonly used tables and indexes in memory - if it can't then you'll see performance drop rapidly as PG has to keep accessing the disk. For the moment, I'd leave the settings roughly where they are while we look at the query, then once that's out of the way we can fine-tune the settings. [snip suggestion to break the query down] > Yes, you're right. I've tested a few statements and obtain interesting > results. > SELECT * FROM v_file02wide WHERE... executes about 34 seconds. > SELECT showcalc(...); executes from 0.7 seconds (without recursion) up > to 6.3 seconds if recursion is used! :( > This mean, that approximate execute time for fully qualified SELECT > with about 8K rows is... about 13 hours! :-O Hmm - not good. > Hence, problem is in my function showcalc: That's certainly the place to start, although we might be able to do something with v_file02wide later. > CREATE OR REPLACE FUNCTION showcalc(VARCHAR(10), VARCHAR(2), VARCHAR(4), > NUMERIC(16)) RETURNS NUMERIC(16) > LANGUAGE SQL STABLE AS ' > -- Parameters: code, dd, r020, t071 > SELECT COALESCE( > (SELECT sc.koef * $4 > FROM showing AS s NATURAL JOIN showcomp AS sc > WHERE s.kod = $1 > AND NOT SUBSTR(acc_mask, 1, 1) = ''['' > AND SUBSTR(acc_mask, 1, 4) = $3 > AND SUBSTR(acc_mask, 5, 1) = SUBSTR($2, 1, 1)), > (SELECT SUM(sc.koef * COALESCE(showcalc(SUBSTR(acc_mask, 2, > LENGTH(acc_mask) - 2), $2, $3, $4), 0)) > FROM showing AS s NATURAL JOIN showcomp AS sc > WHERE s.kod = $1 > AND SUBSTR(acc_mask, 1, 1) = ''[''), > 0) AS showing; > '; > > BTW, cross join "," with WHERE clause don't improve performance > relative to NATURAL JOIN. > Additionally, with user-defined function beginchar (SUBSTR(..., 1, 1)), > used for indexing, showcalc executes about 16 seconds. With function > SUBSTR the same showcalc executes 6 seconds. Fair enough - substr should be fairly efficient. [snip explanation of table structures and usage] I'm not going to claim I understood everything in your explanation, but there are a couple of things I can suggest. However, before you go and do any of that, can I ask you to post an EXPLAIN ANALYSE of two calls to your showcalc() function (once for a simple account, once for one with recursion)? You'll need to cut and paste the query as standard SQL since the explain won't look inside the function body. OK - bear in mind that these suggestions are made without the benefit of the explain analyse: 1. You could try splitting out the various tags of your mask into different fields - that will instantly eliminate all the substr() calls and might make a difference. If you want to keep the mask for display purposes, we could build a trigger to keep it in sync with the separate flags. 2. Use a "calculations" table and build your results step by step. So - calculate all the simple accounts, then calculate the ones that contain the simple accounts. 3. You could keep a separate "account_contains" table that might look like: acc_id | contains A001 | A001 A002 | A002 A003 | A003 A003 | A001 A004 | A004 A004 | A003 A004 | A001 So here A001/A002 are simple accounts but A003 contains A001 too. A004 contains A003 and A001. The table can be kept up to date automatically using some triggers. This should make it simple to pick up all the accounts contained within the target account and might mean you can eliminate the recursion. > Now I think about change function showcalc or/and this data > structures... :) Post the EXPLAIN ANALYSE first - maybe someone smarter than me will have an idea. > Anyway, 600Mb is too low for PostgreSQL for executing my query - DBMS > raise error after 11.5 hours (of estimated 13?). :( I think the problem is the 13 hours, not the 600MB. Once we've got the query running in a reasonable length of time (seconds) then the memory requirements will go down, I'm sure. -- Richard Huxton Archonet Ltd From pgsql-performance-owner@postgresql.org Thu Aug 7 17:24:39 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 AC510D1C48E for ; Thu, 7 Aug 2003 20:24:36 +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 24371-07 for ; Thu, 7 Aug 2003 17:23:12 -0300 (ADT) Received: from perrin.int.nxad.com (internal.ext.nxad.com [69.1.70.251]) by svr1.postgresql.org (Postfix) with ESMTP id 60F19D1C4E1 for ; Thu, 7 Aug 2003 17:24:25 -0300 (ADT) Received: by perrin.int.nxad.com (Postfix, from userid 1001) id 7B04F2105E; Thu, 7 Aug 2003 13:24:26 -0700 (PDT) Date: Thu, 7 Aug 2003 13:24:26 -0700 From: Sean Chittenden To: Manfred Koizar Cc: pgsql-performance@postgresql.org Subject: Re: Moving postgresql.conf tunables into 2003... Message-ID: <20030807202426.GI94710@perrin.int.nxad.com> References: <20030703190502.GR72567@perrin.int.nxad.com> <2422.1057264735@sss.pgh.pa.us> <20030704000646.GV72567@perrin.int.nxad.com> <4nfiiv850cu7vkp39tv7mk2b3pniim8ccu@4ax.com> <20030805222609.GF94710@perrin.int.nxad.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/144 X-Sequence-Number: 2961 > >> I have an experimental patch lying around somewhere that tries to > >> work around these problems by offering different estimation methods > >> for index scans. If you are interested, I'll dig it out. > > > >Sure, I'll take a gander... had my head in enough Knuth recently to > >even hopefully have some kind of a useful response to the patch. > > Sean, the patch is at http://www.pivot.at/pg/16-correlation-732.diff. > A short description of its usage can be found at > http://archives.postgresql.org/pgsql-performance/2002-11/msg00256.php. > If you are interested how the different interpolation methods work, > read the source - it shouldn't be too hard to find. > > You might also want to read the thread starting at > http://archives.postgresql.org/pgsql-hackers/2002-10/msg00072.php. Hrm... let me bop back in my archives and reply there... very interesting work though. I hope a reasonable algorythm can be found in time for 7.5, or even 7.4 as this seems to be biting many people and the current algo is clearly not right. > >> does this mean that sensorid, evtime, and action are not > >> independent? > > > >Hrm... sensorid is sequence and grows proportional with evtime, > >obviously. > > So a *low* sensorid (7) is quite uncommon for a *late* evtime? This > would help understand the problem. Unfortunately I have no clue what > to do about it. :-( Correct. > >Having spent a fair amount of time looking at the two following plans, > >it seems as though an additional statistic is needed to change the > >cost of doing an index lookup when the index is linearly ordered. > > I'm not sure I understand what you mean by "index is linearly > ordered", but I guess correlation is that statistic you are talking > about. However, it is calculated per column, not per index. If two rows are id's 123456 and 123457, what are the odds that the tuples are going to be on the same page? ie, if 123456 is read, is 123457 already in the OS or PostgreSQL's disk cache? > >Whether CLUSTER does this or not, I don't know, > > If you CLUSTER on an index and then ANALYSE, you get a correlation of > 1.0 (== optimum) for the first column of the index. Correlating of what to what? Of data to nearby data? Of data to related data (ie, multi-column index?)? Of related data to pages on disk? Not 100% sure in what context you're using the word correlation... But that value will degrade after time and at what rate? Does ANALYZE maintain that value so that it's kept acurrate? The ANALYZE page was lacking in terms of implementation details in terms of how many rows ANALYZE actually scans on big tables, which could dramatically affect the correlation of a table after time if ANALYZE is maintaining the correlation for a column. > > I never heard back from him after getting the runtime down to a > > few ms. :-/ > > Pity! I'd have liked to see EXPLAIN ANALYSE for > > SELECT * > FROM mss_fwevent > WHERE sensorid = 7 > AND evtime > (now() - '6 hours'::INTERVAL) > AND NOT action; > > SELECT * > FROM mss_fwevent > WHERE sensorid = 7 > AND evtime > (now() - '6 hours'::INTERVAL); > > SELECT * > FROM mss_fwevent > WHERE evtime > (now() - '6 hours'::INTERVAL); > > SELECT * > FROM mss_fwevent > WHERE sensorid = 7; ditto > > Are indexes > >on linearly ordered data rebalanced somehow? I thought CLUSTER only > >reordered data on disk. -sc > > AFAIK CLUSTER re-creates all indices belonging to the table. As of 7.3 or 7.4, yes. -sc -- Sean Chittenden From pgsql-performance-owner@postgresql.org Thu Aug 7 18:16:03 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 7FAA8D1C914 for ; Thu, 7 Aug 2003 21:16: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 29820-03 for ; Thu, 7 Aug 2003 18:14:37 -0300 (ADT) Received: from mail-1.zoominternet.net (mail-1.zoominternet.net [63.67.120.5]) by svr1.postgresql.org (Postfix) with SMTP id DE523D1C7F4 for ; Thu, 7 Aug 2003 18:15:49 -0300 (ADT) Received: (qmail 12860 invoked from network); 7 Aug 2003 21:15:51 -0000 Received: from acs-24-154-209-142.zoominternet.net (HELO gmod.lajolla) ([24.154.209.142]) (envelope-sender ) by mail-1.zoominternet.net (qmail-ldap-1.03) with SMTP for ; 7 Aug 2003 21:15:51 -0000 Subject: Re: EXTERNAL storage and substring on long strings From: Scott Cain To: Tom Lane Cc: Joe Conway , pgsql-performance@postgresql.org In-Reply-To: <8177.1060204101@sss.pgh.pa.us> References: <1059679600.1429.41.camel@localhost.localdomain> <7896.1060202191@sss.pgh.pa.us> <3F316A41.6020403@joeconway.com> <8177.1060204101@sss.pgh.pa.us> Content-Type: text/plain Organization: Cold Spring Harbor Lab Message-Id: <1060290951.6795.38.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 07 Aug 2003 17:15:51 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/145 X-Sequence-Number: 2962 > snipped much discussion about EXTERNAL storage and substring speed Joe and Tom, Thanks for all of your help; I went back to my (nearly) production database, and executed the `update feature set residues = residues ||'';` and then redid my benchmark. Here's a summary of the results: substr in perl 0.83sec/op substring on default text column 0.24sec/op substring on EXTERNAL column 0.0069sec/op There's that 2 orders of magnitude improvement I was looking for! Thanks again, Scott -- ------------------------------------------------------------------------ Scott Cain, Ph. D. cain@cshl.org GMOD Coordinator (http://www.gmod.org/) 216-392-3087 Cold Spring Harbor Laboratory From pgsql-performance-owner@postgresql.org Thu Aug 7 20:32: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 075CED1C514 for ; Thu, 7 Aug 2003 23:32: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 44692-03 for ; Thu, 7 Aug 2003 20:30:45 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id EEFB5D1C488 for ; Thu, 7 Aug 2003 20:31:56 -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 h77NVqSa009731; Thu, 7 Aug 2003 19:31:52 -0400 (EDT) To: Sean Chittenden Cc: Manfred Koizar , pgsql-performance@postgresql.org Subject: Re: Moving postgresql.conf tunables into 2003... In-reply-to: <20030807202426.GI94710@perrin.int.nxad.com> References: <20030703190502.GR72567@perrin.int.nxad.com> <2422.1057264735@sss.pgh.pa.us> <20030704000646.GV72567@perrin.int.nxad.com> <4nfiiv850cu7vkp39tv7mk2b3pniim8ccu@4ax.com> <20030805222609.GF94710@perrin.int.nxad.com> <20030807202426.GI94710@perrin.int.nxad.com> Comments: In-reply-to Sean Chittenden message dated "Thu, 07 Aug 2003 13:24:26 -0700" Date: Thu, 07 Aug 2003 19:31:52 -0400 Message-ID: <9730.1060299112@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/146 X-Sequence-Number: 2963 Sean Chittenden writes: >> If you CLUSTER on an index and then ANALYSE, you get a correlation of >> 1.0 (== optimum) for the first column of the index. > Correlating of what to what? Of data to nearby data? Of data to > related data (ie, multi-column index?)? Of related data to pages on > disk? Not 100% sure in what context you're using the word > correlation... The correlation is between index order and heap order --- that is, are the tuples in the table physically in the same order as the index? The better the correlation, the fewer heap-page reads it will take to do an index scan. Note it is possible to measure correlation without regard to whether there actually is any index; ANALYZE is simply looking to see whether the values appear in increasing order according to the datatype's default sort operator. One problem we have is extrapolating from the single-column correlation stats computed by ANALYZE to appropriate info for multi-column indexes. It might be that the only reasonable fix for this is for ANALYZE to compute multi-column stats too when multi-column indexes are present. People are used to the assumption that you don't need to re-ANALYZE after creating a new index, but maybe we'll have to give that up. > But that value will degrade after time and at what rate? Does ANALYZE > maintain that value so that it's kept acurrate? You keep it up to date by ANALYZE-ing at suitable intervals. It's no different from any other statistic. regards, tom lane From pgsql-performance-owner@postgresql.org Fri Aug 8 04:54:37 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 A105DD1C932 for ; Fri, 8 Aug 2003 07:54: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 91249-06 for ; Fri, 8 Aug 2003 04:53:03 -0300 (ADT) Received: from fw.wubn.net (unknown [213.156.64.226]) by svr1.postgresql.org (Postfix) with ESMTP id C04D8D1C513 for ; Fri, 8 Aug 2003 04:54:13 -0300 (ADT) Received: from (172.24.4.34) by fw.wubn.net (8.12.9/8.11.3) with ESMTP id h787s6Pt090657 for ; Fri, 8 Aug 2003 10:54:08 +0300 (EEST) (envelope-from yamazurak@Lviv.Bank.Gov.UA) Received: from (172.24.4.57) by MTA (8.11.5/8.11.2) with ESMTP id h787s6f01838 for ; Fri, 8 Aug 2003 10:54:06 +0300 Message-ID: <3F335715.109@lviv.bank.gov.ua> Date: Fri, 08 Aug 2003 10:53:57 +0300 From: Yaroslav Mazurak Organization: National Bank of Ukraine Lviv OU User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: uk, ru, en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance problem -> tuning References: <49274.192.168.1.32.1060184304.squirrel@mainbox.archonet.com> <200308071552.48868.dev@archonet.com> <3F327EB9.5020707@lviv.bank.gov.ua> <200308072006.35087.dev@archonet.com> In-Reply-To: <200308072006.35087.dev@archonet.com> 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: 200308/147 X-Sequence-Number: 2964 Hi, All! Richard Huxton wrote: > On Thursday 07 August 2003 17:30, Yaroslav Mazurak wrote: >>Richard Huxton wrote: >>>On Thursday 07 August 2003 09:24, Yaroslav Mazurak wrote: > PG's memory use can be split into four areas (note - I'm not a developer so > this could be wrong). > 1. Shared memory - vital so that different connections can communicate with > each other. Shouldn't be too large, otherwise PG spends too long managing its > shared memory rather than working on your queries. > 2. Sort memory - If you have to sort results during a query it will use up to > the amount you define in sort_mem and then use disk if it needs any more. > This is for each sort. > 3. Results memory - If you're returning 8000 rows then PG will assemble these > and send them to the client which also needs space to store the 8000 rows. > 4. Working memory - to actually run the queries - stack and heap space to keep > track of its calculations etc. Hence, total free RAM - shared_buffers - k * sort_mem - effective_cache_size == (results memory + working memory)? > For the moment, I'd leave the settings roughly where they are while we look at > the query, then once that's out of the way we can fine-tune the settings. OK. >> Additionally, with user-defined function beginchar (SUBSTR(..., 1, 1)), >>used for indexing, showcalc executes about 16 seconds. With function >>SUBSTR the same showcalc executes 6 seconds. > Fair enough - substr should be fairly efficient. Cost of user-defined SQL function call in PostgreSQL is high? > OK - bear in mind that these suggestions are made without the benefit of the > explain analyse: > 1. You could try splitting out the various tags of your mask into different > fields - that will instantly eliminate all the substr() calls and might make > a difference. If you want to keep the mask for display purposes, we could > build a trigger to keep it in sync with the separate flags. This will be next step. :) > 2. Use a "calculations" table and build your results step by step. So - > calculate all the simple accounts, then calculate the ones that contain the > simple accounts. I give to SQL to user and few helper functions. Therefore single step is required for building results. > 3. You could keep a separate "account_contains" table that might look like: > acc_id | contains > A001 | A001 > A002 | A002 > A003 | A003 > A003 | A001 > A004 | A004 > A004 | A003 > A004 | A001 > So here A001/A002 are simple accounts but A003 contains A001 too. A004 > contains A003 and A001. The table can be kept up to date automatically using > some triggers. > This should make it simple to pick up all the accounts contained within the > target account and might mean you can eliminate the recursion. Thanks, sounds not so bad, but I suspect that this method don't improve performance essentially. I think about another secondary table for showcomp (compshow :)) with showings "compiled" into account numbers and characteritics. After inserting or updating new or old showing this showing will be "recompiled" by explicit function call or trigger into atomary account numbers and characteristics. > Post the EXPLAIN ANALYSE first - maybe someone smarter than me will have an > idea. First result - simple showing 'B00202' (without recursion). Second result - complex showing 'B00204' with recursion (1 level depth). Showing 'B00202' contains 85 accounts, 'B00203' - 108 accounts, and 'B00204' = 'B00202' - 'B00203'. Query text: EXPLAIN ANALYZE SELECT COALESCE( (SELECT sc.koef * 100 FROM showing AS s NATURAL JOIN showcomp AS sc WHERE s.kod = 'B00202' AND NOT SUBSTR(acc_mask, 1, 1) = '[' AND SUBSTR(acc_mask, 1, 4) = '6010' AND SUBSTR(acc_mask, 5, 1) = SUBSTR('20', 1, 1)), (SELECT SUM(sc.koef * COALESCE(showcalc(SUBSTR(acc_mask, 2, LENGTH(acc_mask) - 2), '20', '6010', 100), 0)) FROM showing AS s NATURAL JOIN showcomp AS sc WHERE s.kod = 'B00202' AND SUBSTR(acc_mask, 1, 1) = '['), 0) AS showing; EXPLAIN ANALYZE SELECT COALESCE( (SELECT sc.koef * 100 FROM showing AS s NATURAL JOIN showcomp AS sc WHERE s.kod = 'B00204' AND NOT SUBSTR(acc_mask, 1, 1) = '[' AND SUBSTR(acc_mask, 1, 4) = '6010' AND SUBSTR(acc_mask, 5, 1) = SUBSTR('20', 1, 1)), (SELECT SUM(sc.koef * COALESCE(showcalc(SUBSTR(acc_mask, 2, LENGTH(acc_mask) - 2), '20', '6010', 100), 0)) FROM showing AS s NATURAL JOIN showcomp AS sc WHERE s.kod = 'B00204' AND SUBSTR(acc_mask, 1, 1) = '['), 0) AS showing; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Result (cost=0.00..0.01 rows=1 width=0) (actual time=704.39..704.39 rows=1 loops=1) InitPlan -> Hash Join (cost=5.22..449.63 rows=1 width=19) (actual time=167.28..352.90 rows=1 loops=1) Hash Cond: ("outer".id_show = "inner".id_show) -> Seq Scan on showcomp sc (cost=0.00..444.40 rows=1 width=15) (actual time=23.29..350.17 rows=32 loops=1) Filter: ((substr((acc_mask)::text, 1, 1) <> '['::text) AND (substr((acc_mask)::text, 1, 4) = '6010'::text) AND (substr((acc_mask)::text, 5, 1) = '2'::text)) -> Hash (cost=5.22..5.22 rows=1 width=4) (actual time=0.67..0.67 rows=0 loops=1) -> Index Scan using index_showing_kod on showing s (cost=0.00..5.22 rows=1 width=4) (actual time=0.61..0.64 rows=1 loops=1) Index Cond: (kod = 'B00202'::character varying) -> Hash Join (cost=5.22..449.63 rows=1 width=19) (actual time=166.20..351.28 rows=1 loops=1) Hash Cond: ("outer".id_show = "inner".id_show) -> Seq Scan on showcomp sc (cost=0.00..444.40 rows=1 width=15) (actual time=23.36..349.24 rows=32 loops=1) Filter: ((substr((acc_mask)::text, 1, 1) <> '['::text) AND (substr((acc_mask)::text, 1, 4) = '6010'::text) AND (substr((acc_mask)::text, 5, 1) = '2'::text)) -> Hash (cost=5.22..5.22 rows=1 width=4) (actual time=0.17..0.17 rows=0 loops=1) -> Index Scan using index_showing_kod on showing s (cost=0.00..5.22 rows=1 width=4) (actual time=0.12..0.14 rows=1 loops=1) Index Cond: (kod = 'B00202'::character varying) -> Aggregate (cost=312.61..312.61 rows=1 width=28) (never executed) -> Hash Join (cost=5.22..312.61 rows=1 width=28) (never executed) Hash Cond: ("outer".id_show = "inner".id_show) -> Seq Scan on showcomp sc (cost=0.00..307.04 rows=69 width=24) (never executed) Filter: (substr((acc_mask)::text, 1, 1) = '['::text) -> Hash (cost=5.22..5.22 rows=1 width=4) (never executed) -> Index Scan using index_showing_kod on showing s (cost=0.00..5.22 rows=1 width=4) (never executed) Index Cond: (kod = 'B00202'::character varying) -> Aggregate (cost=312.61..312.61 rows=1 width=28) (never executed) -> Hash Join (cost=5.22..312.61 rows=1 width=28) (never executed) Hash Cond: ("outer".id_show = "inner".id_show) -> Seq Scan on showcomp sc (cost=0.00..307.04 rows=69 width=24) (never executed) Filter: (substr((acc_mask)::text, 1, 1) = '['::text) -> Hash (cost=5.22..5.22 rows=1 width=4) (never executed) -> Index Scan using index_showing_kod on showing s (cost=0.00..5.22 rows=1 width=4) (never executed) Index Cond: (kod = 'B00202'::character varying) Total runtime: 706.82 msec (33 rows) QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Result (cost=0.00..0.01 rows=1 width=0) (actual time=6256.20..6256.21 rows=1 loops=1) InitPlan -> Hash Join (cost=5.22..449.63 rows=1 width=19) (actual time=357.43..357.43 rows=0 loops=1) Hash Cond: ("outer".id_show = "inner".id_show) -> Seq Scan on showcomp sc (cost=0.00..444.40 rows=1 width=15) (actual time=23.29..355.41 rows=32 loops=1) Filter: ((substr((acc_mask)::text, 1, 1) <> '['::text) AND (substr((acc_mask)::text, 1, 4) = '6010'::text) AND (substr((acc_mask)::text, 5, 1) = '2'::text)) -> Hash (cost=5.22..5.22 rows=1 width=4) (actual time=0.22..0.22 rows=0 loops=1) -> Index Scan using index_showing_kod on showing s (cost=0.00..5.22 rows=1 width=4) (actual time=0.16..0.19 rows=1 loops=1) Index Cond: (kod = 'B00204'::character varying) -> Hash Join (cost=5.22..449.63 rows=1 width=19) (never executed) Hash Cond: ("outer".id_show = "inner".id_show) -> Seq Scan on showcomp sc (cost=0.00..444.40 rows=1 width=15) (never executed) Filter: ((substr((acc_mask)::text, 1, 1) <> '['::text) AND (substr((acc_mask)::text, 1, 4) = '6010'::text) AND (substr((acc_mask)::text, 5, 1) = '2'::text)) -> Hash (cost=5.22..5.22 rows=1 width=4) (never executed) -> Index Scan using index_showing_kod on showing s (cost=0.00..5.22 rows=1 width=4) (never executed) Index Cond: (kod = 'B00204'::character varying) -> Aggregate (cost=312.61..312.61 rows=1 width=28) (actual time=2952.69..2952.69 rows=1 loops=1) -> Hash Join (cost=5.22..312.61 rows=1 width=28) (actual time=12.59..264.69 rows=2 loops=1) Hash Cond: ("outer".id_show = "inner".id_show) -> Seq Scan on showcomp sc (cost=0.00..307.04 rows=69 width=24) (actual time=0.09..251.52 rows=1035 loops=1) Filter: (substr((acc_mask)::text, 1, 1) = '['::text) -> Hash (cost=5.22..5.22 rows=1 width=4) (actual time=0.17..0.17 rows=0 loops=1) -> Index Scan using index_showing_kod on showing s (cost=0.00..5.22 rows=1 width=4) (actual time=0.12..0.14 rows=1 loops=1) Index Cond: (kod = 'B00204'::character varying) -> Aggregate (cost=312.61..312.61 rows=1 width=28) (actual time=2945.79..2945.80 rows=1 loops=1) -> Hash Join (cost=5.22..312.61 rows=1 width=28) (actual time=12.02..263.63 rows=2 loops=1) Hash Cond: ("outer".id_show = "inner".id_show) -> Seq Scan on showcomp sc (cost=0.00..307.04 rows=69 width=24) (actual time=0.09..251.09 rows=1035 loops=1) Filter: (substr((acc_mask)::text, 1, 1) = '['::text) -> Hash (cost=5.22..5.22 rows=1 width=4) (actual time=0.17..0.17 rows=0 loops=1) -> Index Scan using index_showing_kod on showing s (cost=0.00..5.22 rows=1 width=4) (actual time=0.12..0.14 rows=1 loops=1) Index Cond: (kod = 'B00204'::character varying) Total runtime: 6257.35 msec (33 rows) >> Anyway, 600Mb is too low for PostgreSQL for executing my query - DBMS >>raise error after 11.5 hours (of estimated 13?). :( > I think the problem is the 13 hours, not the 600MB. Once we've got the query > running in a reasonable length of time (seconds) then the memory requirements > will go down, I'm sure. OK, that's right. With best regards Yaroslav Mazurak. From pgsql-performance-owner@postgresql.org Fri Aug 8 07:28: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 8E09FD1C983 for ; Fri, 8 Aug 2003 10:28:36 +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 13705-03 for ; Fri, 8 Aug 2003 07:27:12 -0300 (ADT) Received: from beth.coza.net.za (beth.coza.net.za [206.223.136.193]) by svr1.postgresql.org (Postfix) with ESMTP id 11908D1C4B9 for ; Fri, 8 Aug 2003 07:28:15 -0300 (ADT) Received: from coza.net.za (mixo.coza.net.za [206.223.136.225]) by beth.coza.net.za (8.11.6/8.11.2) with ESMTP id h78AS3o21213 for ; Fri, 8 Aug 2003 12:28:03 +0200 Message-ID: <3F337B39.5030904@coza.net.za> Date: Fri, 08 Aug 2003 12:28:09 +0200 From: mixo User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Perfomance Tuning 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: 200308/148 X-Sequence-Number: 2965 I have just installed redhat linux 9 which ships with Pg 7.3.2. Pg has to be setup so that data inserts (blobs) should be able to handle at least 8M at a time. The machine has two P III 933MHz CPU's, 1.128G RAM (512M*2 + 128M), and a 36 Gig hd with 1 Gig swap and 3 equal size ext3 partitions. What would be the recomended setup for good performance considering that the db will have about 15 users for 9 hours in a day, and about 10 or so users throughout the day who wont be conistenly using the db. From pgsql-performance-owner@postgresql.org Fri Aug 8 07:41:45 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 37E66D1C4CA for ; Fri, 8 Aug 2003 10:41:42 +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 14995-03 for ; Fri, 8 Aug 2003 07:40:17 -0300 (ADT) Received: from ns1.turtle-entertainment.de (ns1.turtle-entertainment.de [193.41.200.20]) by svr1.postgresql.org (Postfix) with ESMTP id D7605D1C4B9 for ; Fri, 8 Aug 2003 07:41:30 -0300 (ADT) Received: from ip97.85.1311c-cud12k-02.ish.de ([62.143.85.97] helo=mail.office.turtle-entertainment.de) by ns1.turtle-entertainment.de with asmtp (Exim 3.22 #3 (Debian)) id 19l4fo-00072q-00; Fri, 08 Aug 2003 12:40:40 +0200 Received: from pd95205c2.dip.t-dialin.net ([217.82.5.194] helo=shock) by mail.office.turtle-entertainment.de with asmtp (Exim 3.22 #7 (Debian)) id 19l4fl-0004jF-00; Fri, 08 Aug 2003 12:40:37 +0200 Message-ID: <01ed01c35d99$73f08d70$0564a8c0@shock> From: "Bjoern Metzdorf" To: "mixo" , References: <3F337B39.5030904@coza.net.za> Subject: Re: Perfomance Tuning Date: Fri, 8 Aug 2003 12:40:13 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Scanner: exiscan *19l4fl-0004jF-00*0rJPZq5DIZE* http://duncanthrax.net/exiscan/ X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/149 X-Sequence-Number: 2966 > be able to handle at least 8M at a time. The machine has > two P III 933MHz CPU's, 1.128G RAM (512M*2 + 128M), and > a 36 Gig hd with 1 Gig swap and 3 equal size ext3 partitions. > What would be the recomended setup for good performance > considering that the db will have about 15 users for > 9 hours in a day, and about 10 or so users throughout the day > who wont be conistenly using the db. For 15 users you won't need great tuning at all. Just make sure, that you have the right indizes on the tables and that you have good queries (query plan). About the 8Meg blobs, I don't know. Other people on this list may be able to give you hints here. Regards, Bjoern From pgsql-performance-owner@postgresql.org Fri Aug 8 07:51:16 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 13A06D1C9AB for ; Fri, 8 Aug 2003 10:51: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 15890-03 for ; Fri, 8 Aug 2003 07:49:46 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 33867D1C990 for ; Fri, 8 Aug 2003 07:50:59 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h78Aq6Yb010719 for ; Fri, 8 Aug 2003 16:22:06 +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 h78Aq57f010705; Fri, 8 Aug 2003 16:22:05 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org, mixo Date: Fri, 08 Aug 2003 16:22:52 +0530 MIME-Version: 1.0 Subject: Re: Perfomance Tuning Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F33CE5C.23372.A81DD87@localhost> In-reply-to: <3F337B39.5030904@coza.net.za> 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: 200308/150 X-Sequence-Number: 2967 On 8 Aug 2003 at 12:28, mixo wrote: > I have just installed redhat linux 9 which ships with Pg > 7.3.2. Pg has to be setup so that data inserts (blobs) should > be able to handle at least 8M at a time. The machine has > two P III 933MHz CPU's, 1.128G RAM (512M*2 + 128M), and > a 36 Gig hd with 1 Gig swap and 3 equal size ext3 partitions. > What would be the recomended setup for good performance > considering that the db will have about 15 users for > 9 hours in a day, and about 10 or so users throughout the day > who wont be conistenly using the db. You can look at http://www.varlena.com/GeneralBits/Tidbits/perf.html to start with, although that would not take careof anything specifics to BLOB. I would suggest some pilot benchmark about how system performs after initial tuning. We could discuss this in detail after you have a set of initial benchmark. HTH Bye Shridhar -- wolf, n.: A man who knows all the ankles. From pgsql-performance-owner@postgresql.org Fri Aug 8 08:29:33 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 651FCD1C983 for ; Fri, 8 Aug 2003 11:29: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 11452-09 for ; Fri, 8 Aug 2003 08:28:03 -0300 (ADT) Received: from curry.tmsl.demon.co.uk (tmsl-adsl.demon.co.uk [80.177.114.181]) by svr1.postgresql.org (Postfix) with ESMTP id C36AFD1C4DB for ; Fri, 8 Aug 2003 08:29:15 -0300 (ADT) Received: from bacon.tmsl.demon.co.uk (bacon.tmsl.demon.co.uk [192.168.7.102]) by curry.tmsl.demon.co.uk (8.11.6/8.11.6) with ESMTP id h78BS1926280; Fri, 8 Aug 2003 12:28:02 +0100 Date: Fri, 8 Aug 2003 12:28:00 +0100 From: Paul Thomas To: mixo Cc: "pgsql-performance @ postgresql . org" Subject: Re: Perfomance Tuning Message-ID: <20030808122800.A10464@bacon> References: <3F337B39.5030904@coza.net.za> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=ISO-8859-1 In-Reply-To: <3F337B39.5030904@coza.net.za>; from mixo@coza.net.za on Fri, Aug 08, 2003 at 11:28:09 +0100 X-Mailer: Balsa 1.2.3 Lines: 30 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/151 X-Sequence-Number: 2968 On 08/08/2003 11:28 mixo wrote: > I have just installed redhat linux 9 which ships with Pg > 7.3.2. Pg has to be setup so that data inserts (blobs) should > be able to handle at least 8M at a time. The machine has > two P III 933MHz CPU's, 1.128G RAM (512M*2 + 128M), and > a 36 Gig hd with 1 Gig swap and 3 equal size ext3 partitions. > What would be the recomended setup for good performance > considering that the db will have about 15 users for > 9 hours in a day, and about 10 or so users throughout the day > who wont be conistenly using the db. It doesn't sound like a particlarly heavy loading to me. I'd start off with something like shared_buffers = 2000 sort_mem = 1024 max_coonections = 100 and see how it performs under normal business loading. -- Paul Thomas +------------------------------+---------------------------------------------+ | Thomas Micro Systems Limited | Software Solutions for the Smaller Business | | Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk | +------------------------------+---------------------------------------------+ From pgsql-performance-owner@postgresql.org Fri Aug 8 10:45:32 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 CCAEED1C984 for ; Fri, 8 Aug 2003 13:45:24 +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 35644-01 for ; Fri, 8 Aug 2003 10:44:01 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 781B3D1C4CA for ; Fri, 8 Aug 2003 10:45:13 -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 h78DgVbS023408; Fri, 8 Aug 2003 07:42:32 -0600 (MDT) Date: Fri, 8 Aug 2003 07:28:13 -0600 (MDT) From: "scott.marlowe" To: mixo Cc: Subject: Re: Perfomance Tuning In-Reply-To: <3F337B39.5030904@coza.net.za> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/152 X-Sequence-Number: 2969 On Fri, 8 Aug 2003, mixo wrote: > I have just installed redhat linux 9 which ships with Pg > 7.3.2. Pg has to be setup so that data inserts (blobs) should > be able to handle at least 8M at a time. Nothing has to be done to tune postgresql to handle this, 8 Meg blobs are no problem as far as I know. > The machine has > two P III 933MHz CPU's, 1.128G RAM (512M*2 + 128M), and > a 36 Gig hd with 1 Gig swap and 3 equal size ext3 partitions. > What would be the recomended setup for good performance > considering that the db will have about 15 users for > 9 hours in a day, and about 10 or so users throughout the day > who wont be conistenly using the db. Seeing as you have only one hard drive, how you arrange things on it doesn't really make a big difference. If you can get another drive and mirror your data partition that will help speed up selects as well as provide some redundancy should one drive fail. How many queries per second are you looking at handling? If it's 1 or less, you probably don't have much to worry about with this setup. We run dual PIII-750s at work with 1.5 Gig ram, and while we're going to upgrade the servers (they're currently handling apache/php/postgresql & ldap) we'll keep the dual PIII-750 machines as the database boxes with nothing else on them. Postgresql is quite snappy on such hardware. From pgsql-performance-owner@postgresql.org Fri Aug 8 14:08:25 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 5B78AD1C990 for ; Fri, 8 Aug 2003 16:40:37 +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 44789-09 for ; Fri, 8 Aug 2003 13:39:09 -0300 (ADT) Received: from irko.smoothcorp.com (unknown [208.49.241.41]) by svr1.postgresql.org (Postfix) with ESMTP id 58E59D1C4DB for ; Fri, 8 Aug 2003 13:40:26 -0300 (ADT) Received: from [10.0.1.63] (helo=jgardner.smoothcorp.com) by irko.smoothcorp.com with esmtp (Exim 4.12) id 19lAHx-0005Yt-00; Fri, 08 Aug 2003 09:40:25 -0700 Received: from jgardner.smoothcorp.com (localhost.localdomain [127.0.0.1]) by jgardner.smoothcorp.com (8.12.8/8.12.8) with ESMTP id h78GePsN027676; Fri, 8 Aug 2003 09:40:25 -0700 Received: from localhost (localhost [[UNIX: localhost]]) by jgardner.smoothcorp.com (8.12.8/8.12.8/Submit) id h78GeL8l027670; Fri, 8 Aug 2003 09:40:21 -0700 From: Jonathan Gardner To: mixo , pgsql-performance@postgresql.org Subject: Re: Perfomance Tuning Date: Fri, 8 Aug 2003 09:40:20 -0700 User-Agent: KMail/1.5 References: <3F337B39.5030904@coza.net.za> In-Reply-To: <3F337B39.5030904@coza.net.za> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline Message-Id: <200308080940.21517.jgardner@jonathangardner.net> X-SA-Exim-Rcpt-To: mixo@coza.net.za, pgsql-performance@postgresql.org X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/153 X-Sequence-Number: 2970 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 08 August 2003 03:28, mixo wrote: > I have just installed redhat linux 9 which ships with Pg > 7.3.2. Pg has to be setup so that data inserts (blobs) should > be able to handle at least 8M at a time. The machine has > two P III 933MHz CPU's, 1.128G RAM (512M*2 + 128M), and > a 36 Gig hd with 1 Gig swap and 3 equal size ext3 partitions. > What would be the recomended setup for good performance > considering that the db will have about 15 users for > 9 hours in a day, and about 10 or so users throughout the day > who wont be conistenly using the db. > Redhat puts ext3 on by default. Consider switching to a non-journaling FS= =20 (ext2?) with the partition that holds your data and WAL. Consider having a seperate partition for the WAL as well. These are things that are more difficult to change later on. Everything els= e=20 is tweaking. Is it absolutely necessary to store 8MB files in the database? I find it=20 cumbersome. Storing them on a file server has been a better alternative for= =20 me. - --=20 Jonathan Gardner Live Free, Use Linux! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/M9J0WgwF3QvpWNwRAlT5AJ9EmDourbCiqj7MFOqfBospc2dW7gCfZKz0 JQjn/2KAeh1SPJfN601LoFg=3D =3DPW6k -----END PGP SIGNATURE----- From pgsql-performance-owner@postgresql.org Fri Aug 8 14:32: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 8913BD1C4DB for ; Fri, 8 Aug 2003 16:52:34 +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 48668-06 for ; Fri, 8 Aug 2003 13:51:06 -0300 (ADT) Received: from email02.aon.at (WARSL402PIP7.highway.telekom.at [195.3.96.94]) by svr1.postgresql.org (Postfix) with SMTP id 59F55D1C91F for ; Fri, 8 Aug 2003 13:52:23 -0300 (ADT) Received: (qmail 194710 invoked from network); 8 Aug 2003 16:52:22 -0000 Received: from m169p004.dipool.highway.telekom.at (HELO cantor) ([62.46.11.4]) (envelope-sender ) by qmail2rs.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 8 Aug 2003 16:52:22 -0000 From: Manfred Koizar To: Tom Lane Cc: Sean Chittenden , pgsql-performance@postgresql.org Subject: Index correlation (was: Moving postgresql.conf tunables into 2003... ) Date: Fri, 08 Aug 2003 18:52:44 +0200 Message-ID: <24k7jv4c62amkgq42ouh4csrjuu5c6s1q4@4ax.com> References: <20030703190502.GR72567@perrin.int.nxad.com> <2422.1057264735@sss.pgh.pa.us> <20030704000646.GV72567@perrin.int.nxad.com> <4nfiiv850cu7vkp39tv7mk2b3pniim8ccu@4ax.com> <20030805222609.GF94710@perrin.int.nxad.com> <20030807202426.GI94710@perrin.int.nxad.com> <9730.1060299112@sss.pgh.pa.us> In-Reply-To: <9730.1060299112@sss.pgh.pa.us> X-Mailer: Forte Agent 1.93/32.576 English (American) 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: 200308/154 X-Sequence-Number: 2971 On Thu, 07 Aug 2003 19:31:52 -0400, Tom Lane wrote: >The correlation is between index order and heap order --- that is, are >the tuples in the table physically in the same order as the index? >The better the correlation, the fewer heap-page reads it will take to do >an index scan. This is true for a column that is the first column of a btree index. Correlation doesn't help with additional index columns and with functional indices. >Note it is possible to measure correlation without regard to whether >there actually is any index; But there is no need to, because the correlation is only used for index access cost estimation. >One problem we have is extrapolating from the single-column correlation >stats computed by ANALYZE to appropriate info for multi-column indexes. >It might be that the only reasonable fix for this is for ANALYZE to >compute multi-column stats too when multi-column indexes are present. I wonder whether it would be better to drop column correlation and calculate index correlation instead, i.e. correlation of index tuples to heap tuple positions. This would solve both the multi-column index and the functional index cost estimation problem. >People are used to the assumption that you don't need to re-ANALYZE >after creating a new index, but maybe we'll have to give that up. Index correlation would be computed on CREATE INDEX and whenever the heap relation is analysed ... Servus Manfred From pgsql-performance-owner@postgresql.org Fri Aug 8 16:04:45 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 A9CC9D1C9B3 for ; Fri, 8 Aug 2003 18:53:33 +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 69667-01 for ; Fri, 8 Aug 2003 15:52:06 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 644D0D1C922 for ; Fri, 8 Aug 2003 15:53:22 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19lCMd-0004Bi-00 for ; Fri, 08 Aug 2003 14:53:23 -0400 Received: by dba2 (Postfix, from userid 1019) id 93AE3CF52; Fri, 8 Aug 2003 14:53:23 -0400 (EDT) Date: Fri, 8 Aug 2003 14:53:23 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: Perfomance Tuning Message-ID: <20030808185323.GH2967@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <3F337B39.5030904@coza.net.za> <200308080940.21517.jgardner@jonathangardner.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200308080940.21517.jgardner@jonathangardner.net> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/155 X-Sequence-Number: 2972 On Fri, Aug 08, 2003 at 09:40:20AM -0700, Jonathan Gardner wrote: > > Redhat puts ext3 on by default. Consider switching to a non-journaling FS > (ext2?) with the partition that holds your data and WAL. I would give you exactly the opposite advice: _never_ use a non-journalling fs for your data and WAL. I suppose if you can afford to lose some transactions, you can do without journalling. Otherwise, you're just borrowing trouble, near as I can tell. A ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Fri Aug 8 16:21: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 14464D1C4CA for ; Fri, 8 Aug 2003 19:14: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 71600-03 for ; Fri, 8 Aug 2003 16:12:35 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 31CA6D1C4BF for ; Fri, 8 Aug 2003 16:13:51 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id A55841024D; Fri, 8 Aug 2003 15:06:24 -0400 (EDT) Received: from [10.0.2.39] (unknown [10.0.2.39]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 8A5CA10248; Fri, 8 Aug 2003 15:06:22 -0400 (EDT) Subject: Re: Perfomance Tuning From: Rod Taylor To: Andrew Sullivan Cc: Postgresql Performance In-Reply-To: <20030808185323.GH2967@libertyrms.info> References: <3F337B39.5030904@coza.net.za> <200308080940.21517.jgardner@jonathangardner.net> <20030808185323.GH2967@libertyrms.info> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-FFrXQU2rUFUFb/YgEIpd" Message-Id: <1060370026.97914.40.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Fri, 08 Aug 2003 15:13:47 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/156 X-Sequence-Number: 2973 --=-FFrXQU2rUFUFb/YgEIpd Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2003-08-08 at 14:53, Andrew Sullivan wrote: > On Fri, Aug 08, 2003 at 09:40:20AM -0700, Jonathan Gardner wrote: > >=20 > > Redhat puts ext3 on by default. Consider switching to a non-journaling = FS=20 > > (ext2?) with the partition that holds your data and WAL. >=20 > I would give you exactly the opposite advice: _never_ use a > non-journalling fs for your data and WAL. I suppose if you can > afford to lose some transactions, you can do without journalling.=20 > Otherwise, you're just borrowing trouble, near as I can tell. Agreed.. WAL cannot recover something when WAL no longer exists due to a filesystem corruption. --=-FFrXQU2rUFUFb/YgEIpd Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQA/M/Zp6DETLow6vwwRAuRlAJ4lEkrRikPrjQnWA2ILvPy6vAECbgCfY5Rj WMkaPjCTU+7XyWtzRpnQOEc= =gYPO -----END PGP SIGNATURE----- --=-FFrXQU2rUFUFb/YgEIpd-- From pgsql-performance-owner@postgresql.org Fri Aug 8 16:37: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 C77A5D1C4CA for ; Fri, 8 Aug 2003 19:34:57 +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 72587-03 for ; Fri, 8 Aug 2003 16:33:30 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 45A55D1C922 for ; Fri, 8 Aug 2003 16:34:46 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h78JYi906553; Fri, 8 Aug 2003 15:34:44 -0400 (EDT) From: Bruce Momjian Message-Id: <200308081934.h78JYi906553@candle.pha.pa.us> Subject: Re: Perfomance Tuning In-Reply-To: <1060370026.97914.40.camel@jester> To: Rod Taylor Date: Fri, 8 Aug 2003 15:34:44 -0400 (EDT) Cc: Andrew Sullivan , Postgresql Performance X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/157 X-Sequence-Number: 2974 Rod Taylor wrote: -- Start of PGP signed section. > On Fri, 2003-08-08 at 14:53, Andrew Sullivan wrote: > > On Fri, Aug 08, 2003 at 09:40:20AM -0700, Jonathan Gardner wrote: > > > > > > Redhat puts ext3 on by default. Consider switching to a non-journaling FS > > > (ext2?) with the partition that holds your data and WAL. > > > > I would give you exactly the opposite advice: _never_ use a > > non-journalling fs for your data and WAL. I suppose if you can > > afford to lose some transactions, you can do without journalling. > > Otherwise, you're just borrowing trouble, near as I can tell. > > Agreed.. WAL cannot recover something when WAL no longer exists due to a > filesystem corruption. It is true that ext2 isn't good because the file system may not recover, but BSD UFS isn't a journalled file system, but does guarantee file system recovery after a crash --- it is especially good using soft updates. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Fri Aug 8 16:47:03 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 52F72D1C91F for ; Fri, 8 Aug 2003 19:47: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 71600-09 for ; Fri, 8 Aug 2003 16:45:34 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 66D8BD1C4BF for ; Fri, 8 Aug 2003 16:46:50 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id E9DF81025B; Fri, 8 Aug 2003 15:39:23 -0400 (EDT) Received: from [10.0.2.39] (unknown [10.0.2.39]) by mailav.tor1.inquent.com (Postfix) with ESMTP id A0F371025A; Fri, 8 Aug 2003 15:39:19 -0400 (EDT) Subject: Re: Perfomance Tuning From: Rod Taylor To: Bruce Momjian Cc: Andrew Sullivan , Postgresql Performance In-Reply-To: <200308081934.h78JYi906553@candle.pha.pa.us> References: <200308081934.h78JYi906553@candle.pha.pa.us> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-j678f8GnEidanTTPf7fL" Message-Id: <1060372003.97914.54.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Fri, 08 Aug 2003 15:46:44 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/158 X-Sequence-Number: 2975 --=-j678f8GnEidanTTPf7fL Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > > Agreed.. WAL cannot recover something when WAL no longer exists due to a > > filesystem corruption. >=20 > It is true that ext2 isn't good because the file system may not recover, > but BSD UFS isn't a journalled file system, but does guarantee file > system recovery after a crash --- it is especially good using soft > updates. Yes, UFS(2) is an excellent filesystem for PostgreSQL, especially if you can use background fsck & softupdates. --=-j678f8GnEidanTTPf7fL Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQA/M/4i6DETLow6vwwRAl3CAJ9I4yCODjAhxPG5tawZZnFP7pcSVACeNMhA GAJ0N4JAiDDZ5+7PTdE53vs= =YcHr -----END PGP SIGNATURE----- --=-j678f8GnEidanTTPf7fL-- From pgsql-performance-owner@postgresql.org Fri Aug 8 16:57: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 EB2E3D1C4DB for ; Fri, 8 Aug 2003 19:57: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 71445-07 for ; Fri, 8 Aug 2003 16:55:41 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id F1A7CD1C4CA for ; Fri, 8 Aug 2003 16:56:56 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19lDMA-0005nw-00 for ; Fri, 08 Aug 2003 15:56:58 -0400 Received: by dba2 (Postfix, from userid 1019) id A624BCF52; Fri, 8 Aug 2003 15:56:58 -0400 (EDT) Date: Fri, 8 Aug 2003 15:56:58 -0400 From: Andrew Sullivan To: Postgresql Performance Subject: Re: Perfomance Tuning Message-ID: <20030808195658.GJ2967@libertyrms.info> Mail-Followup-To: Andrew Sullivan , Postgresql Performance References: <1060370026.97914.40.camel@jester> <200308081934.h78JYi906553@candle.pha.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200308081934.h78JYi906553@candle.pha.pa.us> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/159 X-Sequence-Number: 2976 On Fri, Aug 08, 2003 at 03:34:44PM -0400, Bruce Momjian wrote: > > It is true that ext2 isn't good because the file system may not recover, > but BSD UFS isn't a journalled file system, but does guarantee file > system recovery after a crash --- it is especially good using soft > updates. Sorry. I usually write "journalled or equivalent" for this reason. I think UFS with soft updates is a good example of this. You also don't need complete journalling in most cases -- metadata is probably sufficient, given fsync. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Fri Aug 8 17:14:12 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 D6990D1C93B for ; Fri, 8 Aug 2003 20:14:10 +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 74084-03 for ; Fri, 8 Aug 2003 17:12:44 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id C74C6D1C937 for ; Fri, 8 Aug 2003 17:13:59 -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 h78KDlSa029639; Fri, 8 Aug 2003 16:13:47 -0400 (EDT) To: Bruce Momjian Cc: Rod Taylor , Andrew Sullivan , Postgresql Performance Subject: Re: Perfomance Tuning In-reply-to: <200308081934.h78JYi906553@candle.pha.pa.us> References: <200308081934.h78JYi906553@candle.pha.pa.us> Comments: In-reply-to Bruce Momjian message dated "Fri, 08 Aug 2003 15:34:44 -0400" Date: Fri, 08 Aug 2003 16:13:47 -0400 Message-ID: <29638.1060373627@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/160 X-Sequence-Number: 2977 Bruce Momjian writes: > Rod Taylor wrote: >> On Fri, 2003-08-08 at 14:53, Andrew Sullivan wrote: >>> I would give you exactly the opposite advice: _never_ use a >>> non-journalling fs for your data and WAL. I suppose if you can >>> afford to lose some transactions, you can do without journalling. >>> Otherwise, you're just borrowing trouble, near as I can tell. >> >> Agreed.. WAL cannot recover something when WAL no longer exists due to a >> filesystem corruption. > It is true that ext2 isn't good because the file system may not recover, > but BSD UFS isn't a journalled file system, but does guarantee file > system recovery after a crash --- it is especially good using soft > updates. The main point here is that the filesystem has to be able to take care of itself; we expect it not to lose any files or forget where the data is. If it wants to use journalling to accomplish that, fine. Journalling file contents updates, as opposed to filesystem metadata, should be redundant with what we do in WAL. So I'd recommend journalling metadata only, if that option is available (and if Postgres stuff is the only stuff on the disk...) regards, tom lane From pgsql-hackers-owner@postgresql.org Mon Aug 11 00:11:41 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id EA197D1C984 for ; Mon, 11 Aug 2003 03:11: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 39427-03 for ; Mon, 11 Aug 2003 00:09:40 -0300 (ADT) Received: from varlena.com (adsl-64-165-208-112.dsl.snfc21.pacbell.net [64.165.208.112]) by svr1.postgresql.org (Postfix) with ESMTP id BFF23D1C514 for ; Mon, 11 Aug 2003 00:10:58 -0300 (ADT) Received: by varlena.com (Postfix on SuSE Linux 7.3 (i386), from userid 500) id 42C57399D2; Sun, 10 Aug 2003 20:04:40 -0700 (PDT) Date: Sun, 10 Aug 2003 20:04:40 -0700 From: elein To: pgsql-hackers@postgresql.org Cc: elein@varlena.com Subject: Windows on SuSE? 7.4 Message-ID: <20030810200440.B2396@cookie> Mail-Followup-To: pgsql-hackers@postgresql.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.22.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/606 X-Sequence-Number: 42264 SuSE 7.3, PostgreSQL cvshead (7.4) This is as far as I've gotten with 7.4. It is built and configured like my 7.3 installation on the same machine. I have built from CVS previously. And the production sources always builds very nice and clean. Nothing runs. gbd output is below. It is balking on loading a suspect library. I ordinarily would suspect some minor permission or configuration issue, but I cannot see one. Joe Conway suggested it might be a problem with the the windows configuration changes. My machine has WINE on it (windows) although I never use it. There really should be no reason for anything to be trying to link in a windows socket library. I don't have time to follow it further right now. But if someone else has a similar configuration and/or wine installed, it would be very helpful to compare 7.4 installations. I can provide config arguments and log if someone would find them useful. >gdb bin/postmaster GNU gdb 20010316 Copyright 2001 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-suse-linux"... (gdb) run -i -D /local/pghead/data Starting program: /local/pghead/bin/postmaster -i -D /local/pghead/data Program received signal SIGSEGV, Segmentation fault. 0x40099ac5 in dllname () from /usr/lib/libwsock32.so (gdb) bt #0 0x40099ac5 in dllname () from /usr/lib/libwsock32.so #1 0x08121821 in StreamServerPort () #2 0x08150996 in PostmasterMain () #3 0x08123353 in main () #4 0x4010e7ee in __libc_start_main () from /lib/libc.so.6 elein@varlena.com From pgsql-hackers-owner@postgresql.org Mon Aug 11 01:08:55 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id EB5AFD1C4D9 for ; Mon, 11 Aug 2003 04:08: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 39565-06 for ; Mon, 11 Aug 2003 01:07:24 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id E56E0D1C910 for ; Mon, 11 Aug 2003 01:08:39 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7B48Wd10751; Mon, 11 Aug 2003 00:08:32 -0400 (EDT) From: Bruce Momjian Message-Id: <200308110408.h7B48Wd10751@candle.pha.pa.us> Subject: Re: Windows on SuSE? 7.4 In-Reply-To: <20030810200440.B2396@cookie> To: elein Date: Mon, 11 Aug 2003 00:08:32 -0400 (EDT) Cc: pgsql-hackers@postgresql.org, elein@varlena.com X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/608 X-Sequence-Number: 42266 That line is certainly strange: #0 0x40099ac5 in dllname () from /usr/lib/libwsock32.so When you run configure, it says you are on Linux, right? My guess is that gdb is getting confused because there is no dllopen call in StreamServerPort(). --------------------------------------------------------------------------- elein wrote: > > SuSE 7.3, PostgreSQL cvshead (7.4) > > This is as far as I've gotten with 7.4. > It is built and configured like my 7.3 installation > on the same machine. I have built from CVS previously. > And the production sources always builds very nice and clean. > > Nothing runs. gbd output is below. It is balking > on loading a suspect library. > > I ordinarily would suspect some minor permission > or configuration issue, but I cannot see one. > > Joe Conway suggested it might be a problem with the > the windows configuration changes. > > My machine has WINE on it (windows) although > I never use it. There really should be no > reason for anything to be trying to link > in a windows socket library. > > I don't have time to follow it further right now. > But if someone else has a similar configuration > and/or wine installed, it would be very helpful > to compare 7.4 installations. I can provide > config arguments and log if someone would find > them useful. > > >gdb bin/postmaster > GNU gdb 20010316 > Copyright 2001 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you are > welcome to change it and/or distribute copies of it under certain conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for details. > This GDB was configured as "i386-suse-linux"... > (gdb) run -i -D /local/pghead/data > Starting program: /local/pghead/bin/postmaster -i -D /local/pghead/data > > Program received signal SIGSEGV, Segmentation fault. > 0x40099ac5 in dllname () from /usr/lib/libwsock32.so > (gdb) bt > #0 0x40099ac5 in dllname () from /usr/lib/libwsock32.so > #1 0x08121821 in StreamServerPort () > #2 0x08150996 in PostmasterMain () > #3 0x08123353 in main () > #4 0x4010e7ee in __libc_start_main () from /lib/libc.so.6 > > > elein@varlena.com > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Mon Aug 11 06:01: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 E0AE9D1C4B9 for ; Mon, 11 Aug 2003 09:00:03 +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 65226-08 for ; Mon, 11 Aug 2003 05:58:35 -0300 (ADT) Received: from lata.dp.ua (unknown [213.179.230.244]) by svr1.postgresql.org (Postfix) with ESMTP id BE6B0D1C4E3 for ; Mon, 11 Aug 2003 05:59:46 -0300 (ADT) Received: from [192.168.0.48] (helo=sergeyd) by lata.dp.ua with esmtp (Exim 3.22 #1) id 19m8Wq-00027N-00 for pgsql-performance@postgresql.org; Mon, 11 Aug 2003 11:59:48 +0300 From: "Serge Dorofeev" To: Subject: How to force PostgreeSQL to work faster? Date: Mon, 11 Aug 2003 11:59:45 +0300 Organization: . Message-ID: <000101c35fe6$ea3fea80$3000a8c0@sergeyd> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0002_01C36000.0F8EA920" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.8 tagged_above=0.0 required=5.0 tests=ASCII_FORM_ENTRY, HTML_80_90, HTML_MESSAGE, HTML_TAG_EXISTS_TBODY X-Spam-Level: * X-Archive-Number: 200308/161 X-Sequence-Number: 2978 This is a multi-part message in MIME format. ------=_NextPart_000_0002_01C36000.0F8EA920 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi PostrgeSQL team, My PostrgeSQL installed as part of CYGWIN (Windows XP). I have compared performance PostrgeSQL to MS SQL (I used a little Java program with number of inserts in table). MS SQL is faster in 12 times :-( It's very strange results. Guys who developed this server: what you can tell in this - what customizations needs to increase of productivity? How to force PostgreeSQL to work faster? Speed (inserts/sec) Elapsed time (ms) MS SQL (Average): 295 39 869 testInsert 5000 263 18 977 255 19 619 306 16 334 testInsert 10000 315 31 716 324 30 905 319 31 325 testInsert 20000 241 82 919 313 63 922 317 63 101 PostrgreSQL (Average): 24 520 160 testInsert 5000 26 191 434 26 191 264 26 192 295 testInsert 10000 22 463 669 25 393 510 24 409 528 testInsert 20000 24 834 911 17 1 184 613 24 820 218 MS SQL is faster (times): 12 13 ______________________________________________________ With regards, Serge. ------=_NextPart_000_0002_01C36000.0F8EA920 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Message

Hi PostrgeSQL  team,

My PostrgeSQL installed as part of CYGW= IN=20 (Windows XP).
I have compared performance PostrgeSQL to MS SQL (I used a= =20 little Java program with number of inserts in table).
MS SQL is faster i= n 12=20 times :-(
It's very strange results.
Guys who developed this server: = what=20 you can tell in this - what customizations needs to increase of=20 productivity?
How to force PostgreeSQL to work faster?

  Speed (inserts/sec)<= /TD> Elapsed time (ms)
MS SQL (Average): 295= 39=20 869
  testInsert 5000  
  263 18 977
  255 19 619
  306 16 334
     
  testInsert 10000  
  315 31 716
  324 30 905
  319 31 325
     
  testInsert 20000  
  241 82 919
  313 63 922
  317 63 101
    <= FONT=20 size=3D2> 
PostrgreSQL (Average): 24<= /TD> 520=20 160
  testInsert 5000  
  26 191 434
  26 191 264
  26 192 295
     
  testInsert 10000  
  22 463 669
  25 393 510
  24 409 528
     
  testInsert 20000  
  24 834 911
  17 1 184 613
  24 820 218
MS SQL is faster=20 (times): 12 13



___________________________________________________= ___
With=20 regards,
Serge.

------=_NextPart_000_0002_01C36000.0F8EA920-- From pgsql-performance-owner@postgresql.org Mon Aug 11 08:34:46 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 D12C1D1C514 for ; Mon, 11 Aug 2003 11:34:42 +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 83516-05 for ; Mon, 11 Aug 2003 08:33:15 -0300 (ADT) Received: from popularworld.com (unknown [203.194.162.107]) by svr1.postgresql.org (Postfix) with ESMTP id F1DA8D1C4D9 for ; Mon, 11 Aug 2003 08:34:30 -0300 (ADT) Received: from joey ([202.64.84.81]) by popularworld.com ; Mon, 11 Aug 2003 19:34:32 +0800 Message-ID: <001a01c35ffc$651e7cc0$71327f81@joey> From: To: Subject: Peformance of Update Date: Mon, 11 Aug 2003 19:33:32 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0017_01C3603F.73063A60" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.8 tagged_above=0.0 required=5.0 tests=HTML_30_40, HTML_MESSAGE, NO_REAL_NAME X-Spam-Level: * X-Archive-Number: 200308/162 X-Sequence-Number: 2979 This is a multi-part message in MIME format. ------=_NextPart_000_0017_01C3603F.73063A60 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable Hi, Currently we are using postgresql 7.3 with Redhat linux 9. We find that= when we try to execute 200,000 update statement through JDBC, the performa= nce of degraded obviously for each update statement when comparing with les= s update statement(eg. 5000). Is there any suggestion that we can improve t= he performance for executing update statement at postgresql ? Thanks. Regards, Ricky. ------=_NextPart_000_0017_01C3603F.73063A60 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable
Hi,
    Currently we are using postgresql 7.= 3 with=20 Redhat linux 9. We find that when we try to execute 200,000 update statemen= t=20 through JDBC, the performance of degraded obviously for each update stateme= nt=20 when comparing with less update statement(eg. 5000). Is there any suggestio= n=20 that we can improve the performance for executing update statement at= =20 postgresql ? Thanks.
 
Regards,
Ricky.
------=_NextPart_000_0017_01C3603F.73063A60-- From pgsql-performance-owner@postgresql.org Mon Aug 11 08:38: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 AA8B8D1C4BA for ; Mon, 11 Aug 2003 11:38:10 +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 82287-05 for ; Mon, 11 Aug 2003 08:36:43 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id 21E7FD1C950 for ; Mon, 11 Aug 2003 08:37:59 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7BBc1t15850 for ; Mon, 11 Aug 2003 13:38:01 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7BBc0Y15846; Mon, 11 Aug 2003 13:38:00 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id 5D0FD6FCCC; Mon, 11 Aug 2003 13:37:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id 546137F67F; Mon, 11 Aug 2003 13:37:50 +0200 (CEST) Date: Mon, 11 Aug 2003 13:37:50 +0200 (CEST) From: Tomka Gergely To: Serge Dorofeev Cc: Subject: Re: How to force PostgreeSQL to work faster? In-Reply-To: <000101c35fe6$ea3fea80$3000a8c0@sergeyd> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=2.9 tagged_above=0.0 required=5.0 tests=IN_REP_TO, RCVD_IN_NJABL, RCVD_IN_OSIRUSOFT_COM, RCVD_IN_RFCI, RCVD_IN_UNCONFIRMED_DSBL, USER_AGENT_PINE X-Spam-Level: ** X-Archive-Number: 200308/163 X-Sequence-Number: 2980 Hi! Please send me the test db and the queries, with precise information maybe the developers can help. --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-performance-owner@postgresql.org Mon Aug 11 09:31:04 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 BEE48D1C4B9 for ; Mon, 11 Aug 2003 12:31: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 88704-03 for ; Mon, 11 Aug 2003 09:29:35 -0300 (ADT) Received: from curry.tmsl.demon.co.uk (tmsl-adsl.demon.co.uk [80.177.114.181]) by svr1.postgresql.org (Postfix) with ESMTP id 1ED52D1C514 for ; Mon, 11 Aug 2003 09:30:50 -0300 (ADT) Received: from bacon.tmsl.demon.co.uk (bacon.tmsl.demon.co.uk [192.168.7.102]) by curry.tmsl.demon.co.uk (8.11.6/8.11.6) with ESMTP id h7BCUZ910986; Mon, 11 Aug 2003 13:30:35 +0100 Date: Mon, 11 Aug 2003 13:30:33 +0100 From: Paul Thomas To: Serge Dorofeev Cc: "pgsql-performance @ postgresql . org" Subject: Re: How to force PostgreeSQL to work faster? Message-ID: <20030811133033.A25244@bacon> References: <000101c35fe6$ea3fea80$3000a8c0@sergeyd> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=ISO-8859-1 In-Reply-To: <000101c35fe6$ea3fea80$3000a8c0@sergeyd>; from sergeyd@ua.fm on Mon, Aug 11, 2003 at 09:59:45 +0100 X-Mailer: Balsa 1.2.3 Lines: 67 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/164 X-Sequence-Number: 2981 On 11/08/2003 09:59 Serge Dorofeev wrote: > Hi PostrgeSQL team, > > My PostrgeSQL installed as part of CYGWIN (Windows XP). > I have compared performance PostrgeSQL to MS SQL (I used a little Java > program with number of inserts in table). > MS SQL is faster in 12 times :-( > It's very strange results. > Guys who developed this server: what you can tell in this - what > customizations needs to increase of productivity? > How to force PostgreeSQL to work faster? > > > Speed (inserts/sec) Elapsed time (ms) > MS SQL (Average): 295 39 869 > testInsert 5000 > 263 18 977 > 255 19 619 > 306 16 334 > > testInsert 10000 > 315 31 716 > 324 30 905 > 319 31 325 > > testInsert 20000 > 241 82 919 > 313 63 922 > 317 63 101 > > PostrgreSQL (Average): 24 520 160 > testInsert 5000 > 26 191 434 > 26 191 264 > 26 192 295 > > testInsert 10000 > 22 463 669 > 25 393 510 > 24 409 528 > > testInsert 20000 > 24 834 911 > 17 1 184 613 > 24 820 218 > MS SQL is faster (times): 12 13 You don't give any details about your test code or how the databases are configured so I'm guessing that you're inserts use an autocommitting connection. For PostgreSQL, this causes each insert to be run inside a tranaction and the transaction is then immediately written to disk. My guess is that MS SQL behaves differently and doesn't immediately write to disk (faster maybe but could cause data corruption). Try modifying your program to have connection.setAutoCommit(false) and do a connection.commit() after say every 100 inserts. HTH -- Paul Thomas +------------------------------+---------------------------------------------+ | Thomas Micro Systems Limited | Software Solutions for the Smaller Business | | Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk | +------------------------------+---------------------------------------------+ From pgsql-performance-owner@postgresql.org Mon Aug 11 10:23:40 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 A7471D1C984 for ; Mon, 11 Aug 2003 13:22:46 +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 90455-07 for ; Mon, 11 Aug 2003 10:21:20 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 5B64BD1C4E1 for ; Mon, 11 Aug 2003 10:22:34 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7BDOZkk019845 for ; Mon, 11 Aug 2003 18:54:35 +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 h7BDOY3g019832 for ; Mon, 11 Aug 2003 18:54:34 +0530 From: "Shridhar Daithankar" To: Date: Mon, 11 Aug 2003 18:54:29 +0530 MIME-Version: 1.0 Subject: Re: How to force PostgreeSQL to work faster? Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F37E665.29307.1A7FBFD4@localhost> In-reply-to: <000101c35fe6$ea3fea80$3000a8c0@sergeyd> 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: 200308/165 X-Sequence-Number: 2982 On 11 Aug 2003 at 11:59, Serge Dorofeev wrote: > > Hi PostrgeSQL team, > > My PostrgeSQL installed as part of CYGWIN (Windows XP). > I have compared performance PostrgeSQL to MS SQL (I used a little Java program > with number of inserts in table). > MS SQL is faster in 12 times :-( > It's very strange results. > Guys who developed this server: what you can tell in this - what customizations > needs to increase of productivity? > How to force PostgreeSQL to work faster? First of all, get a unix. Cygwin is nowhere near any unix OS as far as performance goes. Get linux and test. Testing postgresql under cygwin is like testing MSSQL server under wine. May be wine is faster than cygwin but you got the idea.. Second tune postgresql. Since you have not given any details, I would assume you are runnning stock install of postgresql, which is not made for a benchmark to say the least. Check http://www.varlena.com/GeneralBits/Tidbits/perf.html for starters. Let us know if that makes any difference.. Bye Shridhar -- Baker's First Law of Federal Geometry: A block grant is a solid mass of money surrounded on all sides by governors. From pgsql-performance-owner@postgresql.org Mon Aug 11 10:26: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 069F5D1C990 for ; Mon, 11 Aug 2003 13:24:24 +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 88419-10 for ; Mon, 11 Aug 2003 10:22:57 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 17383D1C4D6 for ; Mon, 11 Aug 2003 10:24:12 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7BDQEc0020183 for ; Mon, 11 Aug 2003 18:56:14 +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 h7BDQD3g020170 for ; Mon, 11 Aug 2003 18:56:13 +0530 From: "Shridhar Daithankar" To: Date: Mon, 11 Aug 2003 18:56:08 +0530 MIME-Version: 1.0 Subject: Re: Peformance of Update Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F37E6C8.24039.1A81422F@localhost> In-reply-to: <001a01c35ffc$651e7cc0$71327f81@joey> 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: 200308/166 X-Sequence-Number: 2983 On 11 Aug 2003 at 19:33, whchung@popularworld.com wrote: > Currently we are using postgresql 7.3 with Redhat linux 9. We find that > when we try to execute 200,000 update statement through JDBC, the performance > of degraded obviously for each update statement when comparing with less update > statement(eg. 5000). Is there any suggestion that we can improve the > performance for executing update statementat postgresql ? Thanks. How are you bunching your transactions? I mean how many updates per transaction? And have you tried moving WAL to separate disk for such a update heavy environment? Have you are tuned FSM to take care of dead tuples generated in vacuum? Are you running autovacuum daemon? All these things are almost a must for such update heavy environment.. Bye Shridhar -- Moore's Constant: Everybody sets out to do something, and everybody does something, but no one does what he sets out to do. From pgsql-performance-owner@postgresql.org Mon Aug 11 11:16: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 749B2D1C510 for ; Mon, 11 Aug 2003 14:16: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 99059-07 for ; Mon, 11 Aug 2003 11:14:50 -0300 (ADT) Received: from ucsns.ucs.co.za (ucs.co.za [196.23.43.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1A82ED1C4E1 for ; Mon, 11 Aug 2003 11:14:26 -0300 (ADT) Received: from ucspost.ucs.co.za (mailgw1.ucs.co.za [196.23.43.253]) by ucsns.ucs.co.za (Postfix) with ESMTP id 713C72BDF7 for ; Mon, 11 Aug 2003 16:12:26 +0200 (SAST) Received: from jhb.ucs.co.za (jhb.ucs.co.za [172.31.1.3]) by ucspost.ucs.co.za (Postfix) with ESMTP id 2376CDA9F5 for ; Mon, 11 Aug 2003 15:58:42 +0200 (SAST) Received: from svb.ucs.co.za (svb.ucs.co.za [172.31.1.148]) by jhb.ucs.co.za (Postfix) with SMTP id BD2219737E for ; Mon, 11 Aug 2003 15:58:41 +0200 (SAST) Date: Mon, 11 Aug 2003 15:58:41 +0200 From: Stef To: pgsql-performance@postgresql.org Subject: Analyze makes queries slow... Message-Id: <20030811155841.483ffd93.svb@ucs.co.za> X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i386-pc-linux-gnu) User-Agent: sillypheed-claws (anti-aliased) X-Face: LV^-*d3kQlL,6{Y:X)M~tuL#y!p.kO_Qbc!xxqhZC4s}Y]L0g)z^aiLsQGY34d|}Xp:HNm)MRsc?^?ZQ}smznF&jx|w@,a**K&QL.Dc~2~M5V`zb>hExCJDB[[o=M)e"; k-n[7tz2TY7+; *_xX's(5cUEtdw*yG-OmKm}6($zpUz8S`Nz@w X-Operating-System: sid X-X-X: _-^-_ Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/167 X-Sequence-Number: 2984 This is a multi-part message in MIME format. --Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi all, I posted this problem on the sql list, and was referred to this list in stead. I have attached an sql statement that normally runs under 3 minutes. That is, until I vacuum analyze the database (or just the tables in the query), then the same query runs longer than 12 hours, and I have to kill it. However 90% of queries are faster after analyzing on this database, there are two or three, including this one that takes for ever. I have tried to reverse engineer the explain plan from before analyzing, to come up with an sql statement, using proper joins, to force the planner to do the original join, but although I came close, I never got the same result as the original query. I suspect that this might be caused by some of the crazy indexes that were built on some of these tables, but I can't really do much about that, unless I can come up with a very good reason to nuke them. I also attached the "create table" statements for all the tables, as well as a row count of each. Can somebody help me with guidelines or something similar, to understand exactly what is happening in the explain plan. TIA Stefan --Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0 Content-Type: text/plain; name="explain_after.txt" Content-Disposition: attachment; filename="explain_after.txt" Content-Transfer-Encoding: 7bit Aggregate (cost=52.00..61.64 rows=32 width=241) -> Group (cost=52.00..57.62 rows=321 width=241) -> Sort (cost=52.00..52.80 rows=321 width=241) Sort Key: m.group_code, m.sku, m.brn_code, m.stktype_code, ss.supplier_price_curr_cost, sk.sku_price_curr_cost -> Merge Join (cost=36.38..38.62 rows=321 width=241) Merge Cond: (("outer".group_cde = "inner".group_cde) AND ("outer".brn_code = "inner".brn_code)) Join Filter: (("outer".price_tmpl_hdr_cde = "inner".price_tmpl_hdr_cde) AND ("outer".price_tmpl_hdr_reg = "inner".price_tmpl_hdr_reg)) -> Nested Loop (cost=0.00..1407212.08 rows=63 width=179) Join Filter: (("inner".sku_mst_cde = "outer".sku) AND ("inner".group_cde = "outer".group_code)) -> Merge Join (cost=0.00..1405644.89 rows=315 width=135) Merge Cond: ("outer".group_code = "inner".group_code) Join Filter: ("outer".sku = "inner".sku) -> Nested Loop (cost=0.00..4826563.70 rows=8694 width=108) -> Index Scan using master_fpp_values_idx2 on master_fpp_values m (cost=0.00..3766902.34 rows=215650 width=54) Filter: (fpp_code = '200307'::text) -> Index Scan using pk_supplier_price on supplier_price ss (cost=0.00..4.90 rows=1 width=54) Index Cond: ((ss.group_cde = "outer".group_code) AND (ss.sku_mst_cde = "outer".sku) AND (ss.supplier_cde = "outer".supplier_code)) -> Index Scan using master_sku_descr_idx3 on master_sku_descr s (cost=0.00..2535.04 rows=10758 width=27) Filter: (control_code = '0'::text) -> Index Scan using idx_sku_price on sku_price sk (cost=0.00..4.96 rows=1 width=44) Index Cond: ((sk.group_cde = "outer".group_cde) AND (sk.sku_mst_cde = "outer".sku_mst_cde) AND (sk.price_tmpl_hdr_cde = "outer".price_tmpl_hdr_cde) AND (sk.price_tmpl_hdr_reg = "outer".price_tmpl_hdr_reg)) -> Sort (cost=36.38..36.87 rows=198 width=62) Sort Key: p.group_cde, p.branch_cde -> Hash Join (cost=18.46..28.82 rows=198 width=62) Hash Cond: ("outer".brn_code = "inner".branch_cde) -> Merge Join (cost=13.94..20.34 rows=198 width=33) Merge Cond: ("outer".country_code = "inner".from_ctry) -> Index Scan using master_branch_descr_idx4 on master_branch_descr b (cost=0.00..33.12 rows=198 width=15) -> Sort (cost=13.94..13.95 rows=4 width=18) Sort Key: f.from_ctry -> Index Scan using forex_idx1 on forex f (cost=0.00..13.90 rows=4 width=18) Index Cond: ((to_ctry = 'ZAF'::text) AND (fpp_code = '200307'::text)) -> Hash (cost=4.02..4.02 rows=202 width=29) -> Seq Scan on price_tmpl_det p (cost=0.00..4.02 rows=202 width=29) (34 rows) --Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0 Content-Type: text/plain; name="explain_before.txt" Content-Disposition: attachment; filename="explain_before.txt" Content-Transfer-Encoding: 7bit Aggregate (cost=163.58..163.61 rows=1 width=699) -> Group (cost=163.58..163.60 rows=1 width=699) -> Sort (cost=163.58..163.58 rows=1 width=699) Sort Key: m.group_code, m.sku, m.brn_code, m.stktype_code, ss.supplier_price_curr_cost, sk.sku_price_curr_cost -> Nested Loop (cost=115.56..163.57 rows=1 width=699) Join Filter: (("outer".sku = "inner".sku) AND ("outer".group_code = "inner".group_code)) -> Nested Loop (cost=115.56..157.53 rows=1 width=635) Join Filter: (("inner".price_tmpl_hdr_cde = "outer".price_tmpl_hdr_cde) AND ("inner".price_tmpl_hdr_reg = "outer".price_tmpl_hdr_reg) AND ("inner".group_cde = "outer".group_cde)) -> Nested Loop (cost=115.56..152.49 rows=1 width=517) Join Filter: (("inner".group_cde = "outer".group_cde) AND ("inner".price_tmpl_hdr_cde = "outer".price_tmpl_hdr_cde) AND ("inner".price_tmpl_hdr_reg = "outer".price_tmpl_hdr_reg)) -> Hash Join (cost=115.56..147.45 rows=1 width=367) Hash Cond: ("outer".branch_cde = "inner".brn_code) Join Filter: ("inner".group_code = "outer".group_cde) -> Seq Scan on price_tmpl_det p (cost=0.00..20.00 rows=1000 width=100) -> Hash (cost=115.49..115.49 rows=25 width=267) -> Nested Loop (cost=0.00..115.49 rows=25 width=267) -> Nested Loop (cost=0.00..11.50 rows=1 width=115) -> Index Scan using forex_idx1 on forex f (cost=0.00..5.71 rows=1 width=51) Index Cond: ((to_ctry = 'ZAF'::text) AND (fpp_code = '200307'::text)) -> Index Scan using master_branch_descr_idx4 on master_branch_descr b (cost=0.00..5.78 rows=1 width=64) Index Cond: (b.country_code = "outer".from_ctry) -> Index Scan using master_fpp_values_uidx1 on master_fpp_values m (cost=0.00..103.68 rows=25 width=152) Index Cond: ((m.fpp_code = '200307'::text) AND (m.brn_code = "outer".brn_code)) -> Index Scan using pk_supplier_price on supplier_price ss (cost=0.00..5.02 rows=1 width=150) Index Cond: ((ss.group_cde = "outer".group_code) AND (ss.sku_mst_cde = "outer".sku) AND (ss.supplier_cde = "outer".supplier_code)) -> Index Scan using idx_sku_price on sku_price sk (cost=0.00..5.02 rows=1 width=118) Index Cond: ((sk.group_cde = "outer".group_cde) AND (sk.sku_mst_cde = "outer".sku_mst_cde) AND (sk.price_tmpl_hdr_cde = "outer".price_tmpl_hdr_cde) AND (sk.price_tmpl_hdr_reg = "outer".price_tmpl_hdr_reg)) -> Index Scan using master_sku_descr_idx1 on master_sku_descr s (cost=0.00..6.02 rows=1 width=64) Index Cond: (("outer".group_cde = s.group_code) AND ("outer".sku_mst_cde = s.sku) AND (s.control_code = '0'::text)) (29 rows) --Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0 Content-Type: application/octet-stream; name="forex.sql" Content-Disposition: attachment; filename="forex.sql" Content-Transfer-Encoding: base64 LS0KLS0gUG9zdGdyZVNRTCBkYXRhYmFzZSBkdW1wCi0tCgpcY29ubmVjdCAt IHBvc3RncmVzCgpTRVQgc2VhcmNoX3BhdGggPSBwdWJsaWMsIHBnX2NhdGFs b2c7CgotLQotLSBUT0MgZW50cnkgMiAoT0lEIDgwMjg4MDQpCi0tIE5hbWU6 IGZvcmV4OyBUeXBlOiBUQUJMRTsgU2NoZW1hOiBwdWJsaWM7IE93bmVyOiBw b3N0Z3JlcwotLQoKQ1JFQVRFIFRBQkxFIGZvcmV4ICgKICAgIGZyb21fY3Ry eSB0ZXh0IE5PVCBOVUxMLAogICAgdG9fY3RyeSB0ZXh0IE5PVCBOVUxMLAog ICAgZnBwX2NvZGUgdGV4dCBOT1QgTlVMTCwKICAgIGRlc2NyIHRleHQsCiAg ICBpc19hY3RpdmUgYm9vbGVhbiwKICAgIHNlcSBpbnRlZ2VyLAogICAgcmF0 ZSBudW1lcmljKDE4LDEwKQopOwoKCi0tCi0tIFRPQyBlbnRyeSAzIChPSUQg ODAyODgwNCkKLS0gTmFtZTogZm9yZXg7IFR5cGU6IEFDTDsgU2NoZW1hOiBw dWJsaWM7IE93bmVyOiBwb3N0Z3JlcwotLQoKUkVWT0tFIEFMTCBPTiBUQUJM RSBmb3JleCBGUk9NIFBVQkxJQzsKR1JBTlQgQUxMIE9OIFRBQkxFIGZvcmV4 IFRPIFBVQkxJQzsKCgotLQotLSBUT0MgZW50cnkgNCAoT0lEIDg3ODA3MjIp Ci0tIE5hbWU6IGZvcmV4X2lkeDE7IFR5cGU6IElOREVYOyBTY2hlbWE6IHB1 YmxpYzsgT3duZXI6IHBvc3RncmVzCi0tCgpDUkVBVEUgSU5ERVggZm9yZXhf aWR4MSBPTiBmb3JleCBVU0lORyBidHJlZSAodG9fY3RyeSwgZnBwX2NvZGUp OwoKCi0tCi0tIFRPQyBlbnRyeSA1IChPSUQgODAyODgwOSkKLS0gTmFtZTog Zm9yZXhfcGs7IFR5cGU6IENPTlNUUkFJTlQ7IFNjaGVtYTogcHVibGljOyBP d25lcjogcG9zdGdyZXMKLS0KCkFMVEVSIFRBQkxFIE9OTFkgZm9yZXgKICAg IEFERCBDT05TVFJBSU5UIGZvcmV4X3BrIFBSSU1BUlkgS0VZIChmcm9tX2N0 cnksIHRvX2N0cnksIGZwcF9jb2RlKTsKCgotLQotLSBUT0MgZW50cnkgNiAo T0lEIDgwMjg4MTEpCi0tIE5hbWU6IGZvcmV4X2Zyb21fY3RyeV9mazsgVHlw ZTogQ09OU1RSQUlOVDsgU2NoZW1hOiBwdWJsaWM7IE93bmVyOiBwb3N0Z3Jl cwotLQoKQUxURVIgVEFCTEUgT05MWSBmb3JleAogICAgQUREIENPTlNUUkFJ TlQgZm9yZXhfZnJvbV9jdHJ5X2ZrIEZPUkVJR04gS0VZIChmcm9tX2N0cnkp IFJFRkVSRU5DRVMgY291bnRyeShjb2RlKSBPTiBVUERBVEUgTk8gQUNUSU9O IE9OIERFTEVURSBOTyBBQ1RJT047CgoKLS0KLS0gVE9DIGVudHJ5IDcgKE9J RCA4MDI4ODE1KQotLSBOYW1lOiBmb3JleF90b19jdHJ5X2ZrOyBUeXBlOiBD T05TVFJBSU5UOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0t CgpBTFRFUiBUQUJMRSBPTkxZIGZvcmV4CiAgICBBREQgQ09OU1RSQUlOVCBm b3JleF90b19jdHJ5X2ZrIEZPUkVJR04gS0VZICh0b19jdHJ5KSBSRUZFUkVO Q0VTIGNvdW50cnkoY29kZSkgT04gVVBEQVRFIE5PIEFDVElPTiBPTiBERUxF VEUgTk8gQUNUSU9OOwoKCi0tCi0tIFRPQyBlbnRyeSA4IChPSUQgODAyODgx OSkKLS0gTmFtZTogZm9yZXhfZnBwX2ZrOyBUeXBlOiBDT05TVFJBSU5UOyBT Y2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0tCgpBTFRFUiBUQUJM RSBPTkxZIGZvcmV4CiAgICBBREQgQ09OU1RSQUlOVCBmb3JleF9mcHBfZmsg Rk9SRUlHTiBLRVkgKGZwcF9jb2RlKSBSRUZFUkVOQ0VTIGZwcChjb2RlKSBP TiBVUERBVEUgTk8gQUNUSU9OIE9OIERFTEVURSBOTyBBQ1RJT047CgoK --Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0 Content-Type: application/octet-stream; name="master_branch_descr.sql" Content-Disposition: attachment; filename="master_branch_descr.sql" Content-Transfer-Encoding: base64 LS0KLS0gUG9zdGdyZVNRTCBkYXRhYmFzZSBkdW1wCi0tCgpcY29ubmVjdCAt IHBvc3RncmVzCgpTRVQgc2VhcmNoX3BhdGggPSBwdWJsaWMsIHBnX2NhdGFs b2c7CgotLQotLSBUT0MgZW50cnkgMiAoT0lEIDg4Njc0MjcpCi0tIE5hbWU6 IG1hc3Rlcl9icmFuY2hfZGVzY3I7IFR5cGU6IFRBQkxFOyBTY2hlbWE6IHB1 YmxpYzsgT3duZXI6IHBvc3RncmVzCi0tCgpDUkVBVEUgVEFCTEUgbWFzdGVy X2JyYW5jaF9kZXNjciAoCiAgICBicm5fY29kZSB0ZXh0IE5PVCBOVUxMLAog ICAgYnJuX2Rlc2NyIHRleHQsCiAgICBjb3VudHJ5X2NvZGUgdGV4dCwKICAg IGNvdW50cnlfZGVzY3IgdGV4dCwKICAgIGNsdXN0ZXJfY29kZSB0ZXh0LAog ICAgY2x1c3Rlcl9kZXNjciB0ZXh0LAogICAgYnJhbmRfY29kZSB0ZXh0LAog ICAgYnJhbmRfZGVzY3IgdGV4dCwKICAgIGNoYWluX2NvZGUgdGV4dCwKICAg IGNoYWluX2Rlc2NyIHRleHQsCiAgICBzYnVfY29kZSB0ZXh0LAogICAgc2J1 X2Rlc2NyIHRleHQsCiAgICBncm91cF9jb2RlIHRleHQsCiAgICBncm91cF9k ZXNjciB0ZXh0LAogICAgcmVnaW9uX2NvZGUgdGV4dCwKICAgIHJlZ2lvbl9k ZXNjciB0ZXh0LAogICAgZGl2aXNpb25fY29kZSB0ZXh0LAogICAgZGl2aXNp b25fZGVzY3IgdGV4dAopOwoKCi0tCi0tIFRPQyBlbnRyeSAyMyAoT0lEIDg4 Njc2MzIpCi0tIE5hbWU6IG1hc3Rlcl9icmFuY2hfZGVzY3JfdWlkeDE7IFR5 cGU6IElOREVYOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0t CgpDUkVBVEUgVU5JUVVFIElOREVYIG1hc3Rlcl9icmFuY2hfZGVzY3JfdWlk eDEgT04gbWFzdGVyX2JyYW5jaF9kZXNjciBVU0lORyBidHJlZSAoYnJuX2Nv ZGUpOwoKCi0tCi0tIFRPQyBlbnRyeSAyNCAoT0lEIDg4Njc2MzMpCi0tIE5h bWU6IG1hc3Rlcl9icmFuY2hfZGVzY3JfdWlkeDI7IFR5cGU6IElOREVYOyBT Y2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0tCgpDUkVBVEUgVU5J UVVFIElOREVYIG1hc3Rlcl9icmFuY2hfZGVzY3JfdWlkeDIgT04gbWFzdGVy X2JyYW5jaF9kZXNjciBVU0lORyBidHJlZSAoYnJuX2NvZGUsIGJybl9kZXNj cik7CgoKLS0KLS0gVE9DIGVudHJ5IDMgKE9JRCA4ODY3NjM0KQotLSBOYW1l OiBtYXN0ZXJfYnJhbmNoX2Rlc2NyX2lkeDE7IFR5cGU6IElOREVYOyBTY2hl bWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0tCgpDUkVBVEUgSU5ERVgg bWFzdGVyX2JyYW5jaF9kZXNjcl9pZHgxIE9OIG1hc3Rlcl9icmFuY2hfZGVz Y3IgVVNJTkcgYnRyZWUgKGJybl9jb2RlLCBicm5fZGVzY3IsIGNvdW50cnlf Y29kZSwgY291bnRyeV9kZXNjcik7CgoKLS0KLS0gVE9DIGVudHJ5IDE0IChP SUQgODg2NzYzNSkKLS0gTmFtZTogbWFzdGVyX2JyYW5jaF9kZXNjcl9pZHgy OyBUeXBlOiBJTkRFWDsgU2NoZW1hOiBwdWJsaWM7IE93bmVyOiBwb3N0Z3Jl cwotLQoKQ1JFQVRFIElOREVYIG1hc3Rlcl9icmFuY2hfZGVzY3JfaWR4MiBP TiBtYXN0ZXJfYnJhbmNoX2Rlc2NyIFVTSU5HIGJ0cmVlIChicm5fY29kZSwg YnJuX2Rlc2NyLCBjbHVzdGVyX2NvZGUsIGNsdXN0ZXJfZGVzY3IpOwoKCi0t Ci0tIFRPQyBlbnRyeSAxNSAoT0lEIDg4Njc2MzYpCi0tIE5hbWU6IG1hc3Rl cl9icmFuY2hfZGVzY3JfaWR4MzsgVHlwZTogSU5ERVg7IFNjaGVtYTogcHVi bGljOyBPd25lcjogcG9zdGdyZXMKLS0KCkNSRUFURSBJTkRFWCBtYXN0ZXJf YnJhbmNoX2Rlc2NyX2lkeDMgT04gbWFzdGVyX2JyYW5jaF9kZXNjciBVU0lO RyBidHJlZSAoYnJuX2Rlc2NyLCBicm5fY29kZSk7CgoKLS0KLS0gVE9DIGVu dHJ5IDE2IChPSUQgODg2NzYzNykKLS0gTmFtZTogbWFzdGVyX2JyYW5jaF9k ZXNjcl9pZHg0OyBUeXBlOiBJTkRFWDsgU2NoZW1hOiBwdWJsaWM7IE93bmVy OiBwb3N0Z3JlcwotLQoKQ1JFQVRFIElOREVYIG1hc3Rlcl9icmFuY2hfZGVz Y3JfaWR4NCBPTiBtYXN0ZXJfYnJhbmNoX2Rlc2NyIFVTSU5HIGJ0cmVlIChj b3VudHJ5X2NvZGUsIGJybl9jb2RlKTsKCgotLQotLSBUT0MgZW50cnkgMTcg KE9JRCA4ODY3NjM4KQotLSBOYW1lOiBtYXN0ZXJfYnJhbmNoX2Rlc2NyX2lk eDU7IFR5cGU6IElOREVYOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3Rn cmVzCi0tCgpDUkVBVEUgSU5ERVggbWFzdGVyX2JyYW5jaF9kZXNjcl9pZHg1 IE9OIG1hc3Rlcl9icmFuY2hfZGVzY3IgVVNJTkcgYnRyZWUgKGNvdW50cnlf ZGVzY3IsIGJybl9jb2RlKTsKCgotLQotLSBUT0MgZW50cnkgMTggKE9JRCA4 ODY3NjM5KQotLSBOYW1lOiBtYXN0ZXJfYnJhbmNoX2Rlc2NyX2lkeDY7IFR5 cGU6IElOREVYOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0t CgpDUkVBVEUgSU5ERVggbWFzdGVyX2JyYW5jaF9kZXNjcl9pZHg2IE9OIG1h c3Rlcl9icmFuY2hfZGVzY3IgVVNJTkcgYnRyZWUgKGNsdXN0ZXJfY29kZSwg YnJuX2NvZGUpOwoKCi0tCi0tIFRPQyBlbnRyeSAxOSAoT0lEIDg4Njc2NDAp Ci0tIE5hbWU6IG1hc3Rlcl9icmFuY2hfZGVzY3JfaWR4NzsgVHlwZTogSU5E RVg7IFNjaGVtYTogcHVibGljOyBPd25lcjogcG9zdGdyZXMKLS0KCkNSRUFU RSBJTkRFWCBtYXN0ZXJfYnJhbmNoX2Rlc2NyX2lkeDcgT04gbWFzdGVyX2Jy YW5jaF9kZXNjciBVU0lORyBidHJlZSAoY2x1c3Rlcl9kZXNjciwgYnJuX2Nv ZGUpOwoKCi0tCi0tIFRPQyBlbnRyeSAyMCAoT0lEIDg4Njc2NDEpCi0tIE5h bWU6IG1hc3Rlcl9icmFuY2hfZGVzY3JfaWR4ODsgVHlwZTogSU5ERVg7IFNj aGVtYTogcHVibGljOyBPd25lcjogcG9zdGdyZXMKLS0KCkNSRUFURSBJTkRF WCBtYXN0ZXJfYnJhbmNoX2Rlc2NyX2lkeDggT04gbWFzdGVyX2JyYW5jaF9k ZXNjciBVU0lORyBidHJlZSAoYnJhbmRfY29kZSwgYnJuX2NvZGUpOwoKCi0t Ci0tIFRPQyBlbnRyeSAyMSAoT0lEIDg4Njc2NDIpCi0tIE5hbWU6IG1hc3Rl cl9icmFuY2hfZGVzY3JfaWR4OTsgVHlwZTogSU5ERVg7IFNjaGVtYTogcHVi bGljOyBPd25lcjogcG9zdGdyZXMKLS0KCkNSRUFURSBJTkRFWCBtYXN0ZXJf YnJhbmNoX2Rlc2NyX2lkeDkgT04gbWFzdGVyX2JyYW5jaF9kZXNjciBVU0lO RyBidHJlZSAoYnJhbmRfZGVzY3IsIGJybl9jb2RlKTsKCgotLQotLSBUT0Mg ZW50cnkgNCAoT0lEIDg4Njc2NDMpCi0tIE5hbWU6IG1hc3Rlcl9icmFuY2hf ZGVzY3JfaWR4MTA7IFR5cGU6IElOREVYOyBTY2hlbWE6IHB1YmxpYzsgT3du ZXI6IHBvc3RncmVzCi0tCgpDUkVBVEUgSU5ERVggbWFzdGVyX2JyYW5jaF9k ZXNjcl9pZHgxMCBPTiBtYXN0ZXJfYnJhbmNoX2Rlc2NyIFVTSU5HIGJ0cmVl IChjaGFpbl9jb2RlLCBicm5fY29kZSk7CgoKLS0KLS0gVE9DIGVudHJ5IDUg KE9JRCA4ODY3NjQ0KQotLSBOYW1lOiBtYXN0ZXJfYnJhbmNoX2Rlc2NyX2lk eDExOyBUeXBlOiBJTkRFWDsgU2NoZW1hOiBwdWJsaWM7IE93bmVyOiBwb3N0 Z3JlcwotLQoKQ1JFQVRFIElOREVYIG1hc3Rlcl9icmFuY2hfZGVzY3JfaWR4 MTEgT04gbWFzdGVyX2JyYW5jaF9kZXNjciBVU0lORyBidHJlZSAoY2hhaW5f ZGVzY3IsIGJybl9jb2RlKTsKCgotLQotLSBUT0MgZW50cnkgNiAoT0lEIDg4 Njc2NDUpCi0tIE5hbWU6IG1hc3Rlcl9icmFuY2hfZGVzY3JfaWR4MTI7IFR5 cGU6IElOREVYOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0t CgpDUkVBVEUgSU5ERVggbWFzdGVyX2JyYW5jaF9kZXNjcl9pZHgxMiBPTiBt YXN0ZXJfYnJhbmNoX2Rlc2NyIFVTSU5HIGJ0cmVlIChzYnVfY29kZSwgYnJu X2NvZGUpOwoKCi0tCi0tIFRPQyBlbnRyeSA3IChPSUQgODg2NzY0NikKLS0g TmFtZTogbWFzdGVyX2JyYW5jaF9kZXNjcl9pZHgxMzsgVHlwZTogSU5ERVg7 IFNjaGVtYTogcHVibGljOyBPd25lcjogcG9zdGdyZXMKLS0KCkNSRUFURSBJ TkRFWCBtYXN0ZXJfYnJhbmNoX2Rlc2NyX2lkeDEzIE9OIG1hc3Rlcl9icmFu Y2hfZGVzY3IgVVNJTkcgYnRyZWUgKHNidV9kZXNjciwgYnJuX2NvZGUpOwoK Ci0tCi0tIFRPQyBlbnRyeSA4IChPSUQgODg2NzY0NykKLS0gTmFtZTogbWFz dGVyX2JyYW5jaF9kZXNjcl9pZHgxNDsgVHlwZTogSU5ERVg7IFNjaGVtYTog cHVibGljOyBPd25lcjogcG9zdGdyZXMKLS0KCkNSRUFURSBJTkRFWCBtYXN0 ZXJfYnJhbmNoX2Rlc2NyX2lkeDE0IE9OIG1hc3Rlcl9icmFuY2hfZGVzY3Ig VVNJTkcgYnRyZWUgKGdyb3VwX2NvZGUsIGJybl9jb2RlKTsKCgotLQotLSBU T0MgZW50cnkgOSAoT0lEIDg4Njc2NDgpCi0tIE5hbWU6IG1hc3Rlcl9icmFu Y2hfZGVzY3JfaWR4MTU7IFR5cGU6IElOREVYOyBTY2hlbWE6IHB1YmxpYzsg T3duZXI6IHBvc3RncmVzCi0tCgpDUkVBVEUgSU5ERVggbWFzdGVyX2JyYW5j aF9kZXNjcl9pZHgxNSBPTiBtYXN0ZXJfYnJhbmNoX2Rlc2NyIFVTSU5HIGJ0 cmVlIChncm91cF9kZXNjciwgYnJuX2NvZGUpOwoKCi0tCi0tIFRPQyBlbnRy eSAxMCAoT0lEIDg4Njc2NDkpCi0tIE5hbWU6IG1hc3Rlcl9icmFuY2hfZGVz Y3JfaWR4MTY7IFR5cGU6IElOREVYOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6 IHBvc3RncmVzCi0tCgpDUkVBVEUgSU5ERVggbWFzdGVyX2JyYW5jaF9kZXNj cl9pZHgxNiBPTiBtYXN0ZXJfYnJhbmNoX2Rlc2NyIFVTSU5HIGJ0cmVlIChy ZWdpb25fY29kZSwgYnJuX2NvZGUpOwoKCi0tCi0tIFRPQyBlbnRyeSAxMSAo T0lEIDg4Njc2NTApCi0tIE5hbWU6IG1hc3Rlcl9icmFuY2hfZGVzY3JfaWR4 MTc7IFR5cGU6IElOREVYOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3Rn cmVzCi0tCgpDUkVBVEUgSU5ERVggbWFzdGVyX2JyYW5jaF9kZXNjcl9pZHgx NyBPTiBtYXN0ZXJfYnJhbmNoX2Rlc2NyIFVTSU5HIGJ0cmVlIChyZWdpb25f ZGVzY3IsIGJybl9jb2RlKTsKCgotLQotLSBUT0MgZW50cnkgMTIgKE9JRCA4 ODY3NjUxKQotLSBOYW1lOiBtYXN0ZXJfYnJhbmNoX2Rlc2NyX2lkeDE4OyBU eXBlOiBJTkRFWDsgU2NoZW1hOiBwdWJsaWM7IE93bmVyOiBwb3N0Z3Jlcwot LQoKQ1JFQVRFIElOREVYIG1hc3Rlcl9icmFuY2hfZGVzY3JfaWR4MTggT04g bWFzdGVyX2JyYW5jaF9kZXNjciBVU0lORyBidHJlZSAoZGl2aXNpb25fY29k ZSwgYnJuX2NvZGUpOwoKCi0tCi0tIFRPQyBlbnRyeSAxMyAoT0lEIDg4Njc2 NTIpCi0tIE5hbWU6IG1hc3Rlcl9icmFuY2hfZGVzY3JfaWR4MTk7IFR5cGU6 IElOREVYOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0tCgpD UkVBVEUgSU5ERVggbWFzdGVyX2JyYW5jaF9kZXNjcl9pZHgxOSBPTiBtYXN0 ZXJfYnJhbmNoX2Rlc2NyIFVTSU5HIGJ0cmVlIChkaXZpc2lvbl9kZXNjciwg YnJuX2NvZGUpOwoKCi0tCi0tIFRPQyBlbnRyeSAyMiAoT0lEIDg4Njc0MzIp Ci0tIE5hbWU6IG1hc3Rlcl9icmFuY2hfZGVzY3JfcGtleTsgVHlwZTogQ09O U1RSQUlOVDsgU2NoZW1hOiBwdWJsaWM7IE93bmVyOiBwb3N0Z3JlcwotLQoK QUxURVIgVEFCTEUgT05MWSBtYXN0ZXJfYnJhbmNoX2Rlc2NyCiAgICBBREQg Q09OU1RSQUlOVCBtYXN0ZXJfYnJhbmNoX2Rlc2NyX3BrZXkgUFJJTUFSWSBL RVkgKGJybl9jb2RlKTsKCgo= --Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0 Content-Type: application/octet-stream; name="master_fpp_values.sql" Content-Disposition: attachment; filename="master_fpp_values.sql" Content-Transfer-Encoding: base64 LS0KLS0gUG9zdGdyZVNRTCBkYXRhYmFzZSBkdW1wCi0tCgpcY29ubmVjdCAt IHBvc3RncmVzCgpTRVQgc2VhcmNoX3BhdGggPSBwdWJsaWMsIHBnX2NhdGFs b2c7CgotLQotLSBUT0MgZW50cnkgMiAoT0lEIDE3MTUwKQotLSBOYW1lOiBt YXN0ZXJfZnBwX3ZhbHVlczsgVHlwZTogVEFCTEU7IFNjaGVtYTogcHVibGlj OyBPd25lcjogcG9zdGdyZXMKLS0KCkNSRUFURSBUQUJMRSBtYXN0ZXJfZnBw X3ZhbHVlcyAoCiAgICBmcHBfY29kZSB0ZXh0IE5PVCBOVUxMLAogICAgYnJu X2NvZGUgdGV4dCBOT1QgTlVMTCwKICAgIHNrdSB0ZXh0IE5PVCBOVUxMLAog ICAgZ3JvdXBfY29kZSB0ZXh0IE5PVCBOVUxMLAogICAgc3RrdHlwZV9jb2Rl IGNoYXJhY3RlciB2YXJ5aW5nKDIpLAogICAgc3VwcGxpZXJfY29kZSB0ZXh0 LAogICAgbXRoX3Nsc19xdHlfMDEgbnVtZXJpYygxNiwzKSwKICAgIG10aF9z bHNfcXR5XzAyIG51bWVyaWMoMTYsMyksCiAgICBtdGhfc2xzX3F0eV8wMyBu dW1lcmljKDE2LDMpLAogICAgbXRoX3Nsc19xdHlfMDQgbnVtZXJpYygxNiwz KSwKICAgIG10aF9zbHNfcXR5XzA1IG51bWVyaWMoMTYsMyksCiAgICBtdGhf c2xzX3F0eV8wNiBudW1lcmljKDE2LDMpLAogICAgbXRoX3Nsc19xdHlfMDcg bnVtZXJpYygxNiwzKSwKICAgIG10aF9zbHNfcXR5XzA4IG51bWVyaWMoMTYs MyksCiAgICBtdGhfc2xzX3F0eV8wOSBudW1lcmljKDE2LDMpLAogICAgbXRo X3Nsc19xdHlfMTAgbnVtZXJpYygxNiwzKSwKICAgIG10aF9zbHNfcXR5XzEx IG51bWVyaWMoMTYsMyksCiAgICBtdGhfc2xzX3F0eV8xMiBudW1lcmljKDE2 LDMpLAogICAgcXR5X29uX2hhbmRfMDEgbnVtZXJpYygxNiwzKSwKICAgIHF0 eV9vbl9oYW5kXzAyIG51bWVyaWMoMTYsMyksCiAgICBxdHlfb25faGFuZF8w MyBudW1lcmljKDE2LDMpLAogICAgcXR5X29uX2hhbmRfMDQgbnVtZXJpYygx NiwzKSwKICAgIHF0eV9vbl9oYW5kXzA1IG51bWVyaWMoMTYsMyksCiAgICBx dHlfb25faGFuZF8wNiBudW1lcmljKDE2LDMpLAogICAgcXR5X29uX2hhbmRf MDcgbnVtZXJpYygxNiwzKSwKICAgIHF0eV9vbl9oYW5kXzA4IG51bWVyaWMo MTYsMyksCiAgICBxdHlfb25faGFuZF8wOSBudW1lcmljKDE2LDMpLAogICAg cXR5X29uX2hhbmRfMTAgbnVtZXJpYygxNiwzKSwKICAgIHF0eV9vbl9oYW5k XzExIG51bWVyaWMoMTYsMyksCiAgICBxdHlfb25faGFuZF8xMiBudW1lcmlj KDE2LDMpLAogICAgbXRoX3Nsc19jc3QgbnVtZXJpYygxNiwzKSwKICAgIG10 aF9zbHNfZGlzYyBudW1lcmljKDE2LDMpLAogICAgbXRoX3Nsc19uZXR0X2V4 Y2wgbnVtZXJpYygxNiwzKSwKICAgIG10aF9xdHlfb25faGFuZF9jc3QgbnVt ZXJpYygxNiwzKSwKICAgIG10aF9zbHNfcXR5X3VuZCBudW1lcmljKDE2LDMp LAogICAgcXR5X2luX2dvb2RzIG51bWVyaWMoMTYsMyksCiAgICBtYXRfc2xz X3F0eSBudW1lcmljKDE2LDMpLAogICAgeXRkX3Nsc19xdHkgbnVtZXJpYygx NiwzKSwKICAgIG1hdF9zbHNfY3N0IG51bWVyaWMoMTYsMyksCiAgICB5dGRf c2xzX2NzdCBudW1lcmljKDE2LDMpLAogICAgbWF0X3Nsc19kaXNjIG51bWVy aWMoMTYsMyksCiAgICB5dGRfc2xzX2Rpc2MgbnVtZXJpYygxNiwzKSwKICAg IG1hdF9zbHNfbmV0dF9leGNsIG51bWVyaWMoMTYsMyksCiAgICB5dGRfc2xz X25ldHRfZXhjbCBudW1lcmljKDE2LDMpLAogICAgbHlfbXRoX3Nsc19uZXR0 X2V4Y2wgbnVtZXJpYygxNiwzKSwKICAgIGx5X3l0ZF9zbHNfbmV0dF9leGNs IG51bWVyaWMoMTYsMyksCiAgICBzdGtfdHVybl9xdHlfb25faGFuZF9jc3Qg bnVtZXJpYygxNiwzKSwKICAgIG5vX210aHNfaGlzdG9yeSBpbnRlZ2VyIERF RkFVTFQgMCwKICAgIGN1cnJlbnRfb3JkZXJzIGludGVnZXIsCiAgICBvdmVy ZHVlX29yZGVycyBpbnRlZ2VyCik7CgoKLS0KLS0gVE9DIGVudHJ5IDMgKE9J RCA4MDIyNDIxKQotLSBOYW1lOiBtYXN0ZXJfZnBwX3ZhbHVlc19pZHgxOyBU eXBlOiBJTkRFWDsgU2NoZW1hOiBwdWJsaWM7IE93bmVyOiBwb3N0Z3Jlcwot LQoKQ1JFQVRFIElOREVYIG1hc3Rlcl9mcHBfdmFsdWVzX2lkeDEgT04gbWFz dGVyX2ZwcF92YWx1ZXMgVVNJTkcgYnRyZWUgKHNrdSk7CgoKLS0KLS0gVE9D IGVudHJ5IDQgKE9JRCA4MDIyNDM5KQotLSBOYW1lOiBtYXN0ZXJfZnBwX3Zh bHVlc19pZHgyOyBUeXBlOiBJTkRFWDsgU2NoZW1hOiBwdWJsaWM7IE93bmVy OiBwb3N0Z3JlcwotLQoKQ1JFQVRFIElOREVYIG1hc3Rlcl9mcHBfdmFsdWVz X2lkeDIgT04gbWFzdGVyX2ZwcF92YWx1ZXMgVVNJTkcgYnRyZWUgKGdyb3Vw X2NvZGUsIGJybl9jb2RlLCBza3UpOwoKCi0tCi0tIFRPQyBlbnRyeSA1IChP SUQgODAyMjQ0MCkKLS0gTmFtZTogbWFzdGVyX2ZwcF92YWx1ZXNfaWR4Mzsg VHlwZTogSU5ERVg7IFNjaGVtYTogcHVibGljOyBPd25lcjogcG9zdGdyZXMK LS0KCkNSRUFURSBJTkRFWCBtYXN0ZXJfZnBwX3ZhbHVlc19pZHgzIE9OIG1h c3Rlcl9mcHBfdmFsdWVzIFVTSU5HIGJ0cmVlIChmcHBfY29kZSk7CgoKLS0K LS0gVE9DIGVudHJ5IDYgKE9JRCA4MDIyNDQyKQotLSBOYW1lOiBtYXN0ZXJf ZnBwX3ZhbHVlc19pZHg0OyBUeXBlOiBJTkRFWDsgU2NoZW1hOiBwdWJsaWM7 IE93bmVyOiBwb3N0Z3JlcwotLQoKQ1JFQVRFIElOREVYIG1hc3Rlcl9mcHBf dmFsdWVzX2lkeDQgT04gbWFzdGVyX2ZwcF92YWx1ZXMgVVNJTkcgYnRyZWUg KGZwcF9jb2RlLCBza3UpOwoKCi0tCi0tIFRPQyBlbnRyeSA3IChPSUQgODAy MjQ0MykKLS0gTmFtZTogbWFzdGVyX2ZwcF92YWx1ZXNfaWR4NTsgVHlwZTog SU5ERVg7IFNjaGVtYTogcHVibGljOyBPd25lcjogcG9zdGdyZXMKLS0KCkNS RUFURSBJTkRFWCBtYXN0ZXJfZnBwX3ZhbHVlc19pZHg1IE9OIG1hc3Rlcl9m cHBfdmFsdWVzIFVTSU5HIGJ0cmVlIChicm5fY29kZSk7CgoKLS0KLS0gVE9D IGVudHJ5IDggKE9JRCA4MDIyNjE3KQotLSBOYW1lOiBtYXN0ZXJfZnBwX3Zh bHVlc19wazsgVHlwZTogQ09OU1RSQUlOVDsgU2NoZW1hOiBwdWJsaWM7IE93 bmVyOiBwb3N0Z3JlcwotLQoKQUxURVIgVEFCTEUgT05MWSBtYXN0ZXJfZnBw X3ZhbHVlcwogICAgQUREIENPTlNUUkFJTlQgbWFzdGVyX2ZwcF92YWx1ZXNf cGsgUFJJTUFSWSBLRVkgKGZwcF9jb2RlLCBicm5fY29kZSwgc2t1KTsKCgot LQotLSBUT0MgZW50cnkgMTIgKE9JRCA4MDIyNjE5KQotLSBOYW1lOiBtYXN0 ZXJfZnBwX3ZhbHVlc19mazsgVHlwZTogQ09OU1RSQUlOVDsgU2NoZW1hOiBw dWJsaWM7IE93bmVyOiBwb3N0Z3JlcwotLQoKQUxURVIgVEFCTEUgT05MWSBt YXN0ZXJfZnBwX3ZhbHVlcwogICAgQUREIENPTlNUUkFJTlQgbWFzdGVyX2Zw cF92YWx1ZXNfZmsgRk9SRUlHTiBLRVkgKGdyb3VwX2NvZGUsIHNrdSkgUkVG RVJFTkNFUyBpdGVtKGdyb3VwX2NvZGUsIHNrdSkgT04gVVBEQVRFIE5PIEFD VElPTiBPTiBERUxFVEUgTk8gQUNUSU9OOwoKCi0tCi0tIFRPQyBlbnRyeSAx MSAoT0lEIDgwMjI2NjkpCi0tIE5hbWU6IG1hc3Rlcl9mcHBfdmFsdWVzX3Vp ZHgzOyBUeXBlOiBDT05TVFJBSU5UOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6 IHBvc3RncmVzCi0tCgpBTFRFUiBUQUJMRSBPTkxZIG1hc3Rlcl9mcHBfdmFs dWVzCiAgICBBREQgQ09OU1RSQUlOVCBtYXN0ZXJfZnBwX3ZhbHVlc191aWR4 MyBVTklRVUUgKGJybl9jb2RlLCBmcHBfY29kZSwgc2t1KTsKCgotLQotLSBU T0MgZW50cnkgMTAgKE9JRCA4MDIyNjcxKQotLSBOYW1lOiBtYXN0ZXJfZnBw X3ZhbHVlc191aWR4MjsgVHlwZTogQ09OU1RSQUlOVDsgU2NoZW1hOiBwdWJs aWM7IE93bmVyOiBwb3N0Z3JlcwotLQoKQUxURVIgVEFCTEUgT05MWSBtYXN0 ZXJfZnBwX3ZhbHVlcwogICAgQUREIENPTlNUUkFJTlQgbWFzdGVyX2ZwcF92 YWx1ZXNfdWlkeDIgVU5JUVVFIChmcHBfY29kZSwgYnJuX2NvZGUsIHNrdSk7 CgoKLS0KLS0gVE9DIGVudHJ5IDkgKE9JRCA4MDIyNjczKQotLSBOYW1lOiBt YXN0ZXJfZnBwX3ZhbHVlc191aWR4MTsgVHlwZTogQ09OU1RSQUlOVDsgU2No ZW1hOiBwdWJsaWM7IE93bmVyOiBwb3N0Z3JlcwotLQoKQUxURVIgVEFCTEUg T05MWSBtYXN0ZXJfZnBwX3ZhbHVlcwogICAgQUREIENPTlNUUkFJTlQgbWFz dGVyX2ZwcF92YWx1ZXNfdWlkeDEgVU5JUVVFIChmcHBfY29kZSwgYnJuX2Nv ZGUsIHNrdSwgZ3JvdXBfY29kZSk7CgoK --Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0 Content-Type: application/octet-stream; name="master_sku_descr.sql" Content-Disposition: attachment; filename="master_sku_descr.sql" Content-Transfer-Encoding: base64 LS0KLS0gUG9zdGdyZVNRTCBkYXRhYmFzZSBkdW1wCi0tCgpcY29ubmVjdCAt IHBvc3RncmVzCgpTRVQgc2VhcmNoX3BhdGggPSBwdWJsaWMsIHBnX2NhdGFs b2c7CgotLQotLSBUT0MgZW50cnkgMiAoT0lEIDg4Njc0MDYpCi0tIE5hbWU6 IG1hc3Rlcl9za3VfZGVzY3I7IFR5cGU6IFRBQkxFOyBTY2hlbWE6IHB1Ymxp YzsgT3duZXI6IHBvc3RncmVzCi0tCgpDUkVBVEUgVEFCTEUgbWFzdGVyX3Nr dV9kZXNjciAoCiAgICBncm91cF9jb2RlIHRleHQsCiAgICBza3UgdGV4dCwK ICAgIHNrdV9kZXNjciB0ZXh0LAogICAgZGVwX2NvZGUgdGV4dCwKICAgIGRl cF9kZXNjciB0ZXh0LAogICAgY2F0X2NvZGUgdGV4dCwKICAgIGNhdF9kZXNj ciB0ZXh0LAogICAgc3ViY2F0X2NvZGUgdGV4dCwKICAgIHN1YmNhdF9kZXNj ciB0ZXh0LAogICAgY29udHJvbF9jb2RlIHRleHQsCiAgICBjb250cm9sX2Rl c2NyIHRleHQsCiAgICBzdXBwbGllcl9jb2RlIHRleHQsCiAgICBzdXBwbGll cl9kZXNjciB0ZXh0CikgV0lUSE9VVCBPSURTOwoKCi0tCi0tIFRPQyBlbnRy eSA5IChPSUQgODg2NzQxMSkKLS0gTmFtZTogbWFzdGVyX3NrdV9kZXNjcl9p ZHgyOyBUeXBlOiBJTkRFWDsgU2NoZW1hOiBwdWJsaWM7IE93bmVyOiBwb3N0 Z3JlcwotLQoKQ1JFQVRFIElOREVYIG1hc3Rlcl9za3VfZGVzY3JfaWR4MiBP TiBtYXN0ZXJfc2t1X2Rlc2NyIFVTSU5HIGJ0cmVlIChncm91cF9jb2RlLCBz a3UsIGRlcF9jb2RlLCBjYXRfY29kZSwgc3ViY2F0X2NvZGUsIGNvbnRyb2xf Y29kZSk7CgoKLS0KLS0gVE9DIGVudHJ5IDE4IChPSUQgODg2NzQxMikKLS0g TmFtZTogbWFzdGVyX3NrdV9kZXNjcl91aWR4MzsgVHlwZTogSU5ERVg7IFNj aGVtYTogcHVibGljOyBPd25lcjogcG9zdGdyZXMKLS0KCkNSRUFURSBJTkRF WCBtYXN0ZXJfc2t1X2Rlc2NyX3VpZHgzIE9OIG1hc3Rlcl9za3VfZGVzY3Ig VVNJTkcgYnRyZWUgKHNrdSk7CgoKLS0KLS0gVE9DIGVudHJ5IDMgKE9JRCA4 ODY3NDEzKQotLSBOYW1lOiBtYXN0ZXJfc2t1X2Rlc2NyX2lkeDE7IFR5cGU6 IElOREVYOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0tCgpD UkVBVEUgSU5ERVggbWFzdGVyX3NrdV9kZXNjcl9pZHgxIE9OIG1hc3Rlcl9z a3VfZGVzY3IgVVNJTkcgYnRyZWUgKGdyb3VwX2NvZGUsIHNrdSwgY29udHJv bF9jb2RlKTsKCgotLQotLSBUT0MgZW50cnkgMTMgKE9JRCA4ODY3NDE0KQot LSBOYW1lOiBtYXN0ZXJfc2t1X2Rlc2NyX2lkeDY7IFR5cGU6IElOREVYOyBT Y2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0tCgpDUkVBVEUgSU5E RVggbWFzdGVyX3NrdV9kZXNjcl9pZHg2IE9OIG1hc3Rlcl9za3VfZGVzY3Ig VVNJTkcgYnRyZWUgKGdyb3VwX2NvZGUsIHNrdSk7CgoKLS0KLS0gVE9DIGVu dHJ5IDE3IChPSUQgODg2NzQxNSkKLS0gTmFtZTogbWFzdGVyX3NrdV9kZXNj cl91aWR4MTsgVHlwZTogSU5ERVg7IFNjaGVtYTogcHVibGljOyBPd25lcjog cG9zdGdyZXMKLS0KCkNSRUFURSBVTklRVUUgSU5ERVggbWFzdGVyX3NrdV9k ZXNjcl91aWR4MSBPTiBtYXN0ZXJfc2t1X2Rlc2NyIFVTSU5HIGJ0cmVlIChz a3UsIGdyb3VwX2NvZGUpOwoKCi0tCi0tIFRPQyBlbnRyeSAxMCAoT0lEIDg4 Njc0MTYpCi0tIE5hbWU6IG1hc3Rlcl9za3VfZGVzY3JfaWR4MzsgVHlwZTog SU5ERVg7IFNjaGVtYTogcHVibGljOyBPd25lcjogcG9zdGdyZXMKLS0KCkNS RUFURSBJTkRFWCBtYXN0ZXJfc2t1X2Rlc2NyX2lkeDMgT04gbWFzdGVyX3Nr dV9kZXNjciBVU0lORyBidHJlZSAoZ3JvdXBfY29kZSk7CgoKLS0KLS0gVE9D IGVudHJ5IDExIChPSUQgODg2NzQxNykKLS0gTmFtZTogbWFzdGVyX3NrdV9k ZXNjcl9pZHg0OyBUeXBlOiBJTkRFWDsgU2NoZW1hOiBwdWJsaWM7IE93bmVy OiBwb3N0Z3JlcwotLQoKQ1JFQVRFIElOREVYIG1hc3Rlcl9za3VfZGVzY3Jf aWR4NCBPTiBtYXN0ZXJfc2t1X2Rlc2NyIFVTSU5HIGJ0cmVlIChza3VfZGVz Y3IpOwoKCi0tCi0tIFRPQyBlbnRyeSAxMiAoT0lEIDg4Njc0MTgpCi0tIE5h bWU6IG1hc3Rlcl9za3VfZGVzY3JfaWR4NTsgVHlwZTogSU5ERVg7IFNjaGVt YTogcHVibGljOyBPd25lcjogcG9zdGdyZXMKLS0KCkNSRUFURSBJTkRFWCBt YXN0ZXJfc2t1X2Rlc2NyX2lkeDUgT04gbWFzdGVyX3NrdV9kZXNjciBVU0lO RyBidHJlZSAoZGVwX2NvZGUpOwoKCi0tCi0tIFRPQyBlbnRyeSAxNCAoT0lE IDg4Njc0MTkpCi0tIE5hbWU6IG1hc3Rlcl9za3VfZGVzY3JfaWR4NzsgVHlw ZTogSU5ERVg7IFNjaGVtYTogcHVibGljOyBPd25lcjogcG9zdGdyZXMKLS0K CkNSRUFURSBJTkRFWCBtYXN0ZXJfc2t1X2Rlc2NyX2lkeDcgT04gbWFzdGVy X3NrdV9kZXNjciBVU0lORyBidHJlZSAoZGVwX2Rlc2NyKTsKCgotLQotLSBU T0MgZW50cnkgMTUgKE9JRCA4ODY3NDIwKQotLSBOYW1lOiBtYXN0ZXJfc2t1 X2Rlc2NyX2lkeDg7IFR5cGU6IElOREVYOyBTY2hlbWE6IHB1YmxpYzsgT3du ZXI6IHBvc3RncmVzCi0tCgpDUkVBVEUgSU5ERVggbWFzdGVyX3NrdV9kZXNj cl9pZHg4IE9OIG1hc3Rlcl9za3VfZGVzY3IgVVNJTkcgYnRyZWUgKGNhdF9j b2RlKTsKCgotLQotLSBUT0MgZW50cnkgMTYgKE9JRCA4ODY3NDIxKQotLSBO YW1lOiBtYXN0ZXJfc2t1X2Rlc2NyX2lkeDk7IFR5cGU6IElOREVYOyBTY2hl bWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0tCgpDUkVBVEUgSU5ERVgg bWFzdGVyX3NrdV9kZXNjcl9pZHg5IE9OIG1hc3Rlcl9za3VfZGVzY3IgVVNJ TkcgYnRyZWUgKHN1YmNhdF9kZXNjcik7CgoKLS0KLS0gVE9DIGVudHJ5IDQg KE9JRCA4ODY3NDIyKQotLSBOYW1lOiBtYXN0ZXJfc2t1X2Rlc2NyX2lkeDEw OyBUeXBlOiBJTkRFWDsgU2NoZW1hOiBwdWJsaWM7IE93bmVyOiBwb3N0Z3Jl cwotLQoKQ1JFQVRFIElOREVYIG1hc3Rlcl9za3VfZGVzY3JfaWR4MTAgT04g bWFzdGVyX3NrdV9kZXNjciBVU0lORyBidHJlZSAoc3ViY2F0X2NvZGUpOwoK Ci0tCi0tIFRPQyBlbnRyeSA1IChPSUQgODg2NzQyMykKLS0gTmFtZTogbWFz dGVyX3NrdV9kZXNjcl9pZHgxMTsgVHlwZTogSU5ERVg7IFNjaGVtYTogcHVi bGljOyBPd25lcjogcG9zdGdyZXMKLS0KCkNSRUFURSBJTkRFWCBtYXN0ZXJf c2t1X2Rlc2NyX2lkeDExIE9OIG1hc3Rlcl9za3VfZGVzY3IgVVNJTkcgYnRy ZWUgKGNvbnRyb2xfY29kZSk7CgoKLS0KLS0gVE9DIGVudHJ5IDYgKE9JRCA4 ODY3NDI0KQotLSBOYW1lOiBtYXN0ZXJfc2t1X2Rlc2NyX2lkeDEyOyBUeXBl OiBJTkRFWDsgU2NoZW1hOiBwdWJsaWM7IE93bmVyOiBwb3N0Z3JlcwotLQoK Q1JFQVRFIElOREVYIG1hc3Rlcl9za3VfZGVzY3JfaWR4MTIgT04gbWFzdGVy X3NrdV9kZXNjciBVU0lORyBidHJlZSAoY29udHJvbF9kZXNjcik7CgoKLS0K LS0gVE9DIGVudHJ5IDcgKE9JRCA4ODY3NDI1KQotLSBOYW1lOiBtYXN0ZXJf c2t1X2Rlc2NyX2lkeDEzOyBUeXBlOiBJTkRFWDsgU2NoZW1hOiBwdWJsaWM7 IE93bmVyOiBwb3N0Z3JlcwotLQoKQ1JFQVRFIElOREVYIG1hc3Rlcl9za3Vf ZGVzY3JfaWR4MTMgT04gbWFzdGVyX3NrdV9kZXNjciBVU0lORyBidHJlZSAo c3VwcGxpZXJfY29kZSk7CgoKLS0KLS0gVE9DIGVudHJ5IDggKE9JRCA4ODY3 NDI2KQotLSBOYW1lOiBtYXN0ZXJfc2t1X2Rlc2NyX2lkeDE0OyBUeXBlOiBJ TkRFWDsgU2NoZW1hOiBwdWJsaWM7IE93bmVyOiBwb3N0Z3JlcwotLQoKQ1JF QVRFIElOREVYIG1hc3Rlcl9za3VfZGVzY3JfaWR4MTQgT04gbWFzdGVyX3Nr dV9kZXNjciBVU0lORyBidHJlZSAoc3VwcGxpZXJfZGVzY3IpOwoKCg== --Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0 Content-Type: text/plain; name="number_of_rows.txt" Content-Disposition: attachment; filename="number_of_rows.txt" Content-Transfer-Encoding: 7bit Number of rows in master_fpp_values : count --------- 1012252 (1 row) Number of rows in master_sku_descr : count ------- 53219 (1 row) Number of rows in master_branch_descr : count ------- 198 (1 row) Number of rows in supplier_price : count ------- 54670 (1 row) Number of rows in price_tmpl_det : count ------- 202 (1 row) Number of rows in sku_price : count ------- 54670 (1 row) Number of rows in forex : count ------- 576 (1 row) --Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0 Content-Type: application/octet-stream; name="price_tmpl_det.sql" Content-Disposition: attachment; filename="price_tmpl_det.sql" Content-Transfer-Encoding: base64 LS0KLS0gUG9zdGdyZVNRTCBkYXRhYmFzZSBkdW1wCi0tCgpcY29ubmVjdCAt IHBvc3RncmVzCgpTRVQgc2VhcmNoX3BhdGggPSBwdWJsaWMsIHBnX2NhdGFs b2c7CgotLQotLSBUT0MgZW50cnkgMiAoT0lEIDgwMjkwOTUpCi0tIE5hbWU6 IHByaWNlX3RtcGxfZGV0OyBUeXBlOiBUQUJMRTsgU2NoZW1hOiBwdWJsaWM7 IE93bmVyOiBwb3N0Z3JlcwotLQoKQ1JFQVRFIFRBQkxFIHByaWNlX3RtcGxf ZGV0ICgKICAgIGdyb3VwX2NkZSB0ZXh0IE5PVCBOVUxMLAogICAgcHJpY2Vf dG1wbF9oZHJfY2RlIGludGVnZXIgTk9UIE5VTEwsCiAgICBwcmljZV90bXBs X2hkcl9yZWcgdGV4dCBOT1QgTlVMTCwKICAgIGJyYW5jaF9jZGUgdGV4dCBO T1QgTlVMTCwKICAgIGF1ZGl0X2lkIGludGVnZXIKKTsKCgotLQotLSBUT0Mg ZW50cnkgMyAoT0lEIDgwMjkxMDApCi0tIE5hbWU6IGlkeF9wcmljZV90bXBs X2RldDsgVHlwZTogSU5ERVg7IFNjaGVtYTogcHVibGljOyBPd25lcjogcG9z dGdyZXMKLS0KCkNSRUFURSBJTkRFWCBpZHhfcHJpY2VfdG1wbF9kZXQgT04g cHJpY2VfdG1wbF9kZXQgVVNJTkcgYnRyZWUgKGJyYW5jaF9jZGUpOwoKCg== --Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0 Content-Type: application/octet-stream; name="sku_price.sql" Content-Disposition: attachment; filename="sku_price.sql" Content-Transfer-Encoding: base64 LS0KLS0gUG9zdGdyZVNRTCBkYXRhYmFzZSBkdW1wCi0tCgpcY29ubmVjdCAt IHBvc3RncmVzCgpTRVQgc2VhcmNoX3BhdGggPSBwdWJsaWMsIHBnX2NhdGFs b2c7CgotLQotLSBUT0MgZW50cnkgMiAoT0lEIDgwMjkxMTUpCi0tIE5hbWU6 IHNrdV9wcmljZTsgVHlwZTogVEFCTEU7IFNjaGVtYTogcHVibGljOyBPd25l cjogcG9zdGdyZXMKLS0KCkNSRUFURSBUQUJMRSBza3VfcHJpY2UgKAogICAg Z3JvdXBfY2RlIHRleHQgTk9UIE5VTEwsCiAgICBza3VfbXN0X2NkZSB0ZXh0 IE5PVCBOVUxMLAogICAgcHJpY2VfdG1wbF9oZHJfY2RlIGludGVnZXIgTk9U IE5VTEwsCiAgICBwcmljZV90bXBsX2hkcl9yZWcgdGV4dCBOT1QgTlVMTCwK ICAgIHNrdV9wcmljZV9jdXJyX2Nvc3QgbnVtZXJpYygxNSwyKSwKICAgIHNr dV9wcmljZV9zdGRjc3RfYXR0ciB0ZXh0LAogICAgc2t1X3ByaWNlX21pc2Nf YXR0ciB0ZXh0LAogICAgc2t1X3ByaWNlX2Nvc3RfZHRlX2VmY3R2IHRpbWVz dGFtcCB3aXRoIHRpbWUgem9uZSwKICAgIHNrdV9wcmljZV9jdXJyX3JzcF9j YSBudW1lcmljKDE1LDIpLAogICAgc2t1X3ByaWNlX2N1cnJfcnNwX2NyIG51 bWVyaWMoMTUsMiksCiAgICBza3VfcHJpY2VfcnNwX2R0ZV9lZmN0diB0aW1l c3RhbXAgd2l0aCB0aW1lIHpvbmUsCiAgICBza3VfcHJpY2VfY3Vycl90YXhf Y2RlIHRleHQsCiAgICBza3VfcHJpY2VfdGF4X2R0ZV9lZmN0diB0aW1lc3Rh bXAgd2l0aCB0aW1lIHpvbmUsCiAgICBza3VfcHJpY2VfY3Vycl9zdGtfdHlw IGNoYXJhY3RlciB2YXJ5aW5nKDIpLAogICAgc2t1X3ByaWNlX3N0a19kdGVf ZWZjdHYgdGltZXN0YW1wIHdpdGggdGltZSB6b25lLAogICAgYXVkaXRfaWQg aW50ZWdlcgopOwoKCi0tCi0tIFRPQyBlbnRyeSAzIChPSUQgODAyOTExNSkK LS0gTmFtZTogc2t1X3ByaWNlOyBUeXBlOiBBQ0w7IFNjaGVtYTogcHVibGlj OyBPd25lcjogcG9zdGdyZXMKLS0KClJFVk9LRSBBTEwgT04gVEFCTEUgc2t1 X3ByaWNlIEZST00gUFVCTElDOwpHUkFOVCBBTEwgT04gVEFCTEUgc2t1X3By aWNlIFRPIFBVQkxJQzsKCgotLQotLSBUT0MgZW50cnkgNCAoT0lEIDgwMjkx MjIpCi0tIE5hbWU6IGlkeF9za3VfcHJpY2U7IFR5cGU6IElOREVYOyBTY2hl bWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0tCgpDUkVBVEUgSU5ERVgg aWR4X3NrdV9wcmljZSBPTiBza3VfcHJpY2UgVVNJTkcgYnRyZWUgKGdyb3Vw X2NkZSwgc2t1X21zdF9jZGUsIHByaWNlX3RtcGxfaGRyX2NkZSwgcHJpY2Vf dG1wbF9oZHJfcmVnKTsKCgotLQotLSBUT0MgZW50cnkgNSAoT0lEIDgwMjkx MjMpCi0tIE5hbWU6IGlkeF9za3VfcHJpY2VfY29zdF9kdGVfZWZjdHY7IFR5 cGU6IElOREVYOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0t CgpDUkVBVEUgSU5ERVggaWR4X3NrdV9wcmljZV9jb3N0X2R0ZV9lZmN0diBP TiBza3VfcHJpY2UgVVNJTkcgYnRyZWUgKHNrdV9wcmljZV9jb3N0X2R0ZV9l ZmN0dik7CgoKLS0KLS0gVE9DIGVudHJ5IDYgKE9JRCA4MDI5MTI0KQotLSBO YW1lOiBpZHhfc2t1X3ByaWNlX3JzcF9kdGVfZWZjdHY7IFR5cGU6IElOREVY OyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0tCgpDUkVBVEUg SU5ERVggaWR4X3NrdV9wcmljZV9yc3BfZHRlX2VmY3R2IE9OIHNrdV9wcmlj ZSBVU0lORyBidHJlZSAoc2t1X3ByaWNlX3JzcF9kdGVfZWZjdHYpOwoKCi0t Ci0tIFRPQyBlbnRyeSA4IChPSUQgODAyOTEyNSkKLS0gTmFtZTogaWR4X3Nr dV9wcmljZV90YXhfZHRlX2VmY3R2OyBUeXBlOiBJTkRFWDsgU2NoZW1hOiBw dWJsaWM7IE93bmVyOiBwb3N0Z3JlcwotLQoKQ1JFQVRFIElOREVYIGlkeF9z a3VfcHJpY2VfdGF4X2R0ZV9lZmN0diBPTiBza3VfcHJpY2UgVVNJTkcgYnRy ZWUgKHNrdV9wcmljZV90YXhfZHRlX2VmY3R2KTsKCgotLQotLSBUT0MgZW50 cnkgNyAoT0lEIDgwMjkxMjYpCi0tIE5hbWU6IGlkeF9za3VfcHJpY2Vfc3Rr X2R0ZV9lZmN0djsgVHlwZTogSU5ERVg7IFNjaGVtYTogcHVibGljOyBPd25l cjogcG9zdGdyZXMKLS0KCkNSRUFURSBJTkRFWCBpZHhfc2t1X3ByaWNlX3N0 a19kdGVfZWZjdHYgT04gc2t1X3ByaWNlIFVTSU5HIGJ0cmVlIChza3VfcHJp Y2Vfc3RrX2R0ZV9lZmN0dik7CgoKLS0KLS0gVE9DIGVudHJ5IDEwIChPSUQg ODc4MDcyMSkKLS0gTmFtZTogc2t1X3ByaWNlX2dyb3VwX3NrdV9oZHJfcmVn X3N0azsgVHlwZTogSU5ERVg7IFNjaGVtYTogcHVibGljOyBPd25lcjogcG9z dGdyZXMKLS0KCkNSRUFURSBJTkRFWCBza3VfcHJpY2VfZ3JvdXBfc2t1X2hk cl9yZWdfc3RrIE9OIHNrdV9wcmljZSBVU0lORyBidHJlZSAoZ3JvdXBfY2Rl LCBza3VfbXN0X2NkZSwgcHJpY2VfdG1wbF9oZHJfY2RlLCBwcmljZV90bXBs X2hkcl9yZWcsIHNrdV9wcmljZV9jdXJyX3N0a190eXAgdGV4dF9vcHMpOwoK Ci0tCi0tIFRPQyBlbnRyeSAxMSAoT0lEIDg3ODA3MjMpCi0tIE5hbWU6IHNr dV9wcmljZV9pZHgxOyBUeXBlOiBJTkRFWDsgU2NoZW1hOiBwdWJsaWM7IE93 bmVyOiBwb3N0Z3JlcwotLQoKQ1JFQVRFIElOREVYIHNrdV9wcmljZV9pZHgx IE9OIHNrdV9wcmljZSBVU0lORyBidHJlZSAoc2t1X21zdF9jZGUsIHByaWNl X3RtcGxfaGRyX3JlZyk7CgoKLS0KLS0gVE9DIGVudHJ5IDkgKE9JRCA4MDI5 MTIwKQotLSBOYW1lOiBwa19za3VfcHJpY2U7IFR5cGU6IENPTlNUUkFJTlQ7 IFNjaGVtYTogcHVibGljOyBPd25lcjogcG9zdGdyZXMKLS0KCkFMVEVSIFRB QkxFIE9OTFkgc2t1X3ByaWNlCiAgICBBREQgQ09OU1RSQUlOVCBwa19za3Vf cHJpY2UgUFJJTUFSWSBLRVkgKGdyb3VwX2NkZSwgc2t1X21zdF9jZGUsIHBy aWNlX3RtcGxfaGRyX2NkZSwgcHJpY2VfdG1wbF9oZHJfcmVnKTsKCgo= --Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0 Content-Type: application/octet-stream; name="sql_statement.sql" Content-Disposition: attachment; filename="sql_statement.sql" Content-Transfer-Encoding: base64 Q1JFQVRFIFRBQkxFIHN0b2NrX3ZhbHVhdGlvbiBBUyAoCgpTRUxFQ1QgbS5n cm91cF9jb2RlOjp0ZXh0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIEFTIEdST1VQX0NPREUsCiAgICAg ICBtLnNrdTo6dGV4dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVMgU0tVLAogICAgICAg bS5icm5fY29kZTo6dGV4dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFTIEJSTl9DT0RFLAogICAg ICAgbS5zdGt0eXBlX2NvZGU6OnRleHQgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFTIFNUS1RZUEVfQ09E RSwKICAgICAgIHNzLnN1cHBsaWVyX3ByaWNlX2N1cnJfY29zdDo6bnVtZXJp YygxNiwzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUyBTVVBQ TElFUl9DVVJSX0NPU1QsCiAgICAgICBzay5za3VfcHJpY2VfY3Vycl9jb3N0 OjpudW1lcmljKDE2LDMpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgQVMgU0tVX0NVUlJfQ09TVCwKICAgICAgIFNVTShtLnF0eV9vbl9o YW5kXzAxKTo6aW50NCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBBUyBRVFlfT05fSEFORCwKICAgICAgIFNVTShzcy5z dXBwbGllcl9wcmljZV9jdXJyX2Nvc3QgKiBtLiBxdHlfb25faGFuZF8wMSk6 Om51bWVyaWMoMTYsMykgICAgICBBUyBRVFlfT05fSEFORF9DT1NULAogICAg ICAgU1VNKHNrLnNrdV9wcmljZV9jdXJyX2Nvc3QgKiBtLnF0eV9vbl9oYW5k XzAxICogZi5yYXRlKTo6bnVtZXJpYygxNiwzKSAgIEFTIFFUWV9PTl9IQU5E X1JTUCwKICAgICAgIChTVU0oc3Muc3VwcGxpZXJfcHJpY2VfY3Vycl9jb3N0 ICogbS5xdHlfb25faGFuZF8wMSkgLQogICAgICAgIFNVTShzay5za3VfcHJp Y2VfY3Vycl9jb3N0ICogbS5xdHlfb25faGFuZF8wMSAqIGYucmF0ZSkpOjpu dW1lcmljKDE2LDMpIEFTIFFUWV9PTl9IQU5EX01BUktVUApGUk9NIG1hc3Rl cl9mcHBfdmFsdWVzIG0sCiAgICAgbWFzdGVyX3NrdV9kZXNjciBzLAogICAg IG1hc3Rlcl9icmFuY2hfZGVzY3IgYiwKICAgICBzdXBwbGllcl9wcmljZSBz cywKICAgICBwcmljZV90bXBsX2RldCBwLAogICAgIHNrdV9wcmljZSBzaywK ICAgICBmb3JleCBmCldIRVJFIG0uZnBwX2NvZGUgPSAnMjAwMzA3JwpBTkQg ICBtLmJybl9jb2RlID0gYi5icm5fY29kZQpBTkQgICBtLnNrdSA9IHMuc2t1 CkFORCAgIG0uZ3JvdXBfY29kZSA9IHMuZ3JvdXBfY29kZQpBTkQgICBzLmNv bnRyb2xfY29kZSA9ICcwJwpBTkQgICBtLmJybl9jb2RlID0gcC5icmFuY2hf Y2RlCkFORCAgIGIuYnJuX2NvZGUgPSBwLmJyYW5jaF9jZGUKQU5EICAgc3Mu Z3JvdXBfY2RlID0gcC5ncm91cF9jZGUKQU5EICAgc3MucHJpY2VfdG1wbF9o ZHJfY2RlID0gcC5wcmljZV90bXBsX2hkcl9jZGUKQU5EICAgc3MucHJpY2Vf dG1wbF9oZHJfcmVnID0gcC5wcmljZV90bXBsX2hkcl9yZWcKQU5EICAgc3Mu Z3JvdXBfY2RlID0gbS5ncm91cF9jb2RlCkFORCAgIHNzLnNrdV9tc3RfY2Rl ID0gbS5za3UKQU5EICAgc3Muc3VwcGxpZXJfY2RlID0gbS5zdXBwbGllcl9j b2RlCkFORCAgIHNrLnByaWNlX3RtcGxfaGRyX2NkZSA9IHAucHJpY2VfdG1w bF9oZHJfY2RlCkFORCAgIHNrLnByaWNlX3RtcGxfaGRyX3JlZyA9IHAucHJp Y2VfdG1wbF9oZHJfcmVnCkFORCAgIHNrLmdyb3VwX2NkZSA9IG0uZ3JvdXBf Y29kZQpBTkQgICBzay5za3VfbXN0X2NkZSA9IG0uc2t1CkFORCAgIGIuY291 bnRyeV9jb2RlID0gZi5mcm9tX2N0cnkKQU5EICAgZi50b19jdHJ5ID0gJ1pB RicKQU5EICAgZi5mcHBfY29kZSA9ICcyMDAzMDcnCkdST1VQIEJZIG0uZ3Jv dXBfY29kZSwKICAgICAgICAgbS5za3UsCiAgICAgICAgIG0uYnJuX2NvZGUs CiAgICAgICAgIG0uc3RrdHlwZV9jb2RlLAogICAgICAgICBzcy5zdXBwbGll cl9wcmljZV9jdXJyX2Nvc3QsCiAgICAgICAgIHNrLnNrdV9wcmljZV9jdXJy X2Nvc3QKKTsK --Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0 Content-Type: application/octet-stream; name="supplier_price.sql" Content-Disposition: attachment; filename="supplier_price.sql" Content-Transfer-Encoding: base64 LS0KLS0gUG9zdGdyZVNRTCBkYXRhYmFzZSBkdW1wCi0tCgpcY29ubmVjdCAt IHBvc3RncmVzCgpTRVQgc2VhcmNoX3BhdGggPSBwdWJsaWMsIHBnX2NhdGFs b2c7CgotLQotLSBUT0MgZW50cnkgMiAoT0lEIDgwMjg3NTIpCi0tIE5hbWU6 IHN1cHBsaWVyX3ByaWNlOyBUeXBlOiBUQUJMRTsgU2NoZW1hOiBwdWJsaWM7 IE93bmVyOiBwb3N0Z3JlcwotLQoKQ1JFQVRFIFRBQkxFIHN1cHBsaWVyX3By aWNlICgKICAgIGdyb3VwX2NkZSB0ZXh0IE5PVCBOVUxMLAogICAgc2t1X21z dF9jZGUgdGV4dCBOT1QgTlVMTCwKICAgIHN1cHBsaWVyX2NkZSB0ZXh0IE5P VCBOVUxMLAogICAgcHJpY2VfdG1wbF9oZHJfY2RlIGludGVnZXIgTk9UIE5V TEwsCiAgICBwcmljZV90bXBsX2hkcl9yZWcgdGV4dCBOT1QgTlVMTCwKICAg IHN1cHBsaWVyX3NrdV9jZGUgdGV4dCwKICAgIHN1cHBsaWVyX3NrdV9iYXJj ZGUgdGV4dCwKICAgIHN1cHBsaWVyX3ByaWNlX2xlYWR0bV9kYXlzIGludGVn ZXIsCiAgICBzdXBwbGllcl9wcmljZV9jdXJyX2Nvc3QgbnVtZXJpYygxNSwy KSwKICAgIHN1cHBsaWVyX3ByaWNlX2Nvc3RfZHRlX2VmY3R2IHRpbWVzdGFt cCB3aXRoIHRpbWUgem9uZSwKICAgIHN1cHBsaWVyX3ByaWNlX2R0ZV9jcmVh dGVkIHRpbWVzdGFtcCB3aXRoIHRpbWUgem9uZSwKICAgIHN1cHBsaWVyX3By aWNlX2R0ZV9waGFzZWRvdXQgdGltZXN0YW1wIHdpdGggdGltZSB6b25lLAog ICAgc3VwcGxpZXJfcHJpY2VfZGVsZXRlZCB0aW1lc3RhbXAgd2l0aCB0aW1l IHpvbmUsCiAgICBhdWRpdF9pZCBpbnRlZ2VyCik7CgoKLS0KLS0gVE9DIGVu dHJ5IDMgKE9JRCA4NzgwNzI0KQotLSBOYW1lOiBpZHhfc3VwcGxpZXJfcHJp Y2U7IFR5cGU6IElOREVYOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3Rn cmVzCi0tCgpDUkVBVEUgSU5ERVggaWR4X3N1cHBsaWVyX3ByaWNlIE9OIHN1 cHBsaWVyX3ByaWNlIFVTSU5HIGJ0cmVlIChncm91cF9jZGUsIHNrdV9tc3Rf Y2RlLCBzdXBwbGllcl9jZGUsIHByaWNlX3RtcGxfaGRyX2NkZSwgcHJpY2Vf dG1wbF9oZHJfcmVnKTsKCgotLQotLSBUT0MgZW50cnkgNCAoT0lEIDgwMjg3 NTcpCi0tIE5hbWU6IHBrX3N1cHBsaWVyX3ByaWNlOyBUeXBlOiBDT05TVFJB SU5UOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVzCi0tCgpBTFRF UiBUQUJMRSBPTkxZIHN1cHBsaWVyX3ByaWNlCiAgICBBREQgQ09OU1RSQUlO VCBwa19zdXBwbGllcl9wcmljZSBQUklNQVJZIEtFWSAoZ3JvdXBfY2RlLCBz a3VfbXN0X2NkZSwgc3VwcGxpZXJfY2RlLCBwcmljZV90bXBsX2hkcl9jZGUs IHByaWNlX3RtcGxfaGRyX3JlZyk7CgoK --Multipart_Mon__11_Aug_2003_15:58:41_+0200_084bd0a0-- From pgsql-performance-owner@postgresql.org Mon Aug 11 12:09:34 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 1CAD3D1C950 for ; Mon, 11 Aug 2003 15:06: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 06744-02 for ; Mon, 11 Aug 2003 12:04:30 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id C2E3ED1C94A for ; Mon, 11 Aug 2003 12:05:50 -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 h7BF42bS000485; Mon, 11 Aug 2003 09:04:03 -0600 (MDT) Date: Mon, 11 Aug 2003 08:47:07 -0600 (MDT) From: "scott.marlowe" To: Andrew Sullivan Cc: Subject: Re: Perfomance Tuning In-Reply-To: <20030808185323.GH2967@libertyrms.info> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/168 X-Sequence-Number: 2985 On Fri, 8 Aug 2003, Andrew Sullivan wrote: > On Fri, Aug 08, 2003 at 09:40:20AM -0700, Jonathan Gardner wrote: > > > > Redhat puts ext3 on by default. Consider switching to a non-journaling FS > > (ext2?) with the partition that holds your data and WAL. > > I would give you exactly the opposite advice: _never_ use a > non-journalling fs for your data and WAL. I suppose if you can > afford to lose some transactions, you can do without journalling. > Otherwise, you're just borrowing trouble, near as I can tell. I'd argue that a reliable filesystem (ext2) is still better than a questionable journaling filesystem (ext3 on kernels <2.4.20). This isn't saying to not use jounraling, but I would definitely test it under load first to make sure it's not gonna lose data or get corrupted. From pgsql-performance-owner@postgresql.org Mon Aug 11 12:24: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 83A03D1C4E1 for ; Mon, 11 Aug 2003 15:24:26 +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 06744-06 for ; Mon, 11 Aug 2003 12:22:55 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id C5AEED1C4BA for ; Mon, 11 Aug 2003 12:24:15 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19mEWt-0008M7-00 for ; Mon, 11 Aug 2003 11:24:15 -0400 Received: by dba2 (Postfix, from userid 1019) id 14382D0AA; Mon, 11 Aug 2003 11:24:15 -0400 (EDT) Date: Mon, 11 Aug 2003 11:24:14 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: Perfomance Tuning Message-ID: <20030811152414.GF9086@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <20030808185323.GH2967@libertyrms.info> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/169 X-Sequence-Number: 2986 On Mon, Aug 11, 2003 at 08:47:07AM -0600, scott.marlowe wrote: > This isn't saying to not use jounraling, but I would definitely test it > under load first to make sure it's not gonna lose data or get corrupted. Well, yeah. But given the Linux propensity for introducing major features in "minor" releases (and thereby introducing all the attendant bugs), I'd think twice about using _any_ Linux feature until it's been through a major version (e.g. things introduced in 2.4.x won't really be stable until 2.6.x) -- and even there one is taking a risk[1]. A My laptop's PCMCIA network card recently stopped working during a "minor" version upgrade, even though it's almost 6 years old. Someone decided that "cleaning up" the code required complete redesign, and so all the bugs that had been shaken out during the 2.2 series will now be reimplemented in a new and interesting way. Sigh. -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Mon Aug 11 12:44:03 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 BF298D1C4E1 for ; Mon, 11 Aug 2003 15:44: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 11589-01 for ; Mon, 11 Aug 2003 12:42:29 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 990D7D1C4BA for ; Mon, 11 Aug 2003 12:43:49 -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 h7BFhkSa002935; Mon, 11 Aug 2003 11:43:46 -0400 (EDT) To: Stef Cc: pgsql-performance@postgresql.org Subject: Re: Analyze makes queries slow... In-reply-to: <20030811155841.483ffd93.svb@ucs.co.za> References: <20030811155841.483ffd93.svb@ucs.co.za> Comments: In-reply-to Stef message dated "Mon, 11 Aug 2003 15:58:41 +0200" Date: Mon, 11 Aug 2003 11:43:45 -0400 Message-ID: <2934.1060616625@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/170 X-Sequence-Number: 2987 Stef writes: > I have attached an sql statement that normally runs under 3 minutes. > That is, until I vacuum analyze the database (or just the tables in the query), > then the same query runs longer than 12 hours, and I have to kill it. Could we see the results of "EXPLAIN ANALYZE", rather than just EXPLAIN, for the un-analyzed case? I won't make you do it for the analyzed case ;-) but when dealing with a plan-selection problem the planner's estimates are obviously not to be trusted. Also, what do you see in pg_stats (after analyzing) for each of the tables used in the query? And what PG version is this, exactly? regards, tom lane PS: in case you don't know this already, an easy way to get back to the un-analyzed state is "DELETE FROM pg_statistics". From pgsql-hackers-owner@postgresql.org Mon Aug 11 12:58:14 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 1950AD1C513 for ; Mon, 11 Aug 2003 15:56:34 +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 10239-07 for ; Mon, 11 Aug 2003 12:55:03 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 26AF5D1C4BA for ; Mon, 11 Aug 2003 12:56:23 -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 h7BFsdSa003033; Mon, 11 Aug 2003 11:54:39 -0400 (EDT) To: elein Cc: pgsql-hackers@postgresql.org, elein@varlena.com Subject: Re: Windows on SuSE? 7.4 In-reply-to: <20030810200440.B2396@cookie> References: <20030810200440.B2396@cookie> Comments: In-reply-to elein message dated "Sun, 10 Aug 2003 20:04:40 -0700" Date: Mon, 11 Aug 2003 11:54:39 -0400 Message-ID: <3032.1060617279@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/633 X-Sequence-Number: 42291 elein writes: > This is as far as I've gotten with 7.4. Would you rebuild with --enable-debug (perhaps also --enable-cassert) so that the gdb backtrace is more informative? Also, it seems likely that the issue is in or around the recently-added IPv6 support, so I'd suggest using CVS tip or last night's snapshot rather than the beta1 tarball. We've already made some portability fixes there since beta1. regards, tom lane From pgsql-performance-owner@postgresql.org Mon Aug 11 13:48:23 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 6AD56D1C7F1 for ; Mon, 11 Aug 2003 16:48: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 17149-01 for ; Mon, 11 Aug 2003 13:46:50 -0300 (ADT) Received: from ucsns.ucs.co.za (ucs.co.za [196.23.43.2]) by svr1.postgresql.org (Postfix) with ESMTP id D1635D1C4B9 for ; Mon, 11 Aug 2003 13:47:47 -0300 (ADT) Received: from ucspost.ucs.co.za (mailgw1.ucs.co.za [196.23.43.253]) by ucsns.ucs.co.za (Postfix) with ESMTP id 5F4C92BD7D; Mon, 11 Aug 2003 18:47:37 +0200 (SAST) Received: from jhb.ucs.co.za (jhb.ucs.co.za [172.31.1.3]) by ucspost.ucs.co.za (Postfix) with ESMTP id C0A0FDA328; Mon, 11 Aug 2003 18:47:36 +0200 (SAST) Received: from svb.ucs.co.za (svb.ucs.co.za [172.31.1.148]) by jhb.ucs.co.za (Postfix) with SMTP id 98AC99737E; Mon, 11 Aug 2003 18:47:36 +0200 (SAST) Date: Mon, 11 Aug 2003 18:47:36 +0200 From: Stef To: Tom Lane Cc: pgsql-performance@postgresql.org Subject: Re: Analyze makes queries slow... Message-Id: <20030811184736.7e191a86.svb@ucs.co.za> In-Reply-To: <2934.1060616625@sss.pgh.pa.us> References: <20030811155841.483ffd93.svb@ucs.co.za> <2934.1060616625@sss.pgh.pa.us> X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i386-pc-linux-gnu) User-Agent: sillypheed-claws (anti-aliased) X-Face: LV^-*d3kQlL,6{Y:X)M~tuL#y!p.kO_Qbc!xxqhZC4s}Y]L0g)z^aiLsQGY34d|}Xp:HNm)MRsc?^?ZQ}smznF&jx|w@,a**K&QL.Dc~2~M5V`zb>hExCJDB[[o=M)e"; k-n[7tz2TY7+; *_xX's(5cUEtdw*yG-OmKm}6($zpUz8S`Nz@w X-Operating-System: sid X-X-X: _-^-_ Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Mon__11_Aug_2003_18:47:36_+0200_0856a3f0" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/171 X-Sequence-Number: 2988 This is a multi-part message in MIME format. --Multipart_Mon__11_Aug_2003_18:47:36_+0200_0856a3f0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Tom, Thanks for responding. I got as much info as I could : On Mon, 11 Aug 2003 11:43:45 -0400 Tom Lane wrote: => Could we see the results of "EXPLAIN ANALYZE", rather than just EXPLAIN, => for the un-analyzed case? Attached the output of this. => Also, what do you see in pg_stats (after analyzing) for each of the => tables used in the query? I attached a file in csv format of pg_stats after analyzing. (With the columns selected on the top line) It looks like cached values for (quite a lot of?) the table columns. I would assume it stores the most commonly selected values for every column with an index. Don't know if I'm correct. => And what PG version is this, exactly? PostgreSQL 7.3.1 Kind regards Stefan --Multipart_Mon__11_Aug_2003_18:47:36_+0200_0856a3f0 Content-Type: text/plain; name="explain_analyze.txt" Content-Disposition: attachment; filename="explain_analyze.txt" Content-Transfer-Encoding: 7bit Aggregate (cost=187.80..187.84 rows=1 width=699) (actual time=142704.64..148066.77 rows=125769 loops=1) -> Group (cost=187.80..187.82 rows=1 width=699) (actual time=142704.48..144239.11 rows=125769 loops=1) -> Sort (cost=187.80..187.81 rows=1 width=699) (actual time=142704.45..142947.14 rows=125769 loops=1) Sort Key: m.group_code, m.sku, m.brn_code, m.stktype_code, ss.supplier_price_curr_cost, sk.sku_price_curr_cost -> Nested Loop (cost=140.07..187.79 rows=1 width=699) (actual time=49796.26..135679.87 rows=125769 loops=1) Join Filter: (("outer".sku = "inner".sku) AND ("outer".group_code = "inner".group_code)) -> Nested Loop (cost=140.07..181.76 rows=1 width=635) (actual time=49742.50..118086.42 rows=125769 loops=1) Join Filter: (("inner".group_cde = "outer".group_cde) AND ("inner".price_tmpl_hdr_cde = "outer".price_tmpl_hdr_cde) AND ("inner".price_tmpl_hdr_reg = "outer".price_tmpl_hdr_reg) AND ("inner".supplier_cde = "outer".supplier_code)) -> Nested Loop (cost=140.07..176.91 rows=1 width=485) (actual time=49741.95..90991.39 rows=125769 loops=1) Join Filter: (("inner".price_tmpl_hdr_cde = "outer".price_tmpl_hdr_cde) AND ("inner".price_tmpl_hdr_reg = "outer".price_tmpl_hdr_reg) AND ("inner".group_cde = "outer".group_cde)) -> Hash Join (cost=140.07..172.07 rows=1 width=367) (actual time=49741.16..52345.71 rows=162115 loops=1) Hash Cond: ("outer".branch_cde = "inner".brn_code) Join Filter: ("inner".group_code = "outer".group_cde) -> Seq Scan on price_tmpl_det p (cost=0.00..20.00 rows=1000 width=100) (actual time=0.09..9.50 rows=202 loops=1) -> Hash (cost=140.00..140.00 rows=27 width=267) (actual time=49740.97..49740.97 rows=0 loops=1) -> Nested Loop (cost=0.00..140.00 rows=27 width=267) (actual time=432.55..49360.23 rows=162115 loops=1) -> Nested Loop (cost=0.00..30.79 rows=1 width=115) (actual time=154.19..184.03 rows=198 loops=1) -> Seq Scan on forex f (cost=0.00..25.00 rows=1 width=51) (actual time=50.86..51.12 rows=4 loops=1) Filter: ((to_ctry = 'ZAF'::text) AND (fpp_code = '200307'::text)) -> Index Scan using master_branch_descr_idx4 on master_branch_descr b (cost=0.00..5.78 rows=1 width=64) (actual time=25.90..32.81 rows=50 loops=4) Index Cond: (b.country_code = "outer".from_ctry) -> Index Scan using master_fpp_values_uidx1 on master_fpp_values m (cost=0.00..108.88 rows=27 width=152) (actual time=3.41..243.55 rows=819 loops=198) Index Cond: ((m.fpp_code = '200307'::text) AND (m.brn_code = "outer".brn_code)) -> Index Scan using idx_sku_price on sku_price sk (cost=0.00..4.83 rows=1 width=118) (actual time=0.09..0.21 rows=4 loops=162115) Index Cond: ((sk.group_cde = "outer".group_code) AND (sk.sku_mst_cde = "outer".sku)) -> Index Scan using idx_supplier_price on supplier_price ss (cost=0.00..4.83 rows=1 width=150) (actual time=0.11..0.16 rows=5 loops=125769) Index Cond: (("outer".group_cde = ss.group_cde) AND ("outer".sku_mst_cde = ss.sku_mst_cde)) -> Index Scan using master_sku_descr_idx1 on master_sku_descr s (cost=0.00..6.02 rows=1 width=64) (actual time=0.12..0.12 rows=1 loops=125769) Index Cond: (("outer".group_cde = s.group_code) AND ("outer".sku_mst_cde = s.sku) AND (s.control_code = '0'::text)) Total runtime: 148710.78 msec (30 rows) --Multipart_Mon__11_Aug_2003_18:47:36_+0200_0856a3f0 Content-Type: text/comma-separated-values; name="pg_stats.csv" Content-Disposition: attachment; filename="pg_stats.csv" Content-Transfer-Encoding: 7bit schemaname,tablename,attname,null_frac,avg_width,n_distinct,most_common_freqs,correlation public,master_fpp_values,fpp_code,0,10,7,{0.197667\,0.151\,0.143333\,0.136333\,0.131\,0.123333\,0.117333},0.881058 public,master_fpp_values,brn_code,0,8,199,{0.0306667\,0.025\,0.02\,0.017\,0.015\,0.0146667\,0.0143333\,0.0143333\,0.014\,0.0133333},-0.305321 public,master_fpp_values,sku,0,12,2961,{0.00366667\,0.00333333\,0.003\,0.003\,0.003\,0.003\,0.00266667\,0.00266667\,0.00266667\,0.00266667},-0.1541 public,master_fpp_values,group_code,0,9,1,{1},1 public,master_fpp_values,stktype_code,0,6,10,{0.405\,0.376667\,0.103333\,0.046\,0.0286667\,0.0226667\,0.00633333\,0.006\,0.00466667\,0.000666667},0.299429 public,master_fpp_values,supplier_code,0,9,145,{0.0496667\,0.0496667\,0.049\,0.0433333\,0.0406667\,0.032\,0.03\,0.0283333\,0.0253333\,0.025},-0.00397595 public,master_fpp_values,mth_sls_qty_01,0,10,12,{0.923667},0.887183 public,master_fpp_values,mth_sls_qty_02,0,10,14,{0.921333},0.869282 public,master_fpp_values,mth_sls_qty_03,0,10,12,{0.930333},0.873398 public,master_fpp_values,mth_sls_qty_04,0,10,12,{0.939333},0.899521 public,master_fpp_values,mth_sls_qty_05,0,10,16,{0.932333},0.884406 public,master_fpp_values,mth_sls_qty_06,0,10,14,{0.928333},0.86523 public,master_fpp_values,mth_sls_qty_07,0,10,16,{0.931667},0.870748 public,master_fpp_values,mth_sls_qty_08,0,10,17,{0.939333},0.898058 public,master_fpp_values,mth_sls_qty_09,0,10,16,{0.940667},0.904561 public,master_fpp_values,mth_sls_qty_10,0,10,11,{0.943},0.877744 public,master_fpp_values,mth_sls_qty_11,0,10,7,{0.940667\,0.046\,0.00666667\,0.00266667\,0.00233333\,0.001\,0.000666667},0.889018 public,master_fpp_values,mth_sls_qty_12,0,10,10,{0.945},0.890438 public,master_fpp_values,qty_on_hand_01,0,10,27,{0.748333\,0.162\,0.0496667},0.665886 public,master_fpp_values,qty_on_hand_02,0,10,23,{0.753667\,0.159667},0.657389 public,master_fpp_values,qty_on_hand_03,0,10,21,{0.765\,0.152},0.629485 public,master_fpp_values,qty_on_hand_04,0,10,25,{0.759333\,0.153},0.594277 public,master_fpp_values,qty_on_hand_05,0,10,27,{0.765\,0.149333},0.619 public,master_fpp_values,qty_on_hand_06,0,10,27,{0.764\,0.151333},0.61393 public,master_fpp_values,qty_on_hand_07,0,10,25,{0.761\,0.153333},0.620102 public,master_fpp_values,qty_on_hand_08,0,10,25,{0.766\,0.153667},0.624114 public,master_fpp_values,qty_on_hand_09,0,10,27,{0.772\,0.148333},0.629625 public,master_fpp_values,qty_on_hand_10,0,10,29,{0.783333\,0.141333},0.625353 public,master_fpp_values,qty_on_hand_11,0,10,22,{0.785\,0.146667},0.590573 public,master_fpp_values,qty_on_hand_12,0,10,20,{0.778333\,0.154667},0.565559 public,master_fpp_values,mth_sls_cst,0,10,181,{0.925667},0.889698 public,master_fpp_values,mth_sls_disc,0,10,78,{0.956},0.891678 public,master_fpp_values,mth_sls_nett_excl,0,10,147,{0.925667},0.888023 public,master_fpp_values,mth_qty_on_hand_cst,0,10,512,{0.755\,0.00266667},0.641361 public,master_fpp_values,mth_sls_qty_und,0,10,5,{0.986333},0.979298 public,master_fpp_values,qty_in_goods,0,10,16,{0.947667},0.905277 public,master_fpp_values,mat_sls_qty,0,10,48,{0.648667\,0.177333\,0.05\,0.0316667},0.44792 public,master_fpp_values,ytd_sls_qty,0,10,21,{0.858667\,0.0796667},0.866826 public,master_fpp_values,mat_sls_cst,0,10,1100,{0.651333\,0.00266667\,0.00233333\,0.002\,0.002\,0.002\,0.002\,0.002\,0.00166667\,0.00166667},0.419433 public,master_fpp_values,ytd_sls_cst,0,10,355,{0.86},0.861035 public,master_fpp_values,mat_sls_disc,0,10,452,{0.807333\,0.007\,0.00666667\,0.00433333\,0.004\,0.004\,0.004\,0.00366667},0.646366 public,master_fpp_values,ytd_sls_disc,0,10,167,{0.913667},0.756582 public,master_fpp_values,mat_sls_nett_excl,0,11,838,{0.659333\,0.00633333\,0.00566667\,0.00533333\,0.004\,0.00366667\,0.00333333\,0.003\,0.003\,0.003},0.428129 public,master_fpp_values,ytd_sls_nett_excl,0,10,300,{0.863333\,0.005},0.860931 public,master_fpp_values,ly_mth_sls_nett_excl,0,10,129,{0.946333},0.883056 public,master_fpp_values,ly_ytd_sls_nett_excl,0,10,345,{0.856333\,0.00466667},0.792166 public,master_fpp_values,stk_turn_qty_on_hand_cst,0,11,1906,{0.546667\,0.00233333\,0.00133333\,0.00133333\,0.00133333\,0.00133333\,0.00133333\,0.00133333\,0.00133333\,0.001},0.277605 public,master_fpp_values,current_orders,0.964333,4,1,{0.0356667},1 public,master_fpp_values,overdue_orders,0.964333,4,1,{0.0356667},1 public,master_fpp_values,no_mths_history,0,4,12,{0.382\,0.136\,0.100667},0.165119 public,master_sku_descr,group_code,0,9,1,{1},1 public,master_sku_descr,sku,0,18,-1,\N,-0.17559 public,master_sku_descr,sku_descr,0,27,2532,{0.0176667\,0.015\,0.0136667\,0.009\,0.008\,0.00766667\,0.00733333\,0.007\,0.007\,0.00666667},0.0381189 public,master_sku_descr,dep_code,0,7,19,{0.182333\,0.140667\,0.130667\,0.094\,0.0873333\,0.0696667},0.218586 public,master_sku_descr,dep_descr,0,13,19,{0.182333\,0.140667\,0.130667\,0.094\,0.0873333\,0.0696667},0.100323 public,master_sku_descr,cat_code,0,9,48,{0.181\,0.117\,0.0733333\,0.065\,0.0616667\,0.049\,0.043\,0.0423333\,0.038\,0.0286667},0.182654 public,master_sku_descr,cat_descr,0,14,45,{0.181\,0.117\,0.0733333\,0.065\,0.0616667\,0.049\,0.043\,0.0423333\,0.038\,0.0286667},0.0820663 public,master_sku_descr,subcat_code,0,13,67,{0.175\,0.117\,0.0733333\,0.065\,0.0556667\,0.0486667\,0.043\,0.0353333\,0.0286667\,0.026},0.17828 public,master_sku_descr,subcat_descr,0,16,67,{0.175\,0.117\,0.0733333\,0.065\,0.0556667\,0.0486667\,0.043\,0.0353333\,0.0286667\,0.026},0.0220006 public,master_sku_descr,control_code,0,5,2,{0.812667\,0.187333},1 public,master_sku_descr,control_descr,0,20,2,{0.812667\,0.187333},0.0865626 public,master_sku_descr,supplier_code,0,9,167,{0.182667\,0.0503333\,0.0473333\,0.0373333\,0.0336667\,0.0323333\,0.0323333\,0.03\,0.0296667\,0.026},-0.0817026 public,master_sku_descr,supplier_descr,0,27,163,{0.182667\,0.0503333\,0.0473333\,0.0373333\,0.0336667\,0.0323333\,0.0323333\,0.03\,0.0296667\,0.027},0.184701 public,master_branch_descr,brn_code,0,8,-1,\N,0.0902227 public,master_branch_descr,brn_descr,0,23,-0.99495,{0.010101},-0.0104298 public,master_branch_descr,country_code,0,7,4,{0.883838\,0.0757576\,0.020202\,0.020202},0.713787 public,master_branch_descr,country_descr,0,15,4,{0.883838\,0.0757576\,0.020202\,0.020202},0.713787 public,master_branch_descr,cluster_code,0,8,15,{0.136364\,0.126263\,0.106061\,0.10101\,0.0959596},0.0364343 public,master_branch_descr,cluster_descr,0,23,15,{0.136364\,0.126263\,0.106061\,0.10101\,0.0959596},-0.220806 public,master_branch_descr,brand_code,0,11,2,{0.873737\,0.126263},0.715874 public,master_branch_descr,brand_descr,0,18,2,{0.873737\,0.126263},0.828365 public,master_branch_descr,chain_code,0,9,1,{1},1 public,master_branch_descr,chain_descr,0,17,1,{1},1 public,master_branch_descr,sbu_code,0,7,1,{1},1 public,master_branch_descr,sbu_descr,0,15,1,{1},1 public,master_branch_descr,group_code,0,5,1,{1},1 public,master_branch_descr,group_descr,0,11,1,{1},1 public,master_branch_descr,region_code,0,15,-0.222222,{0.0757576\,0.050505\,0.040404\,0.0353535\,0.0353535\,0.0353535\,0.0353535\,0.0353535\,0.0353535\,0.0353535},-0.270643 public,master_branch_descr,region_descr,0,22,-0.217172,{0.0757576\,0.050505\,0.040404\,0.0353535\,0.0353535\,0.0353535\,0.0353535\,0.0353535\,0.0353535\,0.0353535},-0.155933 public,master_branch_descr,division_code,0,9,7,{0.257576\,0.247475\,0.222222\,0.156566\,0.10101},-0.0911781 public,master_branch_descr,division_descr,0,21,7,{0.257576\,0.247475\,0.222222\,0.156566\,0.10101},0.159081 public,supplier_price,group_cde,0,9,1,{1},1 public,supplier_price,sku_mst_cde,0,11,-0.189704,{0.001\,0.001\,0.001\,0.001\,0.001\,0.001\,0.001\,0.001\,0.001\,0.001},0.425292 public,supplier_price,supplier_cde,0,10,203,{0.073\,0.0446667\,0.0416667\,0.0416667\,0.0306667\,0.026\,0.024\,0.023\,0.023\,0.019},0.151589 public,supplier_price,price_tmpl_hdr_cde,0,4,1,{1},1 public,supplier_price,price_tmpl_hdr_reg,0,8,5,{0.231\,0.207333\,0.191667\,0.185\,0.185},0.211032 public,supplier_price,supplier_sku_cde,0,4,19,{0.989},0.990141 public,supplier_price,supplier_sku_barcde,0,4,1,{1},1 public,supplier_price,supplier_price_leadtm_days,0,4,14,{0.884333},0.815372 public,supplier_price,supplier_price_curr_cost,0,12,2285,{0.00866667\,0.00866667\,0.008\,0.00766667\,0.00533333\,0.00533333\,0.005\,0.005\,0.00466667\,0.00466667},-0.123537 public,supplier_price,supplier_price_cost_dte_efctv,0,8,1407,{0.103\,0.0113333\,0.00766667\,0.00733333\,0.00733333\,0.007\,0.00633333\,0.006\,0.006\,0.00566667},0.200601 public,supplier_price,supplier_price_dte_created,0,8,1718,{0.103\,0.0313333\,0.0163333\,0.0136667\,0.013\,0.009\,0.009\,0.00733333\,0.00633333\,0.00633333},0.236249 public,supplier_price,audit_id,0,4,448,{0.734\,0.011\,0.00766667\,0.00733333\,0.00666667\,0.00666667\,0.00566667\,0.00533333\,0.005\,0.00466667},0.624155 public,forex,from_ctry,0,7,4,{0.25\,0.25\,0.25\,0.25},0.22902 public,forex,to_ctry,0,7,4,{0.25\,0.25\,0.25\,0.25},0.24478 public,forex,fpp_code,0,10,36,\N,0.555554 public,forex,descr,0,4,1,{1},1 public,forex,is_active,0,1,1,{1},1 public,forex,seq,0,4,36,\N,0.555554 public,forex,rate,0,11,3,{0.625\,0.1875\,0.1875},0.470405 public,price_tmpl_det,group_cde,0,9,1,{1},1 public,price_tmpl_det,price_tmpl_hdr_cde,0,4,1,{1},1 public,price_tmpl_det,price_tmpl_hdr_reg,0,8,5,{0.762376\,0.123762\,0.0742574\,0.019802\,0.019802},0.386344 public,price_tmpl_det,branch_cde,0,8,-1,\N,0.951216 public,price_tmpl_det,audit_id,0,4,1,{1},1 public,sku_price,group_cde,0,9,1,{1},1 public,sku_price,sku_mst_cde,0,11,-0.203542,{0.001\,0.001\,0.001\,0.001\,0.001\,0.001\,0.001\,0.001\,0.001\,0.001},0.321261 public,sku_price,price_tmpl_hdr_cde,0,4,1,{1},1 public,sku_price,price_tmpl_hdr_reg,0,8,5,{0.211\,0.201667\,0.2\,0.2\,0.187333},-0.0265109 public,sku_price,sku_price_curr_cost,0,12,3507,{0.007\,0.006\,0.00466667\,0.00433333\,0.004\,0.004\,0.004\,0.00366667\,0.00366667\,0.00333333},-0.10889 public,sku_price,sku_price_stdcst_attr,0,24,2,{0.716667\,0.283333},0.484316 public,sku_price,sku_price_misc_attr,0,24,10,{0.742333\,0.208333},0.593248 public,sku_price,sku_price_cost_dte_efctv,0,8,468,{0.340333\,0.171667\,0.036\,0.0213333\,0.0153333\,0.0143333\,0.0126667\,0.012\,0.009\,0.00833333},0.0142753 public,sku_price,sku_price_curr_rsp_ca,0,12,521,{0.0266667\,0.0236667\,0.0233333\,0.0223333\,0.0216667\,0.0193333\,0.018\,0.0176667\,0.0173333\,0.016},-0.0683204 public,sku_price,sku_price_curr_rsp_cr,0,12,521,{0.0266667\,0.0236667\,0.0233333\,0.0223333\,0.0216667\,0.0193333\,0.018\,0.0176667\,0.0173333\,0.016},-0.0683643 public,sku_price,sku_price_rsp_dte_efctv,0,8,468,{0.340333\,0.171667\,0.036\,0.0213333\,0.0153333\,0.0143333\,0.0126667\,0.012\,0.009\,0.00833333},0.0142753 public,sku_price,sku_price_curr_tax_cde,0,5,3,{0.580667\,0.232\,0.187333},0.556641 public,sku_price,sku_price_tax_dte_efctv,0,8,416,{0.253667\,0.171667\,0.151333\,0.0273333\,0.016\,0.0153333\,0.0143333\,0.0126667\,0.012\,0.009},0.0858765 public,sku_price,sku_price_curr_stk_typ,0,6,7,{0.519333\,0.230667\,0.142},0.383167 public,sku_price,sku_price_stk_dte_efctv,0,8,468,{0.340333\,0.171667\,0.036\,0.0213333\,0.0153333\,0.0143333\,0.0126667\,0.012\,0.009\,0.00833333},0.0142753 public,sku_price,audit_id,0,4,392,{0.55\,0.171333\,0.0153333\,0.0136667\,0.0126667\,0.012\,0.00833333\,0.008\,0.00766667\,0.006},0.175806 --Multipart_Mon__11_Aug_2003_18:47:36_+0200_0856a3f0-- From pgsql-hackers-owner@postgresql.org Mon Aug 11 14:17:40 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id B3B75D1C516 for ; Mon, 11 Aug 2003 17:14: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 14922-04 for ; Mon, 11 Aug 2003 14:12:43 -0300 (ADT) Received: from varlena.com (adsl-64-165-208-112.dsl.snfc21.pacbell.net [64.165.208.112]) by svr1.postgresql.org (Postfix) with ESMTP id 00126D1C4B9 for ; Mon, 11 Aug 2003 14:14:02 -0300 (ADT) Received: by varlena.com (Postfix on SuSE Linux 7.3 (i386), from userid 500) id 0686A399D2; Mon, 11 Aug 2003 10:07:40 -0700 (PDT) Date: Mon, 11 Aug 2003 10:07:40 -0700 From: elein To: pgsql-hackers@postgresql.org Cc: Tom Lane , elein Subject: Re: Windows on SuSE? 7.4 Message-ID: <20030811100740.D2396@cookie> Mail-Followup-To: pgsql-hackers@postgresql.org, Tom Lane References: <20030810200440.B2396@cookie> <3032.1060617279@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3032.1060617279@sss.pgh.pa.us> User-Agent: Mutt/1.3.22.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/639 X-Sequence-Number: 42297 cassert was on. Now debug is on, too. I updated from cvs-head just now. configure knows it is a linux box. Should it be trying to link to libwsock32.so or not? If this is a legitimate link, then the problem is different than if it is trying to link it in erroneously. --elein The is the top of the config.log --------------------- This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by PostgreSQL configure 7.4beta1, which was generated by GNU Autoconf 2.53. Invocation command line was $ ./configure --prefix=/local/pghead --with-perl --with-python --enable-depend --enable-cassert --enable-d ebug ## --------- ## ## Platform. ## ## --------- ## hostname = cookie uname -m = i686 uname -r = 2.4.16-4GB uname -s = Linux uname -v = #1 Mon Apr 15 08:57:26 GMT 2002 --------------------- $ gdb postmaster GNU gdb 20010316 Copyright 2001 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-suse-linux"... (gdb) run -i -D /local/pghead/data Starting program: /local/pghead/bin/postmaster -i -D /local/pghead/data Program received signal SIGSEGV, Segmentation fault. 0x40099ac5 in dllname () from /usr/lib/libwsock32.so (gdb) bt #0 0x40099ac5 in dllname () from /usr/lib/libwsock32.so #1 0x081218b1 in StreamServerPort (family=0, hostName=0x0, portNumber=5432, unixSocketName=0x82d6e68 "", ListenSocket=0x829b420, MaxListen=10) at pqcomm.c:279 #2 0x08150a26 in PostmasterMain (argc=4, argv=0x82cfae8) at postmaster.c:765 #3 0x081233e3 in main (argc=4, argv=0xbffff414) at main.c:215 #4 0x4010e7ee in __libc_start_main () from /lib/libc.so.6 On Mon, Aug 11, 2003 at 11:54:39AM -0400, Tom Lane wrote: > elein writes: > > This is as far as I've gotten with 7.4. > > Would you rebuild with --enable-debug (perhaps also --enable-cassert) > so that the gdb backtrace is more informative? > > Also, it seems likely that the issue is in or around the recently-added > IPv6 support, so I'd suggest using CVS tip or last night's snapshot > rather than the beta1 tarball. We've already made some portability > fixes there since beta1. > > regards, tom lane > From pgsql-hackers-owner@postgresql.org Mon Aug 11 14:31:21 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id EFAFCD1C4DB for ; Mon, 11 Aug 2003 17:31:19 +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 24658-03 for ; Mon, 11 Aug 2003 14:29:48 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 5C586D1C4B9 for ; Mon, 11 Aug 2003 14:31:08 -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 h7BHTJSa003856; Mon, 11 Aug 2003 13:29:19 -0400 (EDT) To: elein Cc: pgsql-hackers@postgresql.org, elein , Bruce Momjian Subject: Re: Windows on SuSE? 7.4 In-reply-to: <20030811100740.D2396@cookie> References: <20030810200440.B2396@cookie> <3032.1060617279@sss.pgh.pa.us> <20030811100740.D2396@cookie> Comments: In-reply-to elein message dated "Mon, 11 Aug 2003 10:07:40 -0700" Date: Mon, 11 Aug 2003 13:29:19 -0400 Message-ID: <3855.1060622959@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/641 X-Sequence-Number: 42299 elein writes: > configure knows it is a linux box. > Should it be trying to link to libwsock32.so > or not? If this is a legitimate link, then > the problem is different than if it is trying > to link it in erroneously. configure is unconditionally including libwsock32 if it can find one. AFAICT from the CVS logs, this was only expected to happen on win32 (Bruce, that was your commit, configure.in v1.250; please confirm). So it would probably make sense to not look for libwsock32 unless PORTNAME is "win32". I take it you actually have a libwsock32? What's it supposed to do? regards, tom lane From pgsql-hackers-owner@postgresql.org Mon Aug 11 14:51:21 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 9EABED1C4BA for ; Mon, 11 Aug 2003 17:51:20 +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 26483-02 for ; Mon, 11 Aug 2003 14:49:49 -0300 (ADT) Received: from varlena.com (adsl-64-165-208-112.dsl.snfc21.pacbell.net [64.165.208.112]) by svr1.postgresql.org (Postfix) with ESMTP id 3E75CD1C4DB for ; Mon, 11 Aug 2003 14:51:09 -0300 (ADT) Received: by varlena.com (Postfix on SuSE Linux 7.3 (i386), from userid 500) id 009C2399D2; Mon, 11 Aug 2003 10:44:47 -0700 (PDT) Date: Mon, 11 Aug 2003 10:44:47 -0700 From: elein To: Tom Lane Cc: elein , pgsql-hackers@postgresql.org, elein , Bruce Momjian Subject: Re: Windows on SuSE? 7.4 Message-ID: <20030811104447.G2396@cookie> Mail-Followup-To: Tom Lane , elein , pgsql-hackers@postgresql.org, Bruce Momjian References: <20030810200440.B2396@cookie> <3032.1060617279@sss.pgh.pa.us> <20030811100740.D2396@cookie> <3855.1060622959@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3855.1060622959@sss.pgh.pa.us> User-Agent: Mutt/1.3.22.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/643 X-Sequence-Number: 42301 Yes, I actually have a libwsock32 because my system has wine on it. Wine is a windows emulator. So the assumption that any system with that file is a windows system will break on systems with windows emulators. It sounds like Joe's guess on this was right. --elein On Mon, Aug 11, 2003 at 01:29:19PM -0400, Tom Lane wrote: > elein writes: > > configure knows it is a linux box. > > Should it be trying to link to libwsock32.so > > or not? If this is a legitimate link, then > > the problem is different than if it is trying > > to link it in erroneously. > > configure is unconditionally including libwsock32 if it can find one. > AFAICT from the CVS logs, this was only expected to happen on win32 > (Bruce, that was your commit, configure.in v1.250; please confirm). > So it would probably make sense to not look for libwsock32 unless > PORTNAME is "win32". > > I take it you actually have a libwsock32? What's it supposed to do? > > regards, tom lane > From pgsql-hackers-owner@postgresql.org Mon Aug 11 20:52:06 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 26BD5D1C4B9 for ; Mon, 11 Aug 2003 17:59: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 25565-04 for ; Mon, 11 Aug 2003 14:58:24 -0300 (ADT) Received: from varlena.com (adsl-64-165-208-112.dsl.snfc21.pacbell.net [64.165.208.112]) by svr1.postgresql.org (Postfix) with ESMTP id 5826BD1C4BA for ; Mon, 11 Aug 2003 14:59:44 -0300 (ADT) Received: by varlena.com (Postfix on SuSE Linux 7.3 (i386), from userid 500) id 09574399D2; Mon, 11 Aug 2003 10:53:23 -0700 (PDT) Date: Mon, 11 Aug 2003 10:53:22 -0700 From: elein To: Tom Lane Cc: elein , pgsql-hackers@postgresql.org, elein , Bruce Momjian Subject: Re: Windows on SuSE? 7.4 Message-ID: <20030811105322.I2396@cookie> Mail-Followup-To: Tom Lane , elein , pgsql-hackers@postgresql.org, Bruce Momjian References: <20030810200440.B2396@cookie> <3032.1060617279@sss.pgh.pa.us> <20030811100740.D2396@cookie> <3855.1060622959@sss.pgh.pa.us> <20030811104447.G2396@cookie> <4146.1060624411@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4146.1060624411@sss.pgh.pa.us> User-Agent: Mutt/1.3.22.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/659 X-Sequence-Number: 42317 I blame SuSE. Thank you for the fix and confirmation of the problem. elein On Mon, Aug 11, 2003 at 01:53:31PM -0400, Tom Lane wrote: > elein writes: > > Yes, I actually have a libwsock32 because my > > system has wine on it. Wine is a windows > > emulator. > > And they drop windows-only libraries into /usr/lib? Yech. > > Anyway, I can't see a need to include libwsock32 on non-win32 platforms. > Will modify configure. > > regards, tom lane > From pgsql-hackers-owner@postgresql.org Mon Aug 11 14:55:31 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C30C4D1C4DB for ; Mon, 11 Aug 2003 17:55: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 26327-03 for ; Mon, 11 Aug 2003 14:53:57 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id D800DD1C4B9 for ; Mon, 11 Aug 2003 14:55:16 -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 h7BHrWSa004147; Mon, 11 Aug 2003 13:53:32 -0400 (EDT) To: elein Cc: pgsql-hackers@postgresql.org, elein , Bruce Momjian Subject: Re: Windows on SuSE? 7.4 In-reply-to: <20030811104447.G2396@cookie> References: <20030810200440.B2396@cookie> <3032.1060617279@sss.pgh.pa.us> <20030811100740.D2396@cookie> <3855.1060622959@sss.pgh.pa.us> <20030811104447.G2396@cookie> Comments: In-reply-to elein message dated "Mon, 11 Aug 2003 10:44:47 -0700" Date: Mon, 11 Aug 2003 13:53:31 -0400 Message-ID: <4146.1060624411@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/644 X-Sequence-Number: 42302 elein writes: > Yes, I actually have a libwsock32 because my > system has wine on it. Wine is a windows > emulator. And they drop windows-only libraries into /usr/lib? Yech. Anyway, I can't see a need to include libwsock32 on non-win32 platforms. Will modify configure. regards, tom lane From pgsql-hackers-owner@postgresql.org Mon Aug 11 15:19:06 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id AA71ED1F41A for ; Mon, 11 Aug 2003 18:18: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 30319-02 for ; Mon, 11 Aug 2003 15:16:54 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id B9CF3D1F437 for ; Mon, 11 Aug 2003 15:16:50 -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 h7BIEvSa005070; Mon, 11 Aug 2003 14:14:58 -0400 (EDT) To: elein Cc: pgsql-hackers@postgresql.org, elein , Bruce Momjian Subject: Re: Windows on SuSE? 7.4 In-reply-to: <20030811104447.G2396@cookie> References: <20030810200440.B2396@cookie> <3032.1060617279@sss.pgh.pa.us> <20030811100740.D2396@cookie> <3855.1060622959@sss.pgh.pa.us> <20030811104447.G2396@cookie> Comments: In-reply-to elein message dated "Mon, 11 Aug 2003 10:44:47 -0700" Date: Mon, 11 Aug 2003 14:14:57 -0400 Message-ID: <5069.1060625697@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/645 X-Sequence-Number: 42303 elein writes: > It sounds like Joe's guess on this was right. I've committed this fix in configure.in: *************** *** 631,637 **** AC_CHECK_LIB(gen, main) AC_CHECK_LIB(PW, main) AC_CHECK_LIB(resolv, main) - AC_CHECK_LIB(wsock32, main) AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt]) # QNX: AC_CHECK_LIB(unix, main) --- 636,641 ---- *************** *** 645,650 **** --- 649,659 ---- AC_SEARCH_LIBS(fdatasync, [rt posix4]) # Cygwin: AC_CHECK_LIB(cygipc, shmget) + # WIN32: + if test "$PORTNAME" = "win32" + then + AC_CHECK_LIB(wsock32, main) + fi if test "$with_readline" = yes; then PGAC_CHECK_READLINE regards, tom lane From pgsql-performance-owner@postgresql.org Mon Aug 11 15:26:36 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 A069ED1C510 for ; Mon, 11 Aug 2003 18:26: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 29802-07 for ; Mon, 11 Aug 2003 15:25:05 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 5CECCD1C4E7 for ; Mon, 11 Aug 2003 15:26:24 -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 h7BIP4Sa005168; Mon, 11 Aug 2003 14:25:04 -0400 (EDT) To: Stef Cc: pgsql-performance@postgresql.org Subject: Re: Analyze makes queries slow... In-reply-to: <20030811184736.7e191a86.svb@ucs.co.za> References: <20030811155841.483ffd93.svb@ucs.co.za> <2934.1060616625@sss.pgh.pa.us> <20030811184736.7e191a86.svb@ucs.co.za> Comments: In-reply-to Stef message dated "Mon, 11 Aug 2003 18:47:36 +0200" Date: Mon, 11 Aug 2003 14:25:03 -0400 Message-ID: <5167.1060626303@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/172 X-Sequence-Number: 2989 Stef writes: > => Could we see the results of "EXPLAIN ANALYZE", rather than just EXPLAIN, > => for the un-analyzed case? > Attached the output of this. Hmm... not immediately obvious where it's going wrong. Could you try this (after ANALYZE): set enable_mergejoin to off; explain analyze ... query ... If it finishes in a reasonable amount of time, send the explain output. regards, tom lane From pgsql-performance-owner@postgresql.org Mon Aug 11 15:51: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 C27F9D1C4E1 for ; Mon, 11 Aug 2003 18:51: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 30212-07 for ; Mon, 11 Aug 2003 15:50:23 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 11A24D1C510 for ; Mon, 11 Aug 2003 15:51:42 -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 h7BIoLSa005399; Mon, 11 Aug 2003 14:50:21 -0400 (EDT) To: Stef Cc: pgsql-performance@postgresql.org Subject: Re: Analyze makes queries slow... In-reply-to: <20030811184736.7e191a86.svb@ucs.co.za> References: <20030811155841.483ffd93.svb@ucs.co.za> <2934.1060616625@sss.pgh.pa.us> <20030811184736.7e191a86.svb@ucs.co.za> Comments: In-reply-to Stef message dated "Mon, 11 Aug 2003 18:47:36 +0200" Date: Mon, 11 Aug 2003 14:50:21 -0400 Message-ID: <5398.1060627821@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/173 X-Sequence-Number: 2990 Stef writes: > => And what PG version is this, exactly? > PostgreSQL 7.3.1 Ah, I think I see it: you are getting burnt by a mergejoin estimation bug that was fixed in 7.3.2. Please update (you might as well go to 7.3.4 while you're at it) and see if the results improve. regards, tom lane From pgsql-hackers-owner@postgresql.org Mon Aug 11 15:53:48 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 64BA6D1C513 for ; Mon, 11 Aug 2003 18:53: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 30437-06 for ; Mon, 11 Aug 2003 15:52:16 -0300 (ADT) Received: from localhost.localdomain (unknown [65.217.53.66]) by svr1.postgresql.org (Postfix) with ESMTP id 60FF9D1C4E1 for ; Mon, 11 Aug 2003 15:53:35 -0300 (ADT) Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h7BHZoqd002917; Mon, 11 Aug 2003 13:35:55 -0400 Received: from gnvex001.mmrd.com (gnvex001.mmrd.com [192.168.3.55]) by thorn.mmrd.com (8.11.6/8.11.6) with ESMTP id h7BIrDZ02157; Mon, 11 Aug 2003 14:53:13 -0400 Received: from camel.mmrd.com ([172.25.5.213]) by gnvex001.mmrd.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 34AD3TYX; Mon, 11 Aug 2003 14:53:10 -0400 Subject: Re: Windows on SuSE? 7.4 From: Robert Treat To: elein Cc: Tom Lane , pgsql-hackers@postgresql.org, elein , Bruce Momjian In-Reply-To: <20030811104447.G2396@cookie> References: <20030810200440.B2396@cookie> <3032.1060617279@sss.pgh.pa.us> <20030811100740.D2396@cookie> <3855.1060622959@sss.pgh.pa.us> <20030811104447.G2396@cookie> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 11 Aug 2003 14:53:12 -0400 Message-Id: <1060627992.22260.2229.camel@camel> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/646 X-Sequence-Number: 42304 On Mon, 2003-08-11 at 13:44, elein wrote: > Yes, I actually have a libwsock32 because my > system has wine on it. Wine is a windows > emulator. > Wine Is Not an Emulator :-) Robert Treat -- PostgreSQL :: The Enterprise Open Source Database From pgsql-performance-owner@postgresql.org Mon Aug 11 18:18: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 70183D1C47A for ; Mon, 11 Aug 2003 21:17:59 +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 36565-09 for ; Mon, 11 Aug 2003 18:16:26 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 964E9D1C4E6 for ; Mon, 11 Aug 2003 18:17:44 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3502938 for pgsql-performance@postgresql.org; Mon, 11 Aug 2003 14:16:52 -0700 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: pgsql-performance@postgresql.org Subject: Odd problem with performance in duplicate database Date: Mon, 11 Aug 2003 14:15:07 -0700 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="------------Boundary-00=_7D4H7BB7TC4QPTKGRV3B" Message-Id: <200308111415.07751.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/174 X-Sequence-Number: 2991 --------------Boundary-00=_7D4H7BB7TC4QPTKGRV3B Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Folks: I have a live and a test database for an in-production system running on=20 7.2.4. The test database is a copy of the live one. They are running on the same= =20 copy of Postgres, on the same server. I use the test database to test=20 changes before I apply them to the production system. Periodically (like= =20 today) I reload the test system from the backup of the live one. I'm now having a problem with a huge complex query which runs very slowly o= n=20 the test database, but very quickly on the live database! The problems=20 seems to be that the test database seems to think that a nested loop is an= =20 appropriate strategy for a table of 140,000 records, while the live one=20 realizes that it's not. What really has me scratching my head is that the test database is an exact= =20 copy of the live database, just a few hours older. And the live database h= as=20 never displayed this performance problem, whereas the test database has had= =20 it for 2-3 weeks. Both EXPLAIN ANALYZEs are attached. --=20 -Josh Berkus Aglio Database Solutions San Francisco --------------Boundary-00=_7D4H7BB7TC4QPTKGRV3B Content-Type: text/plain; charset="us-ascii"; name="perf_prob_live.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="perf_prob_live.txt" Sort (cost=57376.11..57376.11 rows=1 width=627) (actual time=370.48..370.48 rows=8 loops=1) -> Nested Loop (cost=57049.91..57376.10 rows=1 width=627) (actual time=360.99..369.81 rows=8 loops=1) -> Nested Loop (cost=57049.91..57372.18 rows=1 width=583) (actual time=314.97..320.96 rows=8 loops=1) -> Nested Loop (cost=57049.91..57368.25 rows=1 width=539) (actual time=314.90..320.56 rows=8 loops=1) -> Nested Loop (cost=57049.91..57365.27 rows=1 width=525) (actual time=314.42..317.60 rows=8 loops=1) -> Nested Loop (cost=57049.91..57361.78 rows=1 width=497) (actual time=314.35..317.10 rows=8 loops=1) -> Nested Loop (cost=57049.91..57357.83 rows=1 width=436) (actual time=314.27..316.53 rows=8 loops=1) -> Merge Join (cost=57049.91..57050.46 rows=77 width=424) (actual time=314.02..314.77 rows=26 loops=1) -> Sort (cost=57048.31..57048.31 rows=37 width=406) (actual time=313.76..313.78 rows=27 loops=1) -> Merge Join (cost=57019.29..57047.82 rows=37 width=406) (actual time=311.61..313.63 rows=27 loops=1) -> Index Scan using locations_pkey on locations (cost=0.00..27.54 rows=568 width=107) (actual time=0.22..1.55 rows=172 loops=1) -> Sort (cost=57019.29..57019.29 rows=37 width=299) (actual time=311.34..311.35 rows=27 loops=1) -> Hash Join (cost=5.73..57018.80 rows=37 width=299) (actual time=44.24..311.12 rows=27 loops=1) -> Hash Join (cost=4.61..57015.58 rows=745 width=274) (actual time=3.30..308.58 rows=965 loops=1) -> Index Scan using idx_events_date on events (cost=0.00..57004.46 rows=745 width=240) (actual time=2.54..296.46 rows=965 loops=1) SubPlan -> Nested Loop (cost=5.48..19.48 rows=1 width=55) (actual time=0.05..0.05 rows=0 loops=856) -> Nested Loop (cost=0.00..12.52 rows=1 width=23) (actual time=0.03..0.04 rows=0 loops=856) -> Nested Loop (cost=0.00..7.41 rows=1 width=12) (actual time=0.01..0.02 rows=1 loops=856) -> Index Scan using trial_groups_pkey on trial_groups (cost=0.00..3.49 rows=1 width=4) (actual time=0.01..0.01 rows=0 loops=856) -> Index Scan using idx_cases_tgroup on cases (cost=0.00..3.92 rows=1 width=8) (actual time=0.02..0.04 rows=4 loops=133) -> Index Scan using idx_caseclients_case on case_clients (cost=0.00..5.10 rows=1 width=11) (actual time=0.03..0.04 rows=1 loops=471) -> Materialize (cost=6.95..6.95 rows=1 width=32) (actual time=0.00..0.00 rows=3 loops=366) -> Nested Loop (cost=5.48..6.95 rows=1 width=32) (actual time=0.58..0.81 rows=3 loops=1) -> Merge Join (cost=5.48..5.50 rows=1 width=30) (actual time=0.55..0.56 rows=3 loops=1) -> Sort (cost=4.04..4.04 rows=2 width=28) (actual time=0.39..0.39 rows=3 loops=1) -> Merge Join (cost=3.99..4.03 rows=2 width=28) (actual time=0.31..0.32 rows=3 loops=1) -> Sort (cost=1.34..1.34 rows=21 width=8) (actual time=0.12..0.12 rows=2 loops=1) -> Seq Scan on text_lists (cost=0.00..1.10 rows=21 width=8) (actual time=0.01..0.06 rows=21 loops=1) -> Sort (cost=2.65..2.65 rows=2 width=20) (actual time=0.18..0.18 rows=3 loops=1) -> Seq Scan on list_values (cost=0.00..2.65 rows=2 width=20) (actual time=0.01..0.15 rows=3 loops=1) -> Sort (cost=1.45..1.45 rows=3 width=2) (actual time=0.13..0.13 rows=5 loops=1) -> Seq Scan on status s1 (cost=0.00..1.44 rows=3 width=2) (actual time=0.01..0.09 rows=4 loops=1) -> Seq Scan on status s2 (cost=0.00..1.44 rows=3 width=2) (actual time=0.01..0.07 rows=3 loops=3) -> Nested Loop (cost=5.48..16.00 rows=1 width=47) (actual time=0.06..0.06 rows=0 loops=3325) -> Nested Loop (cost=0.00..9.05 rows=1 width=15) (actual time=0.05..0.06 rows=1 loops=3325) -> Index Scan using cases_pkey on cases (cost=0.00..3.94 rows=1 width=4) (actual time=0.02..0.02 rows=1 loops=3325) -> Index Scan using idx_caseclients_case on case_clients (cost=0.00..5.10 rows=1 width=11) (actual time=0.03..0.03 rows=1 loops=3311) -> Materialize (cost=6.95..6.95 rows=1 width=32) (actual time=0.00..0.00 rows=2 loops=2190) -> Nested Loop (cost=5.48..6.95 rows=1 width=32) (actual time=0.63..0.85 rows=3 loops=1) -> Merge Join (cost=5.48..5.50 rows=1 width=30) (actual time=0.59..0.60 rows=3 loops=1) -> Sort (cost=4.04..4.04 rows=2 width=28) (actual time=0.43..0.43 rows=3 loops=1) -> Merge Join (cost=3.99..4.03 rows=2 width=28) (actual time=0.35..0.36 rows=3 loops=1) -> Sort (cost=1.34..1.34 rows=21 width=8) (actual time=0.14..0.14 rows=2 loops=1) -> Seq Scan on text_lists (cost=0.00..1.10 rows=21 width=8) (actual time=0.02..0.06 rows=21 loops=1) -> Sort (cost=2.65..2.65 rows=2 width=20) (actual time=0.19..0.20 rows=3 loops=1) -> Seq Scan on list_values (cost=0.00..2.65 rows=2 width=20) (actual time=0.02..0.17 rows=3 loops=1) -> Sort (cost=1.45..1.45 rows=3 width=2) (actual time=0.14..0.14 rows=5 loops=1) -> Seq Scan on status s1 (cost=0.00..1.44 rows=3 width=2) (actual time=0.02..0.10 rows=4 loops=1) -> Seq Scan on status s2 (cost=0.00..1.44 rows=3 width=2) (actual time=0.01..0.07 rows=3 loops=3) -> Hash (cost=4.49..4.49 rows=97 width=34) (actual time=0.52..0.52 rows=0 loops=1) -> Seq Scan on event_types (cost=0.00..4.49 rows=97 width=34) (actual time=0.06..0.38 rows=97 loops=1) -> Hash (cost=1.12..1.12 rows=1 width=25) (actual time=0.09..0.09 rows=0 loops=1) -> Seq Scan on event_cats (cost=0.00..1.12 rows=1 width=25) (actual time=0.07..0.08 rows=1 loops=1) -> Sort (cost=1.61..1.61 rows=10 width=18) (actual time=0.21..0.23 rows=30 loops=1) -> Seq Scan on status (cost=0.00..1.52 rows=10 width=18) (actual time=0.04..0.12 rows=9 loops=1) -> Index Scan using event_days_pk on event_days (cost=0.00..3.96 rows=1 width=12) (actual time=0.05..0.05 rows=0 loops=26) -> Index Scan using cases_pkey on cases (cost=0.00..3.94 rows=1 width=61) (actual time=0.02..0.03 rows=0 loops=8) -> Index Scan using trial_groups_pkey on trial_groups (cost=0.00..3.49 rows=1 width=28) (actual time=0.01..0.02 rows=0 loops=8) -> Seq Scan on opp_counsel (cost=0.00..2.44 rows=87 width=14) (actual time=0.01..0.18 rows=87 loops=8) -> Index Scan using events_pkey on events parent (cost=0.00..3.92 rows=1 width=44) (actual time=0.00..0.00 rows=0 loops=8) -> Index Scan using events_pkey on events previous (cost=0.00..3.92 rows=1 width=44) (actual time=0.02..0.02 rows=0 loops=8) SubPlan -> Aggregate (cost=9.01..9.01 rows=1 width=23) (actual time=0.35..0.35 rows=1 loops=4) -> Index Scan using idx_cases_tgroup on cases c1 (cost=0.00..9.01 rows=1 width=23) (actual time=0.08..0.23 rows=4 loops=4) SubPlan -> Index Scan using idx_caseclients_case on case_clients cc1 (cost=0.00..5.09 rows=1 width=7) (actual time=0.03..0.03 rows=1 loops=22) Total runtime: 373.70 msec --------------Boundary-00=_7D4H7BB7TC4QPTKGRV3B Content-Type: text/plain; charset="us-ascii"; name="perf_prob_test.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="perf_prob_test.txt" Sort (cost=8725694.92..8725694.92 rows=1 width=625) (actual time=266461.38..266461.38 rows=8 loops=1) -> Nested Loop (cost=8725228.42..8725694.91 rows=1 width=625) (actual time=266452.64..266461.09 rows=8 loops=1) -> Nested Loop (cost=8725228.42..8725691.01 rows=1 width=581) (actual time=266442.99..266448.67 rows=8 loops=1) -> Nested Loop (cost=8725228.42..8725687.12 rows=1 width=537) (actual time=266442.93..266448.29 rows=8 loops=1) -> Nested Loop (cost=8725228.42..8725684.14 rows=1 width=523) (actual time=266442.45..266445.48 rows=8 loops=1) -> Nested Loop (cost=8725228.42..8725680.64 rows=1 width=495) (actual time=266442.38..266444.99 rows=8 loops=1) -> Nested Loop (cost=8725228.42..8725676.67 rows=1 width=434) (actual time=266442.30..266444.43 rows=8 loops=1) -> Merge Join (cost=8725228.42..8725229.20 rows=113 width=422) (actual time=266442.08..266442.77 rows=26 loops=1) -> Sort (cost=8725226.81..8725226.81 rows=54 width=404) (actual time=266441.54..266441.56 rows=27 loops=1) -> Merge Join (cost=8725197.37..8725226.03 rows=54 width=404) (actual time=266439.42..266441.41 rows=27 loops=1) -> Index Scan using locations_pkey on locations (cost=0.00..27.54 rows=568 width=107) (actual time=0.14..1.44 rows=172 loops=1) -> Sort (cost=8725197.37..8725197.37 rows=54 width=297) (actual time=266439.24..266439.25 rows=27 loops=1) -> Hash Join (cost=5.73..8725196.59 rows=54 width=297) (actual time=28490.20..266438.99 rows=27 loops=1) -> Hash Join (cost=4.60..8725192.42 rows=1083 width=272) (actual time=2.25..266436.04 rows=964 loops=1) -> Index Scan using idx_events_date on events (cost=0.00..8725178.35 rows=1083 width=238) (actual time=1.49..266421.59 rows=964 loops=1) SubPlan -> Hash Join (cost=89.59..3792.14 rows=1 width=55) (actual time=311.23..311.23 rows=0 loops=855) -> Hash Join (cost=82.64..3784.86 rows=88 width=23) (actual time=301.99..310.66 rows=0 loops=855) -> Seq Scan on case_clients (cost=0.00..3673.48 rows=11274 width=11) (actual time=0.02..302.20 rows=8822 loops=855) -> Hash (cost=81.53..81.53 rows=887 width=12) (actual time=0.04..0.04 rows=0 loops=855) -> Nested Loop (cost=0.00..81.53 rows=887 width=12) (actual time=0.03..0.04 rows=1 loops=855) -> Index Scan using trial_groups_pkey on trial_groups (cost=0.00..3.49 rows=1 width=4) (actual time=0.02..0.02 rows=0 loops=855) -> Index Scan using idx_cases_tgroup on cases (cost=0.00..77.77 rows=43 width=8) (actual time=0.03..0.07 rows=6 loops=133) -> Hash (cost=6.95..6.95 rows=1 width=32) (actual time=0.30..0.30 rows=0 loops=855) -> Nested Loop (cost=5.48..6.95 rows=1 width=32) (actual time=0.06..0.30 rows=3 loops=855) -> Merge Join (cost=5.48..5.50 rows=1 width=30) (actual time=0.02..0.04 rows=3 loops=855) -> Sort (cost=4.04..4.04 rows=2 width=28) (actual time=0.00..0.00 rows=3 loops=855) -> Merge Join (cost=3.99..4.03 rows=2 width=28) (actual time=0.30..0.30 rows=3 loops=1) -> Sort (cost=1.34..1.34 rows=21 width=8) (actual time=0.11..0.11 rows=2 loops=1) -> Seq Scan on text_lists (cost=0.00..1.10 rows=21 width=8) (actual time=0.01..0.05 rows=21 loops=1) -> Sort (cost=2.65..2.65 rows=2 width=20) (actual time=0.18..0.18 rows=3 loops=1) -> Seq Scan on list_values (cost=0.00..2.65 rows=2 width=20) (actual time=0.01..0.14 rows=3 loops=1) -> Sort (cost=1.45..1.45 rows=3 width=2) (actual time=0.00..0.00 rows=5 loops=855) -> Seq Scan on status s1 (cost=0.00..1.44 rows=3 width=2) (actual time=0.01..0.08 rows=4 loops=1) -> Seq Scan on status s2 (cost=0.00..1.44 rows=3 width=2) (actual time=0.01..0.07 rows=3 loops=2565) -> Nested Loop (cost=5.48..15.71 rows=1 width=47) (actual time=0.07..0.07 rows=0 loops=3312) -> Nested Loop (cost=0.00..8.76 rows=1 width=15) (actual time=0.06..0.07 rows=1 loops=3312) -> Index Scan using cases_pkey on cases (cost=0.00..3.96 rows=1 width=4) (actual time=0.02..0.02 rows=1 loops=3312) -> Index Scan using idx_caseclients_case on case_clients (cost=0.00..4.79 rows=1 width=11) (actual time=0.03..0.03 rows=1 loops=3298) -> Materialize (cost=6.95..6.95 rows=1 width=32) (actual time=0.00..0.00 rows=2 loops=2182) -> Nested Loop (cost=5.48..6.95 rows=1 width=32) (actual time=0.68..0.89 rows=3 loops=1) -> Merge Join (cost=5.48..5.50 rows=1 width=30) (actual time=0.64..0.66 rows=3 loops=1) -> Sort (cost=4.04..4.04 rows=2 width=28) (actual time=0.50..0.50 rows=3 loops=1) -> Merge Join (cost=3.99..4.03 rows=2 width=28) (actual time=0.42..0.43 rows=3 loops=1) -> Sort (cost=1.34..1.34 rows=21 width=8) (actual time=0.16..0.16 rows=2 loops=1) -> Seq Scan on text_lists (cost=0.00..1.10 rows=21 width=8) (actual time=0.06..0.09 rows=21 loops=1) -> Sort (cost=2.65..2.65 rows=2 width=20) (actual time=0.24..0.24 rows=3 loops=1) -> Seq Scan on list_values (cost=0.00..2.65 rows=2 width=20) (actual time=0.06..0.20 rows=3 loops=1) -> Sort (cost=1.45..1.45 rows=3 width=2) (actual time=0.12..0.12 rows=5 loops=1) -> Seq Scan on status s1 (cost=0.00..1.44 rows=3 width=2) (actual time=0.01..0.09 rows=4 loops=1) -> Seq Scan on status s2 (cost=0.00..1.44 rows=3 width=2) (actual time=0.01..0.07 rows=3 loops=3) -> Hash (cost=4.48..4.48 rows=96 width=34) (actual time=0.51..0.51 rows=0 loops=1) -> Seq Scan on event_types (cost=0.00..4.48 rows=96 width=34) (actual time=0.05..0.36 rows=96 loops=1) -> Hash (cost=1.12..1.12 rows=1 width=25) (actual time=0.08..0.08 rows=0 loops=1) -> Seq Scan on event_cats (cost=0.00..1.12 rows=1 width=25) (actual time=0.06..0.07 rows=1 loops=1) -> Sort (cost=1.61..1.61 rows=10 width=18) (actual time=0.49..0.51 rows=30 loops=1) -> Seq Scan on status (cost=0.00..1.52 rows=10 width=18) (actual time=0.05..0.14 rows=9 loops=1) -> Index Scan using event_days_pk on event_days (cost=0.00..3.96 rows=1 width=12) (actual time=0.05..0.05 rows=0 loops=26) -> Index Scan using cases_pkey on cases (cost=0.00..3.96 rows=1 width=61) (actual time=0.03..0.03 rows=0 loops=8) -> Index Scan using trial_groups_pkey on trial_groups (cost=0.00..3.49 rows=1 width=28) (actual time=0.02..0.02 rows=0 loops=8) -> Seq Scan on opp_counsel (cost=0.00..2.44 rows=87 width=14) (actual time=0.01..0.17 rows=87 loops=8) -> Index Scan using events_pkey on events parent (cost=0.00..3.89 rows=1 width=44) (actual time=0.00..0.00 rows=0 loops=8) -> Index Scan using events_pkey on events previous (cost=0.00..3.89 rows=1 width=44) (actual time=0.02..0.02 rows=0 loops=8) SubPlan -> Aggregate (cost=283.08..283.08 rows=1 width=23) (actual time=0.33..0.33 rows=1 loops=4) -> Index Scan using idx_cases_tgroup on cases c1 (cost=0.00..283.05 rows=21 width=23) (actual time=0.08..0.23 rows=4 loops=4) SubPlan -> Index Scan using idx_caseclients_case on case_clients cc1 (cost=0.00..4.78 rows=1 width=7) (actual time=0.03..0.03 rows=1 loops=22) Total runtime: 266463.54 msec --------------Boundary-00=_7D4H7BB7TC4QPTKGRV3B-- From pgsql-hackers-owner@postgresql.org Mon Aug 11 18:46:38 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 6C99BD1C4DF for ; Mon, 11 Aug 2003 21:46:36 +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 49113-07 for ; Mon, 11 Aug 2003 18:45:06 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 41CA2D1C47A for ; Mon, 11 Aug 2003 18:46:23 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7BLjtu03603; Mon, 11 Aug 2003 17:45:55 -0400 (EDT) From: Bruce Momjian Message-Id: <200308112145.h7BLjtu03603@candle.pha.pa.us> Subject: Re: Windows on SuSE? 7.4 In-Reply-To: <5069.1060625697@sss.pgh.pa.us> To: Tom Lane Date: Mon, 11 Aug 2003 17:45:55 -0400 (EDT) Cc: elein , pgsql-hackers@postgresql.org, elein X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/651 X-Sequence-Number: 42309 Yes, this is the right fix. I never suspected wsock32 would exist on a non-MS WIn machine. --------------------------------------------------------------------------- Tom Lane wrote: > elein writes: > > It sounds like Joe's guess on this was right. > > I've committed this fix in configure.in: > > *************** > *** 631,637 **** > AC_CHECK_LIB(gen, main) > AC_CHECK_LIB(PW, main) > AC_CHECK_LIB(resolv, main) > - AC_CHECK_LIB(wsock32, main) > AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt]) > # QNX: > AC_CHECK_LIB(unix, main) > --- 636,641 ---- > *************** > *** 645,650 **** > --- 649,659 ---- > AC_SEARCH_LIBS(fdatasync, [rt posix4]) > # Cygwin: > AC_CHECK_LIB(cygipc, shmget) > + # WIN32: > + if test "$PORTNAME" = "win32" > + then > + AC_CHECK_LIB(wsock32, main) > + fi > > if test "$with_readline" = yes; then > PGAC_CHECK_READLINE > > > regards, tom lane > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Mon Aug 11 19: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 32A42D1C47A for ; Mon, 11 Aug 2003 22:05:19 +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 44393-06 for ; Mon, 11 Aug 2003 19:03:48 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id B0A67D1C4DF for ; Mon, 11 Aug 2003 19:05:05 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3503125 for pgsql-performance@postgresql.org; Mon, 11 Aug 2003 15:05:31 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: pgsql-performance@postgresql.org Subject: Re: Odd problem with performance in duplicate database Date: Mon, 11 Aug 2003 15:03:46 -0700 User-Agent: KMail/1.4.3 References: <200308111415.07751.josh@agliodbs.com> In-Reply-To: <200308111415.07751.josh@agliodbs.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308111503.46794.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/175 X-Sequence-Number: 2992 Folks, More followup on this: The crucial difference between the two execution plans is this clause: test db has: -> Seq Scan on case_clients (cost=3D0.00..3673.48 rows=3D11274 width=3D11= ) (actual=20 time=3D0.02..302.20 rows=3D8822 loops=3D855) whereas live db has: -> Index Scan using idx_caseclients_case on case_clients (cost=3D0.00..5.= 10=20 rows=3D1 width=3D11) (actual time=3D0.03..0.04 rows=3D1 loops=3D471) using an enable_seqscan =3D false fixes this, but is obviously not a long-t= erm=20 solution.=20=20=20 I've re-created the test system from an immediate copy of the live database= ,=20 and checked that the the main tables and indexes were reproduced faithfully. Lowering random_page_cost seems to do the trick. But I'm still mystified; = why=20 would one identical database pick a different plan than its copy? --=20 -Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Mon Aug 11 19:21:42 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 CC6CFD1C4E6 for ; Mon, 11 Aug 2003 22:17: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 52251-02 for ; Mon, 11 Aug 2003 19:15:33 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 34C5BD1C4DF for ; Mon, 11 Aug 2003 19:16:50 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7BMGiF06162; Mon, 11 Aug 2003 18:16:44 -0400 (EDT) From: Bruce Momjian Message-Id: <200308112216.h7BMGiF06162@candle.pha.pa.us> Subject: Re: Perfomance Tuning In-Reply-To: To: "scott.marlowe" Date: Mon, 11 Aug 2003 18:16:44 -0400 (EDT) Cc: Andrew Sullivan , pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/176 X-Sequence-Number: 2993 scott.marlowe wrote: > On Fri, 8 Aug 2003, Andrew Sullivan wrote: > > > On Fri, Aug 08, 2003 at 09:40:20AM -0700, Jonathan Gardner wrote: > > > > > > Redhat puts ext3 on by default. Consider switching to a non-journaling FS > > > (ext2?) with the partition that holds your data and WAL. > > > > I would give you exactly the opposite advice: _never_ use a > > non-journalling fs for your data and WAL. I suppose if you can > > afford to lose some transactions, you can do without journalling. > > Otherwise, you're just borrowing trouble, near as I can tell. > > I'd argue that a reliable filesystem (ext2) is still better than a > questionable journaling filesystem (ext3 on kernels <2.4.20). > > This isn't saying to not use jounraling, but I would definitely test it > under load first to make sure it's not gonna lose data or get corrupted. That _would_ work if ext2 was a reliable file system --- it is not. This is the problem of Linux file systems --- they have unreliable, and journalled, with nothing in between, except using a journalling file system and having it only journal metadata. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Mon Aug 11 19:42: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 79463D1C4E6 for ; Mon, 11 Aug 2003 22:42:42 +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 49668-08 for ; Mon, 11 Aug 2003 19:41:13 -0300 (ADT) Received: from lakemtao03.cox.net (lakemtao03.cox.net [68.1.17.242]) by svr1.postgresql.org (Postfix) with ESMTP id 7AD0CD1C4E3 for ; Mon, 11 Aug 2003 19:42:31 -0300 (ADT) Received: from [192.168.1.1] ([68.11.66.83]) by lakemtao03.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030811224233.UHNZ23518.lakemtao03.cox.net@[192.168.1.1]> for ; Mon, 11 Aug 2003 18:42:33 -0400 Subject: Re: Odd problem with performance in duplicate database From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <200308111503.46794.josh@agliodbs.com> References: <200308111415.07751.josh@agliodbs.com> <200308111503.46794.josh@agliodbs.com> Content-Type: text/plain Message-Id: <1060641748.23325.62.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 11 Aug 2003 17:42:28 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/177 X-Sequence-Number: 2994 On Mon, 2003-08-11 at 17:03, Josh Berkus wrote: > Folks, > > More followup on this: > > The crucial difference between the two execution plans is this clause: > > test db has: > -> Seq Scan on case_clients (cost=0.00..3673.48 rows=11274 width=11) (actual > time=0.02..302.20 rows=8822 loops=855) > > whereas live db has: > -> Index Scan using idx_caseclients_case on case_clients (cost=0.00..5.10 > rows=1 width=11) (actual time=0.03..0.04 rows=1 loops=471) > > using an enable_seqscan = false fixes this, but is obviously not a long-term > solution. > > I've re-created the test system from an immediate copy of the live database, > and checked that the the main tables and indexes were reproduced faithfully. > > Lowering random_page_cost seems to do the trick. But I'm still mystified; why > would one identical database pick a different plan than its copy? If the databases are on different machines, maybe the postgres.conf or pg_hba.conf files are different, and the buffer counts is affect- ing the optimizer? -- +---------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "Man, I'm pretty. Hoo Hah!" | | Johnny Bravo | +---------------------------------------------------------------+ From pgsql-performance-owner@postgresql.org Mon Aug 11 19:49: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 31D13D1C950 for ; Mon, 11 Aug 2003 22:49: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 55751-01 for ; Mon, 11 Aug 2003 19:48:25 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 417D4D1C4DF for ; Mon, 11 Aug 2003 19:49:43 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3503293; Mon, 11 Aug 2003 15:49:54 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Ron Johnson , PgSQL Performance ML Subject: Re: Odd problem with performance in duplicate database Date: Mon, 11 Aug 2003 15:48:09 -0700 User-Agent: KMail/1.4.3 References: <200308111415.07751.josh@agliodbs.com> <200308111503.46794.josh@agliodbs.com> <1060641748.23325.62.camel@haggis> In-Reply-To: <1060641748.23325.62.camel@haggis> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308111548.09684.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/178 X-Sequence-Number: 2995 Ron, > If the databases are on different machines, maybe the postgres.conf > or pg_hba.conf files are different, and the buffer counts is affect- > ing the optimizer? The databases are on the same machine, using the same postmaster. --=20 -Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Mon Aug 11 19:52:37 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 BE771D1C4DF for ; Mon, 11 Aug 2003 22:52: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 51146-10 for ; Mon, 11 Aug 2003 19:51:06 -0300 (ADT) Received: from mail.speakeasy.net (mail10.speakeasy.net [216.254.0.210]) by svr1.postgresql.org (Postfix) with ESMTP id E995CD1C47A for ; Mon, 11 Aug 2003 19:52:23 -0300 (ADT) Received: (qmail 21196 invoked from network); 11 Aug 2003 22:52:26 -0000 Received: from unknown (HELO pdarley) ([64.81.9.230]) (envelope-sender ) by mail10.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 11 Aug 2003 22:52:26 -0000 From: "Peter Darley" To: , "Ron Johnson" , "PgSQL Performance ML" Subject: Re: Odd problem with performance in duplicate database Date: Mon, 11 Aug 2003 15:51:42 -0700 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.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 In-Reply-To: <200308111548.09684.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/179 X-Sequence-Number: 2996 Josh, I'm sure that you've thought of this, but it sounds like you may not have done an analyze in your new DB. Thanks, Peter Darley -----Original Message----- From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org]On Behalf Of Josh Berkus Sent: Monday, August 11, 2003 3:48 PM To: Ron Johnson; PgSQL Performance ML Subject: Re: [PERFORM] Odd problem with performance in duplicate database Ron, > If the databases are on different machines, maybe the postgres.conf > or pg_hba.conf files are different, and the buffer counts is affect- > ing the optimizer? The databases are on the same machine, using the same postmaster. -- -Josh Berkus Aglio Database Solutions San Francisco ---------------------------(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 pgsql-performance-owner@postgresql.org Mon Aug 11 19:56:33 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 CC8CAD1C47A for ; Mon, 11 Aug 2003 22:56:31 +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 54129-05 for ; Mon, 11 Aug 2003 19:55:00 -0300 (ADT) Received: from djinn.gene.com (djinn-open.gene.COM [192.12.78.2]) by svr1.postgresql.org (Postfix) with ESMTP id 74214D1C4DF for ; Mon, 11 Aug 2003 19:56:17 -0300 (ADT) Received: from tallac.gene.com (tallac.gene.com [128.137.116.213]) by djinn.gene.com (8.12.9/8.12.9) with ESMTP id h7BMu8De103167; Mon, 11 Aug 2003 15:56:11 -0700 (PDT) Received: by tallac.gene.com (Postfix, from userid 13922) id B7E404B9BD; Mon, 11 Aug 2003 15:56:07 -0700 (PDT) Subject: Re: Perfomance Tuning From: Reece Hart To: Bruce Momjian Cc: "pgsql-performance@postgresql.org" In-Reply-To: <200308112216.h7BMGiF06162@candle.pha.pa.us> References: <200308112216.h7BMGiF06162@candle.pha.pa.us> Content-Type: multipart/alternative; boundary="=-DAkHNnrjCBmUJ+YtkGfN" Organization: Genentech, Inc. Message-Id: <1060642567.15483.220.camel@tallac> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Mon, 11 Aug 2003 15:56:07 -0700 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/180 X-Sequence-Number: 2997 --=-DAkHNnrjCBmUJ+YtkGfN Content-Type: text/plain Content-Transfer-Encoding: 7bit On Mon, 2003-08-11 at 15:16, Bruce Momjian wrote: > That _would_ work if ext2 was a reliable file system --- it is not. Bruce- I'd like to know your evidence for this. I'm not refuting it, but I'm a >7 year linux user (including several clusters, all of which have run ext2 or ext3) and keep a fairly close ear to kernel newsgroups, announcements, and changelogs. I am aware that there have very occasionally been corruption problems, but my understanding is that these are fixed (and quickly). In any case, I'd say that your assertion is not widely known and I'd appreciate some data or references. As for PostgreSQL on ext2 and ext3, I recently switched from ext3 to ext2 (Stephen Tweedy was insightful to facilitate this backward compatibility). I did this because I had a 45M row update on one table that was taking inordinate time (killed after 10 hours), even though creating the database from backup takes ~4 hours including indexing (see pgsql-perform post on 2003/07/22). CPU usage was ~2% on an otherwise unloaded, fast, SCSI160 machine. vmstat io suggested that PostgreSQL was writing something on the order of 100x as many blocks as being read. My untested interpretation was that the update bookkeeping as well as data update were all getting journalled, the journal space would fill, get sync'd, then repeat. In effect, all blocks were being written TWICE just for the journalling, never mind the overhead for PostgreSQL transactions. This emphasizes that journals probably work best with short burst writes and syncing during lulls rather than sustained writes. I ended up solving the update issue without really updating, so ext2 timings aren't known. So, you may want to test this yourself if you're concerned. -Reece -- Reece Hart, Ph.D. rkh@gene.com, http://www.gene.com/ Genentech, Inc. 650/225-6133 (voice), -5389 (fax) Bioinformatics and Protein Engineering 1 DNA Way, MS-93 http://www.in-machina.com/~reece/ South San Francisco, CA 94080-4990 reece@in-machina.com, GPG: 0x25EC91A0 --=-DAkHNnrjCBmUJ+YtkGfN Content-Type: text/html; charset=utf-8 On Mon, 2003-08-11 at 15:16, Bruce Momjian wrote:
That _would_ work if ext2 was a reliable file system --- it is not.

Bruce-

I'd like to know your evidence for this. I'm not refuting it, but I'm a >7 year linux user (including several clusters, all of which have run ext2 or ext3) and keep a fairly close ear to kernel newsgroups, announcements, and changelogs. I am aware that there have very occasionally been corruption problems, but my understanding is that these are fixed (and quickly). In any case, I'd say that your assertion is not widely known and I'd appreciate some data or references.

As for PostgreSQL on ext2 and ext3, I recently switched from ext3 to ext2 (Stephen Tweedy was insightful to facilitate this backward compatibility). I did this because I had a 45M row update on one table that was taking inordinate time (killed after 10 hours), even though creating the database from backup takes ~4 hours including indexing (see pgsql-perform post on 2003/07/22). CPU usage was ~2% on an otherwise unloaded, fast, SCSI160 machine. vmstat io suggested that PostgreSQL was writing something on the order of 100x as many blocks as being read. My untested interpretation was that the update bookkeeping as well as data update were all getting journalled, the journal space would fill, get sync'd, then repeat. In effect, all blocks were being written TWICE just for the journalling, never mind the overhead for PostgreSQL transactions. This emphasizes that journals probably work best with short burst writes and syncing during lulls rather than sustained writes.

I ended up solving the update issue without really updating, so ext2 timings aren't known. So, you may want to test this yourself if you're concerned.

-Reece

-- 
Reece Hart, Ph.D.                       rkh@gene.com, http://www.gene.com/
Genentech, Inc.                         650/225-6133 (voice), -5389 (fax)
Bioinformatics and Protein Engineering
1 DNA Way, MS-93                        http://www.in-machina.com/~reece/
South San Francisco, CA  94080-4990     reece@in-machina.com, GPG: 0x25EC91A0
--=-DAkHNnrjCBmUJ+YtkGfN-- From pgsql-performance-owner@postgresql.org Mon Aug 11 20:00:41 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 D433ED1C47A for ; Mon, 11 Aug 2003 23:00:39 +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 55158-02 for ; Mon, 11 Aug 2003 19:59:10 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 49AA8D1C7F1 for ; Mon, 11 Aug 2003 20:00:28 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3503341 for pgsql-performance@postgresql.org; Mon, 11 Aug 2003 16:00:54 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: pgsql-performance@postgresql.org Subject: Re: Odd problem with performance in duplicate database Date: Mon, 11 Aug 2003 15:59:09 -0700 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308111559.09924.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/182 X-Sequence-Number: 2999 Peter, > I'm sure that you've thought of this, but it sounds like you may not have > done an analyze in your new DB. Yes. Also a VACUUM. Also forcing a REINDEX on the major involved tables. Also running counts on the pg_* system tables to see if any objects did not= =20 get restored from the backup as compared with the live database. By everything I can measure, the live database and the test are identical; = yet=20 the test does not think that idx_caseclients_case is very accessable, and t= he=20 live database knows it is. Is this perhaps a bug with ANALYZE statistics in 7.2.4? I know that in tha= t=20 version I don't have the option of increasing the statistics sampling ... --=20 -Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Mon Aug 11 19:59:46 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 E1C3BD1C927 for ; Mon, 11 Aug 2003 22:59:43 +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 55751-02 for ; Mon, 11 Aug 2003 19:58:15 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id E9B09D1C4DF for ; Mon, 11 Aug 2003 19:59:31 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7BMxUo14439; Mon, 11 Aug 2003 18:59:30 -0400 (EDT) From: Bruce Momjian Message-Id: <200308112259.h7BMxUo14439@candle.pha.pa.us> Subject: Re: Perfomance Tuning In-Reply-To: <1060642567.15483.220.camel@tallac> To: Reece Hart Date: Mon, 11 Aug 2003 18:59:30 -0400 (EDT) Cc: "pgsql-performance@postgresql.org" X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/181 X-Sequence-Number: 2998 Uh, the ext2 developers say it isn't 100% reliable --- at least that is that was told. I don't know any personally, but I mentioned it while I was visiting Red Hat, and they didn't refute it. Now, the failure window might be quite small, but I have seen it happen myself, and have heard it from others. --------------------------------------------------------------------------- Reece Hart wrote: > On Mon, 2003-08-11 at 15:16, Bruce Momjian wrote: > > > That _would_ work if ext2 was a reliable file system --- it is not. > > > Bruce- > > I'd like to know your evidence for this. I'm not refuting it, but I'm a > >7 year linux user (including several clusters, all of which have run > ext2 or ext3) and keep a fairly close ear to kernel newsgroups, > announcements, and changelogs. I am aware that there have very > occasionally been corruption problems, but my understanding is that > these are fixed (and quickly). In any case, I'd say that your assertion > is not widely known and I'd appreciate some data or references. > > As for PostgreSQL on ext2 and ext3, I recently switched from ext3 to > ext2 (Stephen Tweedy was insightful to facilitate this backward > compatibility). I did this because I had a 45M row update on one table > that was taking inordinate time (killed after 10 hours), even though > creating the database from backup takes ~4 hours including indexing (see > pgsql-perform post on 2003/07/22). CPU usage was ~2% on an otherwise > unloaded, fast, SCSI160 machine. vmstat io suggested that PostgreSQL was > writing something on the order of 100x as many blocks as being read. My > untested interpretation was that the update bookkeeping as well as data > update were all getting journalled, the journal space would fill, get > sync'd, then repeat. In effect, all blocks were being written TWICE just > for the journalling, never mind the overhead for PostgreSQL > transactions. This emphasizes that journals probably work best with > short burst writes and syncing during lulls rather than sustained > writes. > > I ended up solving the update issue without really updating, so ext2 > timings aren't known. So, you may want to test this yourself if you're > concerned. > > -Reece > > > -- > Reece Hart, Ph.D. rkh@gene.com, http://www.gene.com/ > Genentech, Inc. 650/225-6133 (voice), -5389 (fax) > Bioinformatics and Protein Engineering > 1 DNA Way, MS-93 http://www.in-machina.com/~reece/ > South San Francisco, CA 94080-4990 reece@in-machina.com, GPG: 0x25EC91A0 -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Mon Aug 11 20:24:46 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 E6013D1C4D9 for ; Mon, 11 Aug 2003 23:24: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 54928-07 for ; Mon, 11 Aug 2003 20:23:14 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id B8AD4D1C47A for ; Mon, 11 Aug 2003 20:24:31 -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 h7BNMpSa026935; Mon, 11 Aug 2003 19:22:51 -0400 (EDT) To: josh@agliodbs.com Cc: pgsql-performance@postgresql.org Subject: Re: Odd problem with performance in duplicate database In-reply-to: <200308111559.09924.josh@agliodbs.com> References: <200308111559.09924.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Mon, 11 Aug 2003 15:59:09 -0700" Date: Mon, 11 Aug 2003 19:22:51 -0400 Message-ID: <26934.1060644171@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/183 X-Sequence-Number: 3000 Josh Berkus writes: > By everything I can measure, the live database and the test are > identical; yet the test does not think that idx_caseclients_case is > very accessable, and the live database knows it is. Let's see the pg_stats rows for case_clients in both databases. The entries for trial_groups might be relevant too. regards, tom lane From pgsql-performance-owner@postgresql.org Mon Aug 11 21:14:52 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 13AAAD1B523 for ; Mon, 11 Aug 2003 23:48:12 +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 55106-10 for ; Mon, 11 Aug 2003 20:46:42 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id EB6ADD1B574 for ; Mon, 11 Aug 2003 20:47:59 -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 h7BNkLSa027218; Mon, 11 Aug 2003 19:46:21 -0400 (EDT) To: josh@agliodbs.com Cc: pgsql-performance@postgresql.org Subject: Re: Odd problem with performance in duplicate database In-reply-to: <200308111637.33011.josh@agliodbs.com> References: <200308111559.09924.josh@agliodbs.com> <26934.1060644171@sss.pgh.pa.us> <200308111637.33011.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Mon, 11 Aug 2003 16:37:33 -0700" Date: Mon, 11 Aug 2003 19:46:21 -0400 Message-ID: <27217.1060645581@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/186 X-Sequence-Number: 3003 Josh Berkus writes: > Still, they are differences. Attached. Actually, it was mainly "cases" that I wanted to know about --- specifically, whichever columns are in "idx_cases_tgroup". Also, which of the trial_groups columns is the pkey? regards, tom lane From pgsql-performance-owner@postgresql.org Mon Aug 11 21: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 46412D1B4E2 for ; Mon, 11 Aug 2003 23:53:10 +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 58178-08 for ; Mon, 11 Aug 2003 20:51:42 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 43456D1B524 for ; Mon, 11 Aug 2003 20:52:59 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3503835; Mon, 11 Aug 2003 16:52:46 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Tom Lane Subject: Re: Odd problem with performance in duplicate database Date: Mon, 11 Aug 2003 16:51:01 -0700 User-Agent: KMail/1.4.3 References: <200308111559.09924.josh@agliodbs.com> <26934.1060644171@sss.pgh.pa.us> In-Reply-To: <26934.1060644171@sss.pgh.pa.us> Cc: pgsql-performance@postgresql.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308111651.01597.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/185 X-Sequence-Number: 3002 Tom, > Let's see the pg_stats rows for case_clients in both databases. The > entries for trial_groups might be relevant too. My reading is that the case is "borderline"; that is, becuase the correlati= on=20 is about 10-20% higher on the test database (since it was restored "clean"= =20 from backup) the planner is resorting to a seq scan. At which point the spectre of random_page_cost less than 1.0 rears its ugly= =20 head again. Because the planner seems to regard this as a borderline case,= =20 but it's far from borderline ... index scan takes 260ms, seq scan takes=20 244,000ms. Yet my random_page_cost is set pretty low already, at 1.5. It seems like I'd have to set random_page_cost to less than 1.0 to make sur= e=20 that the planner never used a seq scan. Which kinda defies the meaning of= =20 the setting. *sigh* wish the client would pay for an upgrade .... --=20 -Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Mon Aug 11 21:12:25 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 52352D1B4F0 for ; Tue, 12 Aug 2003 00:01:31 +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 61758-05 for ; Mon, 11 Aug 2003 20:59:58 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 1DF12D1B52C for ; Mon, 11 Aug 2003 21:01:16 -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 h7BNxaSa027329; Mon, 11 Aug 2003 19:59:36 -0400 (EDT) To: josh@agliodbs.com Cc: pgsql-performance@postgresql.org Subject: Re: Odd problem with performance in duplicate database In-reply-to: <200308111651.01597.josh@agliodbs.com> References: <200308111559.09924.josh@agliodbs.com> <26934.1060644171@sss.pgh.pa.us> <200308111651.01597.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Mon, 11 Aug 2003 16:51:01 -0700" Date: Mon, 11 Aug 2003 19:59:36 -0400 Message-ID: <27328.1060646376@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/184 X-Sequence-Number: 3001 Josh Berkus writes: > My reading is that the case is "borderline"; Well, clearly the planner is flipping to a much less desirable plan, but the core estimation error is not borderline by my standards. In the live DB we have this subplan: -> Nested Loop (cost=0.00..7.41 rows=1 width=12) (actual time=0.01..0.02 rows=1 loops=856) -> Index Scan using trial_groups_pkey on trial_groups (cost=0.00..3.49 rows=1 width=4) (actual time=0.01..0.01 rows=0 loops=856) -> Index Scan using idx_cases_tgroup on cases (cost=0.00..3.92 rows=1 width=8) (actual time=0.02..0.04 rows=4 loops=133) In the test DB, the identical subplan is estimated at: -> Nested Loop (cost=0.00..81.53 rows=887 width=12) (actual time=0.03..0.04 rows=1 loops=855) -> Index Scan using trial_groups_pkey on trial_groups (cost=0.00..3.49 rows=1 width=4) (actual time=0.02..0.02 rows=0 loops=855) -> Index Scan using idx_cases_tgroup on cases (cost=0.00..77.77 rows=43 width=8) (actual time=0.03..0.07 rows=6 loops=133) and that factor of 887 error in the output rows estimate is what's driving all the outer plan steps to make bad choices. The "trial_groups_pkey" estimate is the same in both databases, so it's presumably a problem with estimating the number of matches to a "trial_groups" row that will be found in "cases". This is dependent on the pg_stats entries for the relevant columns, which I'm still hoping to see ... regards, tom lane From pgsql-performance-owner@postgresql.org Mon Aug 11 21:30: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 8EC21D1B524 for ; Tue, 12 Aug 2003 00:29:39 +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 63521-09 for ; Mon, 11 Aug 2003 21:28:11 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 8AFB0D1B523 for ; Mon, 11 Aug 2003 21:29:28 -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 h7C0TMSa027574; Mon, 11 Aug 2003 20:29:22 -0400 (EDT) To: josh@agliodbs.com Cc: pgsql-performance@postgreSQL.org Subject: Re: Odd problem with performance in duplicate database In-reply-to: <200308111716.22288.josh@agliodbs.com> References: <200308111654.20929.josh@agliodbs.com> <27393.1060646753@sss.pgh.pa.us> <200308111716.22288.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Mon, 11 Aug 2003 17:16:22 -0700" Date: Mon, 11 Aug 2003 20:29:22 -0400 Message-ID: <27573.1060648162@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/187 X-Sequence-Number: 3004 Josh Berkus writes: > Tom, >> Okay, here's our problem: >> >> live DB: tgroup_id n_distinct = -1 >> >> test DN: tgroup_id n_distinct = 11 >> >> The former estimate actually means that it thinks tgroup_id is a unique >> column, whereas the latter says there are only 11 distinct values in the >> column. I assume the former is much nearer to the truth (how many rows >> in cases, and how many distinct tgroup_id values)? > The real case is that there are 113 distinct tgroup_ids, which cover > about 10% of the population of cases. The other 90% is NULL. The > average tgroup_id is shared between 4.7 cases. > So this seems like sampling error. Partly. The numbers suggest that in ANALYZE's default sample of 3000 rows, it's only finding about a dozen non-null tgroup_ids (yielding the 0.996 null_frac value); and that in one case all dozen are different and in the other case there are two duplicates. It would help if you boosted the stats target for this column by a factor of 10. (You can do that in 7.2, btw --- IIRC the only problem is that a pg_dump won't show that you did so.) But the other part of the problem is that in 7.2, the join selectivity estimator is way off when you are joining a unique column (like the pkey on the other side) to a column with a very large fraction of nulls. We only discovered this recently; it's fixed as of 7.3.3: 2003-04-15 01:18 tgl * src/backend/utils/adt/selfuncs.c (REL7_3_STABLE): eqjoinsel's logic for case where MCV lists are not present should account for NULLs; in hindsight this is obvious since the code for the MCV-lists case would reduce to this when there are zero entries in both lists. Per example from Alec Mitchell. Possibly you could backpatch that into 7.2, although I'd think an update to 7.3.4 would be a more profitable use of time. regards, tom lane From pgsql-performance-owner@postgresql.org Mon Aug 11 21:45:19 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 578D3D1B561 for ; Tue, 12 Aug 2003 00:45: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 62615-10 for ; Mon, 11 Aug 2003 21:43:49 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 5ED38D1B53A for ; Mon, 11 Aug 2003 21:45:06 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3504009; Mon, 11 Aug 2003 17:45:33 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Tom Lane Subject: Re: Odd problem with performance in duplicate database Date: Mon, 11 Aug 2003 17:43:48 -0700 User-Agent: KMail/1.4.3 Cc: pgsql-performance@postgreSQL.org References: <200308111716.22288.josh@agliodbs.com> <27573.1060648162@sss.pgh.pa.us> In-Reply-To: <27573.1060648162@sss.pgh.pa.us> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308111743.48564.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/189 X-Sequence-Number: 3006 Tom, > Partly. The numbers suggest that in ANALYZE's default sample of 3000 > rows, it's only finding about a dozen non-null tgroup_ids (yielding the > 0.996 null_frac value); and that in one case all dozen are different and > in the other case there are two duplicates. It would help if you > boosted the stats target for this column by a factor of 10. (You can > do that in 7.2, btw --- IIRC the only problem is that a pg_dump won't > show that you did so.) Also, there doesn't seem to be any way in 7.2 for me to find out what the= =20 current statistics target for a column is. What am I missing? --=20 -Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Mon Aug 11 21:44: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 5202CD1B53A for ; Tue, 12 Aug 2003 00:44: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 63876-06 for ; Mon, 11 Aug 2003 21:42:37 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id 513DDD1B550 for ; Mon, 11 Aug 2003 21:43:53 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h7C0hnLt011542; Tue, 12 Aug 2003 08:43:50 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <184401c3606b$c7459860$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "Andrew Sullivan" , References: <20030808185323.GH2967@libertyrms.info> <20030811152414.GF9086@libertyrms.info> Subject: Re: Perfomance Tuning Date: Tue, 12 Aug 2003 08:50:48 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/188 X-Sequence-Number: 3005 > Well, yeah. But given the Linux propensity for introducing major > features in "minor" releases (and thereby introducing all the > attendant bugs), I'd think twice about using _any_ Linux feature > until it's been through a major version (e.g. things introduced in > 2.4.x won't really be stable until 2.6.x) -- and even there one is > taking a risk[1]. Dudes, seriously - switch to FreeBSD :P Chris From pgsql-performance-owner@postgresql.org Mon Aug 11 21:55:37 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 CB3ACD1B52C for ; Tue, 12 Aug 2003 00:53:23 +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 66985-05 for ; Mon, 11 Aug 2003 21:51:55 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id CCD69D1B524 for ; Mon, 11 Aug 2003 21:53:12 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3504025; Mon, 11 Aug 2003 17:53:24 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Tom Lane Subject: Re: Odd problem with performance in duplicate database Date: Mon, 11 Aug 2003 17:51:39 -0700 User-Agent: KMail/1.4.3 Cc: pgsql-performance@postgreSQL.org References: <200308111716.22288.josh@agliodbs.com> <27573.1060648162@sss.pgh.pa.us> In-Reply-To: <27573.1060648162@sss.pgh.pa.us> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308111751.39998.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/190 X-Sequence-Number: 3007 Tom, > Partly. The numbers suggest that in ANALYZE's default sample of 3000 > rows, it's only finding about a dozen non-null tgroup_ids (yielding the > 0.996 null_frac value); and that in one case all dozen are different and > in the other case there are two duplicates. It would help if you > boosted the stats target for this column by a factor of 10. (You can > do that in 7.2, btw --- IIRC the only problem is that a pg_dump won't > show that you did so.) Hmmm. No dice. I raised the selectivity to 1000, which increased n_disti= nct=20 to 108, which is pretty close to accurate. However, the planner still=20 insists on using a seq scan on case_clients unless I drop random_page_cost = to=20 1.5 (which is up from 1.2 but still somewhat unreasonable). > But the other part of the problem is that in 7.2, the join selectivity > estimator is way off when you are joining a unique column (like the pkey > on the other side) to a column with a very large fraction of nulls. > We only discovered this recently; it's fixed as of 7.3.3: OK, I'll talk to the client about upgrading. --=20 -Josh Berkus ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco From pgsql-performance-owner@postgresql.org Mon Aug 11 23:37:31 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 7734ED1B550 for ; Tue, 12 Aug 2003 02:37:28 +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 77812-07 for ; Mon, 11 Aug 2003 23:36:01 -0300 (ADT) Received: from hub.org (hub.org [64.117.225.220]) by svr1.postgresql.org (Postfix) with ESMTP id A1A8FD1B539 for ; Mon, 11 Aug 2003 23:37:17 -0300 (ADT) Received: from hub.org (unknown [64.117.225.220]) by hub.org (Postfix) with ESMTP id 871B39A7B7F for ; Mon, 11 Aug 2003 23:37:21 -0300 (ADT) X-Received: from localhost ([unix socket]) by hub.org (Cyrus v2.2.prealpha) with LMTP; Mon, 11 Aug 2003 23:35:28 -0300 X-Sieve: CMU Sieve 2.2 X-Received: from postgresql.org (developer.postgresql.org [64.117.224.193]) by hub.org (Postfix) with ESMTP id BFBA39A7B86 for ; Mon, 11 Aug 2003 23:35:26 -0300 (ADT) X-Original-To: pgsql-performance-postgresql.org-owner@localhost.postgresql.org X-Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 98DFBD1B524 for ; Tue, 12 Aug 2003 02:35:16 +0000 (GMT) X-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 80373-02 for ; Mon, 11 Aug 2003 23:33:48 -0300 (ADT) X-Received: from web15106.mail.bjs.yahoo.com (web15106.mail.bjs.yahoo.com [202.3.77.151]) by svr1.postgresql.org (Postfix) with SMTP id 749AAD1B550 for ; Mon, 11 Aug 2003 23:35:02 -0300 (ADT) Message-ID: <20030812023504.27034.qmail@web15106.mail.bjs.yahoo.com> X-Received: from [137.189.4.4] by web15106.mail.bjs.yahoo.com via HTTP; Tue, 12 Aug 2003 10:35:04 CST Date: Tue, 12 Aug 2003 10:35:04 +0800 (CST) From: =?gb2312?q?xin=20fu?= Subject: about performance of postgreSQL To: pgsql-performance-owner@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1101371436-1060655704=:24053" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org ReSent-Date: Mon, 11 Aug 2003 23:37:17 -0300 (ADT) Resent-From: "Marc G. Fournier" Resent-To: pgsql-performance@postgresql.org ReSent-Subject: about performance of postgreSQL ReSent-Message-ID: <20030811233717.K6860@hub.org> X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.8 tagged_above=0.0 required=5.0 tests=FROM_ENDS_IN_NUMS, HTML_10_20 X-Spam-Level: * X-Archive-Number: 200308/191 X-Sequence-Number: 3008 --0-1101371436-1060655704=:24053 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: 8bit Dear master: I have learned postgreSQL for serveral days, now i meet some problems. when I use a TPCC(Transaction Processing Performance Council) test program to test the performance of postgreSQL , postgreSQL works very slowly, it almost need 1 minute to finish a transaction, and the CPU percent is almost 100%, the test environment is : OS: redhat 9.0(ext3, default configurations) Server: postgre7.3.4(default configurations) , PIII 800M, 1G Memory Client: tpcc test program,using ODBC API, PIII 800M, 1G Memory when using SQLServer, it can work on a workload of 40 Warehouse, but postgreSQL can not work even on 1 warehouse. I think there must be some problem with my postgreSQL, can you help me? I am in china, and my english is very poor, but i hope you can give me some advice, thanks. --------------------------------- Do You Yahoo!? ���ڴ�Ƭ����Ż�ͨ ��������ͷ+�Ż�ͨ��Ƶ�������������� --0-1101371436-1060655704=:24053 Content-Type: text/html; charset=gb2312 Content-Transfer-Encoding: 8bit
Dear master:
       I have learned postgreSQL for serveral days, now i meet some problems. when I use a TPCC(Transaction Processing Performance Council) test program to test the performance of postgreSQL , postgreSQL works very slowly, it almost need 1 minute to finish a transaction, and the CPU percent is almost 100%,
the test environment is :
       OS: redhat 9.0(ext3, default configurations)
       Server: postgre7.3.4(default configurations) , PIII 800M, 1G Memory
       Client: tpcc test program,using ODBC API, PIII 800M, 1G Memory
       when using SQLServer, it can work on a workload of 40 Warehouse,
but postgreSQL can not work even on 1 warehouse. I think there must be
some problem with my postgreSQL, can you help me?
      I am in china, and my english is very poor, but i hope you can give
me some advice, thanks.



Do You Yahoo!?
���ڴ�Ƭ����Ż�ͨ ��������ͷ+�Ż�ͨ��Ƶ�������������� --0-1101371436-1060655704=:24053-- From pgsql-performance-owner@postgresql.org Tue Aug 12 00:19: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 D2233D1B53A for ; Tue, 12 Aug 2003 03:18:59 +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 80813-09 for ; Tue, 12 Aug 2003 00:17:27 -0300 (ADT) Received: from news.hub.org (news.hub.org [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 01182D1B524 for ; Tue, 12 Aug 2003 00:18:49 -0300 (ADT) Received: from news.hub.org (news.hub.org [64.117.224.194]) by news.hub.org (8.12.9/8.12.9) with ESMTP id h7C3Imem012877 for ; Tue, 12 Aug 2003 03:18:48 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7C2wadO003090 for pgsql-performance@postgresql.org; Tue, 12 Aug 2003 02:58:36 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: On Linux Filesystems Date: Mon, 11 Aug 2003 22:58:18 -0400 Organization: cbbrowne Computing Inc Lines: 81 Message-ID: References: <20030810200440.B2396@cookie> <3032.1060617279@sss.pgh.pa.us> <20030811100740.D2396@cookie> <3855.1060622959@sss.pgh.pa.us> <20030811104447.G2396@cookie> <4146.1060624411@sss.pgh.pa.us> 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 X-Emacs-Acronym: Even a Master of Arts Comes Simpler Microsoft: Making the world a better place... for Microsoft. X-Uboat-Death-Message: BOMBED BY ATOMIC BOMB. SINKING. U-10. User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:gTY1UnLHe8bTYznki7S6fA4Vgnc= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/192 X-Sequence-Number: 3009 Bruce Momjian commented: "Uh, the ext2 developers say it isn't 100% reliable" ... "I mentioned it while I was visiting Red Hat, and they didn't refute it." 1. Nobody has gone through any formal proofs, and there are few systems _anywhere_ that are 100% reliable. NASA has occasionally lost spacecraft to software bugs, so nobody will be making such rash claims about ext2. 2. Several projects have taken on the task of introducing journalled filesystems, most notably ext3 (sponsored by RHAT via Stephen Tweedy) and ReiserFS (oft sponsored by SuSE). (I leave off JFS/XFS since they existed long before they had any relationship with Linux.) Participants in such projects certainly have interest in presenting the notion that they provide improved reliability over ext2. 3. There is no "apologist" for ext2 that will either (stupidly and futilely) claim it to be flawless. Nor is there substantial interest in improving it; the sort people that would be interested in that sort of thing are working on the other FSes. This also means that there's no one interested in going into the guaranteed-to-be-unsung effort involved in trying to prove ext2 to be "formally reliable." 4. It would be silly to minimize the impact of commercial interest. RHAT has been paying for the development of a would-be ext2 successor. For them to refute your comments wouldn't be in their interests. Note that these are "warm and fuzzy" comments, the whole lot. The 80-some thousand lines of code involved in ext2, ext3, reiserfs, and jfs are no more amenable to absolute mathematical proof of reliability than the corresponding BSD FFS code. 6. Such efforts would be futile, anyways. Disks are mechanical devices, and, as such, suffer from substantial reliability issues irrespective of the reliability of the software. I have lost sleep on too many occasions due to failures of: a) Disk drives, b) Disk controllers [the worst Oracle failure I encountered resulted from this], and c) OS memory management. I used ReiserFS back in its "bleeding edge" days, and find myself a lot more worried about losing data to flakey disk controllers. It frankly seems insulting to focus on ext2 in this way when: a) There aren't _hard_ conclusions to point to, just soft ones; b) The reasons for you hearing vaguely negative things about ext2 are much more likely political than they are technical. I wish there were more "hard and fast" conclusions to draw, to be able to conclusively say that one or another Linux filesystem was unambiguously preferable for use with PostgreSQL. There are not conclusive metrics, either in terms of speed or of some notion of "reliability." I'd expect ReiserFS to be the poorest choice, and for XFS to be the best, but I only have fuzzy reasons, as opposed to metrics. The absence of measurable metrics of the sort is _NOT_ a proof that (say) FreeBSD is conclusively preferable, whatever your own preferences (I'll try to avoid characterizing it as "prejudices," as that would be unkind) may be. That would represent a quite separate debate, and one that doesn't belong here, certainly not on a thread where the underlying question was "Which Linux FS is preferred?" If the OSDB TPC-like benchmarks can get "packaged" up well enough to easily run and rerun them, there's hope of getting better answers, perhaps even including performance metrics for *BSD. That, not Linux-baiting, is the answer... -- select 'cbbrowne' || '@' || 'acm.org'; http://www.ntlug.org/~cbbrowne/sap.html (eq? 'truth 'beauty) ; to avoid unassigned-var error, since compiled code ; will pick up previous value to var set!-ed, ; the unassigned object. -- from BBN-CL's cl-parser.scm From pgsql-performance-owner@postgresql.org Tue Aug 12 01:07:32 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 E4C24D1B524 for ; Tue, 12 Aug 2003 04:07: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 15589-05 for ; Tue, 12 Aug 2003 01:05:58 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 640B2D1B56B for ; Tue, 12 Aug 2003 01:07:18 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7C47C910495; Tue, 12 Aug 2003 00:07:12 -0400 (EDT) From: Bruce Momjian Message-Id: <200308120407.h7C47C910495@candle.pha.pa.us> Subject: Re: On Linux Filesystems In-Reply-To: To: Christopher Browne Date: Tue, 12 Aug 2003 00:07:12 -0400 (EDT) Cc: pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/193 X-Sequence-Number: 3010 As I remember, there were clear cases that ext2 would fail to recover, and it was known to be a limitation of the file system implementation. Some of the ext2 developers were in the room at Red Hat when I said that, so if it was incorrect, they would hopefully have spoken up. I addressed the comments directly to them. To be recoverasble, you have to be careful how you sync metadata to disk. All the journalling file systems, and the BSD UFS do that. I am told ext2 does not. I don't know much more than that. As I remember years ago, ext2 was faster than UFS, but it was true because ext2 didn't guarantee failure recovery. Now, with UFS soft updates, the have similar performance characteristics, but UFS is still crash-safe. However, I just tried google and couldn't find any documented evidence that ext2 isn't crash-safe, so maybe I am wrong. --------------------------------------------------------------------------- Christopher Browne wrote: > Bruce Momjian commented: > > "Uh, the ext2 developers say it isn't 100% reliable" ... "I mentioned > it while I was visiting Red Hat, and they didn't refute it." > > 1. Nobody has gone through any formal proofs, and there are few > systems _anywhere_ that are 100% reliable. NASA has occasionally lost > spacecraft to software bugs, so nobody will be making such rash claims > about ext2. > > 2. Several projects have taken on the task of introducing journalled > filesystems, most notably ext3 (sponsored by RHAT via Stephen Tweedy) > and ReiserFS (oft sponsored by SuSE). (I leave off JFS/XFS since they > existed long before they had any relationship with Linux.) > > Participants in such projects certainly have interest in presenting > the notion that they provide improved reliability over ext2. > > 3. There is no "apologist" for ext2 that will either (stupidly and > futilely) claim it to be flawless. Nor is there substantial interest > in improving it; the sort people that would be interested in that sort > of thing are working on the other FSes. > > This also means that there's no one interested in going into the > guaranteed-to-be-unsung effort involved in trying to prove ext2 to be > "formally reliable." > > 4. It would be silly to minimize the impact of commercial interest. > RHAT has been paying for the development of a would-be ext2 successor. > For them to refute your comments wouldn't be in their interests. > > Note that these are "warm and fuzzy" comments, the whole lot. The > 80-some thousand lines of code involved in ext2, ext3, reiserfs, and > jfs are no more amenable to absolute mathematical proof of reliability > than the corresponding BSD FFS code. > > 6. Such efforts would be futile, anyways. Disks are mechanical > devices, and, as such, suffer from substantial reliability issues > irrespective of the reliability of the software. I have lost sleep on > too many occasions due to failures of: > a) Disk drives, > b) Disk controllers [the worst Oracle failure I encountered resulted > from this], and > c) OS memory management. > > I used ReiserFS back in its "bleeding edge" days, and find myself a > lot more worried about losing data to flakey disk controllers. > > It frankly seems insulting to focus on ext2 in this way when: > > a) There aren't _hard_ conclusions to point to, just soft ones; > > b) The reasons for you hearing vaguely negative things about ext2 > are much more likely political than they are technical. > > I wish there were more "hard and fast" conclusions to draw, to be able > to conclusively say that one or another Linux filesystem was > unambiguously preferable for use with PostgreSQL. There are not > conclusive metrics, either in terms of speed or of some notion of > "reliability." I'd expect ReiserFS to be the poorest choice, and for > XFS to be the best, but I only have fuzzy reasons, as opposed to > metrics. > > The absence of measurable metrics of the sort is _NOT_ a proof that > (say) FreeBSD is conclusively preferable, whatever your own > preferences (I'll try to avoid characterizing it as "prejudices," as > that would be unkind) may be. That would represent a quite separate > debate, and one that doesn't belong here, certainly not on a thread > where the underlying question was "Which Linux FS is preferred?" > > If the OSDB TPC-like benchmarks can get "packaged" up well enough to > easily run and rerun them, there's hope of getting better answers, > perhaps even including performance metrics for *BSD. That, not > Linux-baiting, is the answer... > -- > select 'cbbrowne' || '@' || 'acm.org'; > http://www.ntlug.org/~cbbrowne/sap.html > (eq? 'truth 'beauty) ; to avoid unassigned-var error, since compiled code > ; will pick up previous value to var set!-ed, > ; the unassigned object. > -- from BBN-CL's cl-parser.scm > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Tue Aug 12 01:16:56 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 0637DD1C7F2 for ; Tue, 12 Aug 2003 04:16: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 17003-02 for ; Tue, 12 Aug 2003 01:15:22 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 7D880D1B4E2 for ; Tue, 12 Aug 2003 01:16:42 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7C4Gfn11426; Tue, 12 Aug 2003 00:16:41 -0400 (EDT) From: Bruce Momjian Message-Id: <200308120416.h7C4Gfn11426@candle.pha.pa.us> Subject: Re: On Linux Filesystems In-Reply-To: To: pgman@candle.pha.pa.us Date: Tue, 12 Aug 2003 00:16:41 -0400 (EDT) Cc: Christopher Browne , pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/194 X-Sequence-Number: 3011 Here is one talking about ext2 corruption from power failure from 2002: http://groups.google.com/groups?q=ext2+corrupt+%22power+failure%22&hl=en&lr=&ie=UTF-8&selm=alvrj5%249in%241%40usc.edu&rnum=9 --------------------------------------------------------------------------- pgman wrote: > > As I remember, there were clear cases that ext2 would fail to recover, > and it was known to be a limitation of the file system implementation. > Some of the ext2 developers were in the room at Red Hat when I said > that, so if it was incorrect, they would hopefully have spoken up. I > addressed the comments directly to them. > > To be recoverasble, you have to be careful how you sync metadata to > disk. All the journalling file systems, and the BSD UFS do that. I am > told ext2 does not. I don't know much more than that. > > As I remember years ago, ext2 was faster than UFS, but it was true > because ext2 didn't guarantee failure recovery. Now, with UFS soft > updates, the have similar performance characteristics, but UFS is still > crash-safe. > > However, I just tried google and couldn't find any documented evidence > that ext2 isn't crash-safe, so maybe I am wrong. > > --------------------------------------------------------------------------- > > Christopher Browne wrote: > > Bruce Momjian commented: > > > > "Uh, the ext2 developers say it isn't 100% reliable" ... "I mentioned > > it while I was visiting Red Hat, and they didn't refute it." > > > > 1. Nobody has gone through any formal proofs, and there are few > > systems _anywhere_ that are 100% reliable. NASA has occasionally lost > > spacecraft to software bugs, so nobody will be making such rash claims > > about ext2. > > > > 2. Several projects have taken on the task of introducing journalled > > filesystems, most notably ext3 (sponsored by RHAT via Stephen Tweedy) > > and ReiserFS (oft sponsored by SuSE). (I leave off JFS/XFS since they > > existed long before they had any relationship with Linux.) > > > > Participants in such projects certainly have interest in presenting > > the notion that they provide improved reliability over ext2. > > > > 3. There is no "apologist" for ext2 that will either (stupidly and > > futilely) claim it to be flawless. Nor is there substantial interest > > in improving it; the sort people that would be interested in that sort > > of thing are working on the other FSes. > > > > This also means that there's no one interested in going into the > > guaranteed-to-be-unsung effort involved in trying to prove ext2 to be > > "formally reliable." > > > > 4. It would be silly to minimize the impact of commercial interest. > > RHAT has been paying for the development of a would-be ext2 successor. > > For them to refute your comments wouldn't be in their interests. > > > > Note that these are "warm and fuzzy" comments, the whole lot. The > > 80-some thousand lines of code involved in ext2, ext3, reiserfs, and > > jfs are no more amenable to absolute mathematical proof of reliability > > than the corresponding BSD FFS code. > > > > 6. Such efforts would be futile, anyways. Disks are mechanical > > devices, and, as such, suffer from substantial reliability issues > > irrespective of the reliability of the software. I have lost sleep on > > too many occasions due to failures of: > > a) Disk drives, > > b) Disk controllers [the worst Oracle failure I encountered resulted > > from this], and > > c) OS memory management. > > > > I used ReiserFS back in its "bleeding edge" days, and find myself a > > lot more worried about losing data to flakey disk controllers. > > > > It frankly seems insulting to focus on ext2 in this way when: > > > > a) There aren't _hard_ conclusions to point to, just soft ones; > > > > b) The reasons for you hearing vaguely negative things about ext2 > > are much more likely political than they are technical. > > > > I wish there were more "hard and fast" conclusions to draw, to be able > > to conclusively say that one or another Linux filesystem was > > unambiguously preferable for use with PostgreSQL. There are not > > conclusive metrics, either in terms of speed or of some notion of > > "reliability." I'd expect ReiserFS to be the poorest choice, and for > > XFS to be the best, but I only have fuzzy reasons, as opposed to > > metrics. > > > > The absence of measurable metrics of the sort is _NOT_ a proof that > > (say) FreeBSD is conclusively preferable, whatever your own > > preferences (I'll try to avoid characterizing it as "prejudices," as > > that would be unkind) may be. That would represent a quite separate > > debate, and one that doesn't belong here, certainly not on a thread > > where the underlying question was "Which Linux FS is preferred?" > > > > If the OSDB TPC-like benchmarks can get "packaged" up well enough to > > easily run and rerun them, there's hope of getting better answers, > > perhaps even including performance metrics for *BSD. That, not > > Linux-baiting, is the answer... > > -- > > select 'cbbrowne' || '@' || 'acm.org'; > > http://www.ntlug.org/~cbbrowne/sap.html > > (eq? 'truth 'beauty) ; to avoid unassigned-var error, since compiled code > > ; will pick up previous value to var set!-ed, > > ; the unassigned object. > > -- from BBN-CL's cl-parser.scm > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 4: Don't 'kill -9' the postmaster > > > > -- > Bruce Momjian | http://candle.pha.pa.us > pgman@candle.pha.pa.us | (610) 359-1001 > + If your life is a hard drive, | 13 Roberts Road > + Christ can be your backup. | Newtown Square, Pennsylvania 19073 -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Tue Aug 12 01:37:31 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 E085ED1B52C for ; Tue, 12 Aug 2003 04:37: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 18660-02 for ; Tue, 12 Aug 2003 01:35:58 -0300 (ADT) Received: from home.samurai.com (home.samurai.com [205.207.28.66]) by svr1.postgresql.org (Postfix) with ESMTP id 1DE93D1B550 for ; Tue, 12 Aug 2003 01:37:20 -0300 (ADT) Received: by home.samurai.com (Postfix, from userid 1014) id 8866A26203; Tue, 12 Aug 2003 00:37:19 -0400 (EDT) Date: Tue, 12 Aug 2003 00:37:19 -0400 From: Neil Conway To: Bruce Momjian Cc: Reece Hart , "pgsql-performance@postgresql.org" Subject: Re: Perfomance Tuning Message-ID: <20030812043719.GB76772@home.samurai.com> References: <1060642567.15483.220.camel@tallac> <200308112259.h7BMxUo14439@candle.pha.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200308112259.h7BMxUo14439@candle.pha.pa.us> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/195 X-Sequence-Number: 3012 On Mon, Aug 11, 2003 at 06:59:30PM -0400, Bruce Momjian wrote: > Uh, the ext2 developers say it isn't 100% reliable --- at least that is > that was told. I don't know any personally, but I mentioned it while I > was visiting Red Hat, and they didn't refute it. IMHO, if we're going to say "don't use X on production PostgreSQL systems", we need to have some better evidene than "no one has said anything to the contrary, and I heard X is bad". If we can't produce such evidence, we shouldn't say anything at all, and users can decide what to use for themselves. (Not that I'm agreeing or disagreeing about ext2 in particular...) > > My > > untested interpretation was that the update bookkeeping as well as data > > update were all getting journalled, the journal space would fill, get > > sync'd, then repeat. In effect, all blocks were being written TWICE just > > for the journalling, never mind the overhead for PostgreSQL > > transactions. Journalling may or may not have been the culprit, but I doubt everything was being written to disk twice: (a) ext3 does metadata-only journalling by default (b) PostgreSQL only fsyncs WAL records to disk, not the data itself -Neil From pgsql-performance-owner@postgresql.org Tue Aug 12 01:42:38 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 D1236D1B550 for ; Tue, 12 Aug 2003 04:42:37 +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 15936-06 for ; Tue, 12 Aug 2003 01:41:05 -0300 (ADT) Received: from lakemtao02.cox.net (lakemtao02.cox.net [68.1.17.243]) by svr1.postgresql.org (Postfix) with ESMTP id D61F1D1B53A for ; Tue, 12 Aug 2003 01:42:26 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao02.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030812044225.TYZG24359.lakemtao02.cox.net@lhosts> for ; Tue, 12 Aug 2003 00:42:25 -0400 Subject: Re: Perfomance Tuning From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <184401c3606b$c7459860$2800a8c0@mars> References: <20030808185323.GH2967@libertyrms.info> <20030811152414.GF9086@libertyrms.info> <184401c3606b$c7459860$2800a8c0@mars> Content-Type: text/plain Message-Id: <1060663341.30778.14.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 11 Aug 2003 23:42:21 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/196 X-Sequence-Number: 3013 On Mon, 2003-08-11 at 19:50, Christopher Kings-Lynne wrote: > > Well, yeah. But given the Linux propensity for introducing major > > features in "minor" releases (and thereby introducing all the > > attendant bugs), I'd think twice about using _any_ Linux feature > > until it's been through a major version (e.g. things introduced in > > 2.4.x won't really be stable until 2.6.x) -- and even there one is > > taking a risk[1]. > > Dudes, seriously - switch to FreeBSD :P But, like, we want a *good* OS... 8-0 -- +---------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "Man, I'm pretty. Hoo Hah!" | | Johnny Bravo | +---------------------------------------------------------------+ From pgsql-performance-owner@postgresql.org Tue Aug 12 01:53: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 2BD69D1B524 for ; Tue, 12 Aug 2003 04:53:12 +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 15543-08 for ; Tue, 12 Aug 2003 01:51:39 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 75A50D1B52C for ; Tue, 12 Aug 2003 01:52:59 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7C4qkH14615; Tue, 12 Aug 2003 00:52:46 -0400 (EDT) From: Bruce Momjian Message-Id: <200308120452.h7C4qkH14615@candle.pha.pa.us> Subject: Re: Perfomance Tuning In-Reply-To: <20030812043719.GB76772@home.samurai.com> To: Neil Conway Date: Tue, 12 Aug 2003 00:52:46 -0400 (EDT) Cc: Reece Hart , "pgsql-performance@postgresql.org" X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/197 X-Sequence-Number: 3014 Neil Conway wrote: > On Mon, Aug 11, 2003 at 06:59:30PM -0400, Bruce Momjian wrote: > > Uh, the ext2 developers say it isn't 100% reliable --- at least that is > > that was told. I don't know any personally, but I mentioned it while I > > was visiting Red Hat, and they didn't refute it. > > IMHO, if we're going to say "don't use X on production PostgreSQL > systems", we need to have some better evidene than "no one has > said anything to the contrary, and I heard X is bad". If we can't > produce such evidence, we shouldn't say anything at all, and users > can decide what to use for themselves. > > (Not that I'm agreeing or disagreeing about ext2 in particular...) I don't use Linux and was just repeating what I had heard from others, and read in postings. I don't have any first-hand experience with ext2 (except for a laptop I borrowed that wouldn't boot after being shut off), but others on this mailing list have said the same thing. Here is another email talking about corrupting ext2 file systems: http://groups.google.com/groups?q=ext2+corrupt+%22power+failure%22&start=10&hl=en&lr=&ie=UTF-8&selm=20021128061318.GE18980%40ursine&rnum=11 From his wording, I assume he is not talking about fsck-correctable corrupting. From what I remember, the ext2 failure cases were quite small, but known by the ext2 developers, and considered too large a performance hit to correct. > > > My > > > untested interpretation was that the update bookkeeping as well as data > > > update were all getting journalled, the journal space would fill, get > > > sync'd, then repeat. In effect, all blocks were being written TWICE just > > > for the journalling, never mind the overhead for PostgreSQL > > > transactions. > > Journalling may or may not have been the culprit, but I doubt everything > was being written to disk twice: > > (a) ext3 does metadata-only journalling by default If that is true, why was I told people have to mount their ext3 file systems with metadata-only. Again, I have no experience myself, but why are people telling me this? > (b) PostgreSQL only fsyncs WAL records to disk, not the data itself Right. WAL recovers the data. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Tue Aug 12 02:08:21 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 2A254D1B561 for ; Tue, 12 Aug 2003 05:08:20 +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 17499-07 for ; Tue, 12 Aug 2003 02:06:48 -0300 (ADT) Received: from home.samurai.com (home.samurai.com [205.207.28.66]) by svr1.postgresql.org (Postfix) with ESMTP id 4DB53D1B550 for ; Tue, 12 Aug 2003 02:08:09 -0300 (ADT) Received: by home.samurai.com (Postfix, from userid 1014) id 271E326203; Tue, 12 Aug 2003 01:08:09 -0400 (EDT) Date: Tue, 12 Aug 2003 01:08:09 -0400 From: Neil Conway To: Bruce Momjian Cc: Reece Hart , "pgsql-performance@postgresql.org" Subject: Re: Perfomance Tuning Message-ID: <20030812050809.GC76772@home.samurai.com> References: <20030812043719.GB76772@home.samurai.com> <200308120452.h7C4qkH14615@candle.pha.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200308120452.h7C4qkH14615@candle.pha.pa.us> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/198 X-Sequence-Number: 3015 On Tue, Aug 12, 2003 at 12:52:46AM -0400, Bruce Momjian wrote: I don't use Linux and was just repeating what I had heard from others, > and read in postings. I don't have any first-hand experience with ext2 > (except for a laptop I borrowed that wouldn't boot after being shut > off), but others on this mailing list have said the same thing. Right, and I understand the need to answer users asking about which filesystem to use, but I'd be cautious of bad-mouthing another OSS project without any hard evidence to back up our claim (of course if we have such evidence, then fine -- I just haven't seen it). It would be like $SOME_LARGE_OSS project saying "Don't use our project with PostgreSQL, as foo@bar.org had data corruption with PostgreSQL 6.3 on UnixWare" -- kind of annoying, right? > > (a) ext3 does metadata-only journalling by default > > If that is true, why was I told people have to mount their ext3 file > systems with metadata-only. Again, I have no experience myself, but why > are people telling me this? Perhaps they were suggesting that people mount ext2 using data=writeback, rather than the default of data=ordered. BTW, I've heard from a couple different people that using ext3 with data=journalled (i.e. enabling journalling of both data and metadata) actually makes PostgreSQL faster, as it means that ext3 can skip PostgreSQL's fsync request since ext3's log is flushed to disk already. I haven't tested this myself, however. -Neil From pgsql-performance-owner@postgresql.org Tue Aug 12 15:26:39 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 30E99D1C9BF for ; Tue, 12 Aug 2003 18:26:38 +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 99597-01 for ; Tue, 12 Aug 2003 15:25:01 -0300 (ADT) Received: from www.postgresql.com (www.postgresql.com [64.117.225.209]) by svr1.postgresql.org (Postfix) with ESMTP id 8453BD1F44B for ; Tue, 12 Aug 2003 15:25:23 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by www.postgresql.com (Postfix) with ESMTP id 58F70CF7905 for ; Tue, 12 Aug 2003 03:42:27 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7C6hbU4029109 for ; Tue, 12 Aug 2003 12:13:37 +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 h7C6ha3g029096 for ; Tue, 12 Aug 2003 12:13:36 +0530 From: "Shridhar Daithankar" To: PgSQL Performance ML Date: Tue, 12 Aug 2003 12:13:18 +0530 MIME-Version: 1.0 Subject: Re: Perfomance Tuning Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F38D9DE.20174.1E36D1C5@localhost> In-reply-to: <1060663341.30778.14.camel@haggis> References: <184401c3606b$c7459860$2800a8c0@mars> 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: 200308/212 X-Sequence-Number: 3029 On 11 Aug 2003 at 23:42, Ron Johnson wrote: > On Mon, 2003-08-11 at 19:50, Christopher Kings-Lynne wrote: > > > Well, yeah. But given the Linux propensity for introducing major > > > features in "minor" releases (and thereby introducing all the > > > attendant bugs), I'd think twice about using _any_ Linux feature > > > until it's been through a major version (e.g. things introduced in > > > 2.4.x won't really be stable until 2.6.x) -- and even there one is > > > taking a risk[1]. > > > > Dudes, seriously - switch to FreeBSD :P > > But, like, we want a *good* OS... 8-0 Joke aside, I guess since postgresql is pretty much reliant on file system for basic file functionality, I guess it's time to test Linux 2.6 and compare it. And don't forget, for large databases, there is still XFS out there which is probably the ruler at upper end.. Bye Shridhar -- Unfair animal names:-- tsetse fly -- bullhead-- booby -- duck-billed platypus-- sapsucker -- Clarence -- Gary Larson From pgsql-performance-owner@postgresql.org Tue Aug 12 15:34:24 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id E5D9CD1B550 for ; Tue, 12 Aug 2003 18:27: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 00656-02 for ; Tue, 12 Aug 2003 15:26:18 -0300 (ADT) Received: from www.postgresql.com (www.postgresql.com [64.117.225.209]) by svr1.postgresql.org (Postfix) with ESMTP id 4307DD1F4D7 for ; Tue, 12 Aug 2003 15:25:37 -0300 (ADT) Received: from beth.coza.net.za (beth.coza.net.za [206.223.136.193]) by www.postgresql.com (Postfix) with ESMTP id A3C29CF7B62 for ; Tue, 12 Aug 2003 04:17:40 -0300 (ADT) Received: from coza.net.za (mixo.coza.net.za [206.223.136.225]) by beth.coza.net.za (8.11.6/8.11.2) with ESMTP id h7C7GOo02922; Tue, 12 Aug 2003 09:16:28 +0200 Message-ID: <3F389449.8050305@coza.net.za> Date: Tue, 12 Aug 2003 09:16:25 +0200 From: mixo Reply-To: mixo@coza.net.za User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030811 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bjoern Metzdorf Cc: pgsql-performance@postgresql.org Subject: Re: Perfomance Tuning References: <3F337B39.5030904@coza.net.za> <01ed01c35d99$73f08d70$0564a8c0@shock> In-Reply-To: <01ed01c35d99$73f08d70$0564a8c0@shock> 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: 200308/213 X-Sequence-Number: 3030 Thanks to everyone who responded. It's a pity that the discussion has gone the ext2 vs ext3 route. The main reason I asked my original question is that I am currently importing data into Pg which is about 2.9 Gigs. Unfortunately, to maintain data intergrity, data is inserted into a table one row at a time. This exercise took ~7 days on the same system with slightly different setup(PIII 1.0GHZ, 512M RAM -- CPU speed was down graded due to serveral over heating problems which have since been fixed, and RAM was added for good measure). I have just reloaded the machine, and started the import. So far ~ 6000 record have been imported, and there is 32000 left. P.S. Importing the same data on Mysql took ~2 days. Bjoern Metzdorf wrote: >>be able to handle at least 8M at a time. The machine has >>two P III 933MHz CPU's, 1.128G RAM (512M*2 + 128M), and >>a 36 Gig hd with 1 Gig swap and 3 equal size ext3 partitions. >>What would be the recomended setup for good performance >>considering that the db will have about 15 users for >>9 hours in a day, and about 10 or so users throughout the day >>who wont be conistenly using the db. >> >> > >For 15 users you won't need great tuning at all. Just make sure, that you >have the right indizes on the tables and that you have good queries (query >plan). > >About the 8Meg blobs, I don't know. Other people on this list may be able to >give you hints here. > >Regards, >Bjoern > > From pgsql-performance-owner@postgresql.org Tue Aug 12 13:28: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 9E9A9D1C7F1 for ; Tue, 12 Aug 2003 16:28:46 +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 80360-05 for ; Tue, 12 Aug 2003 13:27:12 -0300 (ADT) Received: from www.postgresql.com (www.postgresql.com [64.117.225.209]) by svr1.postgresql.org (Postfix) with ESMTP id 8D3D5D1C4BA for ; Tue, 12 Aug 2003 13:28:35 -0300 (ADT) Received: from melina.szuwary.org (136-bem-3.acn.waw.pl [62.121.82.136]) by www.postgresql.com (Postfix) with ESMTP id 6F419CF77E0 for ; Tue, 12 Aug 2003 06:52:27 -0300 (ADT) Received: by melina.szuwary.org (Postfix, from userid 1000) id 38178DF22; Tue, 12 Aug 2003 11:57:08 +0200 (CEST) Date: Tue, 12 Aug 2003 11:57:07 +0200 From: Jacek Rembisz To: pgsql-performance@postgresql.org Subject: Re: Analyze makes queries slow... Message-ID: <20030812095707.GA22395@melina.szuwary.org> References: <20030811155841.483ffd93.svb@ucs.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <20030811155841.483ffd93.svb@ucs.co.za> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/206 X-Sequence-Number: 3023 On Mon, Aug 11, 2003 at 03:58:41PM +0200, Stef wrote: > I have attached an sql statement that normally runs under 3 minutes. > That is, until I vacuum analyze the database (or just the tables in the query), > then the same query runs longer than 12 hours, and I have to kill it. Hmm, I have noticed similar problem with a query with order by ... limit clause.Although it runs only 10 times slower after analyze :) The query joins one big table (20 000 rows) with several small tables (200-4000 rows) than order by "primary key of big table" limit 20 Without this order by ... limit clause the query is 5 times faster after analyze. Looking into explain analyze outputs: 1. Before vacuum analyze a planer chooses nested loop, the deepest is: -> Nested Loop (cost=0.00..116866.54 rows=19286 width=96) (actual time=0.14..1.39 rows=21 loops=1) -> Index Scan Backward using big_table_pkey on big_table k (cost=0.00..1461.15 rows=19286 width=52) (actual time=0.07..0.47 rows=21 loops=1) -> Index Scan using 4000rows_table_pkey on 4000rows_table zs (cost=0.00..5.97 rows=1 width=44) (actual time=0.02..0.02 rows=0 loops=21) 2. After analyze uses hashjoins When I remove this order by limit clause the query after analyze takes the same time and the query before analyze is much more slower. I won't blame the planer. How he could learn that he should first take those 20 rows and than perform joins? There is a where clause with complex exists(subquery) condition regarding one of big_table fields, but removing this condition does not change the query plan. Pure joining without any additional conditions and only primary key of big table in select clause runs 4 times slower then whole query before vacuuum analyze :) Does in all the planer take in the consideration the limit clause? Probably I'm missing something. I don't know much about the planer. Finaly I have redesigned the query. Regards, Jacek From pgsql-performance-owner@postgresql.org Tue Aug 12 10:12:34 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 30018D1B550 for ; Tue, 12 Aug 2003 13:12:34 +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 65717-01 for ; Tue, 12 Aug 2003 10:11:03 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 26C3FD1C4BF for ; Tue, 12 Aug 2003 10:12:23 -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 h7CDBrSa000793; Tue, 12 Aug 2003 09:11:54 -0400 (EDT) To: josh@agliodbs.com Cc: pgsql-performance@postgreSQL.org Subject: Re: Odd problem with performance in duplicate database In-reply-to: <200308111743.48564.josh@agliodbs.com> References: <200308111716.22288.josh@agliodbs.com> <27573.1060648162@sss.pgh.pa.us> <200308111743.48564.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Mon, 11 Aug 2003 17:43:48 -0700" Date: Tue, 12 Aug 2003 09:11:53 -0400 Message-ID: <792.1060693913@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/199 X-Sequence-Number: 3016 Josh Berkus writes: > Also, there doesn't seem to be any way in 7.2 for me to find out what the > current statistics target for a column is. What am I missing? There still isn't a handy command for it --- you have to look at pg_attribute.attstattarget for the column. regards, tom lane From pgsql-performance-owner@postgresql.org Tue Aug 12 11:29: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 6B38FD1B56C for ; Tue, 12 Aug 2003 14:29: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 67873-06 for ; Tue, 12 Aug 2003 11:27:47 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 2B555D1C4CA for ; Tue, 12 Aug 2003 11:29:07 -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 h7CEQtbS000117; Tue, 12 Aug 2003 08:26:55 -0600 (MDT) Date: Tue, 12 Aug 2003 08:27:52 -0600 (MDT) From: "scott.marlowe" To: Christopher Kings-Lynne Cc: Andrew Sullivan , Subject: Re: Perfomance Tuning In-Reply-To: <184401c3606b$c7459860$2800a8c0@mars> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/201 X-Sequence-Number: 3018 On Tue, 12 Aug 2003, Christopher Kings-Lynne wrote: > > Well, yeah. But given the Linux propensity for introducing major > > features in "minor" releases (and thereby introducing all the > > attendant bugs), I'd think twice about using _any_ Linux feature > > until it's been through a major version (e.g. things introduced in > > 2.4.x won't really be stable until 2.6.x) -- and even there one is > > taking a risk[1]. > > Dudes, seriously - switch to FreeBSD :P Yeah, it's nice to have a BUG FREE OS huh? ;^) And yes, I've used FreeBSD, it's quite good, but I kept getting the feeling it wasn't quite done. Especially the installation documentation. From pgsql-performance-owner@postgresql.org Tue Aug 12 11:29: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 34550D1C4BF for ; Tue, 12 Aug 2003 14:29: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 67213-08 for ; Tue, 12 Aug 2003 11:27:34 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 55DA4D1C4CA for ; Tue, 12 Aug 2003 11:28:54 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19ma8v-0002fc-00 for ; Tue, 12 Aug 2003 10:28:57 -0400 Received: by dba2 (Postfix, from userid 1019) id B6A4DCF50; Tue, 12 Aug 2003 10:28:56 -0400 (EDT) Date: Tue, 12 Aug 2003 10:28:56 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: On Linux Filesystems Message-ID: <20030812142856.GB12701@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <20030810200440.B2396@cookie> <3032.1060617279@sss.pgh.pa.us> <20030811100740.D2396@cookie> <3855.1060622959@sss.pgh.pa.us> <20030811104447.G2396@cookie> <4146.1060624411@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/200 X-Sequence-Number: 3017 On Mon, Aug 11, 2003 at 10:58:18PM -0400, Christopher Browne wrote: > 1. Nobody has gone through any formal proofs, and there are few > systems _anywhere_ that are 100% reliable. I think the problem is that ext2 is known to be not perfectly crash safe. That is, fsck on reboot after a crash can cause, in some extreme cases, recently-fscynced data to end up in lost+found/. The data may or may not be recoverable from there. I don't think anyone would object to such a characterisation of ext2. It was not designed, ever, for perfect data safety -- it was designed as a reasonably good compromise for most cases. _Every_ filesystem entails some compromises. This happens to be the one entailed by ext2. For production use with valuable data, for my money (or, more precisely, my time when a system panics for no good reason), it is always worth the additional speed penalty to use something like metadata journalling. Maybe others have more time to spare. > perhaps even including performance metrics for *BSD. That, not > Linux-baiting, is the answer... I didn't see anyone Linux-baiting. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Tue Aug 12 11:32: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 61B8DD1C4BF for ; Tue, 12 Aug 2003 14:32: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 70291-04 for ; Tue, 12 Aug 2003 11:31:22 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 3833BD1B4F0 for ; Tue, 12 Aug 2003 11:32:42 -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 h7CEV0bS000583; Tue, 12 Aug 2003 08:31:00 -0600 (MDT) Date: Tue, 12 Aug 2003 08:31:57 -0600 (MDT) From: "scott.marlowe" To: Bruce Momjian Cc: Andrew Sullivan , Subject: Re: Perfomance Tuning In-Reply-To: <200308112216.h7BMGiF06162@candle.pha.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/202 X-Sequence-Number: 3019 On Mon, 11 Aug 2003, Bruce Momjian wrote: > scott.marlowe wrote: > > On Fri, 8 Aug 2003, Andrew Sullivan wrote: > > > > > On Fri, Aug 08, 2003 at 09:40:20AM -0700, Jonathan Gardner wrote: > > > > > > > > Redhat puts ext3 on by default. Consider switching to a non-journaling FS > > > > (ext2?) with the partition that holds your data and WAL. > > > > > > I would give you exactly the opposite advice: _never_ use a > > > non-journalling fs for your data and WAL. I suppose if you can > > > afford to lose some transactions, you can do without journalling. > > > Otherwise, you're just borrowing trouble, near as I can tell. > > > > I'd argue that a reliable filesystem (ext2) is still better than a > > questionable journaling filesystem (ext3 on kernels <2.4.20). > > > > This isn't saying to not use jounraling, but I would definitely test it > > under load first to make sure it's not gonna lose data or get corrupted. > > That _would_ work if ext2 was a reliable file system --- it is not. > > This is the problem of Linux file systems --- they have unreliable, and > journalled, with nothing in between, except using a journalling file > system and having it only journal metadata. Never the less, on LINUX, which is what we use, it is by far more reliable than ext3 or reiserfs. In four years of use I've lost zero files to any of its bugs. Of course, maybe that's RedHat patching the kernel for me or something. :-) they seem to hire some pretty good hackers. From pgsql-performance-owner@postgresql.org Tue Aug 12 11:41:10 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id A7769D1C4D0 for ; Tue, 12 Aug 2003 14:35:32 +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 68978-07 for ; Tue, 12 Aug 2003 11:34:01 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 7FABAD1C4CA for ; Tue, 12 Aug 2003 11:35:19 -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 h7CEXxbS000804; Tue, 12 Aug 2003 08:33:59 -0600 (MDT) Date: Tue, 12 Aug 2003 08:34:56 -0600 (MDT) From: "scott.marlowe" To: Ron Johnson Cc: PgSQL Performance ML Subject: Re: Perfomance Tuning In-Reply-To: <1060663341.30778.14.camel@haggis> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/204 X-Sequence-Number: 3021 On 11 Aug 2003, Ron Johnson wrote: > On Mon, 2003-08-11 at 19:50, Christopher Kings-Lynne wrote: > > > Well, yeah. But given the Linux propensity for introducing major > > > features in "minor" releases (and thereby introducing all the > > > attendant bugs), I'd think twice about using _any_ Linux feature > > > until it's been through a major version (e.g. things introduced in > > > 2.4.x won't really be stable until 2.6.x) -- and even there one is > > > taking a risk[1]. > > > > Dudes, seriously - switch to FreeBSD :P > > But, like, we want a *good* OS... 8-0 What, like Unixware? (ducking quickly) (*_*) From pgsql-performance-owner@postgresql.org Tue Aug 12 11:39:58 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id B5BA4D1B550 for ; Tue, 12 Aug 2003 14:36: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 68978-08 for ; Tue, 12 Aug 2003 11:35:13 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 2A8B4D1B56C for ; Tue, 12 Aug 2003 11:36:33 -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 h7CEZPbS000985; Tue, 12 Aug 2003 08:35:25 -0600 (MDT) Date: Tue, 12 Aug 2003 08:36:22 -0600 (MDT) From: "scott.marlowe" To: Neil Conway Cc: Bruce Momjian , Reece Hart , "pgsql-performance@postgresql.org" Subject: Re: Perfomance Tuning In-Reply-To: <20030812050809.GC76772@home.samurai.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/203 X-Sequence-Number: 3020 On Tue, 12 Aug 2003, Neil Conway wrote: > On Tue, Aug 12, 2003 at 12:52:46AM -0400, Bruce Momjian wrote: > I don't use Linux and was just repeating what I had heard from others, > > and read in postings. I don't have any first-hand experience with ext2 > > (except for a laptop I borrowed that wouldn't boot after being shut > > off), but others on this mailing list have said the same thing. > > Right, and I understand the need to answer users asking about > which filesystem to use, but I'd be cautious of bad-mouthing > another OSS project without any hard evidence to back up our > claim (of course if we have such evidence, then fine -- I > just haven't seen it). It would be like $SOME_LARGE_OSS > project saying "Don't use our project with PostgreSQL, as > foo@bar.org had data corruption with PostgreSQL 6.3 on > UnixWare" -- kind of annoying, right? Wow, you put my thoughts exactly into words for me, thanks Neil. > > > (a) ext3 does metadata-only journalling by default > > > > If that is true, why was I told people have to mount their ext3 file > > systems with metadata-only. Again, I have no experience myself, but why > > are people telling me this? > > Perhaps they were suggesting that people mount ext2 using > data=writeback, rather than the default of data=ordered. > > BTW, I've heard from a couple different people that using > ext3 with data=journalled (i.e. enabling journalling of both > data and metadata) actually makes PostgreSQL faster, as > it means that ext3 can skip PostgreSQL's fsync request > since ext3's log is flushed to disk already. I haven't > tested this myself, however. Now that you mention it, that makes sense. I might have to test ext3 now that the 2.6 kernel is on the way, i.e. the 2.4 kernel should be settling down by now. From pgsql-performance-owner@postgresql.org Tue Aug 12 12:06:34 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 A6DE9D1C4CA for ; Tue, 12 Aug 2003 15:06:33 +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 70291-09 for ; Tue, 12 Aug 2003 12:04:58 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id A7478D1B53A for ; Tue, 12 Aug 2003 12:06:21 -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 h7CF5IbS003465; Tue, 12 Aug 2003 09:05:18 -0600 (MDT) Date: Tue, 12 Aug 2003 09:06:14 -0600 (MDT) From: "scott.marlowe" To: Andrew Sullivan Cc: Subject: Re: On Linux Filesystems In-Reply-To: <20030812142856.GB12701@libertyrms.info> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/205 X-Sequence-Number: 3022 On Tue, 12 Aug 2003, Andrew Sullivan wrote: > On Mon, Aug 11, 2003 at 10:58:18PM -0400, Christopher Browne wrote: > > 1. Nobody has gone through any formal proofs, and there are few > > systems _anywhere_ that are 100% reliable. > > I think the problem is that ext2 is known to be not perfectly crash > safe. That is, fsck on reboot after a crash can cause, in some > extreme cases, recently-fscynced data to end up in lost+found/. The > data may or may not be recoverable from there. > > I don't think anyone would object to such a characterisation of ext2. > It was not designed, ever, for perfect data safety -- it was designed > as a reasonably good compromise for most cases. _Every_ filesystem > entails some compromises. This happens to be the one entailed by > ext2. > > For production use with valuable data, for my money (or, more > precisely, my time when a system panics for no good reason), it is > always worth the additional speed penalty to use something like > metadata journalling. Maybe others have more time to spare. I think the issue here is if you are running with the async mount option, then it is quite likely that your volume will be corrupted if there are writes going on and power fails. I'm pretty sure that as long as the partition is mounted sync, this isn't a problem. I have seen reports where ext3 caused the data corruption (old kernels, 2.4.4 and before I believe) problem, not ext2. I.e. the addition of journaling caused data loss. Given that possibility, it may well have been at one time that ext2 was a safer bet than ext3. > > perhaps even including performance metrics for *BSD. That, not > > Linux-baiting, is the answer... > > I didn't see anyone Linux-baiting. No more than the typical, light hearted stuff we toss back and forth. I certainly wasn't upset by any of it. From pgsql-performance-owner@postgresql.org Tue Aug 12 13:38:28 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 93BB5D1C4D7 for ; Tue, 12 Aug 2003 16:38:26 +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 83111-02 for ; Tue, 12 Aug 2003 13:36:51 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id D4B9FD1C47A for ; Tue, 12 Aug 2003 13:38:13 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3505853 for pgsql-performance@postgresql.org; Tue, 12 Aug 2003 09:37:41 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: pgsql-performance@postgresql.org Subject: Re: On Linux Filesystems Date: Tue, 12 Aug 2003 09:36:21 -0700 User-Agent: KMail/1.4.3 References: <20030810200440.B2396@cookie> <20030812142856.GB12701@libertyrms.info> In-Reply-To: <20030812142856.GB12701@libertyrms.info> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200308120936.21099.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/207 X-Sequence-Number: 3024 People: > On Mon, Aug 11, 2003 at 10:58:18PM -0400, Christopher Browne wrote: > > 1. Nobody has gone through any formal proofs, and there are few > > systems _anywhere_ that are 100% reliable. > > I think the problem is that ext2 is known to be not perfectly crash > safe. That is, fsck on reboot after a crash can cause, in some > extreme cases, recently-fscynced data to end up in lost+found/. The > data may or may not be recoverable from there. Aside from that, as recently as eighteen months ago I had to manually fsck an ext2 system after an unexpected power-out. After my interactive session the system recovered and no data was lost. However, the client lost 3.5 hours of work time ... 2.5 hours for me to get to the site, and 1 hour to recover the server (mostly waiting time). So it's a tradeoff with loss of performance vs. recovery time. In a server room with redundant backup power supplies, "clean room" security and fail-over services, I can certainly imagine that data journalling would not be needed. That is, however, the minority ... -- Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Tue Aug 12 13:47:34 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 CE4D0D1C4D0 for ; Tue, 12 Aug 2003 16:47:33 +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 83987-02 for ; Tue, 12 Aug 2003 13:46:00 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id EF6C8D1C4BA for ; Tue, 12 Aug 2003 13:47:22 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19mcIp-0005Da-00 for ; Tue, 12 Aug 2003 12:47:19 -0400 Received: by dba2 (Postfix, from userid 1019) id E43B6D0AE; Tue, 12 Aug 2003 12:47:18 -0400 (EDT) Date: Tue, 12 Aug 2003 12:47:18 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: On Linux Filesystems Message-ID: <20030812164718.GC12976@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <20030810200440.B2396@cookie> <20030812142856.GB12701@libertyrms.info> <200308120936.21099.josh@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200308120936.21099.josh@agliodbs.com> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/208 X-Sequence-Number: 3025 On Tue, Aug 12, 2003 at 09:36:21AM -0700, Josh Berkus wrote: > So it's a tradeoff with loss of performance vs. recovery time. In > a server room with redundant backup power supplies, "clean room" > security and fail-over services, I can certainly imagine that data > journalling would not be needed. You can have all the redundant power, high availability hardware, and ultra-Robocop security going, and still have crashes: so far as I know, _nobody_ makes perfectly reliable hardware, and the harder you push it, the more likely you are to find trouble. And certainly, when you have a surprise outage because the CPU where the kernel happened to be burned itself up, an extra hour or two offline while you do fsck is liable to make you cry out variations of those four letters more than once. :-/ A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Tue Aug 12 14:26: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 81BE6D1C4CC for ; Tue, 12 Aug 2003 17:26: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 84633-08 for ; Tue, 12 Aug 2003 14:24:34 -0300 (ADT) Received: from mail.travelamericas.com (dsl231-059-037.sea1.dsl.speakeasy.net [216.231.59.37]) by svr1.postgresql.org (Postfix) with SMTP id 050AAD1C4BA for ; Tue, 12 Aug 2003 14:25:56 -0300 (ADT) Received: (qmail 20346 invoked from network); 12 Aug 2003 17:26:17 -0000 Received: from unknown (HELO travelamericas.com) (127.0.0.1) by localhost with SMTP; 12 Aug 2003 17:26:17 -0000 Message-ID: <3F392339.5000007@travelamericas.com> Date: Tue, 12 Aug 2003 10:26:17 -0700 From: Chris Travers User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: xin fu Cc: pgsql-performance@postgresql.org Subject: Re: about performance of postgreSQL References: <20030812023504.27034.qmail@web15106.mail.bjs.yahoo.com> In-Reply-To: <20030812023504.27034.qmail@web15106.mail.bjs.yahoo.com> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/209 X-Sequence-Number: 3026 Hi Xin; PostgreSQL is configured to run on virutally anything out of the box. The reason for this is that, like Oracle, the database manager will not start if it cannot allocate sufficient resources. We take the approach of ensuring that it will start so you can tune it. I would recomment trying to take a close look at many of the posts on the Performance list (searching the archives) and paying attention to things such as effective_cache_size and shared_buffers. If these don't answer your questions, ask this list again. Best Wishes, Chris Travers xin fu wrote: > Dear master: > I have learned postgreSQL for serveral days, now i meet some problems. > when I use a TPCC(Transaction Processing Performance Council) test > program to test the performance of postgreSQL , postgreSQL works very > slowly, it almost need 1 minute to finish a transaction, and the CPU > percent is almost 100%, > the test environment is : > OS: redhat 9.0(ext3, default configurations) > Server: postgre7.3.4(default configurations) , PIII 800M, 1G Memory > Client: tpcc test program,using ODBC API, PIII 800M, 1G Memory > when using SQLServer, it can work on a workload of 40 Warehouse, > but postgreSQL can not work even on 1 warehouse. I think there must be > some problem with my postgreSQL, can you help me? > I am in china, and my english is very poor, but i hope you can give > me some advice, thanks. > > > ------------------------------------------------------------------------ > *Do You Yahoo!?* > ���ڴ�Ƭ����Ż�ͨ ��������ͷ+�Ż�ͨ��Ƶ�������������� > From pgsql-performance-owner@postgresql.org Tue Aug 12 14:30:38 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 A7AB9D1B524 for ; Tue, 12 Aug 2003 17:30:37 +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 85021-08 for ; Tue, 12 Aug 2003 14:29:03 -0300 (ADT) Received: from ucsns.ucs.co.za (ucs.co.za [196.23.43.2]) by svr1.postgresql.org (Postfix) with ESMTP id A72F2D1B523 for ; Tue, 12 Aug 2003 14:30:19 -0300 (ADT) Received: from ucspost.ucs.co.za (mailgw1.ucs.co.za [196.23.43.253]) by ucsns.ucs.co.za (Postfix) with ESMTP id EEE812BD54; Tue, 12 Aug 2003 19:30:02 +0200 (SAST) Received: from jhb.ucs.co.za (jhb.ucs.co.za [172.31.1.3]) by ucspost.ucs.co.za (Postfix) with ESMTP id 72A8BDAC50; Tue, 12 Aug 2003 19:30:11 +0200 (SAST) Received: from svb.ucs.co.za (svb.ucs.co.za [172.31.1.148]) by jhb.ucs.co.za (Postfix) with SMTP id EB4E9973EA; Tue, 12 Aug 2003 19:30:10 +0200 (SAST) Date: Tue, 12 Aug 2003 19:30:10 +0200 From: Stef To: Tom Lane Cc: pgsql-performance@postgresql.org Subject: Re: Analyze makes queries slow... Message-Id: <20030812193010.701de1ee.svb@ucs.co.za> In-Reply-To: <5167.1060626303@sss.pgh.pa.us> References: <20030811155841.483ffd93.svb@ucs.co.za> <2934.1060616625@sss.pgh.pa.us> <20030811184736.7e191a86.svb@ucs.co.za> <5167.1060626303@sss.pgh.pa.us> X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i386-pc-linux-gnu) User-Agent: sillypheed-claws (anti-aliased) X-Face: LV^-*d3kQlL,6{Y:X)M~tuL#y!p.kO_Qbc!xxqhZC4s}Y]L0g)z^aiLsQGY34d|}Xp:HNm)MRsc?^?ZQ}smznF&jx|w@,a**K&QL.Dc~2~M5V`zb>hExCJDB[[o=M)e"; k-n[7tz2TY7+; *_xX's(5cUEtdw*yG-OmKm}6($zpUz8S`Nz@w X-Operating-System: sid X-X-X: _-^-_ Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Tue__12_Aug_2003_19:30:10_+0200_08834680" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/210 X-Sequence-Number: 3027 This is a multi-part message in MIME format. --Multipart_Tue__12_Aug_2003_19:30:10_+0200_08834680 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 11 Aug 2003 14:25:03 -0400 Tom Lane wrote: => set enable_mergejoin to off; => explain analyze ... query ... => => If it finishes in a reasonable amount of time, send the explain output. Hi again, I did this on the 7.3.1 database, and attached the output. It actually ran faster after ANALYZE and 'set enable_mergejoin to off' Thanks! I also reloaded this database onto 7.3.4, tried the same query after the ANALYZE, and the query executed a lot faster. Thanks again! I also attached the output of the EXPLAIN ANALYZE on 7.3.4 For now I'll maybe just disable mergejoin. But definitely a postgres upgrade is what I will do. I went through the different outputs of EXPLAIN ANALYZE a bit, and I think I can now see where the difference is. Thanks a lot for the help. Regards Stefan. --Multipart_Tue__12_Aug_2003_19:30:10_+0200_08834680 Content-Type: text/plain; name="expl_anlyze_nomergejoin_7.3.1.txt" Content-Disposition: attachment; filename="expl_anlyze_nomergejoin_7.3.1.txt" Content-Transfer-Encoding: 7bit Aggregate (cost=103991.51..103999.75 rows=27 width=241) (actual time=77907.78..83292.51 rows=125803 loops=1) -> Group (cost=103991.51..103996.32 rows=274 width=241) (actual time=77907.61..79449.70 rows=125803 loops=1) -> Sort (cost=103991.51..103992.20 rows=274 width=241) (actual time=77907.58..78149.54 rows=125803 loops=1) Sort Key: m.group_code, m.sku, m.brn_code, m.stktype_code, ss.supplier_price_curr_cost, sk.sku_price_curr_cost -> Hash Join (cost=2599.45..103980.40 rows=274 width=241) (actual time=2527.34..73353.16 rows=125803 loops=1) Hash Cond: ("outer".country_code = "inner".from_ctry) -> Nested Loop (cost=2585.54..103961.83 rows=12 width=223) (actual time=2504.90..71966.16 rows=125803 loops=1) Join Filter: (("inner".price_tmpl_hdr_cde = "outer".price_tmpl_hdr_cde) AND ("inner".price_tmpl_hdr_reg = "outer".price_tmpl_hdr_reg) AND ("inner".group_cde = "outer".group_cde) AND ("inner".sku_mst_cde = "outer".sku)) -> Hash Join (cost=2585.54..103611.37 rows=60 width=179) (actual time=2411.76..46771.60 rows=125803 loops=1) Hash Cond: ("outer".brn_code = "inner".brn_code) -> Hash Join (cost=2575.07..103599.70 rows=60 width=164) (actual time=2410.16..44730.60 rows=125803 loops=1) Hash Cond: ("outer".brn_code = "inner".branch_cde) Join Filter: (("inner".group_cde = "outer".group_code) AND ("outer".price_tmpl_hdr_cde = "inner".price_tmpl_hdr_cde) AND ("outer".price_tmpl_hdr_reg = "inner".price_tmpl_hdr_reg)) -> Hash Join (cost=2570.54..103586.96 rows=299 width=135) (actual time=2402.43..39292.85 rows=629015 loops=1) Hash Cond: ("outer".sku = "inner".sku) Join Filter: (("outer".group_code = "inner".group_code) AND ("inner".supplier_cde = "outer".supplier_code)) -> Seq Scan on master_fpp_values m (cost=0.00..98545.54 rows=220358 width=54) (actual time=1013.70..28087.16 rows=162226 loops=1) Filter: (fpp_code = '200307'::text) -> Hash (cost=2542.25..2542.25 rows=11318 width=81) (actual time=1388.58..1388.58 rows=0 loops=1) -> Hash Join (cost=543.67..2542.25 rows=11318 width=81) (actual time=188.63..1277.34 rows=54675 loops=1) Hash Cond: ("outer".sku_mst_cde = "inner".sku) Join Filter: ("outer".group_cde = "inner".group_code) -> Seq Scan on supplier_price ss (cost=0.00..1418.75 rows=54675 width=54) (actual time=5.94..553.10 rows=54675 loops=1) -> Hash (cost=516.06..516.06 rows=11042 width=27) (actual time=182.53..182.53 rows=0 loops=1) -> Index Scan using master_sku_descr_idx11 on master_sku_descr s (cost=0.00..516.06 rows=11042 width=27) (actual time=19.15..160.75 rows=10936 loops=1) Index Cond: (control_code = '0'::text) -> Hash (cost=4.02..4.02 rows=202 width=29) (actual time=7.51..7.51 rows=0 loops=1) -> Seq Scan on price_tmpl_det p (cost=0.00..4.02 rows=202 width=29) (actual time=6.46..7.16 rows=202 loops=1) -> Hash (cost=9.98..9.98 rows=198 width=15) (actual time=1.41..1.41 rows=0 loops=1) -> Seq Scan on master_branch_descr b (cost=0.00..9.98 rows=198 width=15) (actual time=0.09..1.08 rows=198 loops=1) -> Index Scan using idx_sku_price on sku_price sk (cost=0.00..5.83 rows=1 width=44) (actual time=0.17..0.17 rows=1 loops=125803) Index Cond: ((sk.group_cde = "outer".group_cde) AND (sk.sku_mst_cde = "outer".sku_mst_cde) AND (sk.price_tmpl_hdr_cde = "outer".price_tmpl_hdr_cde) AND (sk.price_tmpl_hdr_reg = "outer".price_tmpl_hdr_reg)) -> Hash (cost=13.90..13.90 rows=4 width=18) (actual time=22.28..22.28 rows=0 loops=1) -> Index Scan using forex_idx1 on forex f (cost=0.00..13.90 rows=4 width=18) (actual time=22.22..22.26 rows=4 loops=1) Index Cond: ((to_ctry = 'ZAF'::text) AND (fpp_code = '200307'::text)) Total runtime: 83938.26 msec (36 rows) --Multipart_Tue__12_Aug_2003_19:30:10_+0200_08834680 Content-Type: text/plain; name="expl_anlyze_nomergejoin_7.3.4.txt" Content-Disposition: attachment; filename="expl_anlyze_nomergejoin_7.3.4.txt" Content-Transfer-Encoding: 7bit Aggregate (cost=100832.75..100839.08 rows=21 width=241) (actual time=124406.04..130113.77 rows=125769 loops=1) -> Group (cost=100832.75..100836.44 rows=211 width=241) (actual time=124405.89..126257.32 rows=125769 loops=1) -> Sort (cost=100832.75..100833.28 rows=211 width=241) (actual time=124405.86..124640.33 rows=125769 loops=1) Sort Key: m.group_code, m.sku, m.brn_code, m.stktype_code, ss.supplier_price_curr_cost, sk.sku_price_curr_cost -> Merge Join (cost=100824.44..100824.62 rows=211 width=241) (actual time=105588.22..107495.57 rows=125769 loops=1) Merge Cond: ("outer".country_code = "inner".from_ctry) -> Sort (cost=100810.50..100810.52 rows=9 width=223) (actual time=105562.94..105882.26 rows=125769 loops=1) Sort Key: b.country_code -> Nested Loop (cost=3149.50..100810.35 rows=9 width=223) (actual time=3438.71..101078.92 rows=125769 loops=1) Join Filter: (("inner".price_tmpl_hdr_cde = "outer".price_tmpl_hdr_cde) AND ("inner".price_tmpl_hdr_reg = "outer".price_tmpl_hdr_reg) AND ("inner".group_cde = "outer".group_cde) AND ("inner".sku_mst_cde = "outer".sku)) -> Hash Join (cost=3149.50..100551.84 rows=44 width=179) (actual time=3405.53..63392.62 rows=125769 loops=1) Hash Cond: ("outer".brn_code = "inner".brn_code) -> Hash Join (cost=3139.03..100540.48 rows=44 width=164) (actual time=3403.98..60948.65 rows=125769 loops=1) Hash Cond: ("outer".brn_code = "inner".branch_cde) Join Filter: (("inner".group_cde = "outer".group_code) AND ("outer".price_tmpl_hdr_cde = "inner".price_tmpl_hdr_cde) AND ("outer".price_tmpl_hdr_reg = "inner".price_tmpl_hdr_reg)) -> Hash Join (cost=3134.50..100529.68 rows=228 width=135) (actual time=3392.93..51324.39 rows=628845 loops=1) Hash Cond: ("outer".sku = "inner".sku) Join Filter: (("outer".group_code = "inner".group_code) AND ("inner".supplier_cde = "outer".supplier_code)) -> Seq Scan on master_fpp_values m (cost=0.00..90519.23 rows=176470 width=54) (actual time=978.39..24186.16 rows=162115 loops=1) Filter: (fpp_code = '200307'::text) -> Hash (cost=2957.40..2957.40 rows=11240 width=81) (actual time=2414.25..2414.25 rows=0 loops=1) -> Hash Join (cost=543.88..2957.40 rows=11240 width=81) (actual time=502.21..2278.41 rows=54670 loops=1) Hash Cond: ("outer".sku_mst_cde = "inner".sku) Join Filter: ("outer".group_cde = "inner".group_code) -> Seq Scan on supplier_price ss (cost=0.00..1421.17 rows=54917 width=54) (actual time=0.10..343.54 rows=54670 loops=1) -> Hash (cost=515.77..515.77 rows=11243 width=27) (actual time=501.90..501.90 rows=0 loops=1) -> Index Scan using master_sku_descr_idx11 on master_sku_descr s (cost=0.00..515.77 rows=11243 width=27) (actual time=37.37..477.86 rows=10935 loops=1) Index Cond: (control_code = '0'::text) -> Hash (cost=4.02..4.02 rows=202 width=29) (actual time=10.81..10.81 rows=0 loops=1) -> Seq Scan on price_tmpl_det p (cost=0.00..4.02 rows=202 width=29) (actual time=9.67..10.45 rows=202 loops=1) -> Hash (cost=9.98..9.98 rows=198 width=15) (actual time=1.43..1.43 rows=0 loops=1) -> Seq Scan on master_branch_descr b (cost=0.00..9.98 rows=198 width=15) (actual time=0.11..1.08 rows=198 loops=1) -> Index Scan using pk_sku_price on sku_price sk (cost=0.00..5.83 rows=1 width=44) (actual time=0.25..0.26 rows=1 loops=125769) Index Cond: ((sk.group_cde = "outer".group_cde) AND (sk.sku_mst_cde = "outer".sku_mst_cde) AND (sk.price_tmpl_hdr_cde = "outer".price_tmpl_hdr_cde) AND (sk.price_tmpl_hdr_reg = "outer".price_tmpl_hdr_reg)) -> Sort (cost=13.94..13.95 rows=4 width=18) (actual time=25.22..113.25 rows=9906 loops=1) Sort Key: f.from_ctry -> Index Scan using forex_idx1 on forex f (cost=0.00..13.90 rows=4 width=18) (actual time=24.94..25.00 rows=4 loops=1) Index Cond: ((to_ctry = 'ZAF'::text) AND (fpp_code = '200307'::text)) Total runtime: 130815.00 msec (39 rows) --Multipart_Tue__12_Aug_2003_19:30:10_+0200_08834680-- From pgsql-performance-owner@postgresql.org Tue Aug 12 15:03:29 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 9E60AD1B539 for ; Tue, 12 Aug 2003 18:03: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 92636-08 for ; Tue, 12 Aug 2003 15:01:54 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 9E7EED1C4BA for ; Tue, 12 Aug 2003 15:03:16 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3506096; Tue, 12 Aug 2003 11:03:22 -0700 Content-Type: text/plain; charset="gb2312" From: Josh Berkus Organization: Aglio Database Solutions To: Chris Travers , xin fu Subject: Re: about performance of postgreSQL Date: Tue, 12 Aug 2003 11:02:01 -0700 User-Agent: KMail/1.4.3 Cc: pgsql-performance@postgresql.org References: <20030812023504.27034.qmail@web15106.mail.bjs.yahoo.com> <3F392339.5000007@travelamericas.com> In-Reply-To: <3F392339.5000007@travelamericas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200308121102.01961.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/211 X-Sequence-Number: 3028 Xin, > I would recomment trying to take a close look at many of the posts on > the Performance list (searching the archives) and paying attention to > things such as effective_cache_size and shared_buffers. If these don't > answer your questions, ask this list again. Also see these articles: http://www.varlena.com/varlena/GeneralBits/Tidbits/perf.html http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.html -- Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Tue Aug 12 15:42: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 689D3D1C4DB for ; Tue, 12 Aug 2003 18:39: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 02216-06 for ; Tue, 12 Aug 2003 15:37:57 -0300 (ADT) Received: from mta6.adelphia.net (mta6.adelphia.net [64.8.50.190]) by svr1.postgresql.org (Postfix) with ESMTP id 3C021D1C4CD for ; Tue, 12 Aug 2003 15:39:19 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta6.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030812183920.FORR8257.mta6.adelphia.net@potentialtech.com> for ; Tue, 12 Aug 2003 14:39:20 -0400 Message-ID: <3F393457.1020003@potentialtech.com> Date: Tue, 12 Aug 2003 14:39:19 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 Cc: PgSQL Performance ML Subject: Re: Perfomance Tuning References: <184401c3606b$c7459860$2800a8c0@mars> <3F38D9DE.20174.1E36D1C5@localhost> In-Reply-To: <3F38D9DE.20174.1E36D1C5@localhost> 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: 200308/215 X-Sequence-Number: 3032 Shridhar Daithankar wrote: > On 11 Aug 2003 at 23:42, Ron Johnson wrote: > > >>On Mon, 2003-08-11 at 19:50, Christopher Kings-Lynne wrote: >> >>>>Well, yeah. But given the Linux propensity for introducing major >>>>features in "minor" releases (and thereby introducing all the >>>>attendant bugs), I'd think twice about using _any_ Linux feature >>>>until it's been through a major version (e.g. things introduced in >>>>2.4.x won't really be stable until 2.6.x) -- and even there one is >>>>taking a risk[1]. >>> >>>Dudes, seriously - switch to FreeBSD :P >> >>But, like, we want a *good* OS... 8-0 > > > Joke aside, I guess since postgresql is pretty much reliant on file system for > basic file functionality, I guess it's time to test Linux 2.6 and compare it. > > And don't forget, for large databases, there is still XFS out there which is > probably the ruler at upper end.. This is going to push the whole thing a little off-topic, but I'm curious to know the answer. Has it ever been proposed or attemped to run PostgreSQL without any filesystem (or any other database for that matter ...). Meaning ... just tell it a raw partition to keep the data on and Postgre would create its own "filesystem" ... obviously, doing that would allow Postgre to bypass all the failings of all filesystems and rely entirely apon its own rules. Or are modern filesystems advanced enough that doing something like that would lose more than it would gain? Just thinking out loud. -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Tue Aug 12 15:41:20 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 D8D60D1C4BA for ; Tue, 12 Aug 2003 18:40:15 +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 02708-04 for ; Tue, 12 Aug 2003 15:38:42 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id C1772D1B561 for ; Tue, 12 Aug 2003 15:40:03 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7CIdtF07858; Tue, 12 Aug 2003 14:39:55 -0400 (EDT) From: Bruce Momjian Message-Id: <200308121839.h7CIdtF07858@candle.pha.pa.us> Subject: Re: Perfomance Tuning In-Reply-To: <20030812050809.GC76772@home.samurai.com> To: Neil Conway Date: Tue, 12 Aug 2003 14:39:55 -0400 (EDT) Cc: Reece Hart , "pgsql-performance@postgresql.org" X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/214 X-Sequence-Number: 3031 OK, I got some hard evidence. Here is a discussion on the Linux kernel mailing list with postings from Allen Cox (ac Linux kernels) and Stephen Tweedie (ext3 author). http://www.tux.org/hypermail/linux-kernel/1999week14/subject.html#start Search for "softupdates and ext2". Here is the original email in the thread: http://www.tux.org/hypermail/linux-kernel/1999week14/0498.html Summary is at: http://www.tux.org/hypermail/linux-kernel/1999week14/0571.html and conclusion in: http://www.tux.org/hypermail/linux-kernel/1999week14/0504.html I now remember the issue --- ext2 makes all disk changes asynchonously (unless you mount it via sync, which is slow). This means that the file system isn't always consistent on disk. UFS has always sync metadata (file/directory creation) to the disk so the disk was always consistent, but doesn't sync the data to the disk, for performance reasons. With soft updates, the metadata writes are delayed, and written to disk in an order that keeps the file system consistent. Is this enough evidence, or should I keep researching? --------------------------------------------------------------------------- Neil Conway wrote: > On Tue, Aug 12, 2003 at 12:52:46AM -0400, Bruce Momjian wrote: > I don't use Linux and was just repeating what I had heard from others, > > and read in postings. I don't have any first-hand experience with ext2 > > (except for a laptop I borrowed that wouldn't boot after being shut > > off), but others on this mailing list have said the same thing. > > Right, and I understand the need to answer users asking about > which filesystem to use, but I'd be cautious of bad-mouthing > another OSS project without any hard evidence to back up our > claim (of course if we have such evidence, then fine -- I > just haven't seen it). It would be like $SOME_LARGE_OSS > project saying "Don't use our project with PostgreSQL, as > foo@bar.org had data corruption with PostgreSQL 6.3 on > UnixWare" -- kind of annoying, right? > > > > (a) ext3 does metadata-only journalling by default > > > > If that is true, why was I told people have to mount their ext3 file > > systems with metadata-only. Again, I have no experience myself, but why > > are people telling me this? > > Perhaps they were suggesting that people mount ext2 using > data=writeback, rather than the default of data=ordered. > > BTW, I've heard from a couple different people that using > ext3 with data=journalled (i.e. enabling journalling of both > data and metadata) actually makes PostgreSQL faster, as > it means that ext3 can skip PostgreSQL's fsync request > since ext3's log is flushed to disk already. I haven't > tested this myself, however. > > -Neil > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Tue Aug 12 15:55:49 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 247B0D1C4D0 for ; Tue, 12 Aug 2003 18:55:49 +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 02301-09 for ; Tue, 12 Aug 2003 15:54:16 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 50BD1D1B4E2 for ; Tue, 12 Aug 2003 15:55:38 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19meJ1-0007PX-00 for ; Tue, 12 Aug 2003 14:55:39 -0400 Received: by dba2 (Postfix, from userid 1019) id 7410FD0B6; Tue, 12 Aug 2003 14:55:39 -0400 (EDT) Date: Tue, 12 Aug 2003 14:55:39 -0400 From: Andrew Sullivan To: PgSQL Performance ML Subject: Re: Perfomance Tuning Message-ID: <20030812185539.GB13448@libertyrms.info> Mail-Followup-To: Andrew Sullivan , PgSQL Performance ML References: <184401c3606b$c7459860$2800a8c0@mars> <3F38D9DE.20174.1E36D1C5@localhost> <3F393457.1020003@potentialtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F393457.1020003@potentialtech.com> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/216 X-Sequence-Number: 3033 On Tue, Aug 12, 2003 at 02:39:19PM -0400, Bill Moran wrote: > Meaning ... just tell it a raw partition to keep the data on and > Postgre would create its own "filesystem" ... obviously, doing that > would allow Postgre to bypass all the failings of all filesystems > and rely entirely apon its own rules. > > Or are modern filesystems advanced enough that doing something like > that would lose more than it would gain? The latter, mostly. This has been debated repeatedly on -hackers. If you want "raw" access, then you have to implement some other kind of specialised filesystem of your own. And you have to have all sorts of nice tools to cope with the things that (for instance) fsck handles. I think the reaction of most developers has been, "Why reinvent the wheel?" A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Tue Aug 12 16:30: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 CC3CBD1B550 for ; Tue, 12 Aug 2003 19:30:52 +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 07066-05 for ; Tue, 12 Aug 2003 16:29:20 -0300 (ADT) Received: from loki.globexplorer.com (unknown [208.35.14.10]) by svr1.postgresql.org (Postfix) with ESMTP id 873DFD1B4E2 for ; Tue, 12 Aug 2003 16:30:41 -0300 (ADT) X-MIMEOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Subject: Re: Perfomance Tuning Date: Tue, 12 Aug 2003 12:30:43 -0700 Message-ID: <71E37EF6B7DCC1499CEA0316A25683280105705B@loki.globexplorer.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PERFORM] Perfomance Tuning Thread-Index: AcNhAYL2x0+rgxkpQiezI+zu1bNKBAABmDON From: "Gregory S. Williamson" To: "Bill Moran" Cc: "PgSQL Performance ML" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/217 X-Sequence-Number: 3034 FWIW, Informix can be run using a "cooked" (Unix) file for storing data or = it uses "raw" disk space and bypasses the ordinary (high level) UNIX contro= llers and does its own reads/writes. About 10 times faster and safer. Of co= urse, itmay have taken a lot of programmer time to make that solid. But the= performance gains are significant. Greg W. -----Original Message----- From: Bill Moran [mailto:wmoran@potentialtech.com] Sent: Tue 8/12/2003 11:39 AM To:=09 Cc: PgSQL Performance ML Subject: Re: [PERFORM] Perfomance Tuning Shridhar Daithankar wrote: > On 11 Aug 2003 at 23:42, Ron Johnson wrote: >=20 >=20 >>On Mon, 2003-08-11 at 19:50, Christopher Kings-Lynne wrote: >> >>>>Well, yeah. But given the Linux propensity for introducing major >>>>features in "minor" releases (and thereby introducing all the >>>>attendant bugs), I'd think twice about using _any_ Linux feature >>>>until it's been through a major version (e.g. things introduced in >>>>2.4.x won't really be stable until 2.6.x) -- and even there one is >>>>taking a risk[1]. >>> >>>Dudes, seriously - switch to FreeBSD :P >> >>But, like, we want a *good* OS... 8-0 >=20 >=20 > Joke aside, I guess since postgresql is pretty much reliant on file syste= m for=20 > basic file functionality, I guess it's time to test Linux 2.6 and compare= it. >=20 > And don't forget, for large databases, there is still XFS out there which= is=20 > probably the ruler at upper end.. This is going to push the whole thing a little off-topic, but I'm curious to know the answer. Has it ever been proposed or attemped to run PostgreSQL without any filesys= tem (or any other database for that matter ...). Meaning ... just tell it a raw partition to keep the data on and Postgre wo= uld create its own "filesystem" ... obviously, doing that would allow Postgre to bypass all the failings of all filesystems and rely entirely apon its own rules. Or are modern filesystems advanced enough that doing something like that wo= uld lose more than it would gain? Just thinking out loud. --=20 Bill Moran Potential Technologies http://www.potentialtech.com ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster From pgsql-performance-owner@postgresql.org Tue Aug 12 16:46:20 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 64917D1B550 for ; Tue, 12 Aug 2003 19:46:19 +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 04745-10 for ; Tue, 12 Aug 2003 16:44:46 -0300 (ADT) Received: from perrin.int.nxad.com (internal.ext.nxad.com [69.1.70.251]) by svr1.postgresql.org (Postfix) with ESMTP id 9C8C2D1B4E2 for ; Tue, 12 Aug 2003 16:46:08 -0300 (ADT) Received: by perrin.int.nxad.com (Postfix, from userid 1001) id 8616E20F01; Tue, 12 Aug 2003 12:46:09 -0700 (PDT) Date: Tue, 12 Aug 2003 12:46:09 -0700 From: Sean Chittenden To: "scott.marlowe" Cc: Christopher Kings-Lynne , Andrew Sullivan , pgsql-performance@postgresql.org Subject: Re: Perfomance Tuning Message-ID: <20030812194609.GC82366@perrin.int.nxad.com> References: <184401c3606b$c7459860$2800a8c0@mars> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/218 X-Sequence-Number: 3035 > > > Well, yeah. But given the Linux propensity for introducing major > > > features in "minor" releases (and thereby introducing all the > > > attendant bugs), I'd think twice about using _any_ Linux feature > > > until it's been through a major version (e.g. things introduced in > > > 2.4.x won't really be stable until 2.6.x) -- and even there one is > > > taking a risk[1]. > > > > Dudes, seriously - switch to FreeBSD :P > > Yeah, it's nice to have a BUG FREE OS huh? ;^) > > And yes, I've used FreeBSD, it's quite good, but I kept getting the > feeling it wasn't quite done. Especially the installation > documentation. While the handbook isn't the same as reading the actual source or the only FreeBSD documentation, it certainly is quite good (to the point that publishers see small market to publish FreeBSD books because the documentation provided by the project is so good), IMHO. http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ If anyone on this list has any issues with the documentation, please take them up with me _privately_ and I will do my best to either address or correct the problem. Now, back to our regularly scheduled and on topic programming... -sc -- Sean Chittenden "(PostgreSQL|FreeBSD).org - The Power To Serve" From pgsql-performance-owner@postgresql.org Tue Aug 12 17:11:04 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 DFF1ED1B53A for ; Tue, 12 Aug 2003 20:10:49 +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 07041-08 for ; Tue, 12 Aug 2003 17:09:17 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id D9B88D1C4D5 for ; Tue, 12 Aug 2003 17:10:38 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3506609; Tue, 12 Aug 2003 13:11:03 -0700 Content-Type: text/plain; charset="windows-1252" From: Josh Berkus Organization: Aglio Database Solutions To: "Gregory S. Williamson" , "Bill Moran" Subject: Re: Filesystems WAS: Perfomance Tuning Date: Tue, 12 Aug 2003 13:09:42 -0700 User-Agent: KMail/1.4.3 Cc: "PgSQL Performance ML" References: <71E37EF6B7DCC1499CEA0316A25683280105705B@loki.globexplorer.com> In-Reply-To: <71E37EF6B7DCC1499CEA0316A25683280105705B@loki.globexplorer.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200308121309.42169.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/219 X-Sequence-Number: 3036 Greg, > FWIW, Informix can be run using a "cooked" (Unix) file for storing data or > it uses "raw" disk space and bypasses the ordinary (high level) UNIX > controllers and does its own reads/writes. About 10 times faster and safer. > Of course, itmay have taken a lot of programmer time to make that solid. > But the performance gains are significant. Yes, but it's still slower than PostgreSQL on medium-end hardware. ;-) This idea has been discussed numerous times on the HACKERS list, and is a (pretty much) closed issue. While Oracle and SQL Server use their own filesystems, PostgreSQL will not because: 1) It would interfere with our cross-platform compatibility. PostgreSQL runs on something like 20 OSes. 2) The filesystem projects out there are (mostly) well-staffed and are constantly advancing using specialized technology and theory. There's no way that the PostgreSQL team can do a better job in our "spare time". 3) Development of our "own" filesystem would then require PostgreSQL to create and maintain a whole hardware compatibility library, and troubleshoot problems on exotic hardware and wierd RAID configurations. 4) A database FS also often causes side-effect problems; for example, one cannot move or copy a SQL Server partition without destroying it. Of course, that could all change if some corp with deep pockets steps in an decides to create a "postgresFS" and funds and staffs the effort 100%. But it's unlikely to be a priority for the existing development team any time in the forseeable future. -- Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Tue Aug 12 17:33: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 EF29ED1C4B8 for ; Tue, 12 Aug 2003 20:32:42 +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 07855-08 for ; Tue, 12 Aug 2003 17:31:10 -0300 (ADT) Received: from krusty-motorsports.com (krusty-motorsports.com [192.94.170.8]) by svr1.postgresql.org (Postfix) with ESMTP id 147C2D1C4CA for ; Tue, 12 Aug 2003 17:32:32 -0300 (ADT) Received: from [24.194.112.77] (helo=skipper.averillpark.net) by krusty-motorsports.com with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.14) id 19mfon-0007Zf-Rx for pgsql-performance@postgresql.org; Tue, 12 Aug 2003 20:32:33 +0000 Received: from rwelty by skipper.averillpark.net with local (Exim 4.14) id 19mfnc-0007W1-8n for pgsql-performance@postgresql.org; Tue, 12 Aug 2003 16:31:20 -0400 Date: Tue, 12 Aug 2003 16:31:19 -0400 (EDT) From: Richard Welty Subject: Re: Filesystems WAS: Perfomance Tuning To: PgSQL Performance ML MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-Disposition: INLINE References: <71E37EF6B7DCC1499CEA0316A25683280105705B@loki.globexplorer.com> <200308121309.42169.josh@agliodbs.com> In-Reply-To: <200308121309.42169.josh@agliodbs.com> X-Mailer: Mahogany 0.64 'Sparc', compiled for Linux 2.4.9-13 i686 Message-Id: X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/220 X-Sequence-Number: 3037 On Tue, 12 Aug 2003 13:09:42 -0700 Josh Berkus wrote: > This idea has been discussed numerous times on the HACKERS list, and is > a > (pretty much) closed issue. While Oracle and SQL Server use their own > filesystems, PostgreSQL will not because: ... > 2) The filesystem projects out there are (mostly) well-staffed and are > constantly advancing using specialized technology and theory. There's > no way > that the PostgreSQL team can do a better job in our "spare time". i consider this a fair answer, but i have a slightly different question to ask, inspired by my discussions with a good friend who is a top notch Informix DBA. there are advantages to being able to split the database across a slew of disk drives. if we accept the notion of using the native OS filesystem on each, it would seem that being able to direct various tables and indices to specific drives might be a valuble capability. i know that i could go into /var/lib/pgsql/data/base and fan the contents out, but this is unweildy and impractical. has any consideration been given to providing a way to manage such a deployment? or is it the judgement of the hackers community that a monsterous raid-10 array offers comparable performance? i forget how large the data store on my friend's current project is, but i'll check. knowing the size and transaction rate he's dealing with might put a finer point on this discussion. richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Java, PHP, PostgreSQL, Unix, Linux, IP Network Engineering, Security From pgsql-performance-owner@postgresql.org Tue Aug 12 17:40:31 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 5AEB0D1B53A for ; Tue, 12 Aug 2003 20:40:31 +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 12617-03 for ; Tue, 12 Aug 2003 17:38:59 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 51F15D1B56C for ; Tue, 12 Aug 2003 17:40:20 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19mfwM-0000mT-00 for ; Tue, 12 Aug 2003 16:40:22 -0400 Received: by dba2 (Postfix, from userid 1019) id 4A4B4D0C4; Tue, 12 Aug 2003 16:40:22 -0400 (EDT) Date: Tue, 12 Aug 2003 16:40:22 -0400 From: Andrew Sullivan To: PgSQL Performance ML Subject: Re: Filesystems WAS: Perfomance Tuning Message-ID: <20030812204022.GJ13448@libertyrms.info> Mail-Followup-To: Andrew Sullivan , PgSQL Performance ML References: <71E37EF6B7DCC1499CEA0316A25683280105705B@loki.globexplorer.com> <200308121309.42169.josh@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/221 X-Sequence-Number: 3038 On Tue, Aug 12, 2003 at 04:31:19PM -0400, Richard Welty wrote: > impractical. has any consideration been given to providing a way to manage > such a deployment? Plenty. No-one's completed an implementation yet. > or is it the judgement of the hackers community that a monsterous raid-10 > array offers comparable performance? It's tough to say, but I _can_ tell you that, so far in my tests, I've never been able to prove an advantage in separating even the WAL on a Sun A5200. That's not a result yet, of course, just a bit of gossip. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Tue Aug 12 17:43:33 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 75E39D1C4B8 for ; Tue, 12 Aug 2003 20:40:58 +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 09826-07 for ; Tue, 12 Aug 2003 17:39:26 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id B0B2FD1B53A for ; Tue, 12 Aug 2003 17:40:47 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 228421024D; Tue, 12 Aug 2003 16:33:12 -0400 (EDT) Received: from [10.0.2.6] (unknown [10.0.2.6]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 9D0E810248; Tue, 12 Aug 2003 16:33:09 -0400 (EDT) Subject: Re: Filesystems WAS: Perfomance Tuning From: Rod Taylor To: Richard Welty Cc: PgSQL Performance ML In-Reply-To: References: <71E37EF6B7DCC1499CEA0316A25683280105705B@loki.globexplorer.com> <200308121309.42169.josh@agliodbs.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-0YNb9Wokr6KuaDgwG8iU" Message-Id: <1060720839.83667.55.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Tue, 12 Aug 2003 16:40:40 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/222 X-Sequence-Number: 3039 --=-0YNb9Wokr6KuaDgwG8iU Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > specific drives might be a valuble capability. i know that i could go into > /var/lib/pgsql/data/base and fan the contents out, but this is unweildy a= nd > impractical. has any consideration been given to providing a way to manage > such a deployment? The ability to take various database objects and store them in different locations, sometimes referred to as table spaces, will probably be done in the future. There was a substantial group not all that long ago that was organizing to complete the implementation. > or is it the judgement of the hackers community that a monsterous raid-10 > array offers comparable performance? Often performs well enough... But a raid-10 for data, a stripe for indexes, and a mirror for WAL will offer better performance :) --=-0YNb9Wokr6KuaDgwG8iU Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQA/OVDH6DETLow6vwwRAoA+AJ4x2flyqEi5CgjQiXcfg3Ng4t+5YQCfWrxA x0+BaI1OjfZmPMpK4/d+Lgg= =5Cas -----END PGP SIGNATURE----- --=-0YNb9Wokr6KuaDgwG8iU-- From pgsql-performance-owner@postgresql.org Wed Aug 13 08:54: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 D8C66D1B524 for ; Wed, 13 Aug 2003 11:49:12 +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 03807-10 for ; Wed, 13 Aug 2003 08:47:40 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 44AD4D1B52C for ; Wed, 13 Aug 2003 08:49:02 -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 h7DBn1ek062961 for ; Wed, 13 Aug 2003 11:49:02 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7DBRS2c057845 for pgsql-performance@postgresql.org; Wed, 13 Aug 2003 11:27:28 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Perfomance Tuning Date: Tue, 12 Aug 2003 17:43:29 -0400 Organization: cbbrowne Computing Inc Lines: 33 Message-ID: References: <71E37EF6B7DCC1499CEA0316A25683280105705B@loki.globexplorer.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne X-Emacs-Acronym: Embarrassingly Mundane Advertising Cuts Sales Microsoft: We've got the solution for the problem we sold you. X-Uboat-Death-Message: NETSCAPE. ATTACKED. LEAVE BOAT. U-86. User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:2WRqMdi41uN5e2llTBmEpO2bSn8= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/231 X-Sequence-Number: 3048 Martha Stewart called it a Good Thing whengsw@globexplorer.com ("Gregory S. Williamson")wrote: > FWIW, Informix can be run using a "cooked" (Unix) file for storing > data or it uses "raw" disk space and bypasses the ordinary (high > level) UNIX controllers and does its own reads/writes. About 10 > times faster and safer. Of course, itmay have taken a lot of > programmer time to make that solid. But the performance gains are > significant. Are you _certain_ that's still true? Have you a metric that shows Informix being 10x faster on a modern system? That would be quite surprising... It may have been true on '80s style UFS implementations, but a couple of decades have passed, and pretty much any Unix system has new selections of filesystems that probably aren't so much slower. It could conceivably be an interesting idea to implement a block-oriented filesystem where the granularity of files was 8K (or some such number :-)). Oracle seems to have done something vaguely like this... http://otn.oracle.com/tech/linux/open_source.html But long and short is that the guys implementing OSes have been putting a LOT of effort into making the potential performance gains of using "raw" partitions less and less. -- select 'cbbrowne' || '@' || 'acm.org'; http://www.ntlug.org/~cbbrowne/sap.html (eq? 'truth 'beauty) ; to avoid unassigned-var error, since compiled code ; will pick up previous value to var set!-ed, ; the unassigned object. -- from BBN-CL's cl-parser.scm From pgsql-performance-owner@postgresql.org Tue Aug 12 22:40:45 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 9F844D1C4B8 for ; Wed, 13 Aug 2003 01:40: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 40253-05 for ; Tue, 12 Aug 2003 22:39:14 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id CB080D1B53A for ; Tue, 12 Aug 2003 22:40:32 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h7D1eNLt021506; Wed, 13 Aug 2003 09:40:24 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <1da301c3613c$f8716960$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "Richard Welty" , "PgSQL Performance ML" References: <71E37EF6B7DCC1499CEA0316A25683280105705B@loki.globexplorer.com> <200308121309.42169.josh@agliodbs.com> Subject: Re: Filesystems WAS: Perfomance Tuning Date: Wed, 13 Aug 2003 09:48:18 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/223 X-Sequence-Number: 3040 > there are advantages to being able to split the database across a slew of > disk drives. if we accept the notion of using the native OS filesystem on > each, it would seem that being able to direct various tables and indices to > specific drives might be a valuble capability. i know that i could go into > /var/lib/pgsql/data/base and fan the contents out, but this is unweildy and > impractical. has any consideration been given to providing a way to manage > such a deployment? We've got a little bunch of us tinkering with a tablespace implementation. However, it's been staller for a while now. Chris From pgsql-performance-owner@postgresql.org Tue Aug 12 22:53:32 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 B07A1D1B539 for ; Wed, 13 Aug 2003 01:53:31 +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 47000-05 for ; Tue, 12 Aug 2003 22:52:01 -0300 (ADT) Received: from krusty-motorsports.com (krusty-motorsports.com [192.94.170.8]) by svr1.postgresql.org (Postfix) with ESMTP id 01225D1B53A for ; Tue, 12 Aug 2003 22:53:21 -0300 (ADT) Received: from [24.194.112.77] (helo=skipper.averillpark.net) by krusty-motorsports.com with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.14) id 19mkpJ-0004Pj-9g for pgsql-performance@postgresql.org; Wed, 13 Aug 2003 01:53:25 +0000 Received: from rwelty by skipper.averillpark.net with local (Exim 4.14) id 19mkom-0007xX-Gt for pgsql-performance@postgresql.org; Tue, 12 Aug 2003 21:52:52 -0400 Date: Tue, 12 Aug 2003 21:52:52 -0400 (EDT) From: Richard Welty Subject: Re: Filesystems WAS: Perfomance Tuning To: PgSQL Performance ML MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-Disposition: INLINE References: <71E37EF6B7DCC1499CEA0316A25683280105705B@loki.globexplorer.com> <200308121309.42169.josh@agliodbs.com> <1da301c3613c$f8716960$2800a8c0@mars> In-Reply-To: <1da301c3613c$f8716960$2800a8c0@mars> X-Mailer: Mahogany 0.64 'Sparc', compiled for Linux 2.4.9-13 i686 Message-Id: X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/224 X-Sequence-Number: 3041 On Wed, 13 Aug 2003 09:48:18 +0800 Christopher Kings-Lynne wrote: > We've got a little bunch of us tinkering with a tablespace > implementation. > However, it's been staller for a while now. interesting. i'm involved in the very early stages of a startup that is likely to do a prototype using Java and PostgreSQL. tablespace and replication are issues that would weigh heavily in a decision to stick with PostgreSQL after the prototype. richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Java, PHP, PostgreSQL, Unix, Linux, IP Network Engineering, Security From pgsql-performance-owner@postgresql.org Tue Aug 12 22:54: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 6952CD1B539 for ; Wed, 13 Aug 2003 01:53:58 +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 38842-07 for ; Tue, 12 Aug 2003 22:52:27 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 266D1D1C47A for ; Tue, 12 Aug 2003 22:53:46 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7D1rOL15727; Tue, 12 Aug 2003 21:53:24 -0400 (EDT) From: Bruce Momjian Message-Id: <200308130153.h7D1rOL15727@candle.pha.pa.us> Subject: Re: Filesystems WAS: Perfomance Tuning In-Reply-To: <1da301c3613c$f8716960$2800a8c0@mars> To: Christopher Kings-Lynne Date: Tue, 12 Aug 2003 21:53:24 -0400 (EDT) Cc: Richard Welty , PgSQL Performance ML , swm@linuxworld.com.au X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/225 X-Sequence-Number: 3042 I think Gavin Sherry is working on this. I am CC'ing him. --------------------------------------------------------------------------- Christopher Kings-Lynne wrote: > > there are advantages to being able to split the database across a slew of > > disk drives. if we accept the notion of using the native OS filesystem on > > each, it would seem that being able to direct various tables and indices > to > > specific drives might be a valuble capability. i know that i could go into > > /var/lib/pgsql/data/base and fan the contents out, but this is unweildy > and > > impractical. has any consideration been given to providing a way to manage > > such a deployment? > > We've got a little bunch of us tinkering with a tablespace implementation. > However, it's been staller for a while now. > > Chris > > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Tue Aug 12 23:14: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 1F573D1C4BA for ; Wed, 13 Aug 2003 02:08:33 +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 39124-08 for ; Tue, 12 Aug 2003 23:07:02 -0300 (ADT) Received: from linuxworld.com.au (www.linuxworld.com.au [203.34.46.50]) by svr1.postgresql.org (Postfix) with ESMTP id 207A5D1B539 for ; Tue, 12 Aug 2003 23:08:21 -0300 (ADT) Received: from localhost (swm@localhost) by linuxworld.com.au (8.11.6p2/8.11.4) with ESMTP id h7D27mx32570; Wed, 13 Aug 2003 12:07:48 +1000 Date: Wed, 13 Aug 2003 12:07:47 +1000 (EST) From: Gavin Sherry To: Bruce Momjian Cc: Christopher Kings-Lynne , Richard Welty , PgSQL Performance ML Subject: Re: Filesystems WAS: Perfomance Tuning In-Reply-To: <200308130153.h7D1rOL15727@candle.pha.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/226 X-Sequence-Number: 3043 On Tue, 12 Aug 2003, Bruce Momjian wrote: > > I think Gavin Sherry is working on this. I am CC'ing him. > > --------------------------------------------------------------------------- Yes I am working on this. I am about 50% of the way through the patch but have been held up with other work. For those who are interested, it basically allow: 1) creation of different 'storage' locations. Tables and indexes can be created in different storage locations. Storage locations can also be assigned to schemas and databases. Tables and indexes will default to the schema storage location if STORAGE 'store name' is not provided to CREATE .... This will cascade to the default database storage location if the schema was not created with STORAGE 'store name'. 2) the patch will allow different storage locations to have different rand_cost parameters passed to the planner. 3) the patch *will not* address issues concerning quotas, resource management, WAL/clog, temp or sort spaces. Will keep everyone posted if/when I finish. Thanks, Gavin From pgsql-performance-owner@postgresql.org Wed Aug 13 03:13:58 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id AFAAFD1C47A for ; Wed, 13 Aug 2003 06:13: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 77460-08 for ; Wed, 13 Aug 2003 03:12:16 -0300 (ADT) Received: from lakemtai09.cox.net (lakemtai09.cox.net [68.1.17.123]) by svr1.postgresql.org (Postfix) with ESMTP id E631DD1C4C7 for ; Wed, 13 Aug 2003 03:13:39 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao03.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030813033038.JZTS23518.lakemtao03.cox.net@lhosts> for ; Tue, 12 Aug 2003 23:30:38 -0400 Subject: Re: Perfomance Tuning From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <200308121839.h7CIdtF07858@candle.pha.pa.us> References: <200308121839.h7CIdtF07858@candle.pha.pa.us> Content-Type: text/plain Message-Id: <1060745432.30778.39.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 12 Aug 2003 22:30:33 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/227 X-Sequence-Number: 3044 On Tue, 2003-08-12 at 13:39, Bruce Momjian wrote: > OK, I got some hard evidence. Here is a discussion on the Linux kernel > mailing list with postings from Allen Cox (ac Linux kernels) and Stephen > Tweedie (ext3 author). > > http://www.tux.org/hypermail/linux-kernel/1999week14/subject.html#start > > Search for "softupdates and ext2". > > Here is the original email in the thread: > > http://www.tux.org/hypermail/linux-kernel/1999week14/0498.html > > Summary is at: > > http://www.tux.org/hypermail/linux-kernel/1999week14/0571.html > > and conclusion in: > > http://www.tux.org/hypermail/linux-kernel/1999week14/0504.html > > I now remember the issue --- ext2 makes all disk changes asynchonously > (unless you mount it via sync, which is slow). This means that the file > system isn't always consistent on disk. > > UFS has always sync metadata (file/directory creation) to the disk so > the disk was always consistent, but doesn't sync the data to the disk, > for performance reasons. With soft updates, the metadata writes are > delayed, and written to disk in an order that keeps the file system > consistent. > > Is this enough evidence, or should I keep researching? This is all 4 years old, though. Isn't that why the ext3 "layer" was created, and filesystems like reiserFS, XFS and (kinda) JFS were added to Linux? > --------------------------------------------------------------------------- > > Neil Conway wrote: > > On Tue, Aug 12, 2003 at 12:52:46AM -0400, Bruce Momjian wrote: > > I don't use Linux and was just repeating what I had heard from others, > > > and read in postings. I don't have any first-hand experience with ext2 > > > (except for a laptop I borrowed that wouldn't boot after being shut > > > off), but others on this mailing list have said the same thing. > > > > Right, and I understand the need to answer users asking about > > which filesystem to use, but I'd be cautious of bad-mouthing > > another OSS project without any hard evidence to back up our > > claim (of course if we have such evidence, then fine -- I > > just haven't seen it). It would be like $SOME_LARGE_OSS > > project saying "Don't use our project with PostgreSQL, as > > foo@bar.org had data corruption with PostgreSQL 6.3 on > > UnixWare" -- kind of annoying, right? > > > > > > (a) ext3 does metadata-only journalling by default > > > > > > If that is true, why was I told people have to mount their ext3 file > > > systems with metadata-only. Again, I have no experience myself, but why > > > are people telling me this? > > > > Perhaps they were suggesting that people mount ext2 using > > data=writeback, rather than the default of data=ordered. > > > > BTW, I've heard from a couple different people that using > > ext3 with data=journalled (i.e. enabling journalling of both > > data and metadata) actually makes PostgreSQL faster, as > > it means that ext3 can skip PostgreSQL's fsync request > > since ext3's log is flushed to disk already. I haven't > > tested this myself, however. > > > > -Neil -- +---------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "Man, I'm pretty. Hoo Hah!" | | Johnny Bravo | +---------------------------------------------------------------+ From pgsql-performance-owner@postgresql.org Wed Aug 13 03: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 63242D1C4C7 for ; Wed, 13 Aug 2003 06:30:42 +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 80395-04 for ; Wed, 13 Aug 2003 03:29:05 -0300 (ADT) Received: from zigo.dhs.org (as2-4-3.an.g.bonet.se [194.236.34.191]) by svr1.postgresql.org (Postfix) with ESMTP id 14A7ED1C4B8 for ; Wed, 13 Aug 2003 03:30:28 -0300 (ADT) Received: from zigo.dhs.org (zigo [127.0.0.1]) by zigo.dhs.org (8.12.8/8.12.8) with ESMTP id h7D6UEMG009145; Wed, 13 Aug 2003 08:30:14 +0200 Received: from localhost (db@localhost) by zigo.dhs.org (8.12.8/8.12.8/Submit) with ESMTP id h7D6UC9t009141; Wed, 13 Aug 2003 08:30:14 +0200 Date: Wed, 13 Aug 2003 08:30:12 +0200 (CEST) From: =?ISO-8859-1?Q?Dennis_Bj=F6rklund?= To: mixo Cc: Bjoern Metzdorf , Subject: Re: Perfomance Tuning In-Reply-To: <3F389449.8050305@coza.net.za> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/228 X-Sequence-Number: 3045 On Tue, 12 Aug 2003, mixo wrote: > that I am currently importing data into Pg which is about 2.9 Gigs. > Unfortunately, to maintain data intergrity, data is inserted into a table > one row at a time.' So you don't put a number of inserts into one transaction? If you don't do that then postgresql will treat each command as a transaction and each insert is going to be forced out on disk (returning when the data is just in some cache is not safe even if other products might do that). If you don't do this then the server promise the client that the row have been stored but then the server goes down and the row that was in the cache is lost. It's much faster but not what you expect from a real database. So, group the inserts in transactions with maybe 1000 commands each. It will go much faster. It can then cache the rows and in the end just make sure all 1000 have been written out on disk. There is also a configuration variable that can tell postgresql to not wait until the insert is out on disk, but that is not recomended if you value your data. And last, why does it help integrity to insert data one row at a time? -- /Dennis From pgsql-performance-owner@postgresql.org Wed Aug 13 03:39:28 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 D9C68D1C4B8 for ; Wed, 13 Aug 2003 06:39:24 +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 77730-09 for ; Wed, 13 Aug 2003 03:37:48 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id BF3D3D1C47A for ; Wed, 13 Aug 2003 03:39:10 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h7D6cwLt028010; Wed, 13 Aug 2003 14:38:58 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <1f8901c36166$b50cf6b0$2800a8c0@mars> From: "Christopher Kings-Lynne" To: =?iso-8859-1?Q?Dennis_Bj=F6rklund?= , "mixo" Cc: "Bjoern Metzdorf" , References: Subject: Re: Perfomance Tuning Date: Wed, 13 Aug 2003 14:47:03 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/229 X-Sequence-Number: 3046 > So, group the inserts in transactions with maybe 1000 commands each. It > will go much faster. It can then cache the rows and in the end just make > sure all 1000 have been written out on disk. More than that, he should be using COPY - it's 10x faster than even grouped inserts. Chris From pgsql-performance-owner@postgresql.org Wed Aug 13 07:33:57 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 2EAD0D1C4CD for ; Wed, 13 Aug 2003 10:33:56 +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 00314-07 for ; Wed, 13 Aug 2003 07:32:23 -0300 (ADT) Received: from lakemtao01.cox.net (lakemtao01.cox.net [68.1.17.244]) by svr1.postgresql.org (Postfix) with ESMTP id 3A999D1C4CA for ; Wed, 13 Aug 2003 07:33:45 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao01.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030813103348.CILA7142.lakemtao01.cox.net@lhosts> for ; Wed, 13 Aug 2003 06:33:48 -0400 Subject: Re: Perfomance Tuning From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <1f8901c36166$b50cf6b0$2800a8c0@mars> References: <1f8901c36166$b50cf6b0$2800a8c0@mars> Content-Type: text/plain Message-Id: <1060770827.30778.130.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 13 Aug 2003 05:33:47 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/230 X-Sequence-Number: 3047 On Wed, 2003-08-13 at 01:47, Christopher Kings-Lynne wrote: > > So, group the inserts in transactions with maybe 1000 commands each. It > > will go much faster. It can then cache the rows and in the end just make > > sure all 1000 have been written out on disk. > > More than that, he should be using COPY - it's 10x faster than even grouped > inserts. I have a table which has a foreign key reference to a properly indexed table, and needed to load 15GB of uncompressed data into that table. Since the machine is minimal (60GB 5400RPM IDE HDD, 1GB RAM, 1GHz Athlon), to save precious disk space, I had the data compressed into 22 files totaling 641GiB. The records are approximately 275 bytes in size. Also, because date transformations needed to be made, I had to 1st insert into a temp table, and insert from there into the main table. Thus, in essence, I had to insert each record twice. So, in 8:45 (not 8 minutes 45 seconds!, decompressed 641MiB worth of 96% compressed files, inserted 30M rows, and inserted 30M rows again, while doing foreign key checks to another table. And the data files plus database are all on the same disk. Pretty impressive: 1,920 inserts/second. for f in ltx_*unl.gz; do psql test1 -c "truncate table t_lane_tx2;" ; (zcat $f | sed "s/\"//g" | \ psql test1 -c "copy t_lane_tx2 from stdin delimiter ',';"); time psql -a -f sel_into_ltx.sql -d test1 ; done -- +---------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "Man, I'm pretty. Hoo Hah!" | | Johnny Bravo | +---------------------------------------------------------------+ From pgsql-performance-owner@postgresql.org Wed Aug 13 10:56:03 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 B7327D1C4C8 for ; Wed, 13 Aug 2003 13:55:58 +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 25549-05 for ; Wed, 13 Aug 2003 10:54:26 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id 2FF7AD1B524 for ; Wed, 13 Aug 2003 10:55:47 -0300 (ADT) Received: (qmail 15525 invoked from network); 13 Aug 2003 13:55:54 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 13 Aug 2003 13:55:54 -0000 Date: Wed, 13 Aug 2003 09:55:53 -0400 (EDT) From: Jeff To: Christopher Browne Cc: "pgsql-performance@postgresql.org" Subject: Re: Perfomance Tuning In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/232 X-Sequence-Number: 3049 On Tue, 12 Aug 2003, Christopher Browne wrote: > Are you _certain_ that's still true? Have you a metric that shows > Informix being 10x faster on a modern system? That would be quite > surprising... > We were forced (for budget reason) to switch from raw disk to cooked files on our informix db. We took a huge hit - about 5-6x slower. Granted part of that was because informix takes number of spindles, etc into account when generating query plans and the fact running UPDATE STATISTICS (think Vacuum analyze) on the version we run locks the table exclusively. And it is unacceptable to have our "main table" unavailable for hours and hours while the update runs. (For the record: its a 8cpu sun e4500 running sol2.6. The raw disks were on a hitachi fibre array and the cooked files were on a raid5 (scsi). Forget how many spindles in the raid. There were 20 raw disks) Informix, etc. have spent a lot of time and money working on it. They also have the advantage of having many paid fulltime developers who are doing this for a job, not as a weekend hobby (Compared to the what? 2-3 full time PG developers). The other advantage (which I hinted to above) with raw disks is being able to optimize queries to take advantage of it. Informix is multithreaded and it will spawn off multiple "readers" to do say, a seq scan (and merge the results at the end). So if you have a table across say, 3 disks and you need to do a seq scan it will spawn three readers to do the read. Result: nice and fast (Yes, It may not always spawn the three readers, only when it thinks it will be a good thing to do) I think for PG the effort would be much better spent on other features... like replication and whatnot. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Wed Aug 13 11:04:38 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 0FD85D1C4C8 for ; Wed, 13 Aug 2003 14:04:37 +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 16330-10 for ; Wed, 13 Aug 2003 11:03:04 -0300 (ADT) Received: from correo (correo.qoslabs.com [157.238.87.78]) by svr1.postgresql.org (Postfix) with ESMTP id AC7F9D1C4B8 for ; Wed, 13 Aug 2003 11:04:21 -0300 (ADT) Received: from ldap-02.qoslabs.com (ldap-02 [172.20.1.31]) by correo-01.qoslabs.com (iPlanet Messaging Server 5.2 Patch 1 (built Aug 19 2002)) with SMTP id <0HJK007NA9RARH@correo-01.qoslabs.com> for pgsql-performance@postgresql.org; Wed, 13 Aug 2003 10:04:22 -0400 (EDT) Received: (from ingridmartinez [148.233.235.189]) by ldap-02.qoslabs.com (NAVGW 2.5.2.12) with SMTP id M2003081310042003352 for ; Wed, 13 Aug 2003 10:04:20 -0400 Date: Wed, 13 Aug 2003 09:03:31 -0500 From: ingrid martinez Subject: How can I Improve performance in Solaris? To: pgsql-performance@postgresql.org Message-id: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Mailer: Microsoft Outlook Express 6.00.2800.1158 Content-type: multipart/alternative; boundary="Boundary_(ID_YgqVKM6e27aF0YmARNpKMw)" X-Priority: 3 X-MSMail-priority: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=HTML_60_70 X-Spam-Level: X-Archive-Number: 200308/233 X-Sequence-Number: 3050 This is a multi-part message in MIME format. --Boundary_(ID_YgqVKM6e27aF0YmARNpKMw) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT I want to know, how can I improve the performance of postgres, I have a java class thar inserts register every 30 min but is very slow. The process of postgres consume the 78% of CPU. I have in /etc/system set shmsys:shminfo_shmmax=0x50000000 set shmsys:shminfo_shmmni=0x100 set shmsys:shminfo_shmseg=0x10 Thanks Ingrid --Boundary_(ID_YgqVKM6e27aF0YmARNpKMw) Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: 7BIT
I want to know, how can I improve the performance of postgres, I have a java class thar inserts register every 30 min but is very slow.
The process of postgres consume the 78% of CPU.
 
I have in /etc/system
 

set shmsys:shminfo_shmmax=0x50000000
set shmsys:shminfo_shmmni=0x100
set shmsys:shminfo_shmseg=0x10

 

Thanks

Ingrid

--Boundary_(ID_YgqVKM6e27aF0YmARNpKMw)-- From pgsql-performance-owner@postgresql.org Wed Aug 13 11:33: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 3BD9ED1C4B8 for ; Wed, 13 Aug 2003 14:33: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 25564-08 for ; Wed, 13 Aug 2003 11:31:33 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 86029D1B56B for ; Wed, 13 Aug 2003 11:32:53 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19mwgM-0007Xp-00 for ; Wed, 13 Aug 2003 10:32:58 -0400 Received: by dba2 (Postfix, from userid 1019) id 666DACF50; Wed, 13 Aug 2003 10:32:58 -0400 (EDT) Date: Wed, 13 Aug 2003 10:32:58 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: How can I Improve performance in Solaris? Message-ID: <20030813143258.GC15743@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/234 X-Sequence-Number: 3051 On Wed, Aug 13, 2003 at 09:03:31AM -0500, ingrid martinez wrote: > I want to know, how can I improve the performance of postgres, I > have a java class thar inserts register every 30 min but is very > slow. What does the query do? How is postgres configured? A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Wed Aug 13 11:44:25 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 1AB1FD1C4B8 for ; Wed, 13 Aug 2003 14:44: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 27804-05 for ; Wed, 13 Aug 2003 11:42:44 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 6CF83D1B56B for ; Wed, 13 Aug 2003 11:44:05 -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 h7DEbVSa023798; Wed, 13 Aug 2003 10:37:31 -0400 (EDT) To: Jeff Cc: Christopher Browne , "pgsql-performance@postgresql.org" Subject: Re: Perfomance Tuning In-reply-to: References: Comments: In-reply-to Jeff message dated "Wed, 13 Aug 2003 09:55:53 -0400" Date: Wed, 13 Aug 2003 10:37:31 -0400 Message-ID: <23797.1060785451@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/235 X-Sequence-Number: 3052 Jeff writes: > On Tue, 12 Aug 2003, Christopher Browne wrote: >> Are you _certain_ that's still true? Have you a metric that shows >> Informix being 10x faster on a modern system? That would be quite >> surprising... > We were forced (for budget reason) to switch from raw disk to cooked files > on our informix db. We took a huge hit - about 5-6x slower. > [snip] > The raw disks were on a hitachi fibre array and the cooked files > were on a raid5 (scsi). Forget how many spindles in the raid. > There were 20 raw disks) Seems like you can't know how much of the performance hit was due to the filesystem change and how much to the hardware change. But I'd bet 20 disks on fibre array have way more net throughput than a single RAID array on scsi. regards, tom lane From pgsql-performance-owner@postgresql.org Wed Aug 13 12:16:16 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 801D8D1B56B for ; Wed, 13 Aug 2003 15:16:15 +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 31058-04 for ; Wed, 13 Aug 2003 12:14:38 -0300 (ADT) Received: from lakemtao01.cox.net (lakemtao01.cox.net [68.1.17.244]) by svr1.postgresql.org (Postfix) with ESMTP id 32091D1C4BF for ; Wed, 13 Aug 2003 12:16:04 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao01.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030813151604.EXMG7142.lakemtao01.cox.net@lhosts> for ; Wed, 13 Aug 2003 11:16:04 -0400 Subject: Re: Perfomance Tuning From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <23797.1060785451@sss.pgh.pa.us> References: <23797.1060785451@sss.pgh.pa.us> Content-Type: text/plain Message-Id: <1060787763.3996.15.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 13 Aug 2003 10:16:03 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/236 X-Sequence-Number: 3053 On Wed, 2003-08-13 at 09:37, Tom Lane wrote: > Jeff writes: > > On Tue, 12 Aug 2003, Christopher Browne wrote: > >> Are you _certain_ that's still true? Have you a metric that shows > >> Informix being 10x faster on a modern system? That would be quite > >> surprising... > > > We were forced (for budget reason) to switch from raw disk to cooked files > > on our informix db. We took a huge hit - about 5-6x slower. > > [snip] > > The raw disks were on a hitachi fibre array and the cooked files > > were on a raid5 (scsi). Forget how many spindles in the raid. > > There were 20 raw disks) > > Seems like you can't know how much of the performance hit was due to the > filesystem change and how much to the hardware change. But I'd bet 20 > disks on fibre array have way more net throughput than a single RAID > array on scsi. I wouldn't be surprised either if the fiber array had more cache than the SCSI controller. Was/is the Hitachi device a SAN? -- +---------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "Man, I'm pretty. Hoo Hah!" | | Johnny Bravo | +---------------------------------------------------------------+ From pgsql-performance-owner@postgresql.org Wed Aug 13 12:18:50 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 0FFB4D1B53A for ; Wed, 13 Aug 2003 15:18:50 +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 33323-01 for ; Wed, 13 Aug 2003 12:17:11 -0300 (ADT) Received: from correo (correo.qoslabs.com [157.238.87.78]) by svr1.postgresql.org (Postfix) with ESMTP id A976BD1C4BF for ; Wed, 13 Aug 2003 12:18:37 -0300 (ADT) Received: from ldap-02.qoslabs.com (ldap-02 [172.20.1.31]) by correo-01.qoslabs.com (iPlanet Messaging Server 5.2 Patch 1 (built Aug 19 2002)) with SMTP id <0HJK0074ZD70RH@correo-01.qoslabs.com> for pgsql-performance@postgresql.org; Wed, 13 Aug 2003 11:18:37 -0400 (EDT) Received: (from ingridmartinez [148.233.235.189]) by ldap-02.qoslabs.com (NAVGW 2.5.2.12) with SMTP id M2003081311183519840 ; Wed, 13 Aug 2003 11:18:35 -0400 Date: Wed, 13 Aug 2003 10:17:45 -0500 From: ingrid martinez Subject: Re: How can I Improve performance in Solaris? To: Andrew Sullivan , pgsql-performance@postgresql.org Message-id: <003e01c361ae$0cf914c0$8e64a8c0@ingridmartinez> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Mailer: Microsoft Outlook Express 6.00.2800.1158 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT X-Priority: 3 X-MSMail-priority: Normal References: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> <20030813143258.GC15743@libertyrms.info> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/237 X-Sequence-Number: 3054 The query that execute is only inserts, I use a batch of 300 and then do commit. insert into FLOWS values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) and postgresql.conf looks like this # # PostgreSQL configuration file # ----------------------------- # # This file consists of lines of the form # # name = value # # (The `=' is optional.) White space is collapsed, comments are # introduced by `#' anywhere on a line. The complete list of option # names and allowed values can be found in the PostgreSQL # documentation. The commented-out settings shown in this file # represent the default values. # Any option can also be given as a command line switch to the # postmaster, e.g., 'postmaster -c log_connections=on'. Some options # can be changed at run-time with the 'SET' SQL command. #======================================================================== # # Connection Parameters # #tcpip_socket = false #ssl = false #max_connections = 32 #port = 5432 #hostname_lookup = false #show_source_port = false #unix_socket_directory = '' #unix_socket_group = '' #unix_socket_permissions = 0777 #virtual_host = '' #krb_server_keyfile = '' # # Shared Memory Size # #shared_buffers = 64 # 2*max_connections, min 16 #max_fsm_relations = 100 # min 10, fsm is free space map #max_fsm_pages = 10000 # min 1000, fsm is free space map #max_locks_per_transaction = 64 # min 10 #wal_buffers = 8 # min 4 # # Non-shared Memory Sizes # #sort_mem = 512 # min 32 #vacuum_mem = 8192 # min 1024 # # Write-ahead log (WAL) # #wal_files = 0 # range 0-64 #wal_sync_method = fsync # the default varies across platforms: # # fsync, fdatasync, open_sync, or open_datasync #wal_debug = 0 # range 0-16 #commit_delay = 0 # range 0-100000 #commit_siblings = 5 # range 1-1000 #checkpoint_segments = 3 # in logfile segments (16MB each), min 1 #checkpoint_timeout = 300 # in seconds, range 30-3600 #fsync = true # # Optimizer Parameters # #enable_seqscan = true #enable_indexscan = true #enable_tidscan = true #enable_sort = true #enable_nestloop = true #enable_mergejoin = true #enable_hashjoin = true #ksqo = false #effective_cache_size = 1000 # default in 8k pages #random_page_cost = 4 #cpu_tuple_cost = 0.01 #cpu_index_tuple_cost = 0.001 #cpu_operator_cost = 0.0025 # # GEQO Optimizer Parameters # #geqo = true #geqo_selection_bias = 2.0 # range 1.5-2.0 #geqo_threshold = 11 #geqo_pool_size = 0 # default based on #tables in query, range 128-1024 #geqo_effort = 1 #geqo_generations = 0 #geqo_random_seed = -1 # auto-compute seed # # Debug display # #silent_mode = false #log_connections = false #log_timestamp = false #log_pid = false #debug_level = 0 # range 0-16 #debug_print_query = false #debug_print_parse = false #debug_print_rewritten = false #debug_print_plan = false #debug_pretty_print = false # requires USE_ASSERT_CHECKING #debug_assertions = true # # Syslog # # requires ENABLE_SYSLOG #syslog = 0 # range 0-2 #syslog_facility = 'LOCAL0' #syslog_ident = 'postgres' # # Statistics # #show_parser_stats = false #show_planner_stats = false #show_executor_stats = false #show_query_stats = false # requires BTREE_BUILD_STATS #show_btree_build_stats = false # # Access statistics collection # #stats_start_collector = true #stats_reset_on_server_start = true #stats_command_string = false #stats_row_level = false #stats_block_level = false # # Lock Tracing # #trace_notify = false # requires LOCK_DEBUG #trace_locks = false #trace_userlocks = false #trace_lwlocks = false #debug_deadlocks = false #trace_lock_oidmin = 16384 #trace_lock_table = 0 # # Misc # #dynamic_library_path = '$libdir' #australian_timezones = false #authentication_timeout = 60 # min 1, max 600 #deadlock_timeout = 1000 #default_transaction_isolation = 'read committed' #max_expr_depth = 10000 # min 10 #max_files_per_process = 1000 # min 25 #password_encryption = false #sql_inheritance = true #transform_null_equals = false ----- Original Message ----- From: "Andrew Sullivan" To: Sent: Wednesday, August 13, 2003 9:32 AM Subject: Re: [PERFORM] How can I Improve performance in Solaris? > On Wed, Aug 13, 2003 at 09:03:31AM -0500, ingrid martinez wrote: > > I want to know, how can I improve the performance of postgres, I > > have a java class thar inserts register every 30 min but is very > > slow. > > What does the query do? How is postgres configured? > > A > > -- > ---- > Andrew Sullivan 204-4141 Yonge Street > Liberty RMS Toronto, Ontario Canada > M2P 2A8 > +1 416 646 3304 x110 > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org From pgsql-performance-owner@postgresql.org Wed Aug 13 12:37:49 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 E40D8D1C4C8 for ; Wed, 13 Aug 2003 15:37: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 33442-03 for ; Wed, 13 Aug 2003 12:36:11 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 935DED1B53A for ; Wed, 13 Aug 2003 12:37:35 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7DFbGu23405; Wed, 13 Aug 2003 11:37:16 -0400 (EDT) From: Bruce Momjian Message-Id: <200308131537.h7DFbGu23405@candle.pha.pa.us> Subject: Re: Perfomance Tuning In-Reply-To: <1060745432.30778.39.camel@haggis> To: Ron Johnson Date: Wed, 13 Aug 2003 11:37:16 -0400 (EDT) Cc: PgSQL Performance ML X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/238 X-Sequence-Number: 3055 Ron Johnson wrote: > On Tue, 2003-08-12 at 13:39, Bruce Momjian wrote: > > OK, I got some hard evidence. Here is a discussion on the Linux kernel > > mailing list with postings from Allen Cox (ac Linux kernels) and Stephen > > Tweedie (ext3 author). > > > > http://www.tux.org/hypermail/linux-kernel/1999week14/subject.html#start > > > > Search for "softupdates and ext2". > > > > Here is the original email in the thread: > > > > http://www.tux.org/hypermail/linux-kernel/1999week14/0498.html > > > > Summary is at: > > > > http://www.tux.org/hypermail/linux-kernel/1999week14/0571.html > > > > and conclusion in: > > > > http://www.tux.org/hypermail/linux-kernel/1999week14/0504.html > > > > I now remember the issue --- ext2 makes all disk changes asynchonously > > (unless you mount it via sync, which is slow). This means that the file > > system isn't always consistent on disk. > > > > UFS has always sync metadata (file/directory creation) to the disk so > > the disk was always consistent, but doesn't sync the data to the disk, > > for performance reasons. With soft updates, the metadata writes are > > delayed, and written to disk in an order that keeps the file system > > consistent. > > > > Is this enough evidence, or should I keep researching? > > This is all 4 years old, though. Isn't that why the ext3 "layer" was Yes, it is four years old, but no one has told me ext2 has changed in this regard, and seeing that they created ext3 to fix these aspects, I would think ext2 hasn't changed. > created, and filesystems like reiserFS, XFS and (kinda) JFS were added > to Linux? Yes, it is those ext2 limitations that caused the development of ext3 and the others. However, they went much father than implementing a crash-safe file system, but rather enabled a file system that doesn't need fsck on crash reboot. This causes fsync of data and metadata (file creation), which slows down the file system, and PostgreSQL doesn't need it. You can mount ext3 and others with data=writeback to fsync only metadata, but it isn't the default. I am not sure what the ext3 layer is. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Wed Aug 13 12:47: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 65817D1B56B for ; Wed, 13 Aug 2003 15:47:15 +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 30436-10 for ; Wed, 13 Aug 2003 12:45:38 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 13253D1B53A for ; Wed, 13 Aug 2003 12:47:04 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3509123; Wed, 13 Aug 2003 08:47:27 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Jeff , Christopher Browne Subject: Re: Perfomance Tuning Date: Wed, 13 Aug 2003 08:46:55 -0700 User-Agent: KMail/1.4.3 Cc: "pgsql-performance@postgresql.org" References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200308130846.55991.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/239 X-Sequence-Number: 3056 Jeff, > Informix, etc. have spent a lot of time and money working on it. > They also have the advantage of having many paid fulltime > developers who are doing this for a job, not as a weekend hobby > (Compared to the what? 2-3 full time PG developers). I think 4-6 full-time, actually, plus about 200 part-time contributors. Which adds up to a bloody *lot* of code if you monitor pgsql-patches between versions. The only development advantage the commercials have over us is the ability to engage in large projects (e.g. replication, raw filesystems, etc.) that are difficult for a distributed network of people. > The other advantage (which I hinted to above) with raw disks is being able > to optimize queries to take advantage of it. Informix is multithreaded > and it will spawn off multiple "readers" to do say, a seq scan (and merge > the results at the end). I like this idea. Has it ever been discussed for PostgreSQL? Hmmm .... we'd need to see some tests demonstrating that this approach was still a technical advantage given the improvements in RAID and FS technology since Informix was designed. As I have said elsewhere, Informix is probably a poor database to emulate since they are effectively an old dead-end fork of the Ingres/Postgres code, and have already been "mined" for most of the improvements they made. -- Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Wed Aug 13 12:50: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 93DB2D1C4C7 for ; Wed, 13 Aug 2003 15:50: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 31224-07 for ; Wed, 13 Aug 2003 12:48:23 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 8E5D9D1C4BF for ; Wed, 13 Aug 2003 12:49:49 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 71CDA10259; Wed, 13 Aug 2003 11:42:15 -0400 (EDT) Received: from [10.0.2.6] (unknown [10.0.2.6]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 5F8D610248; Wed, 13 Aug 2003 11:42:13 -0400 (EDT) Subject: Re: How can I Improve performance in Solaris? From: Rod Taylor To: ingrid martinez Cc: Andrew Sullivan , Postgresql Performance In-Reply-To: <003e01c361ae$0cf914c0$8e64a8c0@ingridmartinez> References: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> <20030813143258.GC15743@libertyrms.info> <003e01c361ae$0cf914c0$8e64a8c0@ingridmartinez> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-W/s6Lp6iH1BGB0Ii6YHL" Message-Id: <1060789790.11688.21.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 13 Aug 2003 11:49:51 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/240 X-Sequence-Number: 3057 --=-W/s6Lp6iH1BGB0Ii6YHL Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2003-08-13 at 11:17, ingrid martinez wrote:=20 > The query that execute is only inserts, I use a batch of 300 and then do > commit. >=20 > insert into FLOWS values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Any foreign keys on this table? Triggers or Rules? What kind of hardware do you have? Anything else running on it? Could you provide the header information from top? Off the cuff, modify your postgresql.conf for the below and restart PostgreSQL. shared_buffers =3D 1000 # 2*max_connections, min 16 effective_cache_size =3D 4000 # default in 8k pages --=-W/s6Lp6iH1BGB0Ii6YHL Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQA/Ol4e6DETLow6vwwRAncYAJ4kl0nTEIuJUfboPG4JWe3VYWrIFACeMeZp Fc0qqCKlo87W51j1/t04zzE= =vY3Y -----END PGP SIGNATURE----- --=-W/s6Lp6iH1BGB0Ii6YHL-- From pgsql-performance-owner@postgresql.org Wed Aug 13 13:17: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 15912D1C4D0 for ; Wed, 13 Aug 2003 16:17: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 37951-02 for ; Wed, 13 Aug 2003 13:15:36 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id DE006D1C4BF for ; Wed, 13 Aug 2003 13:17:01 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19myJ4-0000m8-00 for ; Wed, 13 Aug 2003 12:17:02 -0400 Received: by dba2 (Postfix, from userid 1019) id 95586CF52; Wed, 13 Aug 2003 12:17:01 -0400 (EDT) Date: Wed, 13 Aug 2003 12:17:01 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: How can I Improve performance in Solaris? Message-ID: <20030813161701.GA599@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> <20030813143258.GC15743@libertyrms.info> <003e01c361ae$0cf914c0$8e64a8c0@ingridmartinez> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003e01c361ae$0cf914c0$8e64a8c0@ingridmartinez> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/241 X-Sequence-Number: 3058 On Wed, Aug 13, 2003 at 10:17:45AM -0500, ingrid martinez wrote: > The query that execute is only inserts, I use a batch of 300 and then do > commit. > > insert into FLOWS values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Are there any foreign keys, &c? > > and > > postgresql.conf looks like this [ . . .] The configuration is the default. You'll certainly want to increase the shared memory and fiddle with some of the other usual pieces. There is some discussion of the config file at . Unless the INSERTs are causing SELECTs, though, I can't see what exactly might be causing you so much difficulty. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Wed Aug 13 13:21: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 469FBD1C4C7 for ; Wed, 13 Aug 2003 16:21:43 +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 38206-02 for ; Wed, 13 Aug 2003 13:20:04 -0300 (ADT) Received: from correo (correo.qoslabs.com [157.238.87.78]) by svr1.postgresql.org (Postfix) with ESMTP id 89600D1C4BF for ; Wed, 13 Aug 2003 13:21:30 -0300 (ADT) Received: from ldap-02.qoslabs.com (ldap-02 [172.20.1.31]) by correo-01.qoslabs.com (iPlanet Messaging Server 5.2 Patch 1 (built Aug 19 2002)) with SMTP id <0HJK00EBEG3URF@correo-01.qoslabs.com> for pgsql-performance@postgresql.org; Wed, 13 Aug 2003 12:21:30 -0400 (EDT) Received: (from ingridmartinez [148.233.235.189]) by ldap-02.qoslabs.com (NAVGW 2.5.2.12) with SMTP id M2003081312212820948 ; Wed, 13 Aug 2003 12:21:29 -0400 Date: Wed, 13 Aug 2003 11:20:39 -0500 From: ingrid martinez Subject: Re: How can I Improve performance in Solaris? To: Andrew Sullivan , pgsql-performance@postgresql.org Message-id: <00a001c361b6$d668a430$8e64a8c0@ingridmartinez> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Mailer: Microsoft Outlook Express 6.00.2800.1158 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT X-Priority: 3 X-MSMail-priority: Normal References: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> <20030813143258.GC15743@libertyrms.info> <003e01c361ae$0cf914c0$8e64a8c0@ingridmartinez> <20030813161701.GA599@libertyrms.info> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/242 X-Sequence-Number: 3059 Floes table looks like this Table "flows" Column | Type | Modifiers ----------------------+--------------------------+----------- flidload | bigint | not null firsttime | bigint | fldestpeeraddress | character varying(30) | fldesttransaddress | bigint | fldesttranstype | smallint | fldfromoctets | bigint | fldscodepoint | smallint | fldtooctets | bigint | flfrompdus | bigint | flid | text | flidrule | bigint | flsourcepeeraddress | character varying(30) | flsourcetransaddress | bigint | flsourcetranstype | smallint | fltime | timestamp with time zone | fltopdus | bigint | lasttime | bigint | sourceinterface | smallint | destinterface | smallint | sourceasn | smallint | destasn | smallint | Primary key: flows_pkey insert into FLOWS values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) postgresql.conf looks like this # # PostgreSQL configuration file # ----------------------------- # # This file consists of lines of the form # # name = value # # (The `=' is optional.) White space is collapsed, comments are # introduced by `#' anywhere on a line. The complete list of option # names and allowed values can be found in the PostgreSQL # documentation. The commented-out settings shown in this file # represent the default values. # Any option can also be given as a command line switch to the # postmaster, e.g., 'postmaster -c log_connections=on'. Some options # can be changed at run-time with the 'SET' SQL command. #======================================================================== # # Connection Parameters # #tcpip_socket = false #ssl = false #max_connections = 32 #port = 5432 #hostname_lookup = false #show_source_port = false #unix_socket_directory = '' #unix_socket_group = '' #unix_socket_permissions = 0777 #virtual_host = '' #krb_server_keyfile = '' # # Shared Memory Size # #shared_buffers = 64 # 2*max_connections, min 16 #max_fsm_relations = 100 # min 10, fsm is free space map #max_fsm_pages = 10000 # min 1000, fsm is free space map #max_locks_per_transaction = 64 # min 10 #wal_buffers = 8 # min 4 # # Non-shared Memory Sizes # #sort_mem = 512 # min 32 #vacuum_mem = 8192 # min 1024 # # Write-ahead log (WAL) # #wal_files = 0 # range 0-64 #wal_sync_method = fsync # the default varies across platforms: # # fsync, fdatasync, open_sync, or open_datasync #wal_debug = 0 # range 0-16 #commit_delay = 0 # range 0-100000 #commit_siblings = 5 # range 1-1000 #checkpoint_segments = 3 # in logfile segments (16MB each), min 1 #checkpoint_timeout = 300 # in seconds, range 30-3600 #fsync = true # # Optimizer Parameters # #enable_seqscan = true #enable_indexscan = true #enable_tidscan = true #enable_sort = true #enable_nestloop = true #enable_mergejoin = true #enable_hashjoin = true #ksqo = false #effective_cache_size = 1000 # default in 8k pages #random_page_cost = 4 #cpu_tuple_cost = 0.01 #cpu_index_tuple_cost = 0.001 #cpu_operator_cost = 0.0025 # # GEQO Optimizer Parameters # #geqo = true #geqo_selection_bias = 2.0 # range 1.5-2.0 #geqo_threshold = 11 #geqo_pool_size = 0 # default based on #tables in query, range 128-1024 #geqo_effort = 1 #geqo_generations = 0 #geqo_random_seed = -1 # auto-compute seed # # Debug display # #silent_mode = false #log_connections = false #log_timestamp = false #log_pid = false #debug_level = 0 # range 0-16 #debug_print_query = false #debug_print_parse = false #debug_print_rewritten = false #debug_print_plan = false #debug_pretty_print = false # requires USE_ASSERT_CHECKING #debug_assertions = true # # Syslog # # requires ENABLE_SYSLOG #syslog = 0 # range 0-2 #syslog_facility = 'LOCAL0' #syslog_ident = 'postgres' # # Statistics # #show_parser_stats = false #show_planner_stats = false #show_executor_stats = false #show_query_stats = false # requires BTREE_BUILD_STATS #show_btree_build_stats = false # # Access statistics collection # #stats_start_collector = true #stats_reset_on_server_start = true #stats_command_string = false #stats_row_level = false #stats_block_level = false # # Lock Tracing # #trace_notify = false # requires LOCK_DEBUG #trace_locks = false #trace_userlocks = false #trace_lwlocks = false #debug_deadlocks = false #trace_lock_oidmin = 16384 #trace_lock_table = 0 # # Misc # #dynamic_library_path = '$libdir' #australian_timezones = false #authentication_timeout = 60 # min 1, max 600 #deadlock_timeout = 1000 #default_transaction_isolation = 'read committed' #max_expr_depth = 10000 # min 10 #max_files_per_process = 1000 # min 25 #password_encryption = false #sql_inheritance = true #transform_null_equals = false ----- Original Message ----- From: "Andrew Sullivan" To: Sent: Wednesday, August 13, 2003 11:17 AM Subject: Re: [PERFORM] How can I Improve performance in Solaris? > On Wed, Aug 13, 2003 at 10:17:45AM -0500, ingrid martinez wrote: > > The query that execute is only inserts, I use a batch of 300 and then do > > commit. > > > > insert into FLOWS values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) > > Are there any foreign keys, &c? > > > > > and > > > > postgresql.conf looks like this > > [ . . .] > > The configuration is the default. You'll certainly want to increase > the shared memory and fiddle with some of the other usual pieces. > There is some discussion of the config file at > . > Unless the INSERTs are causing SELECTs, though, I can't see what > exactly might be causing you so much difficulty. > > A > > -- > ---- > Andrew Sullivan 204-4141 Yonge Street > Liberty RMS Toronto, Ontario Canada > M2P 2A8 > +1 416 646 3304 x110 > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster From pgsql-performance-owner@postgresql.org Wed Aug 13 13:47:45 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 0EAB2D1B58A for ; Wed, 13 Aug 2003 16:47: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 36835-04 for ; Wed, 13 Aug 2003 13:46:06 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 5DCD7D1B561 for ; Wed, 13 Aug 2003 13:47:31 -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 h7DGkmbS000852; Wed, 13 Aug 2003 10:46:48 -0600 (MDT) Date: Wed, 13 Aug 2003 10:47:36 -0600 (MDT) From: "scott.marlowe" To: ingrid martinez Cc: Andrew Sullivan , Subject: Re: How can I Improve performance in Solaris? In-Reply-To: <00a001c361b6$d668a430$8e64a8c0@ingridmartinez> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/243 X-Sequence-Number: 3060 On Wed, 13 Aug 2003, ingrid martinez wrote: > Floes table looks like this > > Table "flows" > Column | Type | Modifiers > ----------------------+--------------------------+----------- > flidload | bigint | not null > firsttime | bigint | > fldestpeeraddress | character varying(30) | > fldesttransaddress | bigint | > fldesttranstype | smallint | > fldfromoctets | bigint | > fldscodepoint | smallint | > fldtooctets | bigint | > flfrompdus | bigint | > flid | text | > flidrule | bigint | > flsourcepeeraddress | character varying(30) | > flsourcetransaddress | bigint | > flsourcetranstype | smallint | > fltime | timestamp with time zone | > fltopdus | bigint | > lasttime | bigint | > sourceinterface | smallint | > destinterface | smallint | > sourceasn | smallint | > destasn | smallint | > Primary key: flows_pkey Which columns are in the pkey? From pgsql-performance-owner@postgresql.org Wed Aug 13 13:56:38 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 659A6D1B58A for ; Wed, 13 Aug 2003 16:56:19 +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 37951-09 for ; Wed, 13 Aug 2003 13:54:41 -0300 (ADT) Received: from correo (correo.qoslabs.com [157.238.87.78]) by svr1.postgresql.org (Postfix) with ESMTP id 413F1D1C936 for ; Wed, 13 Aug 2003 13:56:07 -0300 (ADT) Received: from ldap-02.qoslabs.com (ldap-02 [172.20.1.31]) by correo-01.qoslabs.com (iPlanet Messaging Server 5.2 Patch 1 (built Aug 19 2002)) with SMTP id <0HJK00EK6HP4RF@correo-01.qoslabs.com> for pgsql-performance@postgresql.org; Wed, 13 Aug 2003 12:55:52 -0400 (EDT) Received: (from ingridmartinez [148.233.235.189]) by ldap-02.qoslabs.com (NAVGW 2.5.2.12) with SMTP id M2003081312555023228 ; Wed, 13 Aug 2003 12:55:51 -0400 Date: Wed, 13 Aug 2003 11:55:00 -0500 From: ingrid martinez Subject: Re: How can I Improve performance in Solaris? To: "scott.marlowe" Cc: Andrew Sullivan , pgsql-performance@postgresql.org Message-id: <00c601c361bb$a34c4890$8e64a8c0@ingridmartinez> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Mailer: Microsoft Outlook Express 6.00.2800.1158 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT X-Priority: 3 X-MSMail-priority: Normal References: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/244 X-Sequence-Number: 3061 the primary key is flidload ----- Original Message ----- From: "scott.marlowe" To: "ingrid martinez" Cc: "Andrew Sullivan" ; Sent: Wednesday, August 13, 2003 11:47 AM Subject: Re: [PERFORM] How can I Improve performance in Solaris? > On Wed, 13 Aug 2003, ingrid martinez wrote: > > > Floes table looks like this > > > > Table "flows" > > Column | Type | Modifiers > > ----------------------+--------------------------+----------- > > flidload | bigint | not null > > firsttime | bigint | > > fldestpeeraddress | character varying(30) | > > fldesttransaddress | bigint | > > fldesttranstype | smallint | > > fldfromoctets | bigint | > > fldscodepoint | smallint | > > fldtooctets | bigint | > > flfrompdus | bigint | > > flid | text | > > flidrule | bigint | > > flsourcepeeraddress | character varying(30) | > > flsourcetransaddress | bigint | > > flsourcetranstype | smallint | > > fltime | timestamp with time zone | > > fltopdus | bigint | > > lasttime | bigint | > > sourceinterface | smallint | > > destinterface | smallint | > > sourceasn | smallint | > > destasn | smallint | > > Primary key: flows_pkey > > Which columns are in the pkey? > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org From pgsql-performance-owner@postgresql.org Wed Aug 13 14:52: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 4EF0DD1C4E3 for ; Wed, 13 Aug 2003 17:52: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 42032-08 for ; Wed, 13 Aug 2003 14:50:32 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 65780D1B561 for ; Wed, 13 Aug 2003 14:51:56 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7DHpc106109; Wed, 13 Aug 2003 13:51:38 -0400 (EDT) From: Bruce Momjian Message-Id: <200308131751.h7DHpc106109@candle.pha.pa.us> Subject: Re: Perfomance Tuning In-Reply-To: <200308130846.55991.josh@agliodbs.com> To: Josh Berkus Date: Wed, 13 Aug 2003 13:51:38 -0400 (EDT) Cc: Jeff , Christopher Browne , "pgsql-performance@postgresql.org" X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/245 X-Sequence-Number: 3062 Josh Berkus wrote: > Jeff, > > > Informix, etc. have spent a lot of time and money working on it. > > They also have the advantage of having many paid fulltime > > developers who are doing this for a job, not as a weekend hobby > > (Compared to the what? 2-3 full time PG developers). > > I think 4-6 full-time, actually, plus about 200 part-time contributors. Which > adds up to a bloody *lot* of code if you monitor pgsql-patches between > versions. The only development advantage the commercials have over us is the > ability to engage in large projects (e.g. replication, raw filesystems, etc.) > that are difficult for a distributed network of people. I think Informix's track record for post-Informix 5.0 releases is poor: 6.0 aborted release, pretty much withdrawn 7.0 took 1-2 years to stabalize 8.0 where was that? 9.0 confused customers How much does Informix improve in 6 months? In 2 years? How long does it take to get a bug fixed? At this point, only the largest corporations can keep up with our open-source development model. The other database vendors have already closed, as did Informix when purchased by IBM. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Wed Aug 13 16:19:25 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 5898ED1B58A for ; Wed, 13 Aug 2003 19:19: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 57649-05 for ; Wed, 13 Aug 2003 16:17:44 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 61D22D1B53A for ; Wed, 13 Aug 2003 16:19:08 -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 h7DJJ8em095360 for ; Wed, 13 Aug 2003 19:19:08 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7DIse22088750 for pgsql-performance@postgresql.org; Wed, 13 Aug 2003 18:54:40 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Perfomance Tuning Date: Wed, 13 Aug 2003 14:54:38 -0400 Organization: Hub.Org Networking Services Lines: 102 Message-ID: <603cg5v15d.fsf@dev6.int.libertyrms.info> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:maMpJwW4xnKG++SiYmibU6V5Edk= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/248 X-Sequence-Number: 3065 threshar@torgo.978.org (Jeff) writes: > On Tue, 12 Aug 2003, Christopher Browne wrote: >> Are you _certain_ that's still true? Have you a metric that shows >> Informix being 10x faster on a modern system? That would be quite >> surprising... > We were forced (for budget reason) to switch from raw disk to cooked > files on our informix db. We took a huge hit - about 5-6x slower. > Granted part of that was because informix takes number of spindles, > etc into account when generating query plans and the fact running > UPDATE STATISTICS (think Vacuum analyze) on the version we run locks > the table exclusively. And it is unacceptable to have our "main > table" unavailable for hours and hours while the update runs. (For > the record: its a 8cpu sun e4500 running sol2.6. The raw disks were > on a hitachi fibre array and the cooked files were on a raid5 > (scsi). Forget how many spindles in the raid. There were 20 raw > disks) Sounds like what you were forced to do was to do TWO things: 1. Switch from raw disk to cooked files, and 2. Switch from a fibre array to a RAID array You're attributing the 5-6x slowdown to 1., when it seems likely that 2. is a far more significant multiple. What with there being TWO big changes that took place that might be expected to affect performance, it seems odd to attribute a factor-of-many change to just one aspect of that. > Informix, etc. have spent a lot of time and money working on it. > They also have the advantage of having many paid fulltime developers > who are doing this for a job, not as a weekend hobby (Compared to > the what? 2-3 full time PG developers). Sure, and I'm sure the PG developers hardly know _anything_ about implementing databases, either. Certainly IBM (who bought Informix) has lots of time and money to devote to enhancements. But I think you underestimate the time, skill, and effort involved with PG work. It's quite typical for people to imagine free software projects to basically be free-wheeling efforts mostly involving guys that still have acne that haven't much knowledge of the area. Reality, for the projects that are of some importance, is staggeringly different from that. The number of people with graduate degrees tends to surprise everyone. The developers may not have time to add frivolous things to the system, like building sophisticated Java-based GUI installers, XML processors, or such. That does, however, improve their focus, and so PostgreSQL does not suffer from the way Oracle has fifty different bundlings most of which nobody understands. > The other advantage (which I hinted to above) with raw disks is > being able to optimize queries to take advantage of it. Informix is > multithreaded and it will spawn off multiple "readers" to do say, a > seq scan (and merge the results at the end). > > So if you have a table across say, 3 disks and you need to do a seq > scan it will spawn three readers to do the read. Result: nice and > fast (Yes, It may not always spawn the three readers, only when it > thinks it will be a good thing to do) Andrew Sullivan's fairly regular response is that he tried (albeit not VASTLY extensively) to distinguish between disks when working with fibre arrays, and he couldn't measure an improvement in shifting WAL (the OBVIOUS thing to shift) to separate disks. There's a lot of guesswork as to precisely why that result falls out. One of the better guesses seems to be that if you've got enough battery-backed memory cache on the array, that lets updates get pushed to cache so fast that it doesn't too much matter which disk they hit. If you've got enough spindles, and build much of the array in a striped manner, you'll get data splitting across disks without having to specify any "table options" to force it to happen. You raise a good point vis-a-vis the thought of spawning multiple readers; that could conceivably be a useful approach to improve performance for very large queries. If you could "stripe" the tables in some manner so they could be doled out to multiple worker processes, that could indeed provide some benefits. If there are three workers, they might round-robin to grab successive pages from the table to do their work, and then end with a merge step. That's probably a 7.7 change, mind you :-), but once other simpler approaches to making the engine faster have been exhausted, that's the sort of thing to look into next. > I think for PG the effort would be much better spent on other > features... like replication and whatnot. At this point, sure. -- let name="cbbrowne" and tld="ntlug.org" in String.concat "@" [name;tld];; http://www3.sympatico.ca/cbbrowne/lisp.html "Using Java as a general purpose application development language is like going big game hunting armed with Nerf weapons." -- Author Unknown From pgsql-performance-owner@postgresql.org Wed Aug 13 16:00:29 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 91BFED1B524 for ; Wed, 13 Aug 2003 19:00:28 +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 58372-02 for ; Wed, 13 Aug 2003 15:58:52 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 7E581D1C4BF for ; Wed, 13 Aug 2003 16:00:17 -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 h7DIxZbS011409; Wed, 13 Aug 2003 12:59:36 -0600 (MDT) Date: Wed, 13 Aug 2003 13:00:23 -0600 (MDT) From: "scott.marlowe" To: ingrid martinez Cc: Andrew Sullivan , Subject: Re: How can I Improve performance in Solaris? In-Reply-To: <00c601c361bb$a34c4890$8e64a8c0@ingridmartinez> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/246 X-Sequence-Number: 3063 More than likely you are suffering from an affliction known as type mismatch. This is listed as tip 9 here on the performance list (funny, it was sent at the bottom of your reply :-) What happens is that when you do: select * from some_table where id=123; where id is a bigint the query planner assumes you must want 123 cast to int4, which doesn't match int8 (aka bigint) and uses a sequential scan to access that row. I.e. it reads the whole table in. You can force the planner to do the right thing here in a couple of ways: select * from some_table where id=123::bigint; -- OR -- select * from some_table where id='123'; On Wed, 13 Aug 2003, ingrid martinez wrote: > the primary key is flidload > ---------------------------(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 > From pgsql-performance-owner@postgresql.org Wed Aug 13 16:19: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 A87D5D1B56C for ; Wed, 13 Aug 2003 19:19:20 +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 55610-08 for ; Wed, 13 Aug 2003 16:17:44 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 6A87ED1B561 for ; Wed, 13 Aug 2003 16:19:08 -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 h7DJJ8eo095360 for ; Wed, 13 Aug 2003 19:19:08 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7DJ78aG092668 for pgsql-performance@postgresql.org; Wed, 13 Aug 2003 19:07:08 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Perfomance Tuning Date: Wed, 13 Aug 2003 15:07:04 -0400 Organization: Hub.Org Networking Services Lines: 54 Message-ID: <60r83ptm07.fsf@dev6.int.libertyrms.info> References: <200308130846.55991.josh@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:NDvTyYzsgECA+AHrbOkslw9/Yus= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/247 X-Sequence-Number: 3064 josh@agliodbs.com (Josh Berkus) writes: >> The other advantage (which I hinted to above) with raw disks is being able >> to optimize queries to take advantage of it. Informix is multithreaded >> and it will spawn off multiple "readers" to do say, a seq scan (and merge >> the results at the end). > > I like this idea. Has it ever been discussed for PostgreSQL? Hmmm > .... we'd need to see some tests demonstrating that this approach > was still a technical advantage given the improvements in RAID and > FS technology since Informix was designed. Ah, but this approach isn't so much an I/O optimization as it is a CPU optimization. If you have some sort of join against a big table, and do a lot of processing on each component, there might be CPU benefits from the split: create table customers( id customer_id, name character varying, other fields ); --- And we're a phone company with 8 millions of them... create table customer_status ( customer_id customer_id, status status_code ); create table customer_address ( customer_id customer_id, address_info... ); And then are doing: select c.id, sum(status), address_label(c.id), balance(c.id) from customers c, customer_status cs; We know there's going to be a SEQ SCAN against customers, because that's the big table. If I wanted to finish the query as fast as possible, as things stand now, and had 4 CPUs, I would run 4 concurrent queries, for 4 ranges of customers. The Really Cool approach would be for PostgreSQL to dole out customers across four processors, perhaps throwing a page at a time at each CPU, where each process would quasi-independently build up their respective result sets. -- let name="cbbrowne" and tld="libertyrms.info" in String.concat "@" [name;tld];; Christopher Browne (416) 646 3304 x124 (land) From pgsql-performance-owner@postgresql.org Wed Aug 13 18:35:57 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 07A43D1B53A for ; Wed, 13 Aug 2003 21:31:26 +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 73387-05 for ; Wed, 13 Aug 2003 18:29:50 -0300 (ADT) Received: from lakemtao04.cox.net (lakemtao04.cox.net [68.1.17.241]) by svr1.postgresql.org (Postfix) with ESMTP id 71983D1B52C for ; Wed, 13 Aug 2003 18:31:14 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao04.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030813213115.ONVT13930.lakemtao04.cox.net@lhosts> for ; Wed, 13 Aug 2003 17:31:15 -0400 Subject: Re: Perfomance Tuning From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <200308130846.55991.josh@agliodbs.com> References: <200308130846.55991.josh@agliodbs.com> Content-Type: text/plain Message-Id: <1060810275.4577.1.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 13 Aug 2003 16:31:16 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/249 X-Sequence-Number: 3066 On Wed, 2003-08-13 at 10:46, Josh Berkus wrote: > Jeff, > [snip] > > The other advantage (which I hinted to above) with raw disks is being able > > to optimize queries to take advantage of it. Informix is multithreaded > > and it will spawn off multiple "readers" to do say, a seq scan (and merge > > the results at the end). > > I like this idea. Has it ever been discussed for PostgreSQL? Hmmm .... we'd > need to see some tests demonstrating that this approach was still a technical > advantage given the improvements in RAID and FS technology since Informix > was designed. Wouldn't PG 1st need horizontal partitioning, and as a precursor to that, "tablespaces"? -- +---------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "Man, I'm pretty. Hoo Hah!" | | Johnny Bravo | +---------------------------------------------------------------+ From pgsql-performance-owner@postgresql.org Wed Aug 13 20:23:42 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 535E2D1B52C for ; Wed, 13 Aug 2003 23:23:39 +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 87329-04 for ; Wed, 13 Aug 2003 20:22:05 -0300 (ADT) Received: from perrin.int.nxad.com (internal.ext.nxad.com [69.1.70.251]) by svr1.postgresql.org (Postfix) with ESMTP id 6C1E8D1B53A for ; Wed, 13 Aug 2003 20:23:28 -0300 (ADT) Received: by perrin.int.nxad.com (Postfix, from userid 1001) id 9A32E20F01; Wed, 13 Aug 2003 16:23:30 -0700 (PDT) Date: Wed, 13 Aug 2003 16:23:30 -0700 From: Sean Chittenden To: Christopher Browne Cc: pgsql-performance@postgresql.org Subject: Re: Perfomance Tuning Message-ID: <20030813232330.GB12595@perrin.int.nxad.com> References: <603cg5v15d.fsf@dev6.int.libertyrms.info> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <603cg5v15d.fsf@dev6.int.libertyrms.info> X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/250 X-Sequence-Number: 3067 > Andrew Sullivan's fairly regular response is that he tried (albeit > not VASTLY extensively) to distinguish between disks when working > with fibre arrays, and he couldn't measure an improvement in > shifting WAL (the OBVIOUS thing to shift) to separate disks. Real quick... the faster the drives, the less important it is to move WAL onto a different drive. The slower the drives, the more important this is... which is why this isn't as necessary (if at all) for large production environments. -sc -- Sean Chittenden From pgsql-performance-owner@postgresql.org Thu Aug 14 07:24: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 05C7FD1C4D5 for ; Thu, 14 Aug 2003 10:21:59 +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 66309-08 for ; Thu, 14 Aug 2003 07:20:22 -0300 (ADT) Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252]) by svr1.postgresql.org (Postfix) with ESMTP id 6D58DD1C4D0 for ; Thu, 14 Aug 2003 07:21:47 -0300 (ADT) Received: from frmug.org (localhost [127.0.0.1]) by frmug.org (8.12.9/8.11.3/frmug-2.7/nospam) with ESMTP id h7EALmXd060158 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256 bits) verified NO) for ; Thu, 14 Aug 2003 12:21:49 +0200 (CEST) (envelope-from pgsql@phoe.frmug.org) Received: (from uucp@localhost) by frmug.org (8.12.9/8.12.9/Submit) with UUCP id h7EALm94060157 for pgsql-performance@postgresql.org; Thu, 14 Aug 2003 12:21:48 +0200 (CEST) Received: (from elrond@localhost) by memo.frmug.org (8.11.6/8.11.6) id h7EALVb03681 for pgsql-performance@postgresql.org; Thu, 14 Aug 2003 12:21:31 +0200 (CEST) (envelope-from pgsql@memo.frmug.org) X-Authentication-Warning: memo.frmug.org: elrond set sender to pgsql@memo.frmug.org using -f Date: Thu, 14 Aug 2003 12:21:30 +0200 From: Bertrand Petit To: pgsql-performance@postgresql.org Subject: 7.4 beta 1 getting out of swap Message-ID: <20030814122130.A3583@memo.frmug.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/251 X-Sequence-Number: 3068 Hello, I recently switched to 7.4 beta 1, one query that used to be corectly executed uder 7.3.3 albeit slowly now abnormaly ends when the backend can't get more memory when it ate about 480 MB of swap space. I suspect that this behavior is the result of a 7.4 beta 1 bug but I wanted to be sure it is one before posting a report on pgsql-bugs. That query operates on three tables: ============================================================================== db=> \d movies Table "public.movies" Column | Type | Modifiers ------------+-------------------+------------------------------------------------- id | bigint | not null default nextval('movies_id_seq'::text) title | character varying | not null orig_title | character varying | not null year | smallint | year_end | smallint | Indexes: "movies_id_idx" unique, btree (id) "movies_title_idx" unique, btree (title) "movies_orig_title_idx" btree (orig_title) "movies_year_idx" btree ("year") Check constraints: "movies_year" CHECK (("year" >= 1888) OR ("year" IS NULL)) "$1" CHECK ((year_end >= 1888) OR (year_end IS NULL)) db=> \d raw_atitles Table "public.raw_atitles" Column | Type | Modifiers ------------+---------------------+-------------------------------------------------- main_title | character varying | not null aka_title | character varying | charset | character varying | not null default 'ISO-8859-1'::character varying byte_title | character varying | not null attribs | character varying[] | Indexes: "rimdb_atitles_aka_title_idx" btree (aka_title) "rimdb_atitles_attribs_idx" btree (attribs array_ops) "rimdb_atitles_main_title_idx" btree (main_title) db=> \d atitles Table "public.atitles" Column | Type | Modifiers ------------+---------------------+----------- title | character varying | not null movie_id | bigint | not null attribs | character varying[] | orig_title | character varying | not null Indexes: "truc" unique, btree (movie_id, orig_title, attribs array_ops) "atitles_movie_id_idx" btree (movie_id) "atitles_title_idx" btree (title) Foreign-key constraints: "$1" FOREIGN KEY (movie_id) REFERENCES movies(id) ============================================================================== The operation is to update the "core" atitles table with the contents of the "raw" raw_atitles table. The query is as follows: ============================================================================== INSERT INTO atitles (movie_id, title, attribs, orig_title) SELECT mo.id, trans_title(rak.aka_title), rak.attribs, rak.aka_title FROM movies AS mo, raw_atitles AS rak WHERE mo.orig_title=rak.main_title AND NOT EXISTS (SELECT at2.movie_id from atitles AS at2 WHERE at2.movie_id=mo.id AND at2.orig_title=rak.aka_title AND at2.attribs=rak.attribs); ============================================================================== Table sizes are 362,921 rows for movies, 152,549 for atitles, and 160,114 for raw_atitles. The query plan is: ============================================================================== QUERY PLAN -------------------------------------------------------------------------------------------------- Merge Join (cost=106998.67..1039376.63 rows=80057 width=86) Merge Cond: ("outer"."?column3?" = "inner"."?column4?") Join Filter: (NOT (subplan)) -> Sort (cost=66212.69..67119.99 rows=362921 width=38) Sort Key: (mo.orig_title)::text -> Seq Scan on movies mo (cost=0.00..8338.21 rows=362921 width=38) -> Sort (cost=40785.99..41186.27 rows=160114 width=107) Sort Key: (rak.main_title)::text -> Seq Scan on raw_atitles rak (cost=0.00..5145.14 rows=160114 width=107) SubPlan -> Index Scan using truc on atitles at2 (cost=0.00..5.80 rows=1 width=8) Index Cond: ((movie_id = $0) AND ((orig_title)::text = ($1)::text) AND (attribs = $2)) (12 rows) ============================================================================== I suspect that the backend does not comply to the sort_mem parameter (set to the default 1024). So my question is: does this really looks like a bug? Regards. -- %!PS 297.6 420.9 translate 90 rotate 0 setgray gsave 0 1 1{pop 0 180 moveto 100 180 170 100 170 -10 curveto 180 -9 180 -9 190 -10 curveto 190 100 100 180 0 180 curveto fill 180 rotate}for grestore/Bookman-LightItalic findfont 240 scalefont setfont -151.536392 -63.7998886 moveto (bp)show showpage From pgsql-performance-owner@postgresql.org Thu Aug 14 08:44:43 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 258C5D1C4D0 for ; Thu, 14 Aug 2003 11:41:25 +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 81378-06 for ; Thu, 14 Aug 2003 08:39:49 -0300 (ADT) Received: from mail.cict.nl (vnd-7521.mxs.adsl.euronet.nl [62.234.149.33]) by svr1.postgresql.org (Postfix) with ESMTP id 58234D1C990 for ; Thu, 14 Aug 2003 08:41:13 -0300 (ADT) Received: from APR ([192.168.150.182]) by mail.cict.nl (Merak 6.0.5) with SMTP id DUC73886 for ; Thu, 14 Aug 2003 13:41:12 +0200 Message-ID: <00e801c36259$30b908b0$b696a8c0@APR> From: "Alexander Priem" To: References: <002a01c34f62$75c01de0$b696a8c0@APR> Subject: 'View'-performance Date: Thu, 14 Aug 2003 13:42:50 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00E5_01C36269.F424B3C0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.5 tagged_above=0.0 required=5.0 tests=HTML_20_30, REFERENCES X-Spam-Level: * X-Archive-Number: 200308/252 X-Sequence-Number: 3069 This is a multi-part message in MIME format. ------=_NextPart_000_00E5_01C36269.F424B3C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, I am wondering about something: I have a table (let's call it "Table") whic= h will contain a lot of records. Every record has a field named "deleted" w= hich can be either NULL or a date value. When this field is NULL, the recor= d in question may be used by a program. If the field contains a date, this = field must be considered as "deleted" and cannot be used anymore. The reason why I don't actually delete such records is that I want to be ab= le to reference them from other locations (for history purposes). What I am thinking about is creating two views for this table: Table_View a= nd Table_History. Table_View would contain all records where "Deleted is nu= ll". Table_History would just contain all records (Select * From Table). In my program most queries would need to view only the records where delete= d is null. Would " Select * from Table_View Where Name=3D'xxx' " perform worse than " = Select * from Table Where deleted is null and Name=3D'xxx' " ? I ask this because I would like it if I wouldn't have to type "where delete= d is null" for about every query in my program. But I will not use this str= ategy if this would mean serious performance loss... Thanks in Advance, Alexander Priem. ------=_NextPart_000_00E5_01C36269.F424B3C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi all,
 
I am wondering about something: I have a t= able=20 (let's call it "Table") which will contain a lot of records. Every rec= ord=20 has a field named "deleted" which can be either NULL or a date value. When = this=20 field is NULL, the record in question may be used by a program. If the fiel= d=20 contains a date, this field must be considered as "deleted" and cannot be u= sed=20 anymore.
 
The reason why I don't actually delete suc= h records=20 is that I want to be able to reference them from other locations (for histo= ry=20 purposes).
 
What I am thinking about is creating two v= iews for=20 this table: Table_View and Table_History. Table_View would contain all reco= rds=20 where "Deleted is null". Table_History would just contain all records (Sele= ct *=20 =46rom Table).
 
In my program most queries would need to v= iew only=20 the records where deleted is null.
 
Would " Select * from Table_View Where Nam= e=3D'xxx' "=20 perform worse than " Select * from Table Where deleted is null=20 and Name=3D'xxx' " ?
 
I ask this because I would like it if I wo= uldn't=20 have to type "where deleted is null" for about every query in my program.= =20 But I will not use this strategy if this would mean serious=20 performance loss...
 
Thanks in Advance,
Alexander Priem.
------=_NextPart_000_00E5_01C36269.F424B3C0-- From pgsql-performance-owner@postgresql.org Thu Aug 14 08:48:50 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 D8860D1C7F1 for ; Thu, 14 Aug 2003 11:48:31 +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 81813-06 for ; Thu, 14 Aug 2003 08:46:56 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id C7D41D1C94C for ; Thu, 14 Aug 2003 08:48:20 -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 h7EBjkSa015590; Thu, 14 Aug 2003 07:45:46 -0400 (EDT) To: Bertrand Petit Cc: pgsql-performance@postgresql.org Subject: Re: 7.4 beta 1 getting out of swap In-reply-to: <20030814122130.A3583@memo.frmug.org> References: <20030814122130.A3583@memo.frmug.org> Comments: In-reply-to Bertrand Petit message dated "Thu, 14 Aug 2003 12:21:30 +0200" Date: Thu, 14 Aug 2003 07:45:46 -0400 Message-ID: <15589.1060861546@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/253 X-Sequence-Number: 3070 Bertrand Petit writes: > I recently switched to 7.4 beta 1, one query that used to be > corectly executed uder 7.3.3 albeit slowly now abnormaly ends when the > backend can't get more memory when it ate about 480 MB of swap space. Please show us the memory context size info that the backend dumps to stderr when it reports "out of memory". regards, tom lane From pgsql-performance-owner@postgresql.org Thu Aug 14 09:03:39 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 7FF8AD1C487 for ; Thu, 14 Aug 2003 12:01: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 85374-10 for ; Thu, 14 Aug 2003 08:59:33 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 76268D1C9C6 for ; Thu, 14 Aug 2003 09:00:57 -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 h7EC0nSa015714; Thu, 14 Aug 2003 08:00:49 -0400 (EDT) To: "Alexander Priem" Cc: pgsql-performance@postgresql.org Subject: Re: 'View'-performance In-reply-to: <00e801c36259$30b908b0$b696a8c0@APR> References: <002a01c34f62$75c01de0$b696a8c0@APR> <00e801c36259$30b908b0$b696a8c0@APR> Comments: In-reply-to "Alexander Priem" message dated "Thu, 14 Aug 2003 13:42:50 +0200" Date: Thu, 14 Aug 2003 08:00:49 -0400 Message-ID: <15713.1060862449@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/254 X-Sequence-Number: 3071 "Alexander Priem" writes: > What I am thinking about is creating two views for this table: Table_View a= > nd Table_History. Table_View would contain all records where "Deleted is nu= > ll". Table_History would just contain all records (Select * From Table). > Would " Select * from Table_View Where Name=3D'xxx' " perform worse than " = > Select * from Table Where deleted is null and Name=3D'xxx' " ? They'd be exactly the same (modulo a few extra microseconds/milliseconds for the query planner to expand the view definition). regards, tom lane From pgsql-performance-owner@postgresql.org Thu Aug 14 09: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 E39BCD1C9D5 for ; Thu, 14 Aug 2003 12:30:25 +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 94483-10 for ; Thu, 14 Aug 2003 09:28:50 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id 8109AD1C93C for ; Thu, 14 Aug 2003 09:30:14 -0300 (ADT) Received: (qmail 21680 invoked from network); 14 Aug 2003 12:30:02 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 14 Aug 2003 12:30:02 -0000 Date: Thu, 14 Aug 2003 08:30:02 -0400 (EDT) From: Jeff To: Christopher Browne Cc: "pgsql-performance@postgresql.org" Subject: Re: Perfomance Tuning In-Reply-To: <603cg5v15d.fsf@dev6.int.libertyrms.info> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/255 X-Sequence-Number: 3072 On Wed, 13 Aug 2003, Christopher Browne wrote: > Sounds like what you were forced to do was to do TWO things: > > 1. Switch from raw disk to cooked files, and > 2. Switch from a fibre array to a RAID array > > You're attributing the 5-6x slowdown to 1., when it seems likely that > 2. is a far more significant multiple. > True. > > Sure, and I'm sure the PG developers hardly know _anything_ about > implementing databases, either. > Oh I know they are good at it. I deal a lot with informix and PG and if I could I'd bring Tom, Bruce, Joe, etc. out for a beer as I'm *constantly* fighting informix and our PG box just sits there merrily churning away. (and god bless "explain analyze" - informix's version is basically boolean - "I will use an index" "I will use a seq scan". Doesn't even tell you what index!. ) > You raise a good point vis-a-vis the thought of spawning multiple > readers; that could conceivably be a useful approach to improve > performance for very large queries. If you could "stripe" the tables > in some manner so they could be doled out to multiple worker > processes, that could indeed provide some benefits. If there are > three workers, they might round-robin to grab successive pages from > the table to do their work, and then end with a merge step. The way informix does this is two fold: 1. it handles the raw disks, it knows where table data is 2. it can "partition" tables in a number of ways: round robin, concatination or expression (Expression is nifty, allows you to use a basic "where" clause to decide where to put data. ie create table foo ( a int, b int, c int ) fragment on c > 0 and c < 100 in dbspace1, c > 100 c < 200 in dbspace 2; that kind of thing. and yeah, I would not expect to see it for a long time.. Without threading it would be rather difficult to implement.. but who knows what the future will bring us. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Thu Aug 14 09:45:50 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 4A3D1D1C7F3 for ; Thu, 14 Aug 2003 12:33:38 +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 96096-07 for ; Thu, 14 Aug 2003 09:32:02 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id CD3B6D1C9CB for ; Thu, 14 Aug 2003 09:33:26 -0300 (ADT) Received: (qmail 21709 invoked from network); 14 Aug 2003 12:33:12 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 14 Aug 2003 12:33:12 -0000 Date: Thu, 14 Aug 2003 08:33:12 -0400 (EDT) From: Jeff To: Bruce Momjian Cc: Josh Berkus , Christopher Browne , "pgsql-performance@postgresql.org" Subject: Re: Perfomance Tuning In-Reply-To: <200308131751.h7DHpc106109@candle.pha.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/256 X-Sequence-Number: 3073 On Wed, 13 Aug 2003, Bruce Momjian wrote: > I think Informix's track record for post-Informix 5.0 releases is poor: > > 6.0 aborted release, pretty much withdrawn > 7.0 took 1-2 years to stabalize > 8.0 where was that? 8.0 never occured. It went 7.3 -> 9.0 > 9.0 confused customers 9.0 had some good stuff. 9.4 *FINALLY* removed a lot of limitations (2GB chunks, etc). (9.4 came out a few years after 7) > How much does Informix improve in 6 months? In 2 years? How long does > it take to get a bug fixed? You make me laugh :) -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Thu Aug 14 09:45:51 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 C9432D1F468 for ; Thu, 14 Aug 2003 12:35:51 +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 97577-02 for ; Thu, 14 Aug 2003 09:34:14 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id 48388D1F42E for ; Thu, 14 Aug 2003 09:35:15 -0300 (ADT) Received: (qmail 21737 invoked from network); 14 Aug 2003 12:35:17 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 14 Aug 2003 12:35:17 -0000 Date: Thu, 14 Aug 2003 08:35:17 -0400 (EDT) From: Jeff To: Josh Berkus Cc: Christopher Browne , "pgsql-performance@postgresql.org" Subject: Re: Perfomance Tuning In-Reply-To: <200308130846.55991.josh@agliodbs.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/257 X-Sequence-Number: 3074 On Wed, 13 Aug 2003, Josh Berkus wrote: > As I have said elsewhere, Informix is probably a poor database to emulate > since they are effectively an old dead-end fork of the Ingres/Postgres code, > and have already been "mined" for most of the improvements they made. > With informix 7.0 they rewrote the entire thing from the ground up to remove a bunch of limitations and build a multithreaded engine. so it isn't so much an old fork anymore. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Thu Aug 14 12:40: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 6C254D1B550 for ; Thu, 14 Aug 2003 15:19:36 +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 46250-08 for ; Thu, 14 Aug 2003 12:17:56 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 5A65FD1B539 for ; Thu, 14 Aug 2003 12:19:25 -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 h7EFJKem085211 for ; Thu, 14 Aug 2003 15:19:21 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7EEnpJU076398 for pgsql-performance@postgresql.org; Thu, 14 Aug 2003 14:49:51 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Perfomance Tuning Date: Thu, 14 Aug 2003 10:49:53 -0400 Organization: Hub.Org Networking Services Lines: 28 Message-ID: <60adaci99q.fsf@dev6.int.libertyrms.info> References: <200308130846.55991.josh@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:IBxl+CLttussBitSqbm3ryDDMhs= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/260 X-Sequence-Number: 3076 threshar@torgo.978.org (Jeff) writes: > On Wed, 13 Aug 2003, Josh Berkus wrote: >> As I have said elsewhere, Informix is probably a poor database to emulate >> since they are effectively an old dead-end fork of the Ingres/Postgres code, >> and have already been "mined" for most of the improvements they made. >> > With informix 7.0 they rewrote the entire thing from the ground up > to remove a bunch of limitations and build a multithreaded engine. > so it isn't so much an old fork anymore. No, I think you misunderstand the intent... The pre-7.0 version was based on Informix's B-Tree libraries, and the file structuring actually bears a marked resemblance to that of MySQL (that's an observation; neither forcibly a good or a bad thing), where there's a data file for the table, and then a bunch of index files, named somewhat after the table. In the 7.0-and-after era, they added in the "old dead-end fork of the Ingres/Postgres code" to get the "Universal Data Server." [This is diverging somewhat from "performance;" let's try to resist extending discussion...] -- (reverse (concatenate 'string "ofni.smrytrebil" "@" "enworbbc")) Christopher Browne (416) 646 3304 x124 (land) From pgsql-performance-owner@postgresql.org Thu Aug 14 12:51: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 8CB24D1F424 for ; Thu, 14 Aug 2003 14:55:19 +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 44749-06 for ; Thu, 14 Aug 2003 11:53:44 -0300 (ADT) Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252]) by svr1.postgresql.org (Postfix) with ESMTP id 4A683D1F595 for ; Thu, 14 Aug 2003 11:55:06 -0300 (ADT) Received: from frmug.org (localhost [127.0.0.1]) by frmug.org (8.12.9/8.11.3/frmug-2.7/nospam) with ESMTP id h7EEssXd076108 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256 bits) verified NO); Thu, 14 Aug 2003 16:54:54 +0200 (CEST) (envelope-from pgsql@phoe.frmug.org) Received: (from uucp@localhost) by frmug.org (8.12.9/8.12.9/Submit) with UUCP id h7EEssPb076105; Thu, 14 Aug 2003 16:54:54 +0200 (CEST) Received: (from elrond@localhost) by memo.frmug.org (8.11.6/8.11.6) id h7EErGr04454; Thu, 14 Aug 2003 16:53:16 +0200 (CEST) (envelope-from pgsql@memo.frmug.org) X-Authentication-Warning: memo.frmug.org: elrond set sender to pgsql@memo.frmug.org using -f Date: Thu, 14 Aug 2003 16:53:11 +0200 From: Bertrand Petit To: Tom Lane Cc: Bertrand Petit , pgsql-performance@postgresql.org Subject: Re: 7.4 beta 1 getting out of swap Message-ID: <20030814165311.A4431@memo.frmug.org> References: <20030814122130.A3583@memo.frmug.org> <15589.1060861546@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <15589.1060861546@sss.pgh.pa.us>; from tgl@sss.pgh.pa.us on Thu, Aug 14, 2003 at 07:45:46AM -0400 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/262 X-Sequence-Number: 3078 On Thu, Aug 14, 2003 at 07:45:46AM -0400, Tom Lane wrote: > > Please show us the memory context size info that the backend dumps to > stderr when it reports "out of memory". Here it is: ============================================================================== TopMemoryContext: 32792 total in 4 blocks; 14600 free (9 chunks); 18192 used TopTransactionContext: 8192 total in 1 blocks; 8136 free (0 chunks); 56 used DeferredTriggerXact: 2088960 total in 8 blocks; 97384 free (6 chunks); 1991576 used MessageContext: 57344 total in 3 blocks; 7552 free (2 chunks); 49792 used PortalMemory: 8192 total in 1 blocks; 8040 free (0 chunks); 152 used PortalHeapMemory: 1024 total in 1 blocks; 936 free (0 chunks); 88 used ExecutorState: 4556232 total in 46 blocks; 3183264 free (8303 chunks); 1372968 used ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used ExecutorState: 528474112 total in 72 blocks; 760 free (1 chunks); 528473352 used ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used ExprContext: 8192 total in 1 blocks; 8176 free (0 chunks); 16 used CacheMemoryContext: 516096 total in 6 blocks; 44208 free (2 chunks); 471888 used raw_atitles_main_title_idx: 1024 total in 1 blocks; 640 free (0 chunks); 384 used raw_atitles_attribs_idx: 1024 total in 1 blocks; 640 free (0 chunks); 384 used raw_atitles_aka_title_idx: 1024 total in 1 blocks; 640 free (0 chunks); 384 used movies_orig_title_idx: 1024 total in 1 blocks; 640 free (0 chunks); 384 used movies_year_idx: 1024 total in 1 blocks; 640 free (0 chunks); 384 used movies_title_idx: 1024 total in 1 blocks; 640 free (0 chunks); 384 used movies_id_idx: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_constraint_conrelid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_attrdef_adrelid_adnum_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used truc: 3144 total in 2 blocks; 1848 free (0 chunks); 1296 used atitles_title_idx: 1024 total in 1 blocks; 640 free (0 chunks); 384 used atitles_movie_id_idx: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_index_indrelid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_type_oid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_type_typname_nsp_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_statistic_relid_att_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_shadow_usesysid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_rewrite_rel_rulename_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_proc_oid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_proc_proname_args_nsp_index: 3144 total in 2 blocks; 1784 free (0 chunks); 1360 used pg_operator_oprname_l_r_n_index: 3144 total in 2 blocks; 1784 free (0 chunks); 1360 used pg_namespace_oid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_namespace_nspname_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_language_oid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_language_name_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_inherits_relid_seqno_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_group_sysid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_group_name_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_conversion_oid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_conversion_name_nsp_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_conversion_default_index: 3144 total in 2 blocks; 1784 free (0 chunks); 1360 used pg_opclass_oid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_opclass_am_name_nsp_index: 3144 total in 2 blocks; 1848 free (0 chunks); 1296 used pg_cast_source_target_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_attribute_relid_attnam_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_amop_opr_opc_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_aggregate_fnoid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_shadow_usename_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_trigger_tgrelid_tgname_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_operator_oid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_amproc_opc_procnum_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_amop_opc_strategy_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_index_indexrelid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_attribute_relid_attnum_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_class_oid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_amproc_opc_procnum_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_operator_oid_index: 1024 total in 1 blocks; 640 free (0 chunks); 384 used pg_amop_opc_strategy_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used pg_class_relname_nsp_index: 1024 total in 1 blocks; 320 free (0 chunks); 704 used MdSmgr: 8192 total in 1 blocks; 6120 free (0 chunks); 2072 used DynaHash: 8192 total in 1 blocks; 7064 free (0 chunks); 1128 used DynaHashTable: 8192 total in 1 blocks; 5080 free (0 chunks); 3112 used DynaHashTable: 8192 total in 1 blocks; 2008 free (0 chunks); 6184 used DynaHashTable: 8192 total in 1 blocks; 3520 free (0 chunks); 4672 used DynaHashTable: 8192 total in 1 blocks; 3520 free (0 chunks); 4672 used DynaHashTable: 24576 total in 2 blocks; 13240 free (4 chunks); 11336 used DynaHashTable: 0 total in 0 blocks; 0 free (0 chunks); 0 used DynaHashTable: 0 total in 0 blocks; 0 free (0 chunks); 0 used DynaHashTable: 0 total in 0 blocks; 0 free (0 chunks); 0 used DynaHashTable: 0 total in 0 blocks; 0 free (0 chunks); 0 used DynaHashTable: 0 total in 0 blocks; 0 free (0 chunks); 0 used ErrorContext: 8192 total in 1 blocks; 8176 free (8 chunks); 16 used ============================================================================== -- %!PS 297.6 420.9 translate 90 rotate 0 setgray gsave 0 1 1{pop 0 180 moveto 100 180 170 100 170 -10 curveto 180 -9 180 -9 190 -10 curveto 190 100 100 180 0 180 curveto fill 180 rotate}for grestore/Bookman-LightItalic findfont 240 scalefont setfont -151.536392 -63.7998886 moveto (bp)show showpage From pgsql-performance-owner@postgresql.org Thu Aug 14 12:39: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 4C981D1B524 for ; Thu, 14 Aug 2003 15:19:33 +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 46113-10 for ; Thu, 14 Aug 2003 12:17:52 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 5941CD1B52C for ; Thu, 14 Aug 2003 12:19:21 -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 h7EFJKek085211 for ; Thu, 14 Aug 2003 15:19:20 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7EEvS1w078478 for pgsql-performance@postgresql.org; Thu, 14 Aug 2003 14:57:28 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Perfomance Tuning Date: Thu, 14 Aug 2003 10:57:33 -0400 Organization: Hub.Org Networking Services Lines: 81 Message-ID: <604r0ki8wy.fsf@dev6.int.libertyrms.info> References: <603cg5v15d.fsf@dev6.int.libertyrms.info> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:ORvo16AGBEtkTuDJ6adTPIfaNpw= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/259 X-Sequence-Number: 3075 threshar@torgo.978.org (Jeff) writes: > On Wed, 13 Aug 2003, Christopher Browne wrote: >> You raise a good point vis-a-vis the thought of spawning multiple >> readers; that could conceivably be a useful approach to improve >> performance for very large queries. If you could "stripe" the tables >> in some manner so they could be doled out to multiple worker >> processes, that could indeed provide some benefits. If there are >> three workers, they might round-robin to grab successive pages from >> the table to do their work, and then end with a merge step. > > The way informix does this is two fold: > 1. it handles the raw disks, it knows where table data is The thing is, this isn't something where there is guaranteed to be a permanent _massive_ difference in performance between "raw" and "cooked." Traditionally, "handling raw disks" was a big deal because the DBMS could then decide where to stick the data, possibly down to specifying what sector of what track of what spindle. There are four reasons for this to not be such a big deal anymore: 1. Disk drives lie to you. They don't necessarily provide information that even _resembles_ their true geometry. So the best you can get is to be sure that "this block was on drive 4, that block was on drive 7." 2. On a big system, you're more than likely using hardware RAID, where there's further cacheing, and where the disk array may not be honest to the DBMS about where the drives actually are. 3. The other traditional benefit to "raw" disks was that they allowed the DBMS to be _certain_ that data was committed in some particular order. But 1. and 2. provide regrettable opportunities for the DBMS' belief to be forlorn. (With the degree to which disk drives lie about things, I have to be a bit skeptical of some of the BSD FFS claims which at least appear to assume that they _do_ control the disk drive... This is NOT reason, by the way, to consider FFS to be, in any way, "bad," but rather just that some of the guarantees may get stolen by your disk drive...) 4. Today's filesystems _aren't_ Grandpa's UFS. We've got better stuff than we had back in the Ultrix days. > 2. it can "partition" tables in a number of ways: round robin, > concatination or expression (Expression is nifty, allows you to use a > basic "where" clause to decide where to put data. ie > create table foo ( > a int, > b int, > c int ) fragment on c > 0 and c < 100 in dbspace1, c > 100 c < 200 in > dbspace 2; > > that kind of thing. I remember thinking this was rather neat when I first saw it. The "fragment on" part was most interesting at the time, when everyone else (including filesystem makers) were decrying fragmentation as the ultimate evil. In effect, Informix was saying that they would _improve_ performance through fragmentation... Sort of like the rash claim that performance can be improved _without_ resorting to a threading-based model... > and yeah, I would not expect to see it for a long time.. Without > threading it would be rather difficult to implement.. but who knows > what the future will bring us. The typical assumption is that threading is a magical talisman that will bring all sorts of benefits. There have been enough cases where PostgreSQL has demonstrated stunning improvements _without_ threading that I am very skeptical that it is necessarily necessary. -- output = reverse("gro.gultn" "@" "enworbbc") http://www3.sympatico.ca/cbbrowne/sap.html Rules of the Evil Overlord #204. "I will hire an entire squad of blind guards. Not only is this in keeping with my status as an equal opportunity employer, but it will come in handy when the hero becomes invisible or douses my only light source." From pgsql-performance-owner@postgresql.org Thu Aug 14 12:44: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 45014D1C943 for ; Thu, 14 Aug 2003 15:04:23 +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 46387-05 for ; Thu, 14 Aug 2003 12:02:43 -0300 (ADT) Received: from smtp016.mail.yahoo.com (smtp016.mail.yahoo.com [216.136.174.113]) by svr1.postgresql.org (Postfix) with SMTP id DA744D1C4F1 for ; Thu, 14 Aug 2003 12:04:11 -0300 (ADT) Received: from pcp01341166pcs.wilog301.pa.comcast.net (HELO europa.janwieck.net) (janwieck@68.80.245.191 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 14 Aug 2003 15:04:10 -0000 Received: from Yahoo.com (ismtp.afilias.com [216.217.55.254]) (authenticated) by europa.janwieck.net (8.11.6/8.11.6) with ESMTP id h7EF49H14055; Thu, 14 Aug 2003 11:04:12 -0400 Message-ID: <3F3BA49D.9070405@Yahoo.com> Date: Thu, 14 Aug 2003 11:02:53 -0400 From: Jan Wieck Organization: Unorganized User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Scott Cain , PgSQL Performance ML , pgsql-sql@postgresql.org Subject: Re: [SQL] EXTERNAL storage and substring on long strings References: <1059679600.1429.41.camel@localhost.localdomain> <3F297CBA.1080703@joeconway.com> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> <3574.1060012423@sss.pgh.pa.us> In-Reply-To: <3574.1060012423@sss.pgh.pa.us> 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: 200308/261 X-Sequence-Number: 3077 Tom Lane wrote: > Scott Cain writes: >> At least this appears to work and is much faster, completing substring >> operations like above in about 0.27 secs (that's about two orders of >> magnitude improvement!) > > I find it really, really hard to believe that a crude reimplementation > in plpgsql of the TOAST concept could beat the built-in implementation > at all, let alone beat it by two orders of magnitude. > > Either there's something unrealistic about your testing of the > dna_string function, or your original tests are not causing TOAST to be > invoked in the expected way, or there's a bug we need to fix. I'd > really like to see some profiling of the poor-performing > external-storage case, so we can figure out what's going on. Doesn't look that unrealistic to me. A plain text based substring function will reassemble the whole beast first before cutting out the wanted part. His manually chunked version will read only those chunks needed. Considering that he's talking about retrieving a few thousand chars from a hundreds of MB size string ... Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com # From pgsql-performance-owner@postgresql.org Thu Aug 14 12:39: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 34650D1B524 for ; Thu, 14 Aug 2003 15:21:33 +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 46250-10 for ; Thu, 14 Aug 2003 12:19:52 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 1AC68D1B4F0 for ; Thu, 14 Aug 2003 12:21:21 -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 h7EFIh5H001579; Thu, 14 Aug 2003 11:18:43 -0400 (EDT) To: Bertrand Petit Cc: pgsql-performance@postgresql.org Subject: Re: 7.4 beta 1 getting out of swap In-reply-to: <20030814165311.A4431@memo.frmug.org> References: <20030814122130.A3583@memo.frmug.org> <15589.1060861546@sss.pgh.pa.us> <20030814165311.A4431@memo.frmug.org> Comments: In-reply-to Bertrand Petit message dated "Thu, 14 Aug 2003 16:53:11 +0200" Date: Thu, 14 Aug 2003 11:18:42 -0400 Message-ID: <1578.1060874322@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/258 X-Sequence-Number: 3075 Bertrand Petit writes: > On Thu, Aug 14, 2003 at 07:45:46AM -0400, Tom Lane wrote: >> Please show us the memory context size info that the backend dumps to >> stderr when it reports "out of memory". > Here it is: > ExecutorState: 4556232 total in 46 blocks; 3183264 free (8303 chunks); 1372968 used That seems a bit large, but I'm not sure if it's really to worry about. > ExecutorState: 528474112 total in 72 blocks; 760 free (1 chunks); 528473352 used Okay, you definitely must have a memory leak in query execution. Could you provide enough info to let someone else reproduce it? We don't need your data, but a schema dump (pg_dump -s) would be nice to avoid trying to guess what causes it. regards, tom lane From pgsql-performance-owner@postgresql.org Thu Aug 14 14:59:46 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 F0916D1C7F7 for ; Thu, 14 Aug 2003 17:56: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 09884-07 for ; Thu, 14 Aug 2003 14:55:53 -0300 (ADT) Received: from ctg-msnex01.staff.berbee.com (msn-office1.binc.net [64.73.12.254]) by svr1.postgresql.org (Postfix) with ESMTP id A33F2D1B52C for ; Thu, 14 Aug 2003 14:55:51 -0300 (ADT) Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnex01.staff.berbee.com with Microsoft SMTPSVC(5.0.2195.5329); Thu, 14 Aug 2003 12:55:37 -0500 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: pgsql-performance@postgresql.org Subject: Vacuum performance question Date: Thu, 14 Aug 2003 12:55:32 -0500 User-Agent: KMail/1.5.3 MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline Message-Id: <200308141255.36225.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 14 Aug 2003 17:55:37.0238 (UTC) FILETIME=[444E0360:01C3628D] X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/263 X-Sequence-Number: 3079 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 My database is approximately 8gb in size. My application is 24/7. I'm=20 constantly cycling through data. I analyze every 15 minutes but I'm notici= ng=20 that during a vacuum the database becomes extremely sluggish. In some cases the operation of my software goes from 1-3 second runtime to= =20 300+ seconds during a vacuum. Should I expect this with a vacuum? I've done reading online where people = say=20 they see only a 10% decrease in speed. Is this supposed to be the norm? I've allocated 196MB of RAM to vacuums. The system is a dual P4-2.4ghz w/ 1.5 gig of RAM w/ 36 gig of RAID mirrored= =20 disk. I'm runing 7.3.2 and I am upgrading to 7.3.3 next week. Please advise. - --=20 Jeremy M. Guthrie Systems Engineer Berbee 5520 Research Park Dr. Madison, WI 53711 Phone: 608-298-1061 Berbee...Decade 1. 1993-2003 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/O80UqtjaBHGZBeURAqmLAJ9kxh0DyaZm3pAP77XGlDTq5JcsowCfeqpC 36SjIo5XW44bEkmHnbwXXBQ=3D =3DoozQ -----END PGP SIGNATURE----- From pgsql-performance-owner@postgresql.org Thu Aug 14 15:13: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 0195AD1F05A for ; Thu, 14 Aug 2003 18:00:51 +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 10958-10 for ; Thu, 14 Aug 2003 15:00:41 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id CA1BFD1F413 for ; Thu, 14 Aug 2003 15:00:20 -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 h7EI0L5H006312; Thu, 14 Aug 2003 14:00:21 -0400 (EDT) To: Jan Wieck Cc: Scott Cain , PgSQL Performance ML , pgsql-sql@postgresql.org Subject: Re: [SQL] EXTERNAL storage and substring on long strings In-reply-to: <3F3BA49D.9070405@Yahoo.com> References: <1059679600.1429.41.camel@localhost.localdomain> <3F297CBA.1080703@joeconway.com> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> <3574.1060012423@sss.pgh.pa.us> <3F3BA49D.9070405@Yahoo.com> Comments: In-reply-to Jan Wieck message dated "Thu, 14 Aug 2003 11:02:53 -0400" Date: Thu, 14 Aug 2003 14:00:21 -0400 Message-ID: <6311.1060884021@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/265 X-Sequence-Number: 3081 Jan Wieck writes: > Doesn't look that unrealistic to me. A plain text based substring > function will reassemble the whole beast first before cutting out the > wanted part. His manually chunked version will read only those chunks > needed. So does substr(), if applied to EXTERNAL (non-compressed) toasted text. See John Gray's improvements a release or two back. regards, tom lane From pgsql-performance-owner@postgresql.org Thu Aug 14 15:11:38 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 8A7B5D1F62C for ; Thu, 14 Aug 2003 18:08:16 +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 19404-07 for ; Thu, 14 Aug 2003 15:08:06 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 85F6FD1C939 for ; Thu, 14 Aug 2003 15:05:18 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id B9DA91024D; Thu, 14 Aug 2003 13:57:25 -0400 (EDT) Received: from [10.0.2.6] (unknown [10.0.2.6]) by mailav.tor1.inquent.com (Postfix) with ESMTP id C914A10248; Thu, 14 Aug 2003 13:57:23 -0400 (EDT) Subject: Re: Vacuum performance question From: Rod Taylor To: jeremy.guthrie@berbee.com Cc: Postgresql Performance In-Reply-To: <200308141255.36225.jeremy.guthrie@berbee.com> References: <200308141255.36225.jeremy.guthrie@berbee.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-6TsFzeY0KSMrE9GItv1I" Message-Id: <1060884297.14006.27.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 14 Aug 2003 14:04:58 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/264 X-Sequence-Number: 3080 --=-6TsFzeY0KSMrE9GItv1I Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > I've allocated 196MB of RAM to vacuums. I would be willing to bet that you have kicked the system into swap because of this. Hence the large decrease in speed. Try sliding back to 32MB for vacuum. A ton more ram doesn't really help it all that much. --=-6TsFzeY0KSMrE9GItv1I Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQA/O89J6DETLow6vwwRAmSjAJ9mfifGLjmBFgwtjIjF8iM4DIrDJgCbB3sk r8l5SYaUC/kEAWJgtCCkOcg= =rzzF -----END PGP SIGNATURE----- --=-6TsFzeY0KSMrE9GItv1I-- From pgsql-performance-owner@postgresql.org Thu Aug 14 15:19: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 778E4D1F473 for ; Thu, 14 Aug 2003 18:18: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 23441-05 for ; Thu, 14 Aug 2003 15:18:38 -0300 (ADT) Received: from mail-2.zoominternet.net (mail-2.zoominternet.net [63.67.120.22]) by svr1.postgresql.org (Postfix) with SMTP id 2B4B0D1F6AC for ; Thu, 14 Aug 2003 15:11:13 -0300 (ADT) Received: (qmail 15194 invoked from network); 14 Aug 2003 18:11:10 -0000 Received: from acs-24-154-209-142.zoominternet.net (HELO gmod.lajolla) ([24.154.209.142]) (envelope-sender ) by mail-2.zoominternet.net (qmail-ldap-1.03) with SMTP for ; 14 Aug 2003 18:11:10 -0000 Subject: Re: [SQL] EXTERNAL storage and substring on long strings From: Scott Cain To: Tom Lane Cc: Jan Wieck , PgSQL Performance ML , pgsql-sql@postgresql.org In-Reply-To: <6311.1060884021@sss.pgh.pa.us> References: <1059679600.1429.41.camel@localhost.localdomain> <3F297CBA.1080703@joeconway.com> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> <3574.1060012423@sss.pgh.pa.us> <3F3BA49D.9070405@Yahoo.com> <6311.1060884021@sss.pgh.pa.us> Content-Type: text/plain Organization: Cold Spring Harbor Lab Message-Id: <1060884667.1430.6.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 14 Aug 2003 14:11:07 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/266 X-Sequence-Number: 3082 Agreed. When I actually Did It Right (tm), EXTERNAL storage gave similar (probably better) performance as my shredding method, without all the hoops to breakup and reassemble the string. Scott On Thu, 2003-08-14 at 14:00, Tom Lane wrote: > Jan Wieck writes: > > Doesn't look that unrealistic to me. A plain text based substring > > function will reassemble the whole beast first before cutting out the > > wanted part. His manually chunked version will read only those chunks > > needed. > > So does substr(), if applied to EXTERNAL (non-compressed) toasted text. > See John Gray's improvements a release or two back. > > regards, tom lane -- ------------------------------------------------------------------------ Scott Cain, Ph. D. cain@cshl.org GMOD Coordinator (http://www.gmod.org/) 216-392-3087 Cold Spring Harbor Laboratory From pgsql-performance-owner@postgresql.org Thu Aug 14 16:12:12 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 C7B96D1C4D5 for ; Thu, 14 Aug 2003 18:57: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 34304-07 for ; Thu, 14 Aug 2003 15:56:53 -0300 (ADT) Received: from smtp101.mail.sc5.yahoo.com (smtp101.mail.sc5.yahoo.com [216.136.174.139]) by svr1.postgresql.org (Postfix) with SMTP id C74F6D1C9BE for ; Thu, 14 Aug 2003 15:56:50 -0300 (ADT) Received: from pcp01341166pcs.wilog301.pa.comcast.net (HELO europa.janwieck.net) (janwieck@68.80.245.191 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 14 Aug 2003 18:56:51 -0000 Received: from Yahoo.com (ismtp.afilias.com [216.217.55.254]) (authenticated) by europa.janwieck.net (8.11.6/8.11.6) with ESMTP id h7EIusH14569; Thu, 14 Aug 2003 14:56:54 -0400 Message-ID: <3F3BDB2A.40506@Yahoo.com> Date: Thu, 14 Aug 2003 14:55:38 -0400 From: Jan Wieck Organization: Unorganized User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Scott Cain , PgSQL Performance ML , pgsql-sql@postgresql.org Subject: Re: [SQL] EXTERNAL storage and substring on long strings References: <1059679600.1429.41.camel@localhost.localdomain> <3F297CBA.1080703@joeconway.com> <1059686498.7505.558.camel@haggis> <1060010735.1433.26.camel@localhost.localdomain> <3574.1060012423@sss.pgh.pa.us> <3F3BA49D.9070405@Yahoo.com> <6311.1060884021@sss.pgh.pa.us> In-Reply-To: <6311.1060884021@sss.pgh.pa.us> 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: 200308/267 X-Sequence-Number: 3083 Tom Lane wrote: > Jan Wieck writes: >> Doesn't look that unrealistic to me. A plain text based substring >> function will reassemble the whole beast first before cutting out the >> wanted part. His manually chunked version will read only those chunks >> needed. > > So does substr(), if applied to EXTERNAL (non-compressed) toasted text. > See John Gray's improvements a release or two back. Duh ... of course, EXTERNAL is uncompressed ... where do I have my head? Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com # From pgsql-performance-owner@postgresql.org Thu Aug 14 16:38:33 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 1A850D1B561 for ; Thu, 14 Aug 2003 19:30: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 48213-06 for ; Thu, 14 Aug 2003 16:29:59 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 65BE8D1C984 for ; Thu, 14 Aug 2003 16:29:57 -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 h7EJS45H006955; Thu, 14 Aug 2003 15:28:04 -0400 (EDT) To: jeremy.guthrie@berbee.com Cc: pgsql-performance@postgresql.org Subject: Re: Vacuum performance question In-reply-to: <200308141255.36225.jeremy.guthrie@berbee.com> References: <200308141255.36225.jeremy.guthrie@berbee.com> Comments: In-reply-to "Jeremy M. Guthrie" message dated "Thu, 14 Aug 2003 12:55:32 -0500" Date: Thu, 14 Aug 2003 15:28:04 -0400 Message-ID: <6954.1060889284@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/268 X-Sequence-Number: 3084 "Jeremy M. Guthrie" writes: > In some cases the operation of my software goes from 1-3 second runtime to > 300+ seconds during a vacuum. That seems like a lot. I concur with the nearby recommendation to reduce vacuum_mem, but I think there may be another problem. You should watch top, iostat, vmstat during a vacuum to try to see what resource is getting saturated. > I'm runing 7.3.2 and I am upgrading to 7.3.3 next week. 7.3.4, please. 7.3.3 has at least one nasty bug. regards, tom lane From pgsql-performance-owner@postgresql.org Thu Aug 14 19:03:26 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 B7B10D1C510 for ; Thu, 14 Aug 2003 21:48: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 01591-01 for ; Thu, 14 Aug 2003 18:48:00 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id BD864D1F443 for ; Thu, 14 Aug 2003 18:47:42 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7ELl1Q11939; Thu, 14 Aug 2003 17:47:01 -0400 (EDT) From: Bruce Momjian Message-Id: <200308142147.h7ELl1Q11939@candle.pha.pa.us> Subject: Re: Perfomance Tuning In-Reply-To: To: Jeff Date: Thu, 14 Aug 2003 17:47:01 -0400 (EDT) Cc: Christopher Browne , "pgsql-performance@postgresql.org" X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/270 X-Sequence-Number: 3086 Jeff wrote: > > You raise a good point vis-a-vis the thought of spawning multiple > > readers; that could conceivably be a useful approach to improve > > performance for very large queries. If you could "stripe" the tables > > in some manner so they could be doled out to multiple worker > > processes, that could indeed provide some benefits. If there are > > three workers, they might round-robin to grab successive pages from > > the table to do their work, and then end with a merge step. > > The way informix does this is two fold: > 1. it handles the raw disks, it knows where table data is > 2. it can "partition" tables in a number of ways: round robin, > concatination or expression (Expression is nifty, allows you to use a > basic "where" clause to decide where to put data. ie > create table foo ( > a int, > b int, > c int ) fragment on c > 0 and c < 100 in dbspace1, c > 100 c < 200 in > dbspace 2; > > that kind of thing. > and yeah, I would not expect to see it for a long time.. Without threading > it would be rather difficult to implement.. but who knows what the future > will bring us. The big question is whether the added complexity is worth it. I know Informix 5 was faster than Informix 7 on single CPU machines for quite a while. It might still be true. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Thu Aug 14 19:03: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 C8639D1C9DC for ; Thu, 14 Aug 2003 21:52:25 +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 01846-02 for ; Thu, 14 Aug 2003 18:52:16 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 859D2D1B561 for ; Thu, 14 Aug 2003 18:52:07 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7ELppX12599; Thu, 14 Aug 2003 17:51:51 -0400 (EDT) From: Bruce Momjian Message-Id: <200308142151.h7ELppX12599@candle.pha.pa.us> Subject: Re: Perfomance Tuning In-Reply-To: <60adaci99q.fsf@dev6.int.libertyrms.info> To: Christopher Browne Date: Thu, 14 Aug 2003 17:51:51 -0400 (EDT) Cc: pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/269 X-Sequence-Number: 3085 Christopher Browne wrote: > threshar@torgo.978.org (Jeff) writes: > > On Wed, 13 Aug 2003, Josh Berkus wrote: > >> As I have said elsewhere, Informix is probably a poor database to emulate > >> since they are effectively an old dead-end fork of the Ingres/Postgres code, > >> and have already been "mined" for most of the improvements they made. > >> > > With informix 7.0 they rewrote the entire thing from the ground up > > to remove a bunch of limitations and build a multithreaded engine. > > so it isn't so much an old fork anymore. > > No, I think you misunderstand the intent... > > The pre-7.0 version was based on Informix's B-Tree libraries, and the > file structuring actually bears a marked resemblance to that of MySQL > (that's an observation; neither forcibly a good or a bad thing), where > there's a data file for the table, and then a bunch of index files, > named somewhat after the table. > > In the 7.0-and-after era, they added in the "old dead-end fork of the > Ingres/Postgres code" to get the "Universal Data Server." I think 9.0 was the the Ingres/Postgres code, not 7.X. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-hackers-owner@postgresql.org Thu Aug 14 21:31:11 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id DBA53D1B524 for ; Fri, 15 Aug 2003 00:18:12 +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 32971-02 for ; Thu, 14 Aug 2003 21:18:05 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id A508DD1B56B for ; Thu, 14 Aug 2003 21:18:01 -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 h7F0Hp5H008827; Thu, 14 Aug 2003 20:17:51 -0400 (EDT) To: Bertrand Petit Cc: Joe Conway , pgsql-hackers@postgreSQL.org Subject: Re: 7.4 beta 1 getting out of swap In-reply-to: <20030815001730.A5628@memo.frmug.org> References: <20030814122130.A3583@memo.frmug.org> <15589.1060861546@sss.pgh.pa.us> <20030814165311.A4431@memo.frmug.org> <1578.1060874322@sss.pgh.pa.us> <20030814200947.A4769@memo.frmug.org> <7037.1060889820@sss.pgh.pa.us> <20030814215410.A5336@memo.frmug.org> <7271.1060891412@sss.pgh.pa.us> <20030815001730.A5628@memo.frmug.org> Comments: In-reply-to Bertrand Petit message dated "Fri, 15 Aug 2003 00:17:30 +0200" Date: Thu, 14 Aug 2003 20:17:50 -0400 Message-ID: <8826.1060906670@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/781 X-Sequence-Number: 42438 Bertrand Petit writes: > And I just got another one, much simpler, that failed the same > way with the same data set: > UPDATE rimdb_atitles SET aka_title=convert(byte_title,charset,'UTF8'); [ where rimdb_atitles has an index on column "attribs varchar[]" ] Uh-huh. Actually, any large insert or update on that table will run out of memory, I bet. The problem appears to be due to the newly-added support for indexing array columns --- array_cmp() leaks memory, which is verboten for index support operators. At first I thought this would be an easy fix --- just rewrite array_cmp to not depend on deconstruct_array, as array_eq already does not. I soon found that that only reduced the speed of leakage, however. The real problem comes from the fact that array_eq and array_cmp expect to be able to save information across calls using flinfo->fn_extra. While this works to some extent, the btree routines generate a new scankey --- with a nulled fn_extra --- for every index AM call. btree knows to delete the scankey when it's done, but it doesn't know anything about deleting what fn_extra points to. (Even if it did, there is additional leakage inside equality_oper(), which would be very difficult to clean up directly.) Quite aside from the memory leak problem, it's annoying to think that the array element information will be looked up again on every btree operation. That seems expensive. I can think of a number of ways we might attack this, but none seem especially attractive --- 1. Have the index AMs create and switch into a special memory context for each call, rather than running in the main execution context. I am not sure this is workable at all, since the AMs tend to think they can create data structures that will live across calls (for example a btree lookup stack). It'd be the most general solution, if we could make it work. 2. Modify the index AMs so that the comparison function FmgrInfo is preserved across a whole query. I think this requires changes to the index AM API (index_insert for instance has no provision for sharing data across multiple calls). Messy, and would likely mean an initdb. It would probably be the fastest answer though, since lookups wouldn't need to be done more than once per query. 3. Set up a long-lived cache internal to the array functions that can translate element type OID to the needed lookup data, and won't leak memory across repeated calls. This is not the fastest or most general solution, but it seems the most localized and safest fix. Has anyone got some other ideas? regards, tom lane From pgsql-hackers-owner@postgresql.org Thu Aug 14 21:47:52 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 78355D1C4B8 for ; Fri, 15 Aug 2003 00:42:33 +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 39822-04 for ; Thu, 14 Aug 2003 21:42:25 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 542D4D1C4C7 for ; Thu, 14 Aug 2003 21:42:20 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7F0fqn08208; Thu, 14 Aug 2003 20:41:52 -0400 (EDT) From: Bruce Momjian Message-Id: <200308150041.h7F0fqn08208@candle.pha.pa.us> Subject: Re: 7.4 beta 1 getting out of swap In-Reply-To: <8826.1060906670@sss.pgh.pa.us> To: Tom Lane Date: Thu, 14 Aug 2003 20:41:52 -0400 (EDT) Cc: Bertrand Petit , Joe Conway , pgsql-hackers@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/782 X-Sequence-Number: 42439 > I can think of a number of ways we might attack this, but none seem > especially attractive --- > > 1. Have the index AMs create and switch into a special memory context > for each call, rather than running in the main execution context. > I am not sure this is workable at all, since the AMs tend to think they > can create data structures that will live across calls (for example a > btree lookup stack). It'd be the most general solution, if we could > make it work. > > 2. Modify the index AMs so that the comparison function FmgrInfo is > preserved across a whole query. I think this requires changes to the > index AM API (index_insert for instance has no provision for sharing > data across multiple calls). Messy, and would likely mean an initdb. > It would probably be the fastest answer though, since lookups wouldn't > need to be done more than once per query. #2 seems most natural in that it formalizes something that is common for lots of index methods. We are only in beta1, so I think we can initdb. > 3. Set up a long-lived cache internal to the array functions that can > translate element type OID to the needed lookup data, and won't leak > memory across repeated calls. This is not the fastest or most general > solution, but it seems the most localized and safest fix. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-hackers-owner@postgresql.org Fri Aug 15 00:41:45 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 9C0A8D1C4DF for ; Fri, 15 Aug 2003 02:51:20 +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 50897-08 for ; Thu, 14 Aug 2003 23:51:10 -0300 (ADT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id E484BD1C4C7 for ; Thu, 14 Aug 2003 23:51:05 -0300 (ADT) Received: from [192.168.5.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.0.6) with ESMTP-TLS id 31704; Thu, 14 Aug 2003 19:09:59 -0700 Message-ID: <3F3C497C.1050200@joeconway.com> Date: Thu, 14 Aug 2003 19:46:20 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Bertrand Petit , pgsql-hackers@postgreSQL.org Subject: Re: 7.4 beta 1 getting out of swap References: <20030814122130.A3583@memo.frmug.org> <15589.1060861546@sss.pgh.pa.us> <20030814165311.A4431@memo.frmug.org> <1578.1060874322@sss.pgh.pa.us> <20030814200947.A4769@memo.frmug.org> <7037.1060889820@sss.pgh.pa.us> <20030814215410.A5336@memo.frmug.org> <7271.1060891412@sss.pgh.pa.us> <20030815001730.A5628@memo.frmug.org> <8826.1060906670@sss.pgh.pa.us> In-Reply-To: <8826.1060906670@sss.pgh.pa.us> 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: 200308/784 X-Sequence-Number: 42441 Tom Lane wrote: > Bertrand Petit writes: >> And I just got another one, much simpler, that failed the same >>way with the same data set: >>UPDATE rimdb_atitles SET aka_title=convert(byte_title,charset,'UTF8'); > > [ where rimdb_atitles has an index on column "attribs varchar[]" ] > > Uh-huh. Actually, any large insert or update on that table will run out > of memory, I bet. The problem appears to be due to the newly-added > support for indexing array columns --- array_cmp() leaks memory, which > is verboten for index support operators. Ugh. > I can think of a number of ways we might attack this, but none seem > especially attractive --- > > 1. Have the index AMs create and switch into a special memory context > for each call, rather than running in the main execution context. > I am not sure this is workable at all, since the AMs tend to think they > can create data structures that will live across calls (for example a > btree lookup stack). It'd be the most general solution, if we could > make it work. This seems like a risky change at this point. > 2. Modify the index AMs so that the comparison function FmgrInfo is > preserved across a whole query. I think this requires changes to the > index AM API (index_insert for instance has no provision for sharing > data across multiple calls). Messy, and would likely mean an initdb. > It would probably be the fastest answer though, since lookups wouldn't > need to be done more than once per query. This seems like a fairly big change this late in the game too. > 3. Set up a long-lived cache internal to the array functions that can > translate element type OID to the needed lookup data, and won't leak > memory across repeated calls. This is not the fastest or most general > solution, but it seems the most localized and safest fix. > I think I like #3 the best, but maybe that's because it's the one I think I understand the best ;-) It seems to me that #3 is the least risky, and even if it isn't the best possible performance, this is the initial implementation of indexes on arrays, so it isn't like we're taking away something. Maybe solution #2 is better held as a performance enhancement for 7.5. Do you want me to take a shot at this since I created the mess? Joe From pgsql-performance-owner@postgresql.org Fri Aug 15 06:13:23 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 CE479D1B524 for ; Fri, 15 Aug 2003 06:34:36 +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 01272-01 for ; Fri, 15 Aug 2003 03:34:25 -0300 (ADT) Received: from beth.coza.net.za (beth.coza.net.za [206.223.136.193]) by svr1.postgresql.org (Postfix) with ESMTP id 4E117D1C50D for ; Fri, 15 Aug 2003 03:34:21 -0300 (ADT) Received: from coza.net.za (mixo.coza.net.za [206.223.136.225]) by beth.coza.net.za (8.11.6/8.11.2) with ESMTP id h7F6YJo12926 for ; Fri, 15 Aug 2003 08:34:21 +0200 Message-ID: <3F3C7ED5.7050807@coza.net.za> Date: Fri, 15 Aug 2003 08:33:57 +0200 From: mixo Reply-To: mixo@coza.net.za User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030811 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Benchmark Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/271 X-Sequence-Number: 3087 I have the following setup : Apache 2 + mod_perl 2 Postgres 7.3.2 I need to is measure the perfomance of a ticketing system (written in perl) which has web interface (html::mason, apache2) with Pg as a backend. Users of the ticketing system can only connect to the backend via the web interface and they usually login to the system at the begining of the the day and remain connected untill they knock of. I have setup two test machines, one with Pg and the other with Mysql. Both machine have the same data (sample). I am looking for a benchmark utilty that the simulate a user session. For example, a user login in, displaying a ticket and searching for tickets; all these invlove a user connecting to the a url, like for search, a user needs to open "somehost.domain/path/to/search.html?with=arguments". The utiltly needs to simulate these actions. The following tools currently have so far caught my attention: Apache Jmeter ab I need suggestions for other utilities. From pgsql-performance-owner@postgresql.org Fri Aug 15 07:26:45 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 D7AEED1C50D for ; Fri, 15 Aug 2003 09:32:36 +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 18581-06 for ; Fri, 15 Aug 2003 06:32:28 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id 56DA6D1B539 for ; Fri, 15 Aug 2003 06:32:25 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7F9WNi28136 for ; Fri, 15 Aug 2003 11:32:23 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7F9WLV28126; Fri, 15 Aug 2003 11:32:21 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id 7050E6FCCC; Fri, 15 Aug 2003 11:32:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id 64E837F6CC; Fri, 15 Aug 2003 11:32:11 +0200 (CEST) Date: Fri, 15 Aug 2003 11:32:11 +0200 (CEST) From: Tomka Gergely To: mixo Cc: Subject: Re: Benchmark In-Reply-To: <3F3C7ED5.7050807@coza.net.za> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/272 X-Sequence-Number: 3088 2003-08-15 ragyog=F3 napj=E1n mixo ezt =FCzente: > For example, a user login in, displaying a ticket and searching for ticke= ts; > all these invlove a user connecting to the a url, like for search, a > user needs > to open "somehost.domain/path/to/search.html?with=3Darguments". The > utiltly needs > to simulate these actions. Maybe a simple script, with lines like this: #!/bin/bash wget http://somehost.domain/path/to/search.html?with=3Darguments wget http://somehost.domain/another/script.html ... ? --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-performance-owner@postgresql.org Fri Aug 15 08:13:38 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 BD66ED1C4B8 for ; Fri, 15 Aug 2003 10:05: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 28506-02 for ; Fri, 15 Aug 2003 07:05:01 -0300 (ADT) Received: from host8.checkdomain.de (host8.checkdomain.de [62.116.141.18]) by svr1.postgresql.org (Postfix) with ESMTP id 42EF3D1B539 for ; Fri, 15 Aug 2003 07:04:58 -0300 (ADT) Received: from schlichting.net (pD9E63F3D.dip.t-dialin.net [217.230.63.61]) (authenticated) by host8.checkdomain.de (8.11.2/8.11.6) with ESMTP id h7FA4FE09825; Fri, 15 Aug 2003 12:04:56 +0200 Message-ID: <3F3CB08C.9080308@schlichting.net> Date: Fri, 15 Aug 2003 12:06:04 +0200 From: Toni Schlichting User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030617 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Christopher Browne Cc: pgsql-performance@postgresql.org Subject: Re: On Linux Filesystems References: <20030810200440.B2396@cookie> <3032.1060617279@sss.pgh.pa.us> <20030811100740.D2396@cookie> <3855.1060622959@sss.pgh.pa.us> <20030811104447.G2396@cookie> <4146.1060624411@sss.pgh.pa.us> 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: 200308/273 X-Sequence-Number: 3089 Christopher, I appreciate your comments. At the end it goes down to personal experience with one or the other file system. From that I can tell, that I have made good experience with UFS, EXT2, and XFS. I made catastrophic ex- perience with ReiserFS (not during operation but you are a looser when it fails because the recovery methods are likely to be insufficient) So at the end if somebody runs technical equipment, regardless whether it's a computer or a chemical fab. It can fail and you need to make up your mind about contingency. This is due even before you start operating the equipment. So waste too much time on thinking about the perfect file system. But evaluate the potential damage that can result from failure. Develop a Backup&Recovery strategy and test it, test it and test it again, so that you can do it blindly when it's due. Ciao, Toni >I wish there were more "hard and fast" conclusions to draw, to be able >to conclusively say that one or another Linux filesystem was >unambiguously preferable for use with PostgreSQL. There are not >conclusive metrics, either in terms of speed or of some notion of >"reliability." I'd expect ReiserFS to be the poorest choice, and for >XFS to be the best, but I only have fuzzy reasons, as opposed to >metrics. > >The absence of measurable metrics of the sort is _NOT_ a proof that >(say) FreeBSD is conclusively preferable, whatever your own >preferences (I'll try to avoid characterizing it as "prejudices," as >that would be unkind) may be. That would represent a quite separate >debate, and one that doesn't belong here, certainly not on a thread >where the underlying question was "Which Linux FS is preferred?" > >If the OSDB TPC-like benchmarks can get "packaged" up well enough to >easily run and rerun them, there's hope of getting better answers, >perhaps even including performance metrics for *BSD. That, not >Linux-baiting, is the answer... > > From pgsql-hackers-owner@postgresql.org Fri Aug 15 08:41:37 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 69DE2D1C4B8 for ; Fri, 15 Aug 2003 11:10: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 34525-05 for ; Fri, 15 Aug 2003 08:10:03 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 63873D1C918 for ; Fri, 15 Aug 2003 08:10:00 -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 h7FB9x5H012304; Fri, 15 Aug 2003 07:09:59 -0400 (EDT) To: Joe Conway Cc: Bertrand Petit , pgsql-hackers@postgresql.org Subject: Re: 7.4 beta 1 getting out of swap In-reply-to: <3F3C497C.1050200@joeconway.com> References: <20030814122130.A3583@memo.frmug.org> <15589.1060861546@sss.pgh.pa.us> <20030814165311.A4431@memo.frmug.org> <1578.1060874322@sss.pgh.pa.us> <20030814200947.A4769@memo.frmug.org> <7037.1060889820@sss.pgh.pa.us> <20030814215410.A5336@memo.frmug.org> <7271.1060891412@sss.pgh.pa.us> <20030815001730.A5628@memo.frmug.org> <8826.1060906670@sss.pgh.pa.us> <3F3C497C.1050200@joeconway.com> Comments: In-reply-to Joe Conway message dated "Thu, 14 Aug 2003 19:46:20 -0700" Date: Fri, 15 Aug 2003 07:09:58 -0400 Message-ID: <12303.1060945798@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/800 X-Sequence-Number: 42457 Joe Conway writes: > Tom Lane wrote: >> 3. Set up a long-lived cache internal to the array functions that can >> translate element type OID to the needed lookup data, and won't leak >> memory across repeated calls. This is not the fastest or most general >> solution, but it seems the most localized and safest fix. > It seems to me that #3 is the least risky, and even if it isn't the best > possible performance, this is the initial implementation of indexes on > arrays, so it isn't like we're taking away something. Maybe solution #2 > is better held as a performance enhancement for 7.5. I'm leaning that way too. It occurs to me also that the same cache could be used to eliminate repeated lookups in sorting setup --- which would not be much of a win percentagewise, compared to the sort itself, but still it seems worth doing. > Do you want me to take a shot at this since I created the mess? Actually I led you down the garden path on that, IIRC --- I was the one who insisted these lookups needed to be cached. I'll work on fixing it. regards, tom lane From pgsql-performance-owner@postgresql.org Fri Aug 15 11:35:42 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 08FA8D1C4D6 for ; Fri, 15 Aug 2003 13:12:34 +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 47849-07 for ; Fri, 15 Aug 2003 10:12:26 -0300 (ADT) Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by svr1.postgresql.org (Postfix) with ESMTP id AD0C0D1C4CD for ; Fri, 15 Aug 2003 10:12:06 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-30.mail.demon.net with esmtp (Exim 3.35 #1) id 19neNF-000HpO-0U; Fri, 15 Aug 2003 14:12:10 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id D1E3917297; Fri, 15 Aug 2003 14:12:08 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 3600017296; Fri, 15 Aug 2003 14:12:08 +0100 (BST) From: Richard Huxton To: mixo@coza.net.za, pgsql-performance@postgresql.org Subject: Re: Benchmark Date: Fri, 15 Aug 2003 14:12:08 +0100 User-Agent: KMail/1.5 References: <3F3C7ED5.7050807@coza.net.za> In-Reply-To: <3F3C7ED5.7050807@coza.net.za> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308151412.08155.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/274 X-Sequence-Number: 3090 On Friday 15 August 2003 07:33, mixo wrote: > I have the following setup : > Apache 2 + mod_perl 2 > Postgres 7.3.2 > > I am looking for a benchmark utilty that the simulate a user session. > For example, a user login in, displaying a ticket and searching for > tickets; all these invlove a user connecting to the a url, like for search, > a user needs > to open "somehost.domain/path/to/search.html?with=arguments". The > utiltly needs > to simulate these actions. > > The following tools currently have so far caught my attention: > Apache Jmeter > ab Depending on how complex things are, you may be able to use Tomka's suggestion of a batch of wget commands. However, if you want to be able to fill in forms, handle cookies and react to results you might want to look at something based on Perl's LWP bundle (LWP::UserAgent is a good start point). If you want to see how many users can be supported, don't forget to include plausible delays in the test sequence where the users would be reading/entering data. If you do find some flexible, scriptable web testing system that can read/fill out forms etc please post to the list - I've had no luck finding anything I like. -- Richard Huxton Archonet Ltd From pgsql-performance-owner@postgresql.org Fri Aug 15 13:44:41 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 A1FDAD1B8A1 for ; Fri, 15 Aug 2003 16:22: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 82571-05 for ; Fri, 15 Aug 2003 13:21:55 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id E0D65D1B89A for ; Fri, 15 Aug 2003 13:21:53 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3515151; Fri, 15 Aug 2003 09:21:52 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: mixo@coza.net.za, pgsql-performance@postgresql.org Subject: Re: Benchmark Date: Fri, 15 Aug 2003 09:21:06 -0700 User-Agent: KMail/1.4.3 References: <3F3C7ED5.7050807@coza.net.za> In-Reply-To: <3F3C7ED5.7050807@coza.net.za> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200308150921.06815.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/275 X-Sequence-Number: 3091 Mixo, > I need to is measure the perfomance of a ticketing system (written in perl) > which has web interface (html::mason, apache2) with Pg as a backend. Users > of the ticketing system can only connect to the backend via the web > interface I'd suggest Perl LWP. There's even a good article on how to use it in last month's Linux Magazine (or the previous month, not sure). Don't forget to come back here for help in tweaking your PostgreSQL settings! -- Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Fri Aug 15 15:24: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 A2E23D1B8CD for ; Fri, 15 Aug 2003 18:24:12 +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 10316-10 for ; Fri, 15 Aug 2003 15:24:03 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id 7AAD8D1B539 for ; Fri, 15 Aug 2003 15:24:01 -0300 (ADT) Received: (qmail 28232 invoked from network); 15 Aug 2003 18:24:01 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 15 Aug 2003 18:24:01 -0000 Date: Fri, 15 Aug 2003 14:24:01 -0400 (EDT) From: Jeff To: Richard Huxton Cc: "mixo@coza.net.za" , "pgsql-performance@postgresql.org" Subject: Re: Benchmark In-Reply-To: <200308151412.08155.dev@archonet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/276 X-Sequence-Number: 3092 On Fri, 15 Aug 2003, Richard Huxton wrote: > If you do find some flexible, scriptable web testing system that can read/fill > out forms etc please post to the list - I've had no luck finding anything I > like. > There was a tool created by altavista R&D called "WebL" that I used on a project. I think if you search around you'll be able to find it. However, I think it has developed "bit rot" from not being touched in so long. My old webl stuff will no longer work. But what is it? it is a web scraping language written in java. Fast it is not. Easy to scrape and interact with pages: YES. It has all sorts of things for locating fields, locating table cells, etc. (I used it for writing a prototype that would scrape a competitors site and import the data into our application :) but if it doesn't work LWP isn't _that_ bad. You will end up in regex hell though. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Fri Aug 15 15:47: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 DBC80D1B8D4 for ; Fri, 15 Aug 2003 18:47: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 18467-09 for ; Fri, 15 Aug 2003 15:47:35 -0300 (ADT) Received: from v2.intertune.com (unknown [209.75.26.20]) by svr1.postgresql.org (Postfix) with ESMTP id 89B1CD1B8D0 for ; Fri, 15 Aug 2003 15:47:33 -0300 (ADT) Received: from MOBILE01 (216-70-225-195.cust.telepacific.net [216.70.225.195]) (authenticated) by v2.intertune.com (8.11.6/8.11.6) with ESMTP id h7FJ8q327545 for ; Fri, 15 Aug 2003 12:08:52 -0700 From: "Balazs Wellisch" To: Subject: Re: Benchmark Date: Fri, 15 Aug 2003 11:47:21 -0700 Message-ID: <001e01c3635d$afb74dc0$3a00a8c0@MOBILE01> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal In-Reply-To: <3F3C7ED5.7050807@coza.net.za> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/277 X-Sequence-Number: 3093 You might want to check out these links: http://www.loadtestingtool.com/download.html http://www.opensta.org/ http://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/itsol utions/intranet/downloads/webstres.asp?frame=true http://www.softwareqatest.com/qatweb1.html Balazs -----Original Message----- From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of mixo Sent: Thursday, August 14, 2003 11:34 PM To: pgsql-performance@postgresql.org Subject: [PERFORM] Benchmark I have the following setup : Apache 2 + mod_perl 2 Postgres 7.3.2 I need to is measure the perfomance of a ticketing system (written in perl) which has web interface (html::mason, apache2) with Pg as a backend. Users of the ticketing system can only connect to the backend via the web interface and they usually login to the system at the begining of the the day and remain connected untill they knock of. I have setup two test machines, one with Pg and the other with Mysql. Both machine have the same data (sample). I am looking for a benchmark utilty that the simulate a user session. For example, a user login in, displaying a ticket and searching for tickets; all these invlove a user connecting to the a url, like for search, a user needs to open "somehost.domain/path/to/search.html?with=arguments". The utiltly needs to simulate these actions. The following tools currently have so far caught my attention: Apache Jmeter ab I need suggestions for other utilities. ---------------------------(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 pgsql-performance-owner@postgresql.org Sat Aug 16 05:38:39 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 54854D1B524 for ; Sat, 16 Aug 2003 08:38:37 +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 33041-07 for ; Sat, 16 Aug 2003 05:38:26 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id B1ACBD1B523 for ; Sat, 16 Aug 2003 05:38:21 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7G8fgIg026225 for ; Sat, 16 Aug 2003 14:11:43 +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 h7G8ff3g026202 for ; Sat, 16 Aug 2003 14:11:41 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Sat, 16 Aug 2003 14:10:15 +0530 MIME-Version: 1.0 Content-type: Multipart/Mixed; boundary=Message-Boundary-17717 Subject: Insert performance Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F3E3B47.13828.333B51D9@localhost> X-mailer: Pegasus Mail for Windows (v4.12a) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/278 X-Sequence-Number: 3094 --Message-Boundary-17717 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Hi all, Couple of days ago, one of my colleague, Rahul Iyer posted a query regarding insert performance of 5M rows. A common suggestion was to use copy. Unfortunately he can not use copy due to some constraints. I was helping him to get maximum out of it. We were playing with a data set of 500K rows on SunOS5.6 and postgresql 7.3.3 Best we could get was 500K records in 355 sec. That's roughly 1400 inserts per sec. This was with default settings and around 10K inserts per transaction. Postgresql was hogging all the CPU during load. Troubled by this, I set up a similar database at home. That is a Athlon XP2000+/512MB machine with a 40GB seagate disk. It is running slackware 9.0 with 2.4.20(IIRC). I have attached the results of my experiements and the code I used to benchmark. It was a simple table with an integer and a varchar(30) field. I was really amazed to see the numbers. First of all, it beat the sunOS machine left and right. Bruce posted some numbers of 9K inserts/sec. Here we see the same. Secondly I also played with filesystems. Ext3 does not seem to be performing as good. Reiser and ext2 did fine. Unfortunately the kernel didn't support XFS/JFS so could not test them. I have also attached the raw benchmark data in kspread format, for the curious. Didn't exported to anything else because kspread had troubles with exporting formula values. I also noticed that reiser takes hell lot more CPU than ext2 and ext3. It nearly peaks out all CPU capacity. Not so with ext2. Comments? One thing I can't help to notice is sunOs is not on same scale. The sunOS machine is a 1GB RAM machine. It has oracle and mysql running on it and have 300MB swap in use but I am sure it has SCSI disk and in all respect I would rather expect a RISC machine to perform better than an athlon XP machine, at least for an IO. If you want me to post details of sparc machine, please let me know how do I find it. I have never worked with sparcs earlier and have no intention of doing this again..:-) Bye Shridhar -- Fourth Law of Applied Terror: The night before the English History mid-term, your Biology instructor will assign 200 pages on planaria.Corollary: Every instructor assumes that you have nothing else to do except study for that instructor's course. --Message-Boundary-17717 Content-type: Application/Octet-stream; name="insert.c"; type=Program-source Content-disposition: attachment; filename="insert.c" Content-transfer-encoding: BASE64 I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8bGlicHEtZmUuaD4NCiNp bmNsdWRlIDxzdGRsaWIuaD4NCg0KaW50IG1haW4oaW50IGFyZ2MsY2hhciAq KmFyZ3YpDQp7DQogUEdjb25uICpjb249UFFjb25uZWN0ZGIoImRibmFtZT10 ZXN0MSIpOw0KIFBHcmVzdWx0ICpyZXM7DQogaW50IHRzaXplLHRjb3VudCxp Ow0KDQogaWYoUFFzdGF0dXMoY29uKT09Q09OTkVDVElPTl9CQUQpDQogew0K ICBmcHJpbnRmKHN0ZGVyciwiRGF0YWJhc2UgY29ubmVjdGlvbiBlcnJvciAl c1xuIixQUWVycm9yTWVzc2FnZShjb24pKTsNCiAgZXhpdCgtMSk7DQogfQ0K DQogaWYoYXJnYz4xKSB0c2l6ZT1hdG9pKGFyZ3ZbMV0pOw0KIGlmKGFyZ2M+ MikgdGNvdW50PWF0b2koYXJndlsyXSk7DQoNCiBmcHJpbnRmKHN0ZGVyciwi VHJhbnNhY3Rpb24gc2l6ZT0lZCBUcmFuc2FjdGlvbiByZWNvcmQ9JWRcbiIs dHNpemUsdGNvdW50KTsNCg0KIGZvcihpPTE7aTw9dGNvdW50O2krKykNCiB7 DQogIGlmKChpJXRzaXplKT09MSkNCiAgew0KICAgLy9mcHJpbnRmKHN0ZGVy ciwiQmVnaW5uaW5nIHRyYW5zYWN0aW9uIGZvciBpPSVkXG4iLGkpOw0KICAg cmVzPVBRZXhlYyhjb24sImJlZ2luIik7DQogICBpZihQUXJlc3VsdFN0YXR1 cyhyZXMpIT1QR1JFU19DT01NQU5EX09LKQ0KICAgew0KICAgIGZwcmludGYo c3RkZXJyLCJCZWdpbiB0cmFuc2FjdGlvbiBlcnJvciAlcy5cbiIsUFFyZXN1 bHRFcnJvck1lc3NhZ2UocmVzKSk7DQogICAgUFFmaW5pc2goY29uKTsNCiAg ICBleGl0KC0xKTsNCiAgIH0NCiAgIFBRY2xlYXIocmVzKTsNCiAgfQ0KDQog IHJlcz1QUWV4ZWMoY29uLCJpbnNlcnQgaW50byB0IHZhbHVlcygyNSxcJ1No cmlkaGFyIERhaXRoYW5rYXJcJykiKTsNCiAgaWYoUFFyZXN1bHRTdGF0dXMo cmVzKSE9UEdSRVNfQ09NTUFORF9PSykNCiAgew0KICAgZnByaW50ZihzdGRl cnIsIkluc2VydGlvbiBlcnJvciAlcy5cbiIsUFFyZXN1bHRFcnJvck1lc3Nh Z2UocmVzKSk7DQogICBQUWV4ZWMoY29uLCJyb2xsYmFjayIpOw0KICAgUFFm aW5pc2goY29uKTsNCiAgIGV4aXQoLTEpOw0KICB9DQogIFBRY2xlYXIocmVz KTsNCg0KICBpZighKGkldHNpemUpKQ0KICB7DQogICAvL2ZwcmludGYoc3Rk ZXJyLCJDb21taXR0aW5nIHRyYW5zYWN0aW9uIGZvciBpPSVkXG4iLGkpOw0K ICAgcmVzPVBRZXhlYyhjb24sImNvbW1pdCIpOw0KICAgaWYoUFFyZXN1bHRT dGF0dXMocmVzKSE9UEdSRVNfQ09NTUFORF9PSykNCiAgIHsNCiAgICBmcHJp bnRmKHN0ZGVyciwiQ29tbWl0IHRyYW5zYWN0aW9uIGVycm9yICVzLlxuIixQ UXJlc3VsdEVycm9yTWVzc2FnZShyZXMpKTsNCiAgICBQUWV4ZWMoY29uLCJy b2xsYmFjayIpOw0KICAgIFBRZmluaXNoKGNvbik7DQogICAgZXhpdCgtMSk7 DQogICB9DQogICBQUWNsZWFyKHJlcyk7DQogIH0NCiB9DQogUFFmaW5pc2go Y29uKTsNCn0NCg== --Message-Boundary-17717 Content-type: Application/ZIP; name="Results.zip" Content-disposition: attachment; filename="Results.zip" Content-transfer-encoding: BASE64 UEsDBBQAAAAIAMc+EC/ONleLswMAAFoqAAAMAAAAUmVzdWx0cy5odG1s5Vpd b9s2FH0fsP/AasCeGFP8kEStUR6aj61otxWJu6KPssXEamXJpZg6+fe9srrC SduHBSeAhsZAZNnikS7P/Ti85uGTk7+P529fnbI/5n++ZK9eP3v5/JhFB0K8 0cdCnMxPxi/MLJZs7su2r0PdtWUjxOlfEWPRKoTNb0Jst9vZVs86fyXm52IV 1o0RTdf1blaFKjpiP/90OHx4NBxdWQ3HtQslG4YfuA/X9cciOu7a4NpwML/d uIgtx7MiCu4m7BCfsuWq9L0Lxev52YGNvoC05doV0e+udb4Mnd8b++Ji4+l2 ow2nN5vOB3ZWN8F59o/zPVnCChbP1A4r1KFxR2LVrZ3oV76u6G7i3PXXTehn wwMcivESulb8a8Wiq27Z4mrZNZ0vol/Odn8jXLloHFt0vnL0jRw/8/SfscNQ sbKpr9oiatxliNjHz2fruqoaMn5bV2FVRGkcsZWrr1Zkioqj3djdeBGqRwNa 0sw5/10oZe5i0WQ3/aakC82I+7ztnQ+92HlLuRzcZe9WdPAPmAmpkq8tICbd r+2i3zy9uO2DWz9oanL5NfAFMe+qEfrZ9eUlucr3sP0w8j/Nu4yRWEgwHkPh 4nt4SOrPXU1edvlAWr7FeWpwpidcywwHZ3mGdBrLVa5wcDlXdt9YJM04eqWy SH4N0l0sNwb4dASHNNZymyST51clKZJfbYARQoTEORIuSYDpIOc6k5PnN5FA QhJKWdAI0WB+4wQHR/k5+x/kZx4raAVWWuLgiBIFTQgqxVZgtZ/9kAyf3oQH PunjiyyjoarI5OCaDs0JqfnhRBY0DVouM2xNV9AEY5WePL9gkZViZWqaQOM3 1UC4nFYMj7UWxvELFllpBs3PqYUm1CwGeh+JaLvvLhPNz2iRlWL7EtCQG1Iq MF3lPLlT0JEMk8jSY7exKkNZvOuufeuaxlU46pHKy/AYKZUyLpHdsoznyG4K wcXTb39AlZfhygCVV0bLY6yylsC4HoT69JU1VHkRvwk0QqSCVmaTQ6uKto+1 OMbxC1VehgIOmlClhcZvkgOdmfJzOv2VE1h5EcPIgp6hWykauxTL7kQHkuF7 ymvr6+AW5fI9jnkkT5ob5KKFaLfQlkhioX1recfYiQY2UngRvxIa1gmyzWyp zmN/d1LT5xcqvAZ+oYXZSKjwUinw6XKu8h+s5TXwq3FwFL8aCEd1FJms8nvb SCaan7HCS3ON3DtDEZxjf0Uw0AjW2bciWOy2Ng7vFuP5sAly9+bzHs/h9QlQ SwECFAAUAAAACADHPhAvzjZXi7MDAABaKgAADAAAAAAAAAABACAAtoEAAAAA UmVzdWx0cy5odG1sUEsFBgAAAAABAAEAOgAAAN0DAAAAAA== --Message-Boundary-17717 Content-type: Application/ZIP; name="pgbenchmark.zip" Content-disposition: attachment; filename="pgbenchmark.zip" Content-transfer-encoding: BASE64 UEsDBBQAAAAIAPK4Dy+uxoCVpVAAABJzAAAPAAAAcGdiZW5jaG1hcmsua3Nw 7b13XFNZ94cLWFEQRQRFiqiANCMi0kFBB+nSmxABAQGpSg0BRQERKdJCR6WL VOkt9C5I7yBdauiBhISbc8L8Xp3Rd+adufe/ix85yclZe3/32msvznn2Uu7K 7dtPQwJ8LRdSQYomA7ZPEV4Dfw8T/lqaWRo/cbYxNrCxeWRmZPDEzNoK4sRj 8djGztjgwd0908Og6eJ14d73hiQkMz6MJEcBUwMzqwfWRpedLB8tDFsGMNZH sH1DYbkKx+mzxtSvjlx4fH/j/tDwJ77wmJG6pk833BPSg2oty54l1PXsYMTU QxbnQlsOX7/QNvvmcvVxjjQ17tWuqdcvsW7jO3Ojuyu+bXE76BJEpr7rxpQ0 cw2P6/LkUvMofKPRF+K+235od1Fgd6Ua99x9V2C3ORPfi8Qi8ZsCu+sB7ruT 3b0QVKz76tynkpJeJfwKEofZ3Wlzx04+p4oTw0Lc0ei2WNywNX6pUQK5/ZTd Vo7wFidBaP95mz4SjxkVg216S+wYYGcyxXHrtail/Ex9PB7/PA6OrmTWF3fC Tm6wM99ze1cft7uaCN+ei/dRWq4Mhui72qLbD7URGlijQ8LwmFWY82Y91e4O FRSOnZqfcd9xx+9Ele7QSjivYNIQzPBlqDh+SQo/7e68mtaGxAyvtaFiXXHd aXSZUMK43V2d0bO+EvhFAQhUH3+jHLc1CHHDds8Q7KIQo0Pw5cnmklEJ5G74 LqYb4ZgZh9zZnKBD7q4yM+PLsNBzO1P7RjZlxOHbO47u6HE0RB/qFjD7nD1T AjsXpdmG3JnsrneESrhv74zNY0clnFYb13odd1fSEFBRd1z7IQkslZLbZmNw HA7T2IafXV1BjK7G7Va6YxwlsJm7S6bMUPy5cuwr/NKSI6TcCb8d51a7+Jzd vbAEOxMA2f22kdasiWtcs95dN95Z2kXX4qzdt+dQ7roE7WOH3PF8zmsSO1Mo 9y20+/Y+/CQMuRNXnjX62i2K2X2zuxk72iEB3/oEEd/pn8pzdtgdd13ZmWcn 6Npuc4TsbhJctT3e7C2RM4Ms2T3vtrZTEAfV39ndGl8dh+8spvU6QksxX0sC cEgkpnpqH9q7F92YqT/q/jV4VGwHC3Vbq7VG6YuXaiBxc1PsCJSfd5z75nhw icTupPtQ2c7cmLXb7motOxUyXQla6rqBWSvpzUTpu61t9I7isFCk68rUPDYT F9UWtzsDkSjaPbgz1y6xLcGEn2oeLcMspEm47laPI7cOUTFvbaPKt+ZKIBPN M1BXVMHmcC/s5tqytcTOeXdsNx10CL6NgeJX0chZdiQGsz11FL466zjKsfuO EIRpCMhlZuzOZ9+NAITEIqINWopfqo7bmStR2p2c8h11d9im68DRPUHPEiZj UTMT6r5RGxWHxM/NC0g4bw4jt/s9O+Lc8LOa0DK3tTWoGGzrSDnWcAnZhyBM O27YG4JyQ2PG+CR2FsaOum2x7q4WIKBfIe5r05r45lEJ2A45qrycEL2fj2Jn IDttUDSV2zJheS3PtSGjJHAm+NU3yBLszho7BIWEyRbu+OCWSlBFmzMSiQLu sUpu2NUozbgyF9zijLV+hjeyzHUZd3R5vVOpekoCYR3ZhizeDW5DoHrbIIr4 2TFdtFJmfRx+23G3AyfhjG9zx9Q5rRBmhW6uxDrRN0Vgd3djbCruHn4/EsvK LD4z1bzTqemwS1hxmMY0ut2J1bYJXLI7vta3DTKw2zk8s4tb2pganMDvHhnZ OdGNLHVC7GJL3DlGSrdGcUoIiawSSNzOWC1hCcDWKHdmRmfi3HxZSrd58NvB oli86XY3rnlrJA4Ni5vUtC7XHsGe3K1I3u52HLVA4Yrcv63tzHXOxLnjx9gh sbv4NAjhpVScaCt8lRkjisRMz5+Kw8DiplbTxFyRbmjHTBR+C2MtjtnuXF6v 3llHoCUSBCRqkpFOYRBID07Cfe0dBKUPX9uex+7C3PFR1sjynard5c90COvu C+isjbJQsSVY8Q6XtfhSyW51YS8a7h0hdUxoJ7YaBh+b/QR8oykPgRzFRao2 Z6NFkyHt0szwo+uh9PkXEgYMS3d2wjvoZuMDyk9h7PouWzSGGc5NhXfSfSOc kZjHGrBvCwqOvQhOZGfF6mPy62l1ikSzqlr2cTGLvDznsYVvroW31YdB3P1Y k8u6OeAx4phvuu+sIYO2/e6JPeb9nSHlvzHD19O/0AXw1Bll2rbB4nSdNTDf 4q2d1N6rVZGzWwTIugiNa8BknQO2D2O79sml7b91nI6bDiY61xPg1p9a68Bg KRunQQ600asy5E+vWrrbPCTjo0LuusxTqTnokFuO+PKYEi4LfRsgjvmNnbVE hZw9+qMYRyMiplfDRTZ1ZGbAdvpZHlfo08PjHlOGrWLWvAX3VBbGwjlDF2RZ 19sLbo1Wf8oMwzVYWuHZUOAZSaiP7aBUv9wsz6LqmeEMNUlm+EQ8dSK1oqC2 q6pMMTcdKk6NxTMfEdFMvZqhRnb+JZdwQ71+fuxc+5w+pLmOAw62Mp7zYqiT 1kU+FU2dfPlIUwlxDJqqQ1VuCeE6KfVqyRZU6+3So99SEixCbaoax9NkXQYK mhV56tXM4wbS7BOpjwnds1XpwJQnxveIbXTMq6UmcIV+kR49AhdDp09ONLB4 3U0yXATlya1vFNbSNhkPR8hGRyJngf4FxDmUOQkTVysQ2hVd4JqbXxAyvfRk UZiVwa7QUEeE0Zkr+0WH0UfjpYRbyS/EMWFDoTZdPHn6hims3alqJfMhhI6o 4bxW/AuLY+E5bbNHQakJCbMhgNQoWdmWwewCpseX+RVDZSNVyF+eyyjiGsMb lkwcNoOkKwzPDoTIEib5sx45bnUhjZXZWcnAfCeJIxRsNdUa7X1RelQqSoTT jCiVE5Q6JRD6Ij0sq35E9ujjKP506uM37/Gm681lL7IypustbKRqyHRyvgPi VJJCtzk1zGF0PhK2aQa0GWQKfanLvdhQ/0YnKhJp9owQhWcZQ9XS96bMHM6F rRYJzS9T8LPQBNtVlrycbsnCmNfdgR3CPiGcI4StnfLdRt1LHL02L8QFnqrm Afp9yi9YO0PQltM0MyOKb82BrrZSbqW9OKlIC1VXGc/OwzoiZxG14+L2mjLd nKQnak5JsyIUBnp0zaW568XRGpXqaaBvaULmHLoG7Ip3CloYQx/uKW7SVeRg lJaHLyVcrDjE7BofHASuiOZMzlndsoUOlUGL/mSdwNuphAXRe089KL8Dsuw/ JBsjnMwNxtf0hyB4cxFT3ouB+a4dBWXAM6wY2VLkpUszTHKcjzHgBLgSV5lv Jmej2SjGTZunR4zJfinlFtCo5muLmfD8WMMFsSS3Fh66UOB6z/InIen6Do9Y 8mAeqsQmGj9lMutSCPU2V1tfvnh4Ibt+5Nvbi/NgGPjKGh4ZzE6O13dTmRl5 emE+hLDGXh20+4YukO3RkOI2tsKwgYEUlEZtOKLCxbpBg+XlhwfbE13r9ujd QlmBmlx0Z7IqcYnFgPOlLGNpdnTxJeKUUZQrMv+jKmGByXnlPe6vOgFL42jz HNBO3C++Ffa1BHlXaLrDhXI7vDNZBVwDi5a+LIm0OsPN0eU3CEnHT1E2CEgG 3MiUhEfSh4WS1AKu2H/SUAHmiZ8udHIRrzHlumC5KjmVAK6hDNk7zoOP5/nD wgajxROBiIjPtEaom3LmdV3pTpYXZl2uJCyqdg5gUaFDarKsp3IUfFkY+BXK VM06OIDJPzVZxqSbydJDL2v5eCYEnKXJ2KCw/HxmOs/shOsF2qrEWZIckSwV JYVwtenPrB8AkuETNepQWcGxBysKrPaZuv6pnuXJtM2EJMsJZK1X8UE6gxpG i7B5sVbG0FugsveZU5aQoq4nIX1Jhh4poHwrzkb7EtHtuVhYGq/iLLhSVpR9 NAAHlKcmLJjJcYTkz+hUd1U87AI9IBDKoHvE2ZplPWTmuoUOMe+9chbRKamw CN58IttnZO1Z5jCZzsDrHTZvTCmcCPlC+LER/zzorSohoNIgnORYjYBCZpj1 O0V7WQ9FMAOkJFhj30Caa7Wqh6JYD8aAi0pd8o7ugG5reg2cED3CYOC+D3LR dtanjSmqj06usybYEubKX1bWqYsjtdd+tdZz2dc7c3ywRFPTZO356KkVHvfi aNtN/dbVgLr+Z2dMCkw2TXi3yxINKQZjmZlN8fz+s9LV7UYB9e7NTPNM7KK/ MTlPrhxh0r10kmlfgOiqk4PqlKDgxOtPnTGL0bZ1/bPzzYVTguLujdIzb6SZ Mr/yDo9qCq33OU2+qbcQZV7jHctebbgQkIw62g0VnFhwNZWIxRw1jR4e6Yfq QqctJTA1GJVdT4LhGG8Suf8cRHDcidL/nYINheD4y4n+kio9rCdfa6tjEq7q jGkyBNKZnXc1u3woD+o0uULPJBcnSDm893rN6fQVVBNgj8+/u0002iEY9V7S bGthWiwGPhGvz8qLqKYbpmOwLT1YT2/CFPBMmslZFKbZF0oU1wSJtnXw60RE svUg9LZBWdkhPmnQ4tWjAaL6tUbhD5FPFukIJu7QFEDRjEin29jrTxYt+WjB T+Vq7mNv6tfEkhYFTVqh66CstvpwNPleL9C+dWIvGLCXsc2rn8ofYSAEl1IG pCq2MPPjCC2XetULrjmpuVeeqF8r8JwDrizn26BrFSxpcoLFpSCvbQAX1RVK CZpswuYAY78Zo2a++nd7fWjtuRm09HOxF29ygmt3g1pmIHyLiA84jwv+mmOC j7FW6qDcP3SyIhftND/7AV91IaB3uXDGqCoeAwy92ki440V9xYUA0dgyCPf3 FnVPYLMnnWHKQGMWTvL27/01iENnkor5hqTB7Xlrl+gtd8BbrwvQEYOOvnii T3+/ijDyHjYMhHWZEC6mqKOf8IQwiUHJ7wJTCYWG8YT5uELmkcsNE9tMEz1s VtWte8HCr8CAfLABdqObgge7UQW6SQO6maAD/fWqXpD3WDjRDUwT4o/x1EB8 fkJ7yuCIkQLY9Z62hliOY4YTiIMPr6rZlusgDus13JDhyizYOVYSRxi2yGgE oE8vHhqzGYGLBYYSi+J9hAsXouommgwlr/rs+es1hugvHOivbbkoIXcfcN5P BfBZS9NuEGXN1yyuK+MOSDO0jdJ+QNrU9W+3dgFzST+xmKpQOmiptteu6Ygl 6weiHzodGPhmIHszf7rr+5lf2YwQkDgyQHTRdrigG/kAMdJsm8AZjS3j4R5T xiXe6z2jdR/30sA4q4LMAv4UvWzmxdVATf2UhMxJ5OmJGySkpYwVJOeeklxu 6wjYx51VoUNlcegod5ZV3oMW6UPHb5BYH8oiPXzuacE+LdL9xys2YCIKJ7Mq hEnDksi17g/bNKaYkZ17KrB/73CahHDNFKxEr3M/d5bi00QzMlqtAt2rS5Fs hO6knn5/qBpR/O4igXtXzSNJDn+lJN07HCQh3W+zPZJhEfn0QA951jWFCrJ5 B7m6jB+6Aw/sC4vgp/u1ItnuP7OvZo1PIn9KMnL8LfFwn4QwCARqMRIQHEMi B3RqVfDg0T+XZP6jpA//WNKrHyVx/2NJl//gpY//WFLQj5Lk/7mkP3gp5R9L 8vhREsWfJRW6WmtWxSfJ4E9Uj78IRtsFCRHuOFIPDNuIaUoSfvRGa9i+IjyR dXIqkrJH29AfqK6vJJykiFmIJtyStaw+ij7AGMMW+VAnIbX91kkF32vqkQ/f mxVeUBH5+iI4+2TePkXBCO0YBe7WkGP3PcxOsIXuC7+v84KjYv9J+fjFLxk2 FeTsRuxHDkXbXM0WPJv52cF+X5iWjpFM/1PWsB4tFf77Pokr+ne6n55UrFNU oyTcsrRTmI2EUtpUmZ1ht98XbaNTx/GVcHscr6CsKQh26EnoUPva7QH1YwQZ oWyJ+wjSEmUWn7JF1omcB9ScEVEGpPE/TtCbJWELpzVQEXpKnnQ7nEz+SuW1 gWP8nsRrgNZYgxMUholCrhOE8IepUWoZmpXSqfCDXakDXfFLDYT8TI76D3J0 /oYc9Z/JOfWjnNt/LUfnp3I0fpAT+TfkaP9MDuuPcmT+Wk7kT+Wo/SCH/m/I Uf6ZnAM/yrn5Zzm5dJxjyt3nbAmBLLFw8THhIMXuc5JgJOwDxO8XGUDQbxHT tjbgRyKEEL/6pANYAe+C68A4V1MkRN23W0xtQKCuOgH9val/XNXY5yMaC0Ql GWBil9M8ITT2YOHPl+mafJNww62uDqNXTNugI/DVyd5RV8zscLMmc21gk1OK G9149YHeLZaLNTOAR1jE2aNfxxxeARt7CTb2DJArNCvpCrR5Yhzs+ngc0PWL LULXDucDQEtnUcCy4c8yyIGBNsgEfy96cuX/LB0ZP2Ty+pnORVHE8eTXtZ07 AypoWAbb8QLbuer6XTuhY2A7FKCCB0QF1f9dAdFfRFcrvvqTAqJl6bw8/IOl qCr0wdajbH63g41/VvBm7Lt2cn6iYE/7rxT8MGNBf1JAtJzUM50zGqjn25Dx aqPVnTAN/GU/+4HImLzY9Cuhf/b1jz66CMTcBfabvxQKWtqpVMWLitv99wCe 0fs+K3+RmSGc9FKkB6NZBYzmv4qPxst/EUZ/VrY3pmBCCo9+Hf3kf7fc64zo x4TG/93yBz+q/++We50RVxjHP7D8YYWF/e+WP6yMoP/d8oeIpp763y2JnVED yPVN8Ln/arntG9zM5YKu71USd8Zjtq3LcZjVInFibkO7u8Yw4+sD8MurtfMl o+K7wxJQ/fxm6fJTvfE2OZUH6O5RPfgZcGZ+U1wq65hZvr2TXeO+Ne3bXDA3 YjTgYlnvViO2iFsVFnX9qsvCdvzm/hXYcdS2Z3LbEuEbH8Y/JCB9iQOdhc5H cMDfiGO+wdzhZb2lG9QTTIaistEdIE0+0Fau1eQQ4ovUsGiylIQKHwPIh82x CP8YwnRrw9SCLPpVZDgY86aKlcSyhPfosliXUTMiz1DEXyfpGGdnO9gORqVJ 9zDuG0/9iOkxToiSDNDOs/Jy7/QXNHKctgFmstB3AeIYL2lWHdZom5zNlAQE Q75+hzEyTI7ycfNtkP+9sYDS+qAbB2zvbZontu4xuSPwVAbdw0J5NObcjzFk 8PX2ghtQOWM5tOd0qfcFBj6MA4AJzzKFLvze7qRGvlZAeb1YrdHSs0R1svMv j4b5sibm15aFqUgtCCnN7uHKVX1mf9nNst5rjmo5FsSOjAN0hSV9sxl5Wn8k NVahDItu+iX1QbBMA3MS016A1LDuE4SN2jUKrceudlmSm/USGx1XzmfSeSU9 qhpOT9q3DxD7Xp3an4dp5fA2mW2cy6b9ntgnRAiqKSM2oPFYbEm3oUwpZtER dIKdrmQGYspQSYhRDJ2qIbPXsF2jrrXQJBMEPxciDnJR23SLVwYWU+JxaSt9 M+tm30PQAtlx/XyNNVttrvzw6dbNPNkb+21v59C6DBsuSaehZwfUMoZBjvqs 3CHESA6HzwmitYiDbYLMq/JTZpJRGj8iHjGSPEKSzBFacWh0OSGBA2Dhc2my kqP+ZSFBuovG5vgkDgCDBaXJyg4vjV4RnL67mkDkc4+V744MjMi28jPZKsap kMPXeYo+JITxIJ4gtyjqGcRjqLe+no0L+QayypWo0tGA0QRq2YfwpbLFKABY XS7ierfJsxFSxQTLUNXkFACB1dWdfG/LUVgAb37z9UfEXQWNUnWbV7qNYoxm 1vZxOs4aiUTPqhF3BNRU/LPy+vzD5dLMzEnegsQu6LMO9+CJ8diJN3bR9CQp RBD4Nqd38dJiuaJzDXwuJYETcOOrKNkqpoLjKjypiwZWW+nf82WNUbUgf54k JnTPZlkrDx3o2UYF1myrPMSARXpZ215sCYSuDxWEEbRNizumP6AEIP0rNLLR 2Fesy87gdFWX5/RtgEAT1sLtPWodNFeeRyv7Sojxca8sLTEMtCWpdF9J9wc8 ibPdi1lWjGQfJrueXrd/ZuRj7t7iEApZfFiUyGDeplqdDLZat7fCXEiS13kS cpJdcwFwngtKPVxRTaJIBWvkRalqDp4C4+gqnraKdmkXs4woig8CAG366QqZ xfeZ02Ub17cPCmrvCdUGh88cWpOfp/W4X5XT2fxTGDj8zyaLfeYPeRbSk+Bz b69aEPcSiqxWvnEkx8+I85MF5hEJtti99dAQyWOJ3UWhycCmi1+AbC4IV/VY qfgbtB4PVetXDRE3mjRbLBBMBXf985NzvIuo7XpAnzqGMmRb5yXAR2Fp9Wpp Fw/9Hqz5erSxzm0sXUbmW9fAVbCcctEMjNYSQmTqXBaq7zOcV6Xi3ltbVW6P DJA7x80fPkY9Dc4lSnOa5EkcsijcnVVL5vp944JHV6ypXSVdOoa+QkaHuBvS Dm7cpAdd6ErPd+tPnzKK42JhJ+atj3kOj2YFMW/8c9umBmTA3QWKr7n53eF2 w3IZ9WrxV39fWyiDwYDjKBgrr5IY9j3gBsoA2fdAjvkozsmBdXhhx8CRpJ9k HqgM+KH3Uc9qDza79wlvX7LdYoq6JDOc67oFmk5uBC1jN//OUwgOAuLxfs15 3E1jgETnpwZe/mE/hDBhWOfFyE7bGqa1LhJFkDGfKmDNVblMSOIbaioKjw+F EhtJuehdnOdQM3GnfiTpNxJDcIUNdZ7q0GBicsUdNvugTg16y0mN+vdpG7s0 yLQ5outvufTZ47kGgJrDe49Zji6Nus7hk4KuOKoRLRr1WHkebQgamqciBPmf nszd273oSV/HpSCkdWSMiRuJfv6ydk5dnP+VNXf8mTUzgax5ZY81lzB15jPD q4y+AhB52VXUjtFFvr4S4GfDakIOrYITC09MY/haBUuq3FBjjEjv+eY6wof6 lUaPbKuMpghGSujTBaXMJ5mOAowaU36XCPY2J1IBlLYYg8vbMB6RjdOGzgHo jF9004jNmkp0tWHilGhdXx2TI8gp4dDCeSJ5A0nt+oZxk66FmSE8dbfqQsAM TH6Qia0V6rAHKxlMRed+QgSNRlgKIjYS8URqemQCG97BBMLwdWjTLfF2EPat ww16AUS5FjMLdMe/CcuWX0AX71FEq3pxW6YB8ELXAIPB+S3xhS7w3Q783R+h 6PTV7PIuIhhsOdnLu/H0gr+g/jt80KbPfFYUyPnKeR59h2tF3EvFrPMUu9Ki 9rDu/Mle+HWQno4aDTTdOptuhvz6cmJ7UHKROKZNcEyYS90+hWVmRNd5pU4g ALKpb0CflUseoI7zJHh/lE5jg2iBAS2QdNiaRQj4WaYdUyR7HeMHsMeJHdYa H5eHICRdQ3t+R0ZF3OHa+c0Dtnvu7l0ubCsdlKUE5miWaY3W38ftYTtg1Yn2 vL1LpLYgVA4omEmvgf/HytsHy/Zqz/2yfDMQkLTiy+9+Z9Mb7thgZohP+QYM SH2aNCBijTgiI3yKUjTywV4whG98x+tDcSMtgxYmOCJOvmrLFLmxR9WLNskD ftqJdRv21kjs3kQac9mP4zTs9uJbHvs7XCYMR+YPVrbjO6yzRF8vGY+LJyUQ R6ZVXYNblwE2S9pG6ea+i1P6bf2Gk2uL4EeZvO40/hGlYgBF11wu7PVBX/AF xWHKr/xgM998mm1pj0P7bceHmG7CwNfl9YV5EdvxKWDIo45+7wI8JseKz9rx bDfUpmaF3j43X+k1c20FcRlSntz48hYA58nWR59jiFEKLkFma4huTN/SgUXi pksgu7/U803i7ES5iJsDw+wfrGJgyoM22cc8O9ATcFqD7Ch3Vs8hJ6o4k0KP FhYyEC+D6FiXVL6edA9GM4IwOu35ARAhXych3b/sQMJF5NYHbpCQ3kMWdF4j Pfrx5H0zADVSIl7vIUFSAGqfqdDr3H+DpBe16PDfgPV/BZEggbQ+mGUBkE1M mV7vT7v7O2wUgKLLJiRRQLsZo4P8/1qS+Z6k7n8ryXdP0ql/K+nK717q+beS gvcksf5rSb97qevfSnq+J+nAX0pqRjsIiZpHTjLzcisKOkNA0hGh84Wy97HQ LcJDttmp5KeEM+ljIf779mB0K4g9ngAIwcT5erawxbX2W53nFUKJSPrLrZMK 1YxvBkiBJ9oURoBYzz0ytE16QnJS3vfKgfD7HmbkSXpjJGzhXoPv9MZAzExz jNCWoe317OuqAiBIDAFAoh+r+r4wLXqUJ0ihF24BSFrjc+BS00HBsdzXqgAD obWdO3JIcOzaEI39d1zytmqC3tRTtkgNMxXhtz5J6pFdAOws/R6Qa/NJD4SC eDyJoOsKT2UXDfCukNEcBOMO7wFKLscmE1VMKsednp3wqIJazoI7lT6rpsMJ kmAOIvQPBwl3xuZeuRxnv77ovAqyep2aVE4GwjsbVbVTx0DRwABpFd5ohBJB 6yxRlghB1or/nUVw9F3AlZ8ZzNSF/w+05u5XVRYkvBtzSLnEYAOwgypC89wR F3nmDnJn59YF5RBlmRNkTZQFfiA6m55w5YczHe8fEZptFjwAzN6J5I82hHfV /wJHH7lSub+TWl5mb8oS/rN/kPMg6FrqWYJL6OWaiLI+EGT5oSUBzxB8CLgp zeROcA6poiDPBI1NFXny7ej3VYR3lAK3lb+b+nYaMzUhcKZCiLLyCLLoUS+7 iD4E3NTT8ua3xP9sZMhdOeBJeEdv5e1RBQ4edFOQTMdbK3CmOIiyPhBkXRs4 OrWcYh4IABdmhyBBEDQ3gDEMYrCQboZDILXLIaK+GBD1mRGp3hRI9Y6An/+a g5X8V4w0ycO3zox0c95ewm59moGgxJ1X563FcetLU2kBhneMRdWQR1fGPCx2 jlP/mTTvYaLLv0TVREb9V6Tw2n9HUyXHunvD6/g2FH7JX/faUfslqv4r/rpH HP87HBuxTxLvvh6bCrnqmt9HL/H81wS4+ZcKiNr/ilzK/Fc8t5rBt8G7OBGB uVht6pu+wnfnl0j8/a+R+PLfAoh/Cz0KNY4pMzEL/SKAcwMkjoE7Jg+IDFqY uKNCvK4JvI7mVzsqe8Nw+Lck+Vd7MX+XJCv8S5Kc+m9J8j+w/MGDOf+SJP9q b+Rvk+RL/3IzYf/fscSPT66+GsGtbAQrxSLdwEJl14wAKLLUFY3DMUNnvHdX 4nfRadb6+vjuZl+H7cKCDhcaheu5XyTnn7VIS7jTx7qFx+FX8d7r095b63Rt qxdUEJqzS90CcRIOW1SjrrbbGmLmQvlM/rGq4ubciN6xsX2jR3g9Dp9/Ofrc qQ0iCncgfIvpLKjn0Vv2HDHnsdzDd98s4CUpg+jmNdQ3M0moKMidPcuP5+dC 8cW99B0tnyBMIvD1dgFBz9fSwCIJYwpdgJnrEn5mhZj3z3ftS3tG6AKFvDcE yxg88bhVuk16XhXDCfLhUf0q2kFPffmNVQFVzBHiqRMdYXIt2Zs9VUNNfJ3S zPDqeGoig1XrsOv3j4RYVKgZNf8fJ1JTmae9PF+rotNqe1kbrLIlg9M56s5v 5OxLK+pNNR3NAGhMmqGHlhRn4hJrLQeIYgREOfvzADqyqCxjyftIek5aXlqk SS0n32KvzjldesRFwuWRNA+cU3sQBGN+5cVTKgO49VljZ6FEJYAcERzDar24 SsINU8pu22Pgv+OcUfUgdE5iaf1xVfFpDV9ZsGr4ngijcVpiTaDOa7gi6Fna b1zZ1gZK9igYt2pMUIYqGbOr3HKoU2Wvbstsw+MJAT2gstjrECvhSGgyYHQ9 yzov78vS2mLREbvevYrJsE2epBH/ZiV/oyNxskBR9+yudxajMYRlRn9G0iOD WNnJaGnB4RlfrzXNyaqXCJBHdlZOgDxi3gfh+pqMP9Eu1edPDO2TS95/6zhi iLN/XsOFaqPqytIexh9/H/Qlv7AgftplvQjbEgWSYiHO/kENWJEEe2qqgl5H dwgROXWEAE7duM0q9ggWUDTdHGS7NEwdBdQ3Xz7Ts2R/NHFx5WXR5zJdQxCT 8mMGwiBK5QNo7M1C4rwU3IL6DuIO3ISR57XZF0f+gB9vsyZ6Lq6mbYZj9eeH TBQA7oZ4bYEyPrqYYzwPO/Z4YoAHKLHkWmc0aE5PHlFteWyN09grQ75bMLBp k8vwOPzI7Ic9mPcBhHlMFY3GFtLc2bV2LTGLv9c2Z+RZbqw+GNRFBaM69cAW Gm/fLHvED93qfhJipEgsp29HFAQOuGl7LAkp1e5X/57nYlISwnjyO9am3tnn wueIOxtcYb7OVIOxS6Np18LKlfxIugCAy1PEw/KINUFLxQcW3ZTnqwES+GSu Gh69WFfYBxbv1FDTdsBPY8oyINLsdgwdQh6Q7kNr6GY85m94DzQsN51XnV2r Yyhung4330l/SMS6vENQM7eEsIDw32tTpzOCcjZcuhj8BwJSuT77fu9Y27QH Smj+BjeGsmGk2ezePyFAUHxdL+6+gNrog0UMph3Y+vrcutKY3Ayl2wz7WFSr n8ypp50KwNOW0RfFi/xMuIZEJtWjbR+BStrq4KCPYNG0kqzsK11yXArCWyMC VtDxUY3oB9bJxRyl5sSuIfYNsKA9aDvqS74aiivULGA7vCMZaIJrvVYnn9ao MbUgMunykabvi9xrpVmzk3k8v3S86RgyVE7cL0WB4KZV7Te0glEkTu2tKw2a 4qVRPNvGk5oO/1RJTRWOZ1TlB7YwTB1T7b1YePpVJcbgi37A5gYTcARSi4IM pb0FbjUuHKUkm8SkRc96zqPQUA1bZd3M23thoy8g9XlQgjKwlC7L9qF5Fjmm y5iNlxQbwXNc64nl1qzo4uQOixjYplkIMQvEA0tWQFZnVvcDx4JYWNCMv+wT kOx/dGjRNU9MiDWUmCYWL1eKsQqF8rzAMjPhheMhxI0NU+hhYy4sbln3SJ4S Zexve3tRt8A8CFeSEcovQ4T5T6S8UxLLAvcLPvtlmFnwJ2NFWAe70h2UU4EK 74VuuxFZUckm3gK15HWip+U8ZEfM/Xi8ezqHRJRug/swcSGXQAYfHBR/j0lL bIPp8nxF0aEwcMlG9GTYc22kJE6KzRR91gE9+6jHfMAlg4OxjEnVkXU/sEOk +wz13poLoW5qiT0xc5mPShhMrxzkwsBS2EoKCqqmlW0VmhSbSi2QpRAGHasj wmwsIqk0lqNuYWD1KYk446Flj1I9+yBKyK6kOmsPMMe001U75HYR7uLbVD2b 3gKXxccH0TCFys7Zx7jasuyMj6VtbS51h/bvfHW87docd9k0ugzxaSve1uG+ V396RJm2vJt1qpP2pbAhZh7OXfr65fixb9n1E0izAH5KsboJkM19zU66PmYL 1DK3WX1gAJCzyLD2xGu+VkUotC49ZGVbTpQTQMwHAoRao5E0xOJo1daTTHw/ B89lUzusnxfQZEQbrP4eay5VFM9WcuraI4AlP3LdTUvUSRxCD+R5E7bjok96 iYh3YSV8+Wdgzm97U9+0BwEUgpZ61F//NDq/V1a8ES5ItbiH/7K+R9v0uLmI CUQGHigGPuMoyJYR9W2OaFKk8JrZ/ifltBYfIapRpyXm9jrBhTuVhCYBwE9T yL1/4oX0BpGZ9v2hCjXMpAexV+tKGEguiDXVRfMBPA3ibiSk6zsSrl432NyC uQrAy97lcPZW6Ic9kNt8sheptodltX4Yupv94O/okjKAX2FIQBkErpxM7BlG H+b26sG/r/LV0mdSXdEnzjUv6mSvwe8lwtdXXLnn9nyV8mMBLlZ+SL8LaFaY ib2O1HePnUfN/rS+Oe01c57PvKPcV+KuRL74msMDbXAuV12jU4BaZQZbUbhu +PeV2qEr8T7diatH/a7pSxn1s4/AhLn2SnzDBm5tsxLflEhOERH7KojY4RHV LdtgL5kn8hE+V3VU3MbAont0BNpDaWAP+poRR5ILdLazMVXumUrcnIhFZVvb j19OSgBioNdJlClR0UntJxXhskPiwfmHGGxrVp74G8ybGZbQEQvuFxF28vLM t8FqeLju6TziYAbAwUwgCDHYCahJW0A33cIR65X5YwNYlXKliOXHSIgacd5T 93ZA4GwjR4Gaf/58GN8G4u1eDbbJiA93CmA8O1j19vtolC/oFV0x4bqJI/7b gamrY8rEl9kLJyeKwNNtI3RJyyl4lYx5Cu4st5qs81r3n+W5HdgGS5xpyABU zPV0RRAAy4OkQ0D58pQBpr2S7OjHjSx6wrX2JaxGB4glziQggw7/aYkzSKaj SIf4FUj2L3uRAAcb3IjVP6DBezSx5Ls614zRQfv/nXMa7WFgs+9KbzFlej/n 4X9HUtqPktT/uaSHP0pq/8eSPv0oyfgfS7ryBy91/GNJ8T9Kuv3PJf3BS1/+ SlKhqzXi+xJn6v8rcUZIAg+cPTav6oFH9/Tx3AmgQPX+1jcicQPemYSZnkz7 JHtS4RpPh9rD9z5JtyOvKlxrvzZ0IpURpKEAXW752MpGa0rKFn5fx8NMk1ik ugdxB76Dr4RrTlrw/VWNczfFLBORTxYXg7QyYQ+b/u81zmJEPslPLLv+HZsm /YBNc/8GNtUlAu4PcyDuDt7Dpuo/YlP1v8amPUTAraZGrAbfw6avfsSm7/+M TUeOptKDzgbo8sdIFh4i4OZII+LuPe5u/CN31/5r7h65jwi4VX6YMtkfuXvw X3P3a3uAO8UKxN0cRO5O8yN3/+1vcHcKIuC+OUUsdyZy90s/cnfKP3P3+LK7 RwI+HAT2S7YN2N+A1BiESd8oMIJE+EZEybP/CWwvRU5igSjx8xYQzv0EZ/X/ nbpC52YKXH0mVL8cK45f2G4uUYrdwUQpSZTBtufiT6ucoepGSboWfqWXeLFX tFzzfenoL1HyD+XO/650dDVDaoM/aUUeHjz2qbZn68zFP4PchF+X8v5AVn8J Dm//HcblGJOqlOdnOuf7k4LrvXa0/0rBLwuuiTMm83cAZOm8PM4YKhGbqvQT wL03M7f+CrH/EnDvofH/gf29CaZhmlp586cIfuhuxwAGbeN3e33fEmzB/ZFQ 8DoOYlBPg0H9E5y48G+BLOJfAtnIfwlkVf5tae8/sPzBgw/+JZO/+G+ru5X/ JZMn//uWkxDFy5nfhpmhEtuT2/MzyO3N+eYZzNZGc7Pj6Ojuin1xqSLCfZ1W IWATIyLHjeviwWUF/UbOGkKhaRIQyeN3UtFtTnHkYwt+Oj5OglJJokXJ3XlX ymVNyhXja7rdvrqwyjlchpleq28u3Ct5fqMy6B/kXzrTU2XrzMgkvpx+fB9Q jiz2Er1T1WkKfOOAJ3bz1EY+tjIebX5RPvGUSnxrhHl0BFvuietDj8hesj84 eozZdTndaXWqvDtk3njM2drmINSbcNnBmYvS1YR7gDCm4IXURB5mnknq+XZT fxn/JhZvhst9KZ4a+fS68tINHHlnXA+Ib33VfZqZCPdNLZhYDTaaq0T0GwWU naIqn1j9ysW6wWShxLdJDVvIFhC+oMxauT+41vQif2J6yPHHR6bCdTkPHhOa tKm9nj6Tjr6Qr4NWM4m8WMJGTlBVQac6LLv4Lj+eSVUhSC8YgC1dhQNwv7Sa WN0+qbjKZBkyZtd4VeCjk/I9sUFdIRNhm2EuMqxLfLX1esEvpI7RfTxlQWF2 lHUhe6rLPJZowLWcGG/FsS5WcGE9grY3Q6aKCWaxkJdee3xQ2V9w4yuWDs3T NT+HHV9NLHPa4iwvg9kbv5bYKqMdXY1sl0OFjPjM0+DZHYnoA46qKhYIqDid PzC33FRcj+baUcpoV6Wqdy9hmAgLWKEMCrC+V3FCmqENJsxk2ZI98fKCv2Zp NSlfyxURb+1aCr4WRei9pPTXiLADv502KK2qlBOro+fzu9bh5CltlHGSqv4F UHe2on+45Ur1AoMJYFdSpwHxQ7uUNB0lfGKc6SgRJz6esgo+awqHXbn8YokT eDbfjLXRdK6k+NQZkVpKELrt22x0tiDVMZTutIEo80T5IrZGUWnmgDRDZrVt ygp0SEI5o/mNBN5tP57tcjTJUe4sDbE+JvHPInq8lczuO3r9o62Ew3ALdCZA Ah/W++Gs5j3bvCH1qVdcGVb5+tw7K/Wjn3eM8VsTKBM8tfvOSoErNPl+1SnN eb0DGYXjcxrztXrIFxJ4qxml7w5hqHkHHHVGoQ5KFvmC0FCBfhdkLAA5uN0J HKK2sXQCPJPMvDdinSJXr9naEvLZzmRM6WLRmmLvOaA8A5VoluzDFklrNgdU bogMEe542MIpIMcr9gfHiQYXfPw8MnudJPy+xyz8ijFQr0GZRAiSK2XVfWKE m+2r0e/rweuQ5ddgyT5OYVqGs2LcHPTgjaM54S5p/fLzGYJVo40/w0l5t1V5 /FzTQsxvVcqS5InuYqyn9oXc1bk5C6UwZw/TwqTqRp7uAn+GnOwDbXLpCT2d aZU38iBnq44wI9wpPhDk8wPkJb/jJYT/WDQfqOF+HUGS18kW0MjjDGB0jB00 KjICjVReA0bSr0CjO7yAEQMdaBRfEX5/Ndh0tUz5K3HnCr7Tv4ZwjBPd3hCI c3NBr3ZL8yZcZfrkHiJzPb/PcP7mzzeulPc2rtzd2XbvlFmzTpUlREoqELes pq/YNLB4jz52ygS2rAjfYqo1OxwY6GAwEcm5k1sYUkLi4KmgQxd60tvJZ/cw mS4vLlceGiVzZV3QlU1FpUPXGfm2hF2XKwUEny1QEgan7SKb03u34LR/M1U2 dNOCLyANyCXluzq2mbCRgRP+ZfVqslGVml+fAxRZx0pXkRXFghhaoyinAHtC +BdPhRv1SwU4m/dHABe1c/hcJviHW5y1caxPB8Xq+WUzglOG6rThy7FXcB2I 7ufszUh/u5aFzkhOYjbRHVKx4FncyFGNEnr36MPF5coCMqjgapgded5ULjOf WEaSLJBPpIKSZAlzYEElYz6AXjycHQqUBkfw4ZJkq1i8j/a8yqsr7b7gdRzt FAI/GEdsGWExrCNvqTR2GNt1IhE4xVOh6R9vzV+j5j9kESvE6uw6Kll2uRxy Gdrv6w0B63jzt56Pmq/wQM6ULiuOMUKTn54xCedx/s0NRX662qF/jdL6jItr JZk/YS0z1V/wE1oCGM4pwfxrK08WwJcQ2wpC+mg10OCtJixzOoSthX1pPve1 jjsTp671iGd3NwNXzTJ00s7VdPKOgXnnNBkx7wCGGdm9clgb2/4QfaDmEFam thYe3wGklOdGGZYtyrPAv5cfOXk9kY5gERPRcdQkPAZZOFQQjnWyTd0Ass3X PozTSIpZ2VegF9U+SQZzV9cDt4syfttZxp5YPjsqVHlK8166jrG4a6Rj8QMP CfxWSQ4yBjhEIIFswpOpLkBIDuZFaU2EC4cflWltTQDLvpmYTVgJ2cR6u1wR SA09JUfu2dZ2p/f4Kvw0jUS6kRO6ckyEElJOgS5kDrFcP7q4MwscPu+IlZuy 7L7Ejb3opEleySMnrpr85FYRPY8bhEfzMkTS3r9C7gRyis0oCbDISsVJwFU/ knMdllxCct+DPAldGWJAOPCHUxNW5voxKTS4aL2YiNkB07EQMz2mbeiTiM5K eEh83DtDSCYlr2PA9cxhJ39lu5FvO43rkyP9YWnCD338RogaxV1JswOJ9UYD hPducyF1RgNgo3gwfRzTAC19iOmDF0wf7ElgJuC+BqYPOzATrDWDRm5g+miF gEbtD0AjezB9HCKmjxvE9HEJNKquAo2Onwbllwsc3lmZRyBQ5QESMPzqUjA7 Ej/dqYTSL8ek1F2LzXankQF3v/8yiZzbbRCz4gkZgnFj9SGZ1dWHyj8bfA2U OoacWdaHOmEWCN+EPTMns0IDdV+lIibCKzSpgB0v0vLc3sWXQnnxm8cHKMoZ wbsJCDNWwz9M9iFL60dhC9MAsc2DMwF5hBlgk6OS2dSp7oFw1QZ2KuvEOt9T J9w+LOMQr2CQsRw1brGkZkif6cKpzT4j62dlIU1huil5TOkbHK5niDcpi/Bm 1m7qgL6mrg98lcB/ZyRFrUCYUm3XOypV2RvFM2WbIUk5C09ZvE5f1uLssXsk 7c/zQsclMktz/Q74X80wrIXJCvvT+nehz7i6AClkP9RCt1R0QyfFDGV8MO48 YfH7td55dZ7g+Y9iF1KLEhYf8iwhGAen2vnXClUujgVWH7CodXG/E4SOz2eS s7Y9GLd3qzNf7ulbxlDNe9KYTox6/YvuTUhyYWj44/ntw87TT1dX1I9uFG+V F7oaQ5jKX1qj9PX6x6nc0moLSh8sV4l4OroGk5mEG+RPntkuY79PgdaMpoCc dnEtABMIff2IP289ozSDbWldp+34WJ9Zwps6rpFRIOXEVH809DpjkpzJM6Eh ywC5fBQwEK7PrRW2XQ2yrTlRzyXKaBHtJMwGkOpXBZL3CRfPXDkabuDVf4oW sfiwutZY2aXyRL0FQ9mLa+IuHLLA3Ydf8oQyIZ/0EBqLLWPn1oGEGzgI86UD ucTdtgi66TKRl9hx1O9abOYKvgchPp2yDt6/CG4a7TwBs8hlafwW9sTW71nE JUPs/80scvunWeTV/59F/j/LIpe6r/8vWcR91GLYZS4x8UJ9z6+yyHNUA4/1 bAqWyVBoU/AZhBm488BODMoNF4h10epyLTbwbTkQU4v+HO1mFvOK4Kaa6bI9 cMqGJOIsYRA5myEJCXAL/qXsDQZ/o2lbdaFJcG0G+qeHlc1cKMhSSj91lHD3 UkAC5ZnKUZ6fepnYYzT38mo1IWlwKcoYDtiJqojaWZvV6RsSstNv3hc/XCQ0 iglMWBicElKXamZhVg1IqwAelrQ482kLjm9qGV6me35yK2jvlmE+e/GdZ2ST bdfeXQRPJaIpzOjzbM4yt/30i6upQRWHRr+FXEwNIrh4QDVIR6df9jPvQv2U d6of4X4GaJarJ3JOw4UzFSX9gXDzkiALPttMDRREy4lWGSdft7/zHni2kWNy 5X2ESIZSwRrT8yJ4UdJnnP/rrcho0n9uRZyc8cOZQoccKcTK9Z/9Rm8mKmM0 tBlSx+AIZIMjDM1wGt7xPjBL6I99n00glzs1zM/sZRPPMn2qkwx8wEu/eIT4 CfmLYC6hk/oxl+S9HtXm8uknfETP/o5lmleaV4RwO/K4lBG8aYkIJxxbofeW dAXrbkpSf5p4OcEvKN7SX14dFYmYt5sMQDI/Q65o8QBPJnNFm8tmI2aBYX9O F9b+/P9zupApr2N2b46zIByBR5rGXsIjjcP87W164JFodEKoYOfCpvdJRdXo OiOL/yQGynftf35IaYEBP8GqV3jAdezcPLAQY5L9s7ygRMwL5L/nhUdDEHV+ sKichlhUzr8vTMsFka0JrtDaV+RsEs5s7vbGm4r7Ui+9e9GBjA16RSp7Kf3t upO8COG9UkyHk/xZcG1DwbVdaf7nhFBDTAie4NpWbf1zQtg2Bo0iwYSQ7P/n hLCvFjTSOg2mHjIjj0al2Eb0wWe//J8scgNMF5hvB1Hy5H5xOb7W3hbnlcw8 nYws3WUp22YRx9V+2rnTNaVeDNv4PDPK3CDRMVKQxczDxOEZePkXecE7M2FR cDNo0+FFF/ty7T7gZ/6zzLDFb4lh8IB625avg2Pg04Vds67wXLm3lr9YK7cI s+XunP0K3Ha7SV/U9cToSFlxTi3zjoavtXPjV0/HIygnR29CbKeLk+A6FV4O GvcLia67lo5WA4/1E6fnwif8gYf0Z0awgltZOy/bjJarUQxuE2LngFBcyHbY jXMcWF+pZ3bX3CxYIxwKVtFO0JnhEBtM42N6684rlZPsbZOWSjGOA09+iBiX J6He47wK13hOwwc73+THJ+Wi7RL0TQ6ScHoz2G3h95HgyKxFxkdUX4vlprYX ENb+cplEedmiQZo7XimqEkEcp0qq7ojqsEXmSp/pstgA3ozRN3lMjFUJVlpR A8AH4bXXugoTfG3yFwg/jDN4LXehMNNPg9ep949hxW/H3jDpthG8eHzBWAk2 PHkg+tY2KXV9Vi4K2cT8XjCbA/5+6oCK+AH/qLBEztb13s+xUkmoRdTNzpNn dmvdm62FJ9K2OMt1zPWwrhHx+REr0B263Zh+dxi26dqrWkVkWcy0iJJhcN9k QUGjWFrrTmRnvTyvakvu6wjZFhq+WvnmcDNU40yudq08bye1H15h+MNZ0fU8 i+dUc4Vz49VbV8Tvve91+pD2TiddnnP4plL/QgQkhpllnRdVvWHwGXUH3RKO 0RqiQ/OEUzEFnVjahjixOryKWcrt/IiwczD8SMPF86aLv0B948rD6Lm3Uq2K LULX+9XrSmYaZjHCo5/jSCeyoQvohzJ6vynUKdh2nhfS85/0DzVMvG1XnJFe bKWCUkmWMiGb4q5Z4DAa/pTwZML13WXTnhq37NH4xCcRjkwCtQq+CU+QDA5u Lmcf8pinCcvDezfyKDaeMlrVidV38W6QNRqrM2oa353HGAowzpQ9QPSP1JVQ 5Z5TSrt67JOFnYLDGWytW0ConglGaohGgPFrkjb71PE3ghyKOucT0/LSi806 ugaHv+5TKX6t54MeL2PVyIa23tP+aqhNbdTcRw3xuWw5VR7aGj9g0/BpCb8k Nmw8aToYNeyO++RWoD1aOiIa4f5g+asFfmPF/FPZUNFsv0sJ3HHDZLNDccJJ 8K7V5YC6Z9H1KYb1fSsMYo6dV9x/e9P5hI4wrQEFDNPLXlsQPBa6BRls7+N1 cD0n4s+1Ycm0kyDHjvfdZbIUUnPRMCIYji1+U7fE8aaLa1MaIftQpWkGcbVX rF6fZR7ys+RXWJsglZQFzrfTVj/tKOS1Eq3vfD18Le7Mkn2Dc5LU0mIr7bzm KP3k9fp7mNbWIQjCze2xc16Ra9HwmeVPef5FT9x3Ex2t63w3PgcHZMaJ7qIx OEyKpp6p/kYJlXRZxxi+GQfP0x59JEAXtdEsklFc8rXXdbxzzMkaOWIyNFzs q+9KOYT7pmTL6DvPdlqgqvDgxMHTmgb3qCaOvOZ7/dxlNly/qWZdhS0JcZW3 LMRnNlFeHmJs6MJxslMuYu+jFMSJOeMXLmfe6f/255dmdyGUc4k3y66lIA5u dLzVp++Se048afzU5cxb/YMpCNI/v+TskvN0Sb0LOTWXKFmmloI4sqHyjnhy 9p2+SwqCaS7R+88vyTZU3uof6ZJ75sJxF3JgLvFGGc3eSYoNwxQ6qbLTc7V3 IV4uvF2+74inbpYdnrt9F+LhcqLL963+/o3zKXQNpyiLssZwAzajRoXuvEO9 Z6YLvJw/mOGPSSDJityelZZWuNx4tvGUzNn5mf0LsnnSA6vbZNuuz1xHAtvO rjpLiVs3zFBul7LECUyuef3xJPr6JMbr3mjg/NlVO6kM64YyynnSvfcWwPtg yqJyFojA5JSXaH8gArhI34pwkXMO8WTpUCDs7OoD4OQ7SqESFlOByRGvnYHA TnqC+TFLwknClUrXJ3O9GAYCpc7aPZSKfURo0zkNONkItHn0rJ2B1OVHDZ6E MbLQXZ+s8rrX96eT6cCV7EBHhJOw/UV+X/E6y/ATpRDyaaH326cnXb2iewIL 6Fc1pKzMdQqeMoACHkgpcjXoHihKPSdwajLJY0gtMOqInepNK84Ghb2TrzxK 1QknV+/cHOFs8DxQ9P7cLs1kCXAl6siqEuGklhJguWFY6ZJ9zhp4uaNK+IjQ CJ6jQeLAdvK50b2TRkfs5G+2sjdcOOAcc07i5OR9D1eZLCXpwDjy6U6P0htX UHSTEA+G24Fy5KusN5fYtKAnPgYf3nxO3iOyf57KA/7AY+NUJeb5/bjoc710 HzMP28ErXbzPmdJ9bD5s50D44ByS9uOFw3YGNzMghBE5F53zpp3M9YBHe7je DaQ6snrzpvilhu39QnHnAmgmn3vc0wrhqnIhqXmT9YqEhe1B+HEDSQ9yUrZJ xHGopAv5GOsDxPGbkmTkN89Pph2XkJQ9MnbhQcBxMcmcI89YJ0OPi0hGHhqj /9gumXvQ59R+i8BkyYWjqRDu81K0x9p5PgZKVVA4Q2ryA8slXx45w3mLIbBU cnlfEVUNR2DSjYb92iduXQl0lSLZ5yxUoxKYI9UnZcr95Y0h9+tjOwYGTxgO HY2nav50BXPp4pF4yvR1ZxLa30q0tU8vvjEwyJ0I8FRWpLTlTog+ziTpVRNO NuiZ0xJiyRaB6R+8GbfP0/hSfmAOtM6qfgF3X3mdJcyoqpzCFn+9EKsqjLX8 +MlVegHBHE4Jkfa22M1SZmQW74JS4n5DxpQ6xTnh63wFRpFrs/Pez0ncmPrc JydxzCZpzBiW988plnAiVjHqNuUS848VxmbeTN0aWEz4tpLwbfaa6oi9hOCV HSdV/HG3QVppr1GNiTdjyfBvwouqvWbMJdMS6GS6wWY6VG+Ju3jZlo0zboZZ CXK9V2C+WTOqYH6jlXmX9D+/ymKlkArSH7zvGgcpCclNMhKS44SzD6yN7C2N rZ6YWZlYA7/Pwk85W7H6Cs0Q9lSGY/0TqQYz9aDzLMef3DmkZm9zMjnPZuGS 87splHP+u+M1FUEi0KWlbVZDWysKZ1W9zBiFWe6i97f6O9QHmFSKOZb6+PVa 2A0jJUxrm11uc2oe88upyE1n1La2YkbxSZ6Zodp+tVba4C5k0vh6rfsk6/rh LyM2bsIxQZqavcVqPvPHxKukT3i9SfB4RXiAoNPv3pxF+mY9PTxx7PCtp8LV 95ZJLq2lHBWqaLevVKaqu8J11jPfmimH/rXmBZfEJwpciyLm0Ja0D28G3tLy KvJ/EBM+20HHlNT4Ke55W5+A1jdD6AN9Sz2qjis7Z8V312iu0ktWPJdAf+GY cty56Nbc7CK5NExSyY5+GMgqnDzIDaVtXrTyTvXd6a3D2zf4rrDHKomT/OjW ZN9Vn0BKEpLPhL/AbwixsTN2MDN2vGxjZWqs6XwtRG+fe131YT6p38LO6J6X 1X5/qbYv50HEA/JMisSPrMHcRs7HOdiMU7uulJY+YM9pbbi+aXxJ7uH79+GR svwy41EuoyjXUcdyidg1EXQsbElsBp+PJXRS4lXw6cYRoxekJDd0tCOFlpOe QkdpAw+RTrEzOl95XmB7zVQhixZ62U7frq6+TkBAQMiXQZaWNTi6qHF4MsNG u/Njsbc9wzHvWkPe4jO+vr4RBVeL7i1tLW9ND7CVxbZqT1NsUFHaU/Hk0HL0 07jwxTSP0U7ThWmGIRBhWOy2qYnxMUqqoqJi1hpWmmkaF5izrq5O8j05g9yr pxkpXLjEWHif0Sisbq4kTd698y6hGCNseDw7I6d1oM7F1VCURfjdcqakUbSt rOGRlfNvaG7aZdneYUkO2VVfeup4zova7/PrYdGhUrHS9M8fcfAdxmgG2mQ6 bSPu3XPu5WxzyiQ3QrQizoh4qY7AXtaNZCKuQZfrbjYsHbvzTfmIsP3DzVm3 7XLHZ+0LEXlxv8V/Kw9/is1+3wIj2zb2ZtIrUU6VD00vPR/mdpt7tdHr1TEW 2rjFu1mXWwvWarru0U8/6SlzkLj5YgK2KVT0OVPad7/FDiOk76Dot09xnxqi NK4d9+su/1iuf9r5tQ/yMcos7vEXb91MxY92XeIc9+DRw+/Y1wyirPxlRtZL 2fkbZZYrz8ic9NnKep+fMQ+J9LkaVGNz1GHp7QMk5AnWj8ZirvzgTRH6zAgh 0fBQ1Xb/E0anLxaWXw/bf/zQXEVbP628x9KcivRBseNvsEnDRbWfjl7Tuxiz JY/t6nEzl4NkZerw5ilOVoU58EYa227aTPdoaDfPbjgg9ldXLmoeWO6SrTwc VXTjKFWg81mzJy/vys6RQkrd4g4ZwzmaSs4y2Qd3e4u91LmST6P/+bLaioyj TFWy97UODeo+Hdum3B4qqRJEx4CUijwDZxpbc+DZ18Xt9nKU/BvvEzv8OWF0 3hCv65+4sLeeVzOzQ0OrU6v9+r49oaxMdxi2RzUElH/pjldKFsJzN4xzob7N 31/6ombwdGw1s/hjvm5ZlZf+wJspTnjPQ5pQupXuTgj5oahyHH+urUBnfw15 fuhtWuUovYfoXOyOYRg0fH+myXuNV6Gx6CtdLjP8sfM1kXWKMQa6V8qxkIYu Y//Is5uWzKOMifKaSBaVu7jkZTgD+5XZ+Xeil8bHr/c+5hpJSoWUZCKHR+7z ob/W3pJuPTTA2++Q7Ed5mlIlNndJwfcjby8u3+TamatWi0kzbFcouS6pc5x9 1L/2xpV1wweK0U+G5TmVR9w58Bt0/mou5StXrfbyBO6p1VvZF68+3Oex7aWH eqHni3nTH5qOXkip6j013B8dbvjCLSPytZ6fnDwqbuka1VnsxAO1Ef2o0mrO Wz5GmhMXL41vTi41hlrhuEXYV4Sg1ft6SdeU5r1Cjr+WnoAyeVqlm7jEH1t9 JiF3s6s2UCZ8+fmmANR0/NKZiN61kKi3ljpu4ax+F4u7dVUOjpQu26bYJXze lLoiHvHy+o23yy8rlpmZZG9nhqHNbqBk51Ywjqwf/IcPnyso31lXvRdL+UCr OTI+7jWMBuERT9uhy5nAiZXDzNvDXtcfH9KpDFgqHoC/vBnBbfFg+7WTGxLb 9iGsNHckz9tblgfyqIbNqkvA6xAU4Yw3CphrEC6qL33vYPuUDPrwpunF5+jT +aOiPAIu+mPlF7spYtNTz+UOm36Una4PoquV7WDSrLye+eV5d483j6XYq49p QzOYqID2W5pyA+VT3ioG1mjhON2OwrOxX7hcii7uj+l8nPHRuTuRbmB7Wpmj 8Ka5/Oo98m9dz6iQ2ohTl8w1zj7Sn/p2Yzi/5kne9uUTn3UOLcpHK08pCKQq GJyZpoORnRcjDSmxP6oxSKuSbvWqvvyll8XtIOoT5YlZNzTWDr9NHxBZ2dkW eknOUHjXnvL6F5JEx9AjZ6aealSxxitbihSiE2YuWmmsM+RZlsbcSFNvCj14 LKwk2sXfxWbz4FXzVnoalL243lvl10uHUiJtZKMnu5wD1CPqnnksUTjpib4h ZTxMS18UkjBYNJP+YWt2QWsYX6ZPO8Ntn0Im8bmHOhDS9FnhBo73HFk3A+7a W6kDcryb0DfHRScMsdQ61ENO5EKjKrn1Q12hJyLE6JVYjg5V+L1hTDDcsn+E +hAZM3DQronZ3Uu9JbFpTCZTusROCf8ksuaeV9Mpay6LmXodE6oijnnJDw3B byNsA/GBQ/KD5NqSC862N/ECxZfI1KMnXxy/UCet2v4866ovm9RxlJLwwqGt cXRQ8+2qp580P5jbasHp5JeFJrluJE1nJDmUSD5v/1TEUpDB7aQXfXiVhxHP SmdCptjuVIPbty7zdiSoKH8j7D2spyx+BWniGfhi/4XdaKmG5q5dXQrGlQ7a L2aaX3RVIpQyzSW14A7GA1zJO49545/GF2q4aLSMrZtc3/X56ogovlUx8sE2 zN9ZUnuG6nPKkXXm1oQTPheS1RLt4U+PPjpe2Ws3/fKm8je3pwGzNPFRBXEe tzGvhvofe7MM1jKLnLU/V6rRIXvyZI95hN+1jaYZs69qR0pXzrzHRn5ryX3Z dIFlKII2kjajm+rCnTN4N8bSxYtbkQXYLpaVXpOvVltfg3lu4jpj3VxxIlMv Y552bYt4fXa46ZeARWc3qO8iPhd6aFt7uoYdu+hZ804FghKdoH/xaF/sUM15 CXrOVB6aO8rwzba2Pk0Y27vH0NVcgVrxh0NUepyLEm6FQ3dyIq3r5y9qZT7d sstbv9Xhkx4hPEN3s6CVDRINmwgRWTwrSdGZr7WyjzfZQ2cDfb1FxE2c+bdd 3WLRA3SvWE/p4NOvMi2e9NANfNF2sv1Otm8F7qD/sVY08h2PfO/1+49vJw3E Znga6zWsy0vAbtdazNC16+VlcGh+RYjeTGpq25bvbiQN9aJcbx1x9j8uzE4Z zY8vNnVzzjV9KHlYys9GHT7PjdESVzdzYLvmdrYwnNx38254CWXL/CAVZxKj oxO9GNvYvkQkvpK8YvuJ/t3Dg4OfpY9tRx/6RJ4hczK4yrVl25wqNtnkFprs Zr5uQyfzgYEw1ZsPbJqs1FYtzh1Grpdf6Louepp/unvniIfncNNZkXN4+kOK wQc0olrFlg/alYTxzIY82/TJOXHuXFJB0ZHpi94zEjyGfNTSjjUDYtf7pEov 9W9Zul+Ncnx0JMY2kHyhi672YWht9CQC3pttLEq++Jss6Rs/jp3gfRFUr55F 7H+sW8IeZmhHPnjA/cxzxdt05z3mq3Fq5ztP6impGLDkToZxnrYhow6gOy9Y my5M/3Y1VxHNe+/Z9fcw0/3Wu8uZuZvp+KjZju7fqB5F+tfLn670z0hK7a4b Ubm1O+aLPddpwn1WNId2mpTc7Ns0XGqZ4VaDQTT/rUyoqN70/YGtxHovumPP V3hlBwricDk3HnRDXgXv1vPvVhS+a4St6xyE3OmIg08qX/5c+jJk+pPMWWRm A3N49lAA+iHNxXBnecm88y37LGw80g5paKK0WdDKWJi6n2zC5L2xrSrRNGoF GFW7S9/9O8s32F/Nh0a46YTdPyc2m0oituE8EeRK9/UQJelMvinPXaE0Qwsz 8y6qCTXSFo+LHFO6l+WtqLU2d9Q+oO++vX5CVFuH9CwaqVVV99Xh9Dw/40ET 7cj9+000ggUoAqmGX/roZuZ8tLq/5ntFSHYxnZuxvuaYHKnL4wqmiI9D9DQi CudKec99mZ6Lj5gnm2gnt5U8kyciMiNlinT3psii1Ky2u/+8kp9yrFRO/oVF 3hkKqX1arwMTKLab2Jpz0+YcH3qHlBYffhMrPTDWXXLp1ZGarQtHzqNG2DT5 ZkYPvq9Tch7EJTh+TjT5UuJgZEThkMqzakRH+/wxTVvvoM+Ba3TXaijSHyer iaHOd2YdtZav1IhxPS10ceHwq8CLZLuDSrtecy9zLnCVj3hpRSLuW7uvbi72 Ook6obYt46ByhVVXX0HexSv47IYGlj78aPbFkQr2iCxZvXpms7qfJ4kexUr2 HrnhIZuQ51V/IPOBemx+EbODUPOIGH2EbNyx8pnLSAjJqihXCmL4Yy2Zwvm2 1WG3feHMN9iYjUbah7qtn7foTykO2unerZVTPu17ijEOg66gitHXjz3sc6zA N2nk9d3Mu9e2v2UQ3FRT/DkLEsNx8J02d/QlKwuaB/X2zfRvilusOc1LKe74 LszFU5tGplN19FCdiQoN6Oc0aS475/tt8GyG1WdE9eCTrfGQrryS1Nm50UPM ZuKjCEZo5Fu93Nmd199UoQbVyWdE7IIxiijRuftf6k1Szl2BtEpFvRUy3L3I zWYym+k9KEFxbPnCDbqaDyoDNTFpcU9cN83yEgObKW8u2cIzz94fa9wa9kly e5/XVsCQf0YAyRTWGFtsv/7lU7rQ6vrVxvO+V7bfbUjkcFHYuC9l8NymFTg1 w74W1cxpx9qWLVQ682zn5f0Jug8im11VU3W8JBfWk9PnY9jrApapjJ0Zd0pu 2YoMaJ/6tjFGaaegGyFwjs6d9NGXS5sT6/pWq3i9x/KFXt2nvGrOZbInyX4u lApBoQ9azansVlvYsHDrFuZXDCDjtWrRdhJ+5Se+Ut7244q3yncLob5XTz3h DDmMEjN0SmAdZD794ZLvanXq7pIS6qE+3yOPx1lZXXp6DvBSd76KpqHWjx0v ju9C7sqRktGQ/Pr3Qv749ftvifzd6vAvfiXkf75ESH74BZHfG/7sAfw/XweN /vw4/kfrPz5n/udL78EPT5135Q4cBE7vJ/yZJhxp7YCr/x9QSwECFAAUAAAA CADyuA8vrsaAlaVQAAAScwAADwAAAAAAAAAAACAAtoEAAAAAcGdiZW5jaG1h cmsua3NwUEsFBgAAAAABAAEAPQAAANJQAAAAAA== --Message-Boundary-17717-- From pgsql-performance-owner@postgresql.org Sat Aug 16 17:33:24 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id DA281D1B897 for ; Sat, 16 Aug 2003 20:26:28 +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 21848-02 for ; Sat, 16 Aug 2003 17:26:19 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 47082D1BA54 for ; Sat, 16 Aug 2003 15:41:54 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3519548; Sat, 16 Aug 2003 11:41:54 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: shridhar_daithankar@persistent.co.in, pgsql-performance@postgresql.org Subject: Re: Insert performance Date: Sat, 16 Aug 2003 11:40:59 -0700 User-Agent: KMail/1.4.3 References: <3F3E3B47.13828.333B51D9@localhost> In-Reply-To: <3F3E3B47.13828.333B51D9@localhost> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200308161140.59764.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/279 X-Sequence-Number: 3095 Shridhar, > Unfortunately he can not use copy due to some constraints. Why not use COPY to load the table, and then apply the constraints by query afterwords? It might not be faster, but then again it might. > I was really amazed to see the numbers. First of all, it beat the sunOS > machine left and right. Bruce posted some numbers of 9K inserts/sec. Here > we see the same. > Comments? One thing I can't help to notice is sunOs is not on same scale. > The sunOS machine is a 1GB RAM machine. It has oracle and mysql running on > it and have 300MB swap in use but I am sure it has SCSI disk and in all > respect I would rather expect a RISC machine to perform better than an > athlon XP machine, at least for an IO. It's been reported on this list several times that Solaris is the *worst* of the *nixes for PostgreSQL performance. No analysis has been posted as to why; my own thoughts are: - Solaris' multi-threaded architecture which imposes a hefty per-process overhead, about triple that of Linux, slowing new connections and large multi-user activity; - Poor filesystem management; Sun simply hasn't kept up with IBM, Reiser, Red Hat and BSD in developing filesystems. ... but that's based on inadequate experimentation, just a few tests on Bonnie++ on a Netra running Solaris 8. -- Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Sat Aug 16 19:50: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 2028ED1B897 for ; Sat, 16 Aug 2003 22:49:58 +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 31066-09 for ; Sat, 16 Aug 2003 19:49:50 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 7AC5CD1B8B7 for ; Sat, 16 Aug 2003 19:49:47 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h7GMnlem094733 for ; Sat, 16 Aug 2003 22:49:47 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7GMN2ZW091790 for pgsql-performance@postgresql.org; Sat, 16 Aug 2003 22:23:02 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Insert performance Date: Sat, 16 Aug 2003 18:22:48 -0400 Organization: cbbrowne Computing Inc Lines: 35 Message-ID: References: <3F3E3B47.13828.333B51D9@localhost> <200308161140.59764.josh@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:UP4/Pv3wqcoo/TbzgM5koaM7nhY= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/280 X-Sequence-Number: 3096 Martha Stewart called it a Good Thing whenjosh@agliodbs.com (Josh Berkus)wrote: > Shridhar, >> Unfortunately he can not use copy due to some constraints. > Why not use COPY to load the table, and then apply the constraints > by query afterwords? It might not be faster, but then again it > might. If you can transform the information into COPYable form, that's certainly a good thing. Whether it will be workable or not is another question. > ... but that's based on inadequate experimentation, just a few tests > on Bonnie++ on a Netra running Solaris 8. As far as the filesystem issues are concerned, you're probably using an "old, standard" version of UFS. The "high performance" option on Solaris involves using third-party Veritas software. The persistence of this is somewhat surprising; I'd somewhat have expected Sun to have bought out Veritas or some such thing, as it's a pretty vital technology that _isn't_ totally under their control. Actually, an entertaining option would be for them to buy out SGI, as that would get them control of XFS and a number of other interesting technologies. My expectations of a Netra wouldn't be terribly high, either; they seem to exist as a product so that people that need a cheap Sun box have an option. They are mostly running IDE disk, and the latest IA-32 hardware is likely to have newer faster interface options. -- (format nil "~S@~S" "cbbrowne" "ntlug.org") http://cbbrowne.com/info/advocacy.html "Windows NT was designed to be administered by an idiot and usually is..." -- Chris Adams" From pgsql-docs-owner@postgresql.org Sat Aug 16 21:42:30 2003 X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id DE1D2D1B53A for ; Sun, 17 Aug 2003 00:37:10 +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 57497-01 for ; Sat, 16 Aug 2003 21:37:03 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id A1506D1B524 for ; Sat, 16 Aug 2003 21:36:58 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7H0avV17926; Sat, 16 Aug 2003 20:36:57 -0400 (EDT) From: Bruce Momjian Message-Id: <200308170036.h7H0avV17926@candle.pha.pa.us> Subject: Re: [PERFORM] PostgreSQL vs. MySQL In-Reply-To: <20030704182853.GK4707@libertyrms.info> To: Andrew Sullivan Date: Sat, 16 Aug 2003 20:36:57 -0400 (EDT) Cc: PostgreSQL-documentation X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/51 X-Sequence-Number: 1911 Do we need to add a mention of the need for tuning to the install docs? --------------------------------------------------------------------------- Andrew Sullivan wrote: > On Fri, Jul 04, 2003 at 08:07:18PM +0200, Arjen van der Meijden wrote: > > > Andrew Sullivan wrote: > > > results under production conditions, and not bother to read > > > even the basic "quickstart"-type stuff that is kicking > > > around. > > Then please point out where it sais, in the documentation, that the > > value for the shared_memory of 64 is too low and that 4000 is a nice > > value to start with? > > I think I did indeed speak too soon, as the criticism is a fair one: > nowhere in the installation instructions or the "getting started" > docs does it say that you really ought to do some tuning once you > have the system installed. Can I suggest for the time being that > something along these lines should go in 14.6.3, "Tuning the > installation": > > ---snip--- > By default, PostgreSQL is configured to run on minimal hardware. As > a result, some tuning of your installation will be necessary before > using it for anything other than extremely small databases. At the > very least, it will probably be necessary to increase your shared > buffers setting. See Chapter 16 for details on what tuning options > are available to you. > ---snip--- > > > I'm sorry to put this in a such a confronting manner, but you simply > > can't expect people to search for information that they don't know the > > existence of. > > No need to apologise; I think you're right. > > A > > -- > ---- > Andrew Sullivan 204-4141 Yonge Street > Liberty RMS Toronto, Ontario Canada > M2P 2A8 > +1 416 646 3304 x110 > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Sun Aug 17 00:52: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 B52DBD1B8A2 for ; Sun, 17 Aug 2003 03:52:32 +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 81820-10 for ; Sun, 17 Aug 2003 00:52:22 -0300 (ADT) Received: from newsometer.securesites.net (newsometer.securesites.net [128.121.51.168]) by svr1.postgresql.org (Postfix) with ESMTP id 7432CD1B523 for ; Sun, 17 Aug 2003 00:52:18 -0300 (ADT) Received: from skiddlydee.com (YahooBB218176088089.bbtec.net [218.176.88.89]) (authenticated bits=0) by newsometer.securesites.net (8.12.6p2/8.12.6) with ESMTP id h7H3q8bW068472; Sun, 17 Aug 2003 03:52:09 GMT (envelope-from dave@skiddlydee.com) Date: Sun, 17 Aug 2003 12:48:24 +0900 Subject: Re: Benchmark Content-Type: text/plain; delsp=yes; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) Cc: pgsql-performance@postgresql.org To: mixo@coza.net.za From: David Emery In-Reply-To: <200308150921.06815.josh@agliodbs.com> Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.552) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/281 X-Sequence-Number: 3097 On Saturday, August 16, 2003, at 01:21 AM, Josh Berkus wrote: > Mixo, > >> I need to is measure the perfomance of a ticketing system (written in >> perl) >> which has web interface (html::mason, apache2) with Pg as a backend. >> Users >> of the ticketing system can only connect to the backend via the web >> interface > > I'd suggest Perl LWP. There's even a good article on how to use it in > last > month's Linux Magazine (or the previous month, not sure). > The Perl module HTTP::WebTest should help you do what you want. http://search.cpan.org/author/ILYAM/HTTP-WebTest-2.03/lib/HTTP/ WebTest.pm It should save a ton of time over building one from scratch. Lots of docs too. There are other Perl web testing tools too if you do a search at: http://search.cpan.org HTH, Dave From pgsql-docs-owner@postgresql.org Sun Aug 17 21:16:13 2003 X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 9752ED1B8A4 for ; Sun, 17 Aug 2003 15:06:41 +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 85902-04 for ; Sun, 17 Aug 2003 12:06:30 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 6F63FD1B89E for ; Sun, 17 Aug 2003 12:06:30 -0300 (ADT) Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 (Debian)) id 19oP6p-0007MG-00; Sun, 17 Aug 2003 11:06:19 -0400 Date: Sun, 17 Aug 2003 11:06:19 -0400 From: Andrew Sullivan To: Bruce Momjian Cc: Andrew Sullivan , PostgreSQL-documentation Subject: Re: [PERFORM] PostgreSQL vs. MySQL Message-ID: <20030817110619.A28221@mail.libertyrms.com> References: <20030704182853.GK4707@libertyrms.info> <200308170036.h7H0avV17926@candle.pha.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200308170036.h7H0avV17926@candle.pha.pa.us>; from pgman@candle.pha.pa.us on Sat, Aug 16, 2003 at 08:36:57PM -0400 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/55 X-Sequence-Number: 1915 On Sat, Aug 16, 2003 at 08:36:57PM -0400, Bruce Momjian wrote: > > Do we need to add a mention of the need for tuning to the install docs? Wouldn't be a bad idea, as far as I'm concerned. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-hackers-owner@postgresql.org Sun Aug 17 19:25:24 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 13DC1D1B89E for ; Sun, 17 Aug 2003 22:25: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 45071-08 for ; Sun, 17 Aug 2003 19:25:13 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 988F3D1B539 for ; Sun, 17 Aug 2003 19:25:10 -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 h7HMP85H002519; Sun, 17 Aug 2003 18:25:09 -0400 (EDT) To: Joe Conway , Bertrand Petit Cc: pgsql-hackers@postgresql.org Subject: Re: 7.4 beta 1 getting out of swap In-reply-to: <12303.1060945798@sss.pgh.pa.us> References: <20030814122130.A3583@memo.frmug.org> <15589.1060861546@sss.pgh.pa.us> <20030814165311.A4431@memo.frmug.org> <1578.1060874322@sss.pgh.pa.us> <20030814200947.A4769@memo.frmug.org> <7037.1060889820@sss.pgh.pa.us> <20030814215410.A5336@memo.frmug.org> <7271.1060891412@sss.pgh.pa.us> <20030815001730.A5628@memo.frmug.org> <8826.1060906670@sss.pgh.pa.us> <3F3C497C.1050200@joeconway.com> <12303.1060945798@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 15 Aug 2003 07:09:58 -0400" Date: Sun, 17 Aug 2003 18:25:08 -0400 Message-ID: <2518.1061159108@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/887 X-Sequence-Number: 42544 > Joe Conway writes: >> Tom Lane wrote: > 3. Set up a long-lived cache internal to the array functions that can > translate element type OID to the needed lookup data, and won't leak > memory across repeated calls. This is not the fastest or most general > solution, but it seems the most localized and safest fix. >> It seems to me that #3 is the least risky, and even if it isn't the best >> possible performance, this is the initial implementation of indexes on >> arrays, so it isn't like we're taking away something. Maybe solution #2 >> is better held as a performance enhancement for 7.5. > I'm leaning that way too. It occurs to me also that the same cache > could be used to eliminate repeated lookups in sorting setup --- which > would not be much of a win percentagewise, compared to the sort itself, > but still it seems worth doing. I've committed fixes for this, and verified that inserts/updates on an indexed array column don't leak memory anymore. regards, tom lane From pgsql-performance-owner@postgresql.org Mon Aug 18 03:23:33 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 55D26D1B8A5 for ; Mon, 18 Aug 2003 06:19:52 +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 28179-06 for ; Mon, 18 Aug 2003 03:19:41 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 9F2D0D1B89E for ; Mon, 18 Aug 2003 03:19:37 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7I6NVfO003466 for ; Mon, 18 Aug 2003 11:53:31 +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 h7I6NU3g003453 for ; Mon, 18 Aug 2003 11:53:31 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Mon, 18 Aug 2003 11:51:32 +0530 MIME-Version: 1.0 Subject: Re: Insert performance Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F40BDC4.1605.9407ADF@localhost> In-reply-to: <200308161140.59764.josh@agliodbs.com> References: <3F3E3B47.13828.333B51D9@localhost> 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: 200308/282 X-Sequence-Number: 3098 On 16 Aug 2003 at 11:40, Josh Berkus wrote: > Shridhar, > > > Unfortunately he can not use copy due to some constraints. > > Why not use COPY to load the table, and then apply the constraints by query > afterwords? It might not be faster, but then again it might. Lol.. The constraints I mentioned weren't database constraints.. It need to interface with another database module.. The data import can not be text.. that's a project requirement.. I should have been clearer in first place.. Bye Shridhar -- O'Toole's commentary on Murphy's Law: Murphy was an optimist. From pgsql-performance-owner@postgresql.org Mon Aug 18 15:54: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 0C21BD1B56B for ; Mon, 18 Aug 2003 16:43:41 +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 29432-09 for ; Mon, 18 Aug 2003 13:43:31 -0300 (ADT) Received: from unimm.unisoftbg.com (mail.unisoftbg.com [194.12.229.207]) by svr1.postgresql.org (Postfix) with ESMTP id 977D0D1B89E for ; Mon, 18 Aug 2003 13:43:27 -0300 (ADT) Received: (qmail 3307 invoked by uid 507); 18 Aug 2003 11:19:13 -0000 Received: from unknown (HELO t1.unisoftbg.com) (pginfo%t1.unisoftbg.com@194.12.229.193) by 0 with SMTP; 18 Aug 2003 11:19:13 -0000 Message-ID: <3F40A623.FF953D8E@t1.unisoftbg.com> Date: Mon, 18 Aug 2003 12:10:43 +0200 From: pginfo X-Mailer: Mozilla 4.03 [en] (Win95; I) MIME-Version: 1.0 To: "pgsql-performance@postgresql.org" Subject: bad join preformance Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/286 X-Sequence-Number: 3102 Hi , I am using pg 7.3.3 on RH 7.3, dual Athlon 1 GB RAM. I have 2 tables a_acc and a_vid_doc (all PK are int). sizes: select count(IDS) from a_acc; count --------- 1006772 select count(IDS) from a_vid_doc; count ------- 25 I have problem with the join ot this tables. I tryed this examples: explain analyze select G.IDS from A_ACC G join A_VID_DOC VD ON(G.IDS_VID_DOC=VD.IDS) WHERE G.IDS = 1338673 ; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------- Merge Join (cost=1.83..1.97 rows=1 width=12) (actual time=40.78..2085.82 rows=1 loops=1) Merge Cond: ("outer".ids_vid_doc = "inner".ids) -> Index Scan using i_a_acc_ids_vid_doc on a_acc g (cost=0.00..43706.42 rows=1 width=8) (actual time=40.52..2085.55 rows=1 loops=1) Filter: (ids = 1338673) -> Sort (cost=1.83..1.89 rows=25 width=4) (actual time=0.22..0.22 rows=25 loops=1) Sort Key: vd.ids -> Seq Scan on a_vid_doc vd (cost=0.00..1.25 rows=25 width=4) (actual time=0.05..0.07 rows=25 loops=1) Total runtime: 2085.93 msec (8 rows) and explain analyze select G.IDS from A_ACC G , A_VID_DOC VD where G.IDS_VID_DOC=VD.IDS and G.IDS = 1338673 ; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------- Merge Join (cost=1.83..1.97 rows=1 width=12) (actual time=40.91..2099.13 rows=1 loops=1) Merge Cond: ("outer".ids_vid_doc = "inner".ids) -> Index Scan using i_a_acc_ids_vid_doc on a_acc g (cost=0.00..43706.42 rows=1 width=8) (actual time=40.65..2098.86 rows=1 loops=1) Filter: (ids = 1338673) -> Sort (cost=1.83..1.89 rows=25 width=4) (actual time=0.22..0.22 rows=25 loops=1) Sort Key: vd.ids -> Seq Scan on a_vid_doc vd (cost=0.00..1.25 rows=25 width=4) (actual time=0.05..0.07 rows=25 loops=1) Total runtime: 2099.24 msec (8 rows) From time to time the second one is very slow (15-17 sek). If I execute: explain analyze select G.IDS from A_ACC G where G.IDS = 1338673 ; QUERY PLAN ------------------------------------------------------------------------------------------------------------------ Index Scan using a_acc_pkey on a_acc g (cost=0.00..3.13 rows=1 width=4) (actual time=0.06..0.06 rows=1 loops=1) Index Cond: (ids = 1338673) Total runtime: 0.11 msec (3 rows) , all is working well. How can I find the problem? I have index on A_ACC.IDS_VID_DOC and have vacuum full analyze; Will it help if I make A_ACC.IDS_VID_DOC not null ? My problem is that I will execute this query many times and ~ 2 sek is very slow for me. Many thanks and best regards, ivan. From pgsql-performance-owner@postgresql.org Mon Aug 18 14:25:56 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 62CC0D1B89F for ; Mon, 18 Aug 2003 16:05:28 +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 26494-10 for ; Mon, 18 Aug 2003 13:05:17 -0300 (ADT) Received: from unimm.unisoftbg.com (mail.unisoftbg.com [194.12.229.207]) by svr1.postgresql.org (Postfix) with ESMTP id 2FF31D1B89A for ; Mon, 18 Aug 2003 13:05:13 -0300 (ADT) Received: (qmail 9691 invoked by uid 507); 18 Aug 2003 16:07:19 -0000 Received: from unknown (HELO t1.unisoftbg.com) (pginfo%t1.unisoftbg.com@194.12.229.193) by 0 with SMTP; 18 Aug 2003 16:07:19 -0000 Message-ID: <3F40E9A9.12AE5D55@t1.unisoftbg.com> Date: Mon, 18 Aug 2003 16:58:49 +0200 From: pginfo X-Mailer: Mozilla 4.03 [en] (Win95; I) MIME-Version: 1.0 To: "pgsql-performance@postgresql.org" Subject: bad join performance Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/283 X-Sequence-Number: 3099 Hi , I am using pg 7.3.3 on RH 7.3, dual Athlon 1 GB RAM. I have 2 tables a_acc and a_vid_doc (all PK are int). sizes: select count(IDS) from a_acc; count --------- 1006772 select count(IDS) from a_vid_doc; count ------- 25 I have problem with the join ot this tables. I tryed this examples: explain analyze select G.IDS from A_ACC G join A_VID_DOC VD ON(G.IDS_VID_DOC=VD.IDS) WHERE G.IDS = 1338673 ; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------- Merge Join (cost=1.83..1.97 rows=1 width=12) (actual time=40.78..2085.82 rows=1 loops=1) Merge Cond: ("outer".ids_vid_doc = "inner".ids) -> Index Scan using i_a_acc_ids_vid_doc on a_acc g (cost=0.00..43706.42 rows=1 width=8) (actual time=40.52..2085.55 rows=1 loops=1) Filter: (ids = 1338673) -> Sort (cost=1.83..1.89 rows=25 width=4) (actual time=0.22..0.22 rows=25 loops=1) Sort Key: vd.ids -> Seq Scan on a_vid_doc vd (cost=0.00..1.25 rows=25 width=4) (actual time=0.05..0.07 rows=25 loops=1) Total runtime: 2085.93 msec (8 rows) and explain analyze select G.IDS from A_ACC G , A_VID_DOC VD where G.IDS_VID_DOC=VD.IDS and G.IDS = 1338673 ; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------- Merge Join (cost=1.83..1.97 rows=1 width=12) (actual time=40.91..2099.13 rows=1 loops=1) Merge Cond: ("outer".ids_vid_doc = "inner".ids) -> Index Scan using i_a_acc_ids_vid_doc on a_acc g (cost=0.00..43706.42 rows=1 width=8) (actual time=40.65..2098.86 rows=1 loops=1) Filter: (ids = 1338673) -> Sort (cost=1.83..1.89 rows=25 width=4) (actual time=0.22..0.22 rows=25 loops=1) Sort Key: vd.ids -> Seq Scan on a_vid_doc vd (cost=0.00..1.25 rows=25 width=4) (actual time=0.05..0.07 rows=25 loops=1) Total runtime: 2099.24 msec (8 rows) >From time to time the second one is very slow (15-17 sek). If I execute: explain analyze select G.IDS from A_ACC G where G.IDS = 1338673 ; QUERY PLAN ------------------------------------------------------------------------------------------------------------------ Index Scan using a_acc_pkey on a_acc g (cost=0.00..3.13 rows=1 width=4) (actual time=0.06..0.06 rows=1 loops=1) Index Cond: (ids = 1338673) Total runtime: 0.11 msec (3 rows) , all is working well. How can I find the problem? I have index on A_ACC.IDS_VID_DOC and have vacuum full analyze; Will it help if I make A_ACC.IDS_VID_DOC not null ? My problem is that I will execute this query many times and ~ 2 sek is very slow for me. Many thanks and best regards, ivan. From pgsql-performance-owner@postgresql.org Mon Aug 18 16:11: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 F0723D1B89F for ; Mon, 18 Aug 2003 15:53:20 +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 23319-09 for ; Mon, 18 Aug 2003 12:53:10 -0300 (ADT) Received: from fuji.krosing.net (unknown [194.204.44.104]) by svr1.postgresql.org (Postfix) with ESMTP id 215B6D1B897 for ; Mon, 18 Aug 2003 12:53:09 -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 h7IFqosQ002646; Mon, 18 Aug 2003 18:52:50 +0300 Received: (from hannu@localhost) by fuji.krosing.net (8.12.8/8.12.8/Submit) id h7IFqhGX002643; Mon, 18 Aug 2003 18:52:43 +0300 X-Authentication-Warning: fuji.krosing.net: hannu set sender to hannu@tm.ee using -f Subject: Re: Insert performance From: Hannu Krosing To: shridhar_daithankar@persistent.co.in Cc: pgsql-performance@postgresql.org In-Reply-To: <3F40BDC4.1605.9407ADF@localhost> References: <3F3E3B47.13828.333B51D9@localhost> <3F40BDC4.1605.9407ADF@localhost> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1061221963.2620.4.camel@fuji.krosing.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Mon, 18 Aug 2003 18:52:43 +0300 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/287 X-Sequence-Number: 3103 Shridhar Daithankar kirjutas E, 18.08.2003 kell 09:21: > On 16 Aug 2003 at 11:40, Josh Berkus wrote: > > > Shridhar, > > > > > Unfortunately he can not use copy due to some constraints. > > > > Why not use COPY to load the table, and then apply the constraints by query > > afterwords? It might not be faster, but then again it might. > > Lol.. The constraints I mentioned weren't database constraints.. Can't you still apply them later ;) My own experimentation also got numbers in 9k/sec range (on a quad 1.3GHz Xeons, 2GM mem, 50MB/sec raid) when doing 10-20 parallel runs of ~1000 inserts/transaction. Performance dropped to ~300/sec (at about 60M rows) when I added an index (primary key) - as I did random inserts, the hit rates for index pages were probably low. -------------- Hannu From pgsql-performance-owner@postgresql.org Mon Aug 18 14:32: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 45AB3D1B539 for ; Mon, 18 Aug 2003 16:00:46 +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 28626-03 for ; Mon, 18 Aug 2003 13:00:35 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id E3556D1B56B for ; Mon, 18 Aug 2003 13:00:33 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7IG4XZo028354 for ; Mon, 18 Aug 2003 21:34:33 +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 h7IG4W3g028341 for ; Mon, 18 Aug 2003 21:34:33 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Mon, 18 Aug 2003 21:32:27 +0530 MIME-Version: 1.0 Subject: Re: Insert performance Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4145EB.20645.B5452D9@localhost> In-reply-to: <1061221963.2620.4.camel@fuji.krosing.net> References: <3F40BDC4.1605.9407ADF@localhost> 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: 200308/284 X-Sequence-Number: 3100 On 18 Aug 2003 at 18:52, Hannu Krosing wrote: > My own experimentation also got numbers in 9k/sec range (on a quad > 1.3GHz Xeons, 2GM mem, 50MB/sec raid) when doing 10-20 parallel runs of > ~1000 inserts/transaction. > > Performance dropped to ~300/sec (at about 60M rows) when I added an > index (primary key) - as I did random inserts, the hit rates for index > pages were probably low. I was loading a geographic data couple of months back.. It was 3GB data when loaded in postgresql. I tried loading data first and creating index later. It ran out of available 9GB space. So I created index on an empty table and started loading it. It was slow but at least finished after 3 hours... Co-incidentally oracle had same problems as well. So creating index beforehand remains only option at times, it seems. Tom remarked that it shouldn't have made difference but apparently it does.. You mentioned parallel runs and still getting 9K/sec. Was that overall 9K or per connection? If it is former, probably WAL is hit too hard. You could do some additional testing by having WALit's own disk. I was plannning to do the multiple writers test. But since objective was to find out why postgresql was so slow and it tunred out to be slowaris in first place, didn't have any enthu. left. I recommended my colleague to move to linux. But apparently this product is a part of suit which runs on some HUGE solaris machines. So if it has to run postgresql, it has to run sunos. I hope they are faster with SCSI.. Bye Shridhar -- On my planet, to rest is to rest -- to cease using energy. To me, itis quite illogical to run up and down on green grass, using energy,instead of saving it. -- Spock, "Shore Leave", stardate 3025.2 From pgsql-performance-owner@postgresql.org Mon Aug 18 15:48: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 87A0BD1B539 for ; Mon, 18 Aug 2003 16:58:49 +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 38037-03 for ; Mon, 18 Aug 2003 13:58:39 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 3C26ED1B56B for ; Mon, 18 Aug 2003 13:58:38 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3523788; Mon, 18 Aug 2003 09:58:31 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Christopher Browne , pgsql-performance@postgresql.org Subject: Re: Insert performance Date: Mon, 18 Aug 2003 09:57:59 -0700 User-Agent: KMail/1.4.3 References: <3F3E3B47.13828.333B51D9@localhost> <200308161140.59764.josh@agliodbs.com> In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200308180957.59891.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/285 X-Sequence-Number: 3101 Chris, > My expectations of a Netra wouldn't be terribly high, either; they > seem to exist as a product so that people that need a cheap Sun box > have an option. They are mostly running IDE disk, and the latest > IA-32 hardware is likely to have newer faster interface options. Neither are ours ... we bought an array of 1U Netras as a dot-com closeout. At $330 per machine including OS, they were a darned good deal, and with 4 of them the redundancy makes up for the lack of individual server performance. -- Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Mon Aug 18 18:51: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 2034BD1B8B9 for ; Mon, 18 Aug 2003 17:45:38 +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 48147-05 for ; Mon, 18 Aug 2003 14:45:28 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id 029B7D1B8AC for ; Mon, 18 Aug 2003 14:45:27 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 6464BD625; Mon, 18 Aug 2003 10:45:25 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 3FD9F5C0A; Mon, 18 Aug 2003 10:45:25 -0700 (PDT) Date: Mon, 18 Aug 2003 10:45:25 -0700 (PDT) From: Stephan Szabo To: pginfo Cc: "pgsql-performance@postgresql.org" Subject: Re: bad join performance In-Reply-To: <3F40E9A9.12AE5D55@t1.unisoftbg.com> Message-ID: <20030818104119.C30675-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/289 X-Sequence-Number: 3105 On Mon, 18 Aug 2003, pginfo wrote: > Hi , > I am using pg 7.3.3 on RH 7.3, > dual Athlon > 1 GB RAM. > > I have 2 tables a_acc and a_vid_doc (all PK are int). > > sizes: > > select count(IDS) from a_acc; > count > --------- > 1006772 > > select count(IDS) from a_vid_doc; > count > ------- > 25 > > I have problem with the join ot this tables. > I tryed this examples: > > explain analyze select G.IDS from A_ACC G join A_VID_DOC VD > ON(G.IDS_VID_DOC=VD.IDS) WHERE G.IDS = 1338673 ; In general the best index on A_ACC for this kind of query might be on on A_ACC(IDS, IDS_VID_DOC). That should allow you to search by IDS value but still get a sorted order of IDS_VID_DOC to help the join. From pgsql-performance-owner@postgresql.org Mon Aug 18 17:49:03 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 54552D1B8AB for ; Mon, 18 Aug 2003 18:40:32 +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 58210-05 for ; Mon, 18 Aug 2003 15:40:23 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 35639D1B56C for ; Mon, 18 Aug 2003 15:40:21 -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 h7IIeL5H028776; Mon, 18 Aug 2003 14:40:21 -0400 (EDT) To: pginfo Cc: "pgsql-performance@postgresql.org" Subject: Re: bad join performance In-reply-to: <3F40E9A9.12AE5D55@t1.unisoftbg.com> References: <3F40E9A9.12AE5D55@t1.unisoftbg.com> Comments: In-reply-to pginfo message dated "Mon, 18 Aug 2003 16:58:49 +0200" Date: Mon, 18 Aug 2003 14:40:21 -0400 Message-ID: <28775.1061232021@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/288 X-Sequence-Number: 3104 pginfo writes: > I am using pg 7.3.3 on RH 7.3, Are you certain the server is 7.3.3? This looks like a mergejoin estimation bug that was present in 7.3 and 7.3.1, but should be fixed in 7.3.2 and later. If it is 7.3.3, I'd like to see the pg_stats rows for a_acc.ids_vid_doc and a_vid_doc.ids. regards, tom lane From pgsql-performance-owner@postgresql.org Mon Aug 18 19:17:41 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 889D8D1B89E for ; Mon, 18 Aug 2003 19:17:37 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 90130-07 for ; Mon, 18 Aug 2003 19:17:27 -0300 (ADT) Received: from fuji.krosing.net (unknown [194.204.44.104]) by svr1.postgresql.org (Postfix) with ESMTP id 56FC8D1B56B for ; Mon, 18 Aug 2003 19:17:24 -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 h7IMHBsQ004554; Tue, 19 Aug 2003 01:17:12 +0300 Received: (from hannu@localhost) by fuji.krosing.net (8.12.8/8.12.8/Submit) id h7IMGw3D004552; Tue, 19 Aug 2003 01:16:58 +0300 X-Authentication-Warning: fuji.krosing.net: hannu set sender to hannu@tm.ee using -f Subject: Re: Insert performance From: Hannu Krosing To: shridhar_daithankar@persistent.co.in Cc: pgsql-performance@postgresql.org In-Reply-To: <3F4145EB.20645.B5452D9@localhost> References: <3F40BDC4.1605.9407ADF@localhost> <3F4145EB.20645.B5452D9@localhost> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1061245017.2620.14.camel@fuji.krosing.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Tue, 19 Aug 2003 01:16:58 +0300 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/290 X-Sequence-Number: 3106 Shridhar Daithankar kirjutas E, 18.08.2003 kell 19:02: > On 18 Aug 2003 at 18:52, Hannu Krosing wrote: > > My own experimentation also got numbers in 9k/sec range (on a quad > > 1.3GHz Xeons, 2GM mem, 50MB/sec raid) when doing 10-20 parallel runs of > > ~1000 inserts/transaction. > > > > Performance dropped to ~300/sec (at about 60M rows) when I added an > > index (primary key) - as I did random inserts, the hit rates for index > > pages were probably low. > > I was loading a geographic data couple of months back.. It was 3GB data when > loaded in postgresql. With or without indexes ? > I tried loading data first and creating index later. It ran out of available > 9GB space. So I created index on an empty table and started loading it. It was > slow but at least finished after 3 hours... Co-incidentally oracle had same > problems as well. So creating index beforehand remains only option at times, it > seems. Tom remarked that it shouldn't have made difference but apparently it > does.. Tom just fixed some memory leaks on array indexing the other day. Could there be something like that on geographic types ? > You mentioned parallel runs and still getting 9K/sec. Was that overall 9K or > per connection? Overall. But notice that my setup was (a little) slower per processor. > If it is former, probably WAL is hit too hard. You could do > some additional testing by having WALit's own disk. I guess that todays IDE disks are about the same speed (~50MB/sec) as my test RAID was. I run multiple parallel runs to have a chance to use all 4 processors (but IIRC it was heavyly IO-bound) as well as to better use writing time on WAL platters (not to wait for full rotation on each platter) -------------- Hannu From pgsql-performance-owner@postgresql.org Tue Aug 19 01:22:39 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 25AA0D1B58A for ; Tue, 19 Aug 2003 01:22:36 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 66964-01 for ; Tue, 19 Aug 2003 01:22:25 -0300 (ADT) Received: from unimm.unisoftbg.com (mail.unisoftbg.com [194.12.229.207]) by svr1.postgresql.org (Postfix) with ESMTP id 54FB6D1B8A1 for ; Tue, 19 Aug 2003 01:22:22 -0300 (ADT) Received: (qmail 17746 invoked by uid 507); 19 Aug 2003 04:24:48 -0000 Received: from unknown (HELO t1.unisoftbg.com) (pginfo%t1.unisoftbg.com@194.12.229.193) by 0 with SMTP; 19 Aug 2003 04:24:48 -0000 Message-ID: <3F419680.B70BDA19@t1.unisoftbg.com> Date: Tue, 19 Aug 2003 05:16:16 +0200 From: pginfo X-Mailer: Mozilla 4.03 [en] (Win95; I) MIME-Version: 1.0 To: Tom Lane Cc: "pgsql-performance@postgresql.org" Subject: Re: bad join performance References: <3F40E9A9.12AE5D55@t1.unisoftbg.com> <28775.1061232021@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/291 X-Sequence-Number: 3107 Hi tom, sorry for my bad. My production server is 7.3.7, but the development is 7.3.1 and I ran the tests on 7.3.1. It is courios that on 7.3.1 the query is not constantly bad. >From time to time it is running well. regards, ivan. Tom Lane wrote: > pginfo writes: > > I am using pg 7.3.3 on RH 7.3, > > Are you certain the server is 7.3.3? This looks like a mergejoin > estimation bug that was present in 7.3 and 7.3.1, but should be fixed > in 7.3.2 and later. > > If it is 7.3.3, I'd like to see the pg_stats rows for > a_acc.ids_vid_doc and a_vid_doc.ids. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org From pgsql-performance-owner@postgresql.org Tue Aug 19 01:32:03 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 DD8F9D1B8A1 for ; Tue, 19 Aug 2003 01:32:01 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 54498-09 for ; Tue, 19 Aug 2003 01:31:51 -0300 (ADT) Received: from unimm.unisoftbg.com (mail.unisoftbg.com [194.12.229.207]) by svr1.postgresql.org (Postfix) with ESMTP id 66D4CD1B539 for ; Tue, 19 Aug 2003 01:31:48 -0300 (ADT) Received: (qmail 17888 invoked by uid 507); 19 Aug 2003 04:34:14 -0000 Received: from unknown (HELO t1.unisoftbg.com) (pginfo%t1.unisoftbg.com@194.12.229.193) by 0 with SMTP; 19 Aug 2003 04:34:14 -0000 Message-ID: <3F4198B6.7A24F36F@t1.unisoftbg.com> Date: Tue, 19 Aug 2003 05:25:42 +0200 From: pginfo X-Mailer: Mozilla 4.03 [en] (Win95; I) MIME-Version: 1.0 To: Tom Lane Cc: "pgsql-performance@postgresql.org" Subject: Re: bad join performance References: <3F40E9A9.12AE5D55@t1.unisoftbg.com> <28775.1061232021@sss.pgh.pa.us> <3F419680.B70BDA19@t1.unisoftbg.com> <19949.1061267078@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/293 X-Sequence-Number: 3109 Ok, thanks for the help and best regards. ivan. Tom Lane wrote: > pginfo writes: > > sorry for my bad. > > My production server is 7.3.7, but the development is 7.3.1 and I ran the > > tests on 7.3.1. > > > It is courios that on 7.3.1 the query is not constantly bad. > > From time to time it is running well. > > Yeah, the mergejoin estimation bug doesn't bite in every case (if it > did, we'd have found it before release ;-)). Please update to 7.3.4. > > regards, tom lane From pgsql-performance-owner@postgresql.org Tue Aug 19 01:24: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 06298D1B8B5 for ; Tue, 19 Aug 2003 01:24:50 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 66220-03 for ; Tue, 19 Aug 2003 01:24:39 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 0C14AD1B89E for ; Tue, 19 Aug 2003 01:24:39 -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 h7J4Oc5H019950; Tue, 19 Aug 2003 00:24:38 -0400 (EDT) To: pginfo Cc: "pgsql-performance@postgresql.org" Subject: Re: bad join performance In-reply-to: <3F419680.B70BDA19@t1.unisoftbg.com> References: <3F40E9A9.12AE5D55@t1.unisoftbg.com> <28775.1061232021@sss.pgh.pa.us> <3F419680.B70BDA19@t1.unisoftbg.com> Comments: In-reply-to pginfo message dated "Tue, 19 Aug 2003 05:16:16 +0200" Date: Tue, 19 Aug 2003 00:24:38 -0400 Message-ID: <19949.1061267078@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/292 X-Sequence-Number: 3108 pginfo writes: > sorry for my bad. > My production server is 7.3.7, but the development is 7.3.1 and I ran the > tests on 7.3.1. > It is courios that on 7.3.1 the query is not constantly bad. > From time to time it is running well. Yeah, the mergejoin estimation bug doesn't bite in every case (if it did, we'd have found it before release ;-)). Please update to 7.3.4. regards, tom lane From pgsql-performance-owner@postgresql.org Tue Aug 19 03:27: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 D6003D1B56B for ; Tue, 19 Aug 2003 03:27:06 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 80698-05 for ; Tue, 19 Aug 2003 03:26:54 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 62D19D1B8B2 for ; Tue, 19 Aug 2003 03:26:51 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7J6V1IP009825 for ; Tue, 19 Aug 2003 12:01:01 +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 h7J6V13g009804 for ; Tue, 19 Aug 2003 12:01:01 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Tue, 19 Aug 2003 11:58:45 +0530 MIME-Version: 1.0 Subject: Re: Insert performance Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4210F5.12800.E6D73AE@localhost> In-reply-to: <200308180957.59891.josh@agliodbs.com> References: 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: 200308/294 X-Sequence-Number: 3110 On 18 Aug 2003 at 9:57, Josh Berkus wrote: > Chris, > > > My expectations of a Netra wouldn't be terribly high, either; they > > seem to exist as a product so that people that need a cheap Sun box > > have an option. They are mostly running IDE disk, and the latest > > IA-32 hardware is likely to have newer faster interface options. > > Neither are ours ... we bought an array of 1U Netras as a dot-com closeout. > At $330 per machine including OS, they were a darned good deal, and with 4 of > them the redundancy makes up for the lack of individual server performance. I am sure they would run much better with linux on them rather than solaris.. Bye Shridhar -- Shannon's Observation: Nothing is so frustrating as a bad situation that is beginning to improve. From pgsql-performance-owner@postgresql.org Tue Aug 19 03:31: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 8CF37D1B56C for ; Tue, 19 Aug 2003 03:31:53 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 88479-01 for ; Tue, 19 Aug 2003 03:31:33 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 07ECDD1B56B for ; Tue, 19 Aug 2003 03:31:31 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7J6Zg8L011862 for ; Tue, 19 Aug 2003 12:05:42 +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 h7J6Zf3g011845 for ; Tue, 19 Aug 2003 12:05:41 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Tue, 19 Aug 2003 12:03:26 +0530 MIME-Version: 1.0 Subject: Re: Insert performance Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F42120E.28901.E71BBDF@localhost> In-reply-to: <1061245017.2620.14.camel@fuji.krosing.net> References: <3F4145EB.20645.B5452D9@localhost> 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: 200308/295 X-Sequence-Number: 3111 On 19 Aug 2003 at 1:16, Hannu Krosing wrote: > Shridhar Daithankar kirjutas E, 18.08.2003 kell 19:02: > > I was loading a geographic data couple of months back.. It was 3GB data when > > loaded in postgresql. > > With or without indexes ? Without index. Index was another 3 GB with 50% utilisation. It was 81M rows with 3 floats each.. > > > I tried loading data first and creating index later. It ran out of available > > 9GB space. So I created index on an empty table and started loading it. It was > > slow but at least finished after 3 hours... Co-incidentally oracle had same > > problems as well. So creating index beforehand remains only option at times, it > > seems. Tom remarked that it shouldn't have made difference but apparently it > > does.. > > Tom just fixed some memory leaks on array indexing the other day. Could > there be something like that on geographic types ? Dunno.. This was 7.3.2 or earlier.. Later the project abandoned all types of databases and went to in memory structures since flat data was of the order of 200MB. Now they aer returning to databases as flat data is approaching excess of 3 GB.. God knows what will they do next. It's an ideal example what schedule pressure can do to architecture design of a software.. Bye Shridhar -- Air Force Inertia Axiom: Consistency is always easier to defend than correctness. From pgsql-performance-owner@postgresql.org Wed Aug 20 07:04: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 3BCEED1BB80 for ; Wed, 20 Aug 2003 07:04:08 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 92104-08 for ; Wed, 20 Aug 2003 07:03:59 -0300 (ADT) Received: from Tiger.server100.com (unknown [207.44.158.4]) by svr1.postgresql.org (Postfix) with ESMTP id E4695D1B8BB for ; Wed, 20 Aug 2003 07:03:56 -0300 (ADT) Received: from [195.13.175.104] (helo=Xeon) by Tiger.server100.com with asmtp (Exim 4.20) id 19pPos-00061R-Vj for pgsql-performance@postgresql.org; Wed, 20 Aug 2003 05:03:59 -0500 Message-ID: <004201c36701$fffee930$1401010a@Xeon> Reply-To: From: To: Subject: When NOT to index small tables? Date: Wed, 20 Aug 2003 13:01:16 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-4" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - Tiger.server100.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - piladzi-2.biz X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.3 tagged_above=0.0 required=5.0 tests=BAYES_30, NO_REAL_NAME, RCVD_IN_RFCI X-Spam-Level: * X-Archive-Number: 200308/296 X-Sequence-Number: 3112 I have found many reasons not to index small tables (see . But I still have questions. 1. How small is small enough? 2. am I supposed to drop primary key index on so called 'label tables' knowing I am using this pk in join clause? 3. Is it good to drop index on small table If I know I have created VIEW and joined large table and the small one and I have where condition on that particular colum? Ilustrative example: table small { id -- primary key colum_for_where_condition -- index or not to index? } table large { ... fk_for_small_table -- indexed ... } create view as select ..... inner join on common_column .. I have migrated from mysql . I have found that complex view expression takes about 10 sec using ordinary planner, but genetic alg takes about 5 sec. Strange? I can give details if someone is interested. Regards, Alvis From pgsql-performance-owner@postgresql.org Wed Aug 20 10:31:03 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 3F159D1BAA3 for ; Wed, 20 Aug 2003 10:30:46 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 50055-10 for ; Wed, 20 Aug 2003 10:30:38 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 1B0EBD1B92B for ; Wed, 20 Aug 2003 10:30:34 -0300 (ADT) Received: (qmail 6720 invoked by uid 500); 20 Aug 2003 13:36:24 -0000 Date: Wed, 20 Aug 2003 08:36:24 -0500 From: Bruno Wolff III To: alvis@piladzi-2.biz Cc: pgsql-performance@postgresql.org Subject: Re: When NOT to index small tables? Message-ID: <20030820133624.GB5221@wolff.to> Mail-Followup-To: alvis@piladzi-2.biz, pgsql-performance@postgresql.org References: <004201c36701$fffee930$1401010a@Xeon> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <004201c36701$fffee930$1401010a@Xeon> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/297 X-Sequence-Number: 3113 On Wed, Aug 20, 2003 at 13:01:16 +0300, alvis@piladzi-2.biz wrote: > I have found many reasons not to index small tables (see . > But I still have questions. > > 1. How small is small enough? Unless you think maintaining the indexes is a significant overhead, you shouldn't worry about it as the planner will choose whether or not to use them according to what it thinks is faster. > 2. am I supposed to drop primary key index on so called 'label tables' > knowing I am using this pk in join clause? I don't think you want to drop any indexes that are used to enforce constraints. > 3. Is it good to drop index on small table If I know I have created VIEW and > joined large table and the small one > and I have where condition on that particular colum? If you have some other reason for creating the index, you probably don't want to drop it to try to speed up queries. If there isn't some reason you have for keeping the index, then you might want to drop it if it isn't helping your queries as maintaining the index will slow down queries that modify the table. From pgsql-performance-owner@postgresql.org Thu Aug 21 08:54:16 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 A4F49D1BB23 for ; Thu, 21 Aug 2003 08:54:03 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 80772-02 for ; Thu, 21 Aug 2003 08:53:56 -0300 (ADT) Received: from localhost.localdomain (unknown [202.181.234.12]) by svr1.postgresql.org (Postfix) with ESMTP id B1FF3D1BB0B for ; Thu, 21 Aug 2003 08:53:51 -0300 (ADT) Received: from mktam ([202.181.183.119]) by localhost.localdomain (8.11.6/8.9.3) with SMTP id h7LBkjv03380 for ; Thu, 21 Aug 2003 19:46:46 +0800 Message-ID: <00d001c367db$54c98ea0$1400a8c0@DIGITALONE> From: "Tam MK" To: Subject: More connections in Solaris9 Date: Thu, 21 Aug 2003 19:56:57 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200308/298 X-Sequence-Number: 3114 I try to increase my no. of connections of the Postmaster in my client's Solaris9 box but fails: When startup using bin/postmaster -N 300 -B 2000 -D /export/data, I got the message: IpcSemaphoreCreate: semget(key=5432004, num=17, 03600) failed: No space left on device This error does *not* mean that you have run out of disk space. It occurs either because system limit for the maximum number of semaphore sets (SEMMNI), or the system wide maximum number of semaphores (SEMMNS), would be exceeded. You need to raise the respective kernel parameter. Look into the PostgreSQL documentation for details. So what should I set for SEMMNI and SEMMNS? Any suggestion? The /etc/system file (partial) is set with the following: set shmsys:shminfo_shmmax=0x7fffffff set rlim_fd_max=8192 set rlim_fd_cur=4096 Regards, Tam MK From pgsql-performance-owner@postgresql.org Thu Aug 21 10:37: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 1AE09D1DB70 for ; Thu, 21 Aug 2003 10:36:08 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 13918-09 for ; Thu, 21 Aug 2003 10:36:01 -0300 (ADT) Received: from www.postgresql.com (www.postgresql.com [64.117.225.209]) by svr1.postgresql.org (Postfix) with ESMTP id 3B4B2D1BB3A for ; Thu, 21 Aug 2003 10:35:57 -0300 (ADT) Received: from nebula.skynet.be (nebula.skynet.be [195.238.2.112]) by www.postgresql.com (Postfix) with ESMTP id 78331CF499B for ; Thu, 21 Aug 2003 10:35:56 -0300 (ADT) Received: from pleyel.kotnet.org (157.77-200-80.adsl.skynet.be [80.200.77.157]) by nebula.skynet.be (8.12.9/8.12.9/Skynet-OUT-2.21) with ESMTP id h7LDZWPF017160 for ; Thu, 21 Aug 2003 15:35:32 +0200 (envelope-from ) Received: from slicks by pleyel.kotnet.org with local (Exim 3.36 #1 (Debian)) id 19ppbG-0001QM-00 for ; Thu, 21 Aug 2003 15:35:38 +0200 Date: Thu, 21 Aug 2003 15:35:38 +0200 From: Mathieu De Zutter To: pgsql-performance@postgresql.org Subject: Sorting a query on a view ignores an index Message-ID: <20030821133538.GA973@pleyel.kotnet.org> Reply-To: Mathieu De Zutter Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/299 X-Sequence-Number: 3115 Hi, I'm having a performance problem in postgresql. I have a rather complex view (attached) which, on itself, executes very fast, as it should. Normally this view is unordered. When I order the view itself (see comments in attachment), the view executes with about the same speed since the field i'm sorting on has an index. However, i dont want the view to be presorted, but sort it in the queries that use the view. When I do that, the index I have on that field seems to be ignored. It stretches so far that, when I sort the view on A and sort the query on A too, the query will try to sort _again_ _without_ index and thus lose all performance. I've attached the query-plans for the different cases. preordered: means the view itself is sorted with/without sorting: tells whether the query is sorted Note: the "NOT NULL" in the queries doesn't affect performance With kind regards, Mathieu From pgsql-performance-owner@postgresql.org Thu Aug 21 11:07: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 A6D54D1B9AC for ; Thu, 21 Aug 2003 11:06:53 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 19941-08 for ; Thu, 21 Aug 2003 11:06:45 -0300 (ADT) Received: from ferengi.skynet.be (ferengi.skynet.be [195.238.2.126]) by svr1.postgresql.org (Postfix) with ESMTP id 0E504D1BB22 for ; Thu, 21 Aug 2003 11:06:41 -0300 (ADT) Received: from pleyel.kotnet.org (157.77-200-80.adsl.skynet.be [80.200.77.157]) by ferengi.skynet.be (8.12.9/8.12.9/Skynet-OUT-2.21) with ESMTP id h7LE6YPl011073 for ; Thu, 21 Aug 2003 16:06:35 +0200 (envelope-from ) Received: from slicks by pleyel.kotnet.org with local (Exim 3.36 #1 (Debian)) id 19pq5I-0001hA-00 for ; Thu, 21 Aug 2003 16:06:40 +0200 Date: Thu, 21 Aug 2003 16:06:40 +0200 From: Mathieu De Zutter To: pgsql-performance@postgresql.org Subject: A better look on the same problem (ignored index) Message-ID: <20030821140640.GB973@pleyel.kotnet.org> Reply-To: Mathieu De Zutter Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Dxnq1zWXvFF0Q93v" Content-Disposition: inline User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/300 X-Sequence-Number: 3116 --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, After my first mail, I found a better testcase (well it's a about the same, but you have a better look to compare). See attachment prob-query.sql The ORDER BY in the FROM clause uses the index. The last ORDER BY does not use the index. They should be the same... The query plans are identical to the plans in my previous mail. With kind regards, Mathieu P.S.: i just noted that i forgot to attach to previous mail, i'll attach everything now. --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="prob_query.sql" SELECT v.id , v.title, v.artist, v.music, v.lyrics, v.year FROM ( SELECT href('song', r.id, r.title) AS title, r.title AS search_title, ( SELECT br(href('artist', a.id, a.name)) FROM credit c JOIN artist a ON (c.artist_id = a.id) WHERE (c.song_id = r.id AND c.type_id = 0) ) AS artist, ( SELECT comma(a.name) FROM credit c JOIN artist a ON (c.artist_id = a.id) WHERE (c.song_id = r.id AND c.type_id = 0) ) AS search_artist, ( SELECT br(href('artist', a.id, a.name)) FROM credit c JOIN artist a ON (c.artist_id = a.id) WHERE (c.song_id = r.id AND c.type_id = 1) ) AS music, ( SELECT comma(a.name) FROM credit c JOIN artist a ON (c.artist_id = a.id) WHERE (c.song_id = r.id AND c.type_id = 1) ) AS search_music, ( SELECT br(href('artist', a.id, a.name)) FROM credit c JOIN artist a ON (c.artist_id = a.id) WHERE (c.song_id = r.id AND c.type_id = 2) ) AS lyrics, ( SELECT comma(a.name) FROM credit c JOIN artist a ON (c.artist_id = a.id) WHERE (c.song_id = r.id AND c.type_id = 2) ) AS search_lyrics, r.year AS year, r.year AS search_year, r.id AS id FROM song r ORDER BY search_title ) AS v ORDER BY v.search_title LIMIT 20 OFFSET 0 ; --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="presorted-query-plan-without-sorting.sql" coverdb=# explain analyze SELECT id , title, artist, music, lyrics, year FROM search_song WHERE search_title IS NOT NULL LIMIT 20 OFFSET 0 ; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------- Limit (cost=0.00..1.18 rows=20 width=28) (actual time=0.47..9.57 rows=20 loops=1) -> Subquery Scan search_song (cost=0.00..390.11 rows=6593 width=28) (actual time=0.47..9.54 rows=21 loops=1) -> Index Scan using song_title_idx on song r (cost=0.00..390.11 rows=6593 width=28) (actual time=0.47..9.47 rows=21 loops=1) Filter: (title IS NOT NULL) SubPlan -> Aggregate (cost=8.14..8.14 rows=1 width=25) (actual time=0.24..0.24 rows=1 loops=21) -> Nested Loop (cost=0.00..8.13 rows=2 width=25) (actual time=0.03..0.03 rows=1 loops=21) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=2 width=4) (actual time=0.01..0.02 rows=1 loops=21) Index Cond: (song_id = $0) Filter: (type_id = 0) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=8.14..8.14 rows=1 width=25) (actual time=0.04..0.04 rows=1 loops=21) -> Nested Loop (cost=0.00..8.13 rows=2 width=25) (actual time=0.02..0.03 rows=1 loops=21) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=2 width=4) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: (song_id = $0) Filter: (type_id = 0) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.74..6.74 rows=1 width=25) (actual time=0.04..0.04 rows=1 loops=21) -> Nested Loop (cost=0.00..6.74 rows=1 width=25) (actual time=0.02..0.02 rows=1 loops=21) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: (song_id = $0) Filter: (type_id = 1) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=15) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.74..6.74 rows=1 width=25) (actual time=0.03..0.03 rows=1 loops=21) -> Nested Loop (cost=0.00..6.74 rows=1 width=25) (actual time=0.01..0.02 rows=1 loops=21) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: (song_id = $0) Filter: (type_id = 1) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=15) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.62..6.62 rows=1 width=25) (actual time=0.04..0.04 rows=1 loops=21) -> Nested Loop (cost=0.00..6.62 rows=1 width=25) (actual time=0.01..0.02 rows=1 loops=21) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: (song_id = $0) Filter: (type_id = 2) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=15) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.62..6.62 rows=1 width=25) (actual time=0.03..0.03 rows=1 loops=21) -> Nested Loop (cost=0.00..6.62 rows=1 width=25) (actual time=0.01..0.02 rows=1 loops=21) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: (song_id = $0) Filter: (type_id = 2) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=15) Index Cond: ("outer".artist_id = a.id) Total runtime: 9.98 msec (48 rows) --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="presorted-query-plan-with-sorting.sql" coverdb=# explain analyze SELECT id , title, artist, music, lyrics, year FROM search_song WHERE search_title IS NOT NULL ORDER BY search_title LIMIT 20 OFFSET 0 ; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit (cost=808.33..808.38 rows=20 width=28) (actual time=2276.68..2276.70 rows=20 loops=1) -> Sort (cost=808.33..824.81 rows=6593 width=28) (actual time=2276.67..2276.68 rows=21 loops=1) Sort Key: search_title -> Subquery Scan search_song (cost=0.00..390.11 rows=6593 width=28) (actual time=0.47..2231.64 rows=6380 loops=1) -> Index Scan using song_title_idx on song r (cost=0.00..390.11 rows=6593 width=28) (actual time=0.47..2202.12 rows=6380 loops=1) Filter: (title IS NOT NULL) SubPlan -> Aggregate (cost=8.14..8.14 rows=1 width=25) (actual time=0.07..0.07 rows=1 loops=6380) -> Nested Loop (cost=0.00..8.13 rows=2 width=25) (actual time=0.04..0.04 rows=1 loops=6380) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=2 width=4) (actual time=0.01..0.02 rows=1 loops=6380) Index Cond: (song_id = $0) Filter: (type_id = 0) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.02..0.02 rows=1 loops=6341) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=8.14..8.14 rows=1 width=25) (actual time=0.05..0.05 rows=1 loops=6380) -> Nested Loop (cost=0.00..8.13 rows=2 width=25) (actual time=0.03..0.03 rows=1 loops=6380) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=2 width=4) (actual time=0.02..0.02 rows=1 loops=6380) Index Cond: (song_id = $0) Filter: (type_id = 0) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=6341) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.74..6.74 rows=1 width=25) (actual time=0.06..0.06 rows=1 loops=6380) -> Nested Loop (cost=0.00..6.74 rows=1 width=25) (actual time=0.02..0.03 rows=1 loops=6380) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.02 rows=1 loops=6380) Index Cond: (song_id = $0) Filter: (type_id = 1) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.02 rows=1 loops=4497) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.74..6.74 rows=1 width=25) (actual time=0.04..0.04 rows=1 loops=6380) -> Nested Loop (cost=0.00..6.74 rows=1 width=25) (actual time=0.02..0.03 rows=1 loops=6380) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.01 rows=1 loops=6380) Index Cond: (song_id = $0) Filter: (type_id = 1) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=4497) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.62..6.62 rows=1 width=25) (actual time=0.05..0.05 rows=1 loops=6380) -> Nested Loop (cost=0.00..6.62 rows=1 width=25) (actual time=0.02..0.03 rows=1 loops=6380) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.02 rows=1 loops=6380) Index Cond: (song_id = $0) Filter: (type_id = 2) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.02 rows=1 loops=4463) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.62..6.62 rows=1 width=25) (actual time=0.04..0.04 rows=1 loops=6380) -> Nested Loop (cost=0.00..6.62 rows=1 width=25) (actual time=0.02..0.03 rows=1 loops=6380) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.02 rows=1 loops=6380) Index Cond: (song_id = $0) Filter: (type_id = 2) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=4463) Index Cond: ("outer".artist_id = a.id) Total runtime: 2278.43 msec (50 rows) --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="query-plan-without-sorting.sql" coverdb=# explain analyze SELECT id , title, artist, music, lyrics, year FROM search_song WHERE search_title IS NOT NULL LIMIT 20 OFFSET 0 ; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------- Limit (cost=0.00..0.41 rows=20 width=28) (actual time=1.52..6.54 rows=20 loops=1) -> Subquery Scan search_song (cost=0.00..134.93 rows=6593 width=28) (actual time=1.52..6.53 rows=21 loops=1) -> Seq Scan on song r (cost=0.00..134.93 rows=6593 width=28) (actual time=1.51..6.45 rows=21 loops=1) Filter: (title IS NOT NULL) SubPlan -> Aggregate (cost=8.14..8.14 rows=1 width=25) (actual time=0.07..0.07 rows=1 loops=21) -> Nested Loop (cost=0.00..8.14 rows=2 width=25) (actual time=0.02..0.03 rows=1 loops=21) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=2 width=4) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: (song_id = $0) Filter: (type_id = 0) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=8.14..8.14 rows=1 width=25) (actual time=0.04..0.04 rows=1 loops=21) -> Nested Loop (cost=0.00..8.14 rows=2 width=25) (actual time=0.02..0.02 rows=1 loops=21) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=2 width=4) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: (song_id = $0) Filter: (type_id = 0) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.35..6.35 rows=1 width=25) (actual time=0.04..0.04 rows=1 loops=21) -> Nested Loop (cost=0.00..6.35 rows=1 width=25) (actual time=0.01..0.02 rows=1 loops=21) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: (song_id = $0) Filter: (type_id = 1) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=15) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.35..6.35 rows=1 width=25) (actual time=0.03..0.03 rows=1 loops=21) -> Nested Loop (cost=0.00..6.35 rows=1 width=25) (actual time=0.01..0.02 rows=1 loops=21) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: (song_id = $0) Filter: (type_id = 1) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=15) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.45..6.45 rows=1 width=25) (actual time=0.04..0.04 rows=1 loops=21) -> Nested Loop (cost=0.00..6.45 rows=1 width=25) (actual time=0.01..0.02 rows=1 loops=21) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: (song_id = $0) Filter: (type_id = 2) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=14) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.45..6.45 rows=1 width=25) (actual time=0.03..0.03 rows=1 loops=21) -> Nested Loop (cost=0.00..6.45 rows=1 width=25) (actual time=0.01..0.02 rows=1 loops=21) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.01 rows=1 loops=21) Index Cond: (song_id = $0) Filter: (type_id = 2) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=14) Index Cond: ("outer".artist_id = a.id) Total runtime: 7.23 msec (48 rows) --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="query-plan-with-sorting.sql" coverdb=# explain analyze SELECT id , title, artist, music, lyrics, year FROM search_song WHERE search_title IS NOT NULL ORDER BY search_title LIMIT 20 OFFSET 0 ; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit (cost=553.15..553.20 rows=20 width=28) (actual time=2227.78..2227.80 rows=20 loops=1) -> Sort (cost=553.15..569.63 rows=6593 width=28) (actual time=2227.78..2227.78 rows=21 loops=1) Sort Key: search_title -> Subquery Scan search_song (cost=0.00..134.93 rows=6593 width=28) (actual time=1.09..2153.71 rows=6380 loops=1) -> Seq Scan on song r (cost=0.00..134.93 rows=6593 width=28) (actual time=1.09..2125.37 rows=6380 loops=1) Filter: (title IS NOT NULL) SubPlan -> Aggregate (cost=8.10..8.10 rows=1 width=25) (actual time=0.06..0.06 rows=1 loops=6380) -> Nested Loop (cost=0.00..8.09 rows=2 width=25) (actual time=0.03..0.03 rows=1 loops=6380) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=2 width=4) (actual time=0.01..0.01 rows=1 loops=6380) Index Cond: (song_id = $0) Filter: (type_id = 0) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=6341) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=8.10..8.10 rows=1 width=25) (actual time=0.05..0.05 rows=1 loops=6380) -> Nested Loop (cost=0.00..8.09 rows=2 width=25) (actual time=0.03..0.03 rows=1 loops=6380) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=2 width=4) (actual time=0.01..0.01 rows=1 loops=6380) Index Cond: (song_id = $0) Filter: (type_id = 0) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=6341) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.62..6.62 rows=1 width=25) (actual time=0.05..0.05 rows=1 loops=6380) -> Nested Loop (cost=0.00..6.62 rows=1 width=25) (actual time=0.02..0.03 rows=1 loops=6380) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.02..0.02 rows=1 loops=6380) Index Cond: (song_id = $0) Filter: (type_id = 1) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=4497) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.62..6.62 rows=1 width=25) (actual time=0.04..0.04 rows=1 loops=6380) -> Nested Loop (cost=0.00..6.62 rows=1 width=25) (actual time=0.02..0.03 rows=1 loops=6380) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.02 rows=1 loops=6380) Index Cond: (song_id = $0) Filter: (type_id = 1) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=4497) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.76..6.76 rows=1 width=25) (actual time=0.05..0.05 rows=1 loops=6380) -> Nested Loop (cost=0.00..6.76 rows=1 width=25) (actual time=0.01..0.02 rows=1 loops=6380) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.01 rows=1 loops=6380) Index Cond: (song_id = $0) Filter: (type_id = 2) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=4463) Index Cond: ("outer".artist_id = a.id) -> Aggregate (cost=6.76..6.76 rows=1 width=25) (actual time=0.04..0.04 rows=1 loops=6380) -> Nested Loop (cost=0.00..6.76 rows=1 width=25) (actual time=0.01..0.02 rows=1 loops=6380) -> Index Scan using credit_song_idx on credit c (cost=0.00..3.08 rows=1 width=4) (actual time=0.01..0.01 rows=1 loops=6380) Index Cond: (song_id = $0) Filter: (type_id = 2) -> Index Scan using artist_pkey on artist a (cost=0.00..3.02 rows=1 width=21) (actual time=0.01..0.01 rows=1 loops=4463) Index Cond: ("outer".artist_id = a.id) Total runtime: 2229.73 msec (50 rows) --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="query.sql" -- with sorting SELECT id , title, artist, music, lyrics, year FROM search_song WHERE search_title IS NOT NULL ORDER BY search_title LIMIT 20 OFFSET 0 ; -- without sorting SELECT id , title, artist, music, lyrics, year FROM search_song WHERE search_title IS NOT NULL LIMIT 20 OFFSET 0 ; --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="view.sql" CREATE VIEW search_song AS SELECT href('song', r.id, r.title) AS title, r.title AS search_title, ( SELECT br(href('artist', a.id, a.name)) FROM credit c JOIN artist a ON (c.artist_id = a.id) WHERE (c.song_id = r.id AND c.type_id = 0) ) AS artist, ( SELECT comma(a.name) FROM credit c JOIN artist a ON (c.artist_id = a.id) WHERE (c.song_id = r.id AND c.type_id = 0) ) AS search_artist, ( SELECT br(href('artist', a.id, a.name)) FROM credit c JOIN artist a ON (c.artist_id = a.id) WHERE (c.song_id = r.id AND c.type_id = 1) ) AS music, ( SELECT comma(a.name) FROM credit c JOIN artist a ON (c.artist_id = a.id) WHERE (c.song_id = r.id AND c.type_id = 1) ) AS search_music, ( SELECT br(href('artist', a.id, a.name)) FROM credit c JOIN artist a ON (c.artist_id = a.id) WHERE (c.song_id = r.id AND c.type_id = 2) ) AS lyrics, ( SELECT comma(a.name) FROM credit c JOIN artist a ON (c.artist_id = a.id) WHERE (c.song_id = r.id AND c.type_id = 2) ) AS search_lyrics, r.year AS year, r.year AS search_year, --href('album', alb.id, alb.title) AS album, --alb.title AS search_album, r.id AS id FROM song r --LEFT JOIN album alb ON (r.album_id = alb.id) -- Uncomment next line for 'presorted' -- ORDER BY search_title ; --Dxnq1zWXvFF0Q93v-- From pgsql-performance-owner@postgresql.org Thu Aug 21 11:51:32 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 E2F90D1BAE7 for ; Thu, 21 Aug 2003 11:51:24 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 34317-10 for ; Thu, 21 Aug 2003 11:51:18 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id 3B7A2D1BB3F for ; Thu, 21 Aug 2003 11:51:13 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7LEpGi15020 for ; Thu, 21 Aug 2003 16:51:16 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7LEpGV15016 for ; Thu, 21 Aug 2003 16:51:16 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id 556FA6FCCD; Thu, 21 Aug 2003 16:51:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id 4B2067F6E6 for ; Thu, 21 Aug 2003 16:51:05 +0200 (CEST) Date: Thu, 21 Aug 2003 16:51:05 +0200 (CEST) From: Tomka Gergely To: Subject: Tests Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/301 X-Sequence-Number: 3117 http://195.199.65.92/~horvaths/pgperformance.html One of my friend do these tests. We think about the best filesystem for the Linux/Postgres systems. The four test was: teszt1 - 10.000 inserts teszt2 - 10.inserts, 10 in one trans. teszt3 - 14.000.000 inserts, 1.000 in one trans. teszt4 - "Select count(*)" on the big table. What test are interesting? Plese give us tips and ideas. The guy has time for other test. --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-performance-owner@postgresql.org Thu Aug 21 11:59:31 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 46B85D1BB27 for ; Thu, 21 Aug 2003 11:59:29 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 37182-01 for ; Thu, 21 Aug 2003 11:59:14 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 5ACEFD1B8C8 for ; Thu, 21 Aug 2003 11:59:14 -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 h7LExC5H008510; Thu, 21 Aug 2003 10:59:12 -0400 (EDT) To: Mathieu De Zutter Cc: pgsql-performance@postgresql.org Subject: Re: Sorting a query on a view ignores an index In-reply-to: <20030821133538.GA973@pleyel.kotnet.org> References: <20030821133538.GA973@pleyel.kotnet.org> Comments: In-reply-to Mathieu De Zutter message dated "Thu, 21 Aug 2003 15:35:38 +0200" Date: Thu, 21 Aug 2003 10:59:11 -0400 Message-ID: <8509.1061477951@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/303 X-Sequence-Number: 3119 Mathieu De Zutter writes: > However, i dont want the view to be presorted, but sort it in the > queries that use the view. When I do that, the index I have on that > field seems to be ignored. It stretches so far that, when I sort the > view on A and sort the query on A too, the query will try to sort > _again_ _without_ index and thus lose all performance. This is a limitation of the 7.3 query planner. 7.4 should do better. regards, tom lane From pgsql-performance-owner@postgresql.org Thu Aug 21 11:57:40 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 2057CD1BB3E for ; Thu, 21 Aug 2003 11:57:38 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 36073-10 for ; Thu, 21 Aug 2003 11:57:31 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 4221FD1BB56 for ; Thu, 21 Aug 2003 11:57:26 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7LF03fQ026656 for ; Thu, 21 Aug 2003 20:30:03 +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 h7LF03Qb026642 for ; Thu, 21 Aug 2003 20:30:03 +0530 From: "Shridhar Daithankar" To: Date: Thu, 21 Aug 2003 20:29:20 +0530 MIME-Version: 1.0 Subject: Re: Tests Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F452BA0.8319.16A36CE@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: 200308/302 X-Sequence-Number: 3118 On 21 Aug 2003 at 16:51, Tomka Gergely wrote: > http://195.199.65.92/~horvaths/pgperformance.html > > One of my friend do these tests. We think about the best filesystem for > the Linux/Postgres systems. > > The four test was: > > teszt1 - 10.000 inserts > teszt2 - 10.inserts, 10 in one trans. > teszt3 - 14.000.000 inserts, 1.000 in one trans. > teszt4 - "Select count(*)" on the big table. > > What test are interesting? Plese give us tips and ideas. The guy has time > for other test. - Try creating table without OIDs and repeat runs - Try changing number of inserts per transactions. I tried similar test on my home machine last week. It gave me 500K records in about 54 seconds on 7.3.3. That translates to roughly 3 minutes for 1.4M records. You sure something isn't right here? What is the hardware? Can you try it with 7.4CVS? Bye Shridhar -- XIIdigitation, n.: The practice of trying to determine the year a movie was made by deciphering the Roman numerals at the end of the credits. -- Rich Hall, "Sniglets" From pgsql-performance-owner@postgresql.org Thu Aug 21 13:25:42 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 E96E9D1B93F for ; Thu, 21 Aug 2003 13:25:39 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 67704-01 for ; Thu, 21 Aug 2003 13:25:09 -0300 (ADT) Received: from www.postgresql.com (www.postgresql.com [64.117.225.209]) by svr1.postgresql.org (Postfix) with ESMTP id 0B520D1B921 for ; Thu, 21 Aug 2003 13:25:09 -0300 (ADT) Received: from sojef.skynet.be (sojef.skynet.be [195.238.2.127]) by www.postgresql.com (Postfix) with ESMTP id 5C8C2CF4BC8 for ; Thu, 21 Aug 2003 13:25:08 -0300 (ADT) Received: from pleyel.kotnet.org (157.77-200-80.adsl.skynet.be [80.200.77.157]) by sojef.skynet.be (8.12.9/8.12.9/Skynet-OUT-2.21) with ESMTP id h7LGOgdu007480; Thu, 21 Aug 2003 18:24:42 +0200 (envelope-from ) Received: from slicks by pleyel.kotnet.org with local (Exim 3.36 #1 (Debian)) id 19psEy-0002ha-00; Thu, 21 Aug 2003 18:24:48 +0200 Date: Thu, 21 Aug 2003 18:24:48 +0200 From: Mathieu De Zutter To: Tom Lane Cc: pgsql-performance@postgresql.org Subject: Re: Sorting a query on a view ignores an index Message-ID: <20030821162448.GC973@pleyel.kotnet.org> Reply-To: Mathieu De Zutter References: <20030821133538.GA973@pleyel.kotnet.org> <8509.1061477951@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8509.1061477951@sss.pgh.pa.us> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/304 X-Sequence-Number: 3120 On Thu, Aug 21, 2003 at 10:59:11AM -0400, Tom Lane wrote: > Mathieu De Zutter writes: > > However, i dont want the view to be presorted, but sort it in the > > queries that use the view. When I do that, the index I have on that > > field seems to be ignored. It stretches so far that, when I sort the > > view on A and sort the query on A too, the query will try to sort > > _again_ _without_ index and thus lose all performance. > > This is a limitation of the 7.3 query planner. 7.4 should do better. Ok I'll have to live with that I guess. Apart from avoiding views or subselects when sorting afterwards and putting the whole bunch in a huge SQL statement (which i'll have to produce on-the-fly), do you have an other alternative? The 2 seconds is way to much, as the database will eventually run on a machine that is 10 times slower. With kind regards, Mathieu From pgsql-performance-owner@postgresql.org Thu Aug 21 13:28: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 CB6A8D1B99D for ; Thu, 21 Aug 2003 13:28:46 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 67430-03 for ; Thu, 21 Aug 2003 13:28:16 -0300 (ADT) Received: from mta7.adelphia.net (mta7.adelphia.net [68.168.78.193]) by svr1.postgresql.org (Postfix) with ESMTP id 7B2C6D1B94A for ; Thu, 21 Aug 2003 13:27:57 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta7.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030821162743.KFOO1349.mta7.adelphia.net@potentialtech.com>; Thu, 21 Aug 2003 12:27:43 -0400 Message-ID: <3F44F2FD.3080903@potentialtech.com> Date: Thu, 21 Aug 2003 12:27:41 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomka Gergely Cc: pgsql-performance@postgresql.org Subject: Re: Tests 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: 200308/305 X-Sequence-Number: 3121 Tomka Gergely wrote: > http://195.199.65.92/~horvaths/pgperformance.html > > One of my friend do these tests. We think about the best filesystem for > the Linux/Postgres systems. > > The four test was: > > teszt1 - 10.000 inserts > teszt2 - 10.inserts, 10 in one trans. > teszt3 - 14.000.000 inserts, 1.000 in one trans. > teszt4 - "Select count(*)" on the big table. > > What test are interesting? Plese give us tips and ideas. The guy has time > for other test. It's a shame you didn't test ufs+softupdates. I'd be curious to see how it stacked up against the others. -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Thu Aug 21 14:03:10 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id A601BD1B9AC for ; Thu, 21 Aug 2003 14:03:03 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 73059-10 for ; Thu, 21 Aug 2003 14:02:32 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 04849D1B975 for ; Thu, 21 Aug 2003 14:02:30 -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 h7LH285H014118; Thu, 21 Aug 2003 13:02:08 -0400 (EDT) To: Mathieu De Zutter Cc: pgsql-performance@postgresql.org Subject: Re: Sorting a query on a view ignores an index In-reply-to: <20030821162448.GC973@pleyel.kotnet.org> References: <20030821133538.GA973@pleyel.kotnet.org> <8509.1061477951@sss.pgh.pa.us> <20030821162448.GC973@pleyel.kotnet.org> Comments: In-reply-to Mathieu De Zutter message dated "Thu, 21 Aug 2003 18:24:48 +0200" Date: Thu, 21 Aug 2003 13:02:08 -0400 Message-ID: <14117.1061485328@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/306 X-Sequence-Number: 3122 Mathieu De Zutter writes: > Apart from avoiding views or subselects when sorting afterwards and > putting the whole bunch in a huge SQL statement (which i'll have to > produce on-the-fly), do you have an other alternative? See if you can avoid the subselects in the view's SELECT list. That's what's preventing 7.3 from doing a good job. regards, tom lane From pgsql-performance-owner@postgresql.org Thu Aug 21 14:56:19 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 8B580D1B926 for ; Thu, 21 Aug 2003 14:56:18 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 90003-08 for ; Thu, 21 Aug 2003 14:55:47 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id B525CD1B8B7 for ; Thu, 21 Aug 2003 14:55:45 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7LHtTi25439 for ; Thu, 21 Aug 2003 19:55:30 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7LHtTV25435; Thu, 21 Aug 2003 19:55:29 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id 9096E6FCCD; Thu, 21 Aug 2003 19:55:18 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id 85D9F7F6E6; Thu, 21 Aug 2003 19:55:18 +0200 (CEST) Date: Thu, 21 Aug 2003 19:55:18 +0200 (CEST) From: Tomka Gergely To: Bill Moran Cc: Subject: Re: Tests In-Reply-To: <3F44F2FD.3080903@potentialtech.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/307 X-Sequence-Number: 3123 2003-08-21 ragyog=F3 napj=E1n Bill Moran ezt =FCzente: > Tomka Gergely wrote: > > http://195.199.65.92/~horvaths/pgperformance.html > > > > One of my friend do these tests. We think about the best filesystem for > > the Linux/Postgres systems. > > > > The four test was: > > > > teszt1 - 10.000 inserts > > teszt2 - 10.inserts, 10 in one trans. > > teszt3 - 14.000.000 inserts, 1.000 in one trans. > > teszt4 - "Select count(*)" on the big table. > > > > What test are interesting? Plese give us tips and ideas. The guy has ti= me > > for other test. > > It's a shame you didn't test ufs+softupdates. I'd be curious to see how > it stacked up against the others. Shame? I smell here a harcore BSD fighter :) Maybe sometime he run tests on *SD, but now we need linux data. --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-performance-owner@postgresql.org Thu Aug 21 15:17:45 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 75655D1B926 for ; Thu, 21 Aug 2003 15:17:39 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 01367-04 for ; Thu, 21 Aug 2003 15:17:09 -0300 (ADT) Received: from mta8.adelphia.net (mta8.adelphia.net [68.168.78.196]) by svr1.postgresql.org (Postfix) with ESMTP id A3850D1B8B6 for ; Thu, 21 Aug 2003 15:17:07 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta8.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030821181701.QYKZ1354.mta8.adelphia.net@potentialtech.com>; Thu, 21 Aug 2003 14:17:01 -0400 Message-ID: <3F450C9B.6000201@potentialtech.com> Date: Thu, 21 Aug 2003 14:16:59 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomka Gergely Cc: pgsql-performance@postgresql.org Subject: Re: Tests References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/308 X-Sequence-Number: 3124 Tomka Gergely wrote: > 2003-08-21 ragyog� napj�n Bill Moran ezt �zente: > > >>Tomka Gergely wrote: >> >>>http://195.199.65.92/~horvaths/pgperformance.html >>> >>>One of my friend do these tests. We think about the best filesystem for >>>the Linux/Postgres systems. >>> >>>The four test was: >>> >>>teszt1 - 10.000 inserts >>>teszt2 - 10.inserts, 10 in one trans. >>>teszt3 - 14.000.000 inserts, 1.000 in one trans. >>>teszt4 - "Select count(*)" on the big table. >>> >>>What test are interesting? Plese give us tips and ideas. The guy has time >>>for other test. >> >>It's a shame you didn't test ufs+softupdates. I'd be curious to see how >>it stacked up against the others. > > Shame? I smell here a harcore BSD fighter :) Well, I suppose ... > Maybe sometime he run > tests on *SD, but now we need linux data. "He" has had it on his list of things to do for months. And if I ever get enough free moments, I will test *both* BSD and Linux, because I'm terribly biased towards BSD because that's all I use. In addition to being interested in how FreeBSD's ufs+softupdates compares to the variety of Linux journalling filesystems, I'm also interested to compare FreeBSD's performance on ext2fs and FAT to Linux's peformance on those same filesystems. It's a "shame" because I simply haven't found the time yet. -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Thu Aug 21 17:12:40 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 B4938D1B94A for ; Thu, 21 Aug 2003 17:12:36 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 37738-01 for ; Thu, 21 Aug 2003 17:12:06 -0300 (ADT) Received: from viper.rx2.net (viper.rx2.net [66.78.14.162]) by svr1.postgresql.org (Postfix) with ESMTP id 315A4D1B8A3 for ; Thu, 21 Aug 2003 17:12:04 -0300 (ADT) Received: from cbbrowne by viper.rx2.net with local (Exim 4.20) id 19pvmT-0003kE-Dw; Thu, 21 Aug 2003 16:11:37 -0400 From: "Your Name" To: Mathieu De Zutter , Tom Lane , pgsql-performance@postgresql.org Subject: Re: Sorting a query on a view ignores an index X-Mailer: NeoMail 1.25 X-IPAddress: 207.136.25.10 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Message-Id: Date: Thu, 21 Aug 2003 16:11:37 -0400 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - viper.rx2.net X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [32025 32023] / [47 12] X-AntiAbuse: Sender Address Domain - viper.rx2.net X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/309 X-Sequence-Number: 3125 > Apart from avoiding views or subselects when sorting afterwards and > putting the whole bunch in a huge SQL statement (which i'll have to > produce on-the-fly), do you have an other alternative? > The 2 seconds is way to much, as the database will eventually run on a > machine that is 10 times slower. Something that isn't _totally_ clear is whether or not it is going to be possible to make use of indices in the selection. If the postmaster must assemble, out of disparate sources, a large collection of data, the best trade-off may very well be to build the collection the best way the system knows how (perhaps NOT ordering this using the index you expect), and sort it afterwards. Sorting doesn't tend to be grieviously expensive except when finding the query results is also grieviously expensive. I think you are assuming that the query would be quicker if it used the sorted index; that is an assumption that should be checked at the door, or at least checked somewhere. -- "The main difference between an amateur crypto designer and a used car salesman is that the used car salesman can probably drive and knows when he's lying." -- An Metet From pgsql-performance-owner@postgresql.org Thu Aug 21 17:57:45 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 880F4D1BB7D for ; Thu, 21 Aug 2003 17:57:38 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 46922-03 for ; Thu, 21 Aug 2003 17:57:09 -0300 (ADT) Received: from www.postgresql.com (www.postgresql.com [64.117.225.209]) by svr1.postgresql.org (Postfix) with ESMTP id D4E43D1B9BC for ; Thu, 21 Aug 2003 17:57:06 -0300 (ADT) Received: from sarek.skynet.be (sarek.skynet.be [195.238.3.230]) by www.postgresql.com (Postfix) with ESMTP id 23E6ACF4C54 for ; Thu, 21 Aug 2003 17:57:06 -0300 (ADT) Received: from pleyel.kotnet.org (127.78-200-80.adsl.skynet.be [80.200.78.127]) by sarek.skynet.be (8.12.9/8.12.9/Skynet-OUT-2.21) with ESMTP id h7LKurC9001908; Thu, 21 Aug 2003 22:56:54 +0200 (envelope-from ) Received: from slicks by pleyel.kotnet.org with local (Exim 3.36 #1 (Debian)) id 19pwUN-0007zg-00; Thu, 21 Aug 2003 22:56:59 +0200 Date: Thu, 21 Aug 2003 22:56:59 +0200 From: Mathieu De Zutter To: Tom Lane Cc: pgsql-performance@postgresql.org Subject: Re: Sorting a query on a view ignores an index Message-ID: <20030821205659.GA28674@pleyel.kotnet.org> Reply-To: Mathieu De Zutter References: <20030821133538.GA973@pleyel.kotnet.org> <8509.1061477951@sss.pgh.pa.us> <20030821162448.GC973@pleyel.kotnet.org> <14117.1061485328@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14117.1061485328@sss.pgh.pa.us> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/310 X-Sequence-Number: 3126 On Thu, Aug 21, 2003 at 01:02:08PM -0400, Tom Lane wrote: > Mathieu De Zutter writes: > > Apart from avoiding views or subselects when sorting afterwards and > > putting the whole bunch in a huge SQL statement (which i'll have to > > produce on-the-fly), do you have an other alternative? > > See if you can avoid the subselects in the view's SELECT list. That's > what's preventing 7.3 from doing a good job. First of all, I've installed 7.4beta1 and the performance is as should be expected. Good, I'll try to convince the admin to upgrade to 7.4 when it gets released (though that machine I will eventually have to use, runs debian/stable atm, with pgsql 7.2). Second, I have tried to eliminate the subselects by (left) joining some tables (I only kept a part of the original view to do this(1)). That made me also add a GROUP BY clause to remove duplicates. Comparing to the result-equivalent subselect-version, it has an enormous performance hit (1) I only kept one subselect and rearranged it to left join's Limit (cost=2169.31..2169.36 rows=20 width=140) (actual time=526.12..526.14 rows=20 loops=1) -> Sort (cost=2169.31..2185.79 rows=6591 width=140) (actual time=526.11..526.12 rows=20 loops=1) Sort Key: search_title -> Subquery Scan search_song (cost=1254.25..1484.93 rows=6591 width=140) (actual time=149.29..423.16 rows=6380 loops=1) -> GroupAggregate (cost=1254.25..1419.02 rows=6591 width=49) (actual time=149.28..407.04 rows=6380 loops=1) -> Sort (cost=1254.25..1270.73 rows=6591 width=49) (actual time=147.92..150.75 rows=6380 loops=1) Sort Key: s.id, s.title, s."year" etc... Running half a second. It looks like the grouping is messing it up. No index seems to be used either? (s.id is primary key, s.title = search_title, with index search_title_idx) While the subselect-version shows no sort in its plan and runs in 2msec and shows "Index Scan using song_title_idx on song s" (both queries are sorted on search_title) I'm fairly sure the two queries were written as they should. If you want more info on how I got this result, just tell me. I think my mail is yet long enough. Oh, important detail, these results are obtained with 7.4beta1, I haven't checked it in 7.3 With kind regards, Mathieu From pgsql-performance-owner@postgresql.org Fri Aug 22 07:14:58 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 393C6D1BB02 for ; Fri, 22 Aug 2003 07:14:51 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 80976-09 for ; Fri, 22 Aug 2003 07:14:21 -0300 (ADT) Received: from Tiger.server100.com (unknown [207.44.158.4]) by svr1.postgresql.org (Postfix) with ESMTP id 40E88D1BA8C for ; Fri, 22 Aug 2003 07:14:19 -0300 (ADT) Received: from [195.13.175.104] (helo=Xeon) by Tiger.server100.com with asmtp (Exim 4.20) id 19q8w0-0004JY-Qo for pgsql-performance@postgresql.org; Fri, 22 Aug 2003 05:14:21 -0500 Message-ID: <001201c36895$bc9a9910$1401010a@Xeon> Reply-To: From: To: Subject: Re: Sorting a query on a view ignores an index Date: Fri, 22 Aug 2003 13:11:19 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-4" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - Tiger.server100.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - piladzi-2.biz X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.3 tagged_above=0.0 required=5.0 tests=BAYES_30, NO_REAL_NAME, RCVD_IN_RFCI X-Spam-Level: * X-Archive-Number: 200308/311 X-Sequence-Number: 3127 Hello, Here is my exp. regarding VIEW (create VIEW view_name AS SELECT ....) optimization. I have found strange (or at least not very intelligent) behavior of query planner (v.7.3.4). Given task is to take data from 14 tables, join, group, sort, etc. I currently use about ten views referencing each other. I have done a lot of job to adjust 'postgresql.conf' configuration. Except common increase of shared_mem&buffer stuff I felt I was unable to do anything else. So, initialy, time to generate the Monthly report was about 10 sec. I started to play with GEQO.... Screaming success -- I downplayed query execution time about 3x JUST by setting geqo_threshold=3. Now my Monthly report takes about 3 sec. (Users are running that sequence of select queries (I call it invocation of the final view ;-) quite often for any given period of time -- usually from one week to half a year (rarely) so it is essential part of my dbvs. Maybe my exp. will encourage somebody to play with scary genetic stuff. ;-) Good luck & Best Regards, Alvis From pgsql-performance-owner@postgresql.org Fri Aug 22 17:47: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 799CCD1BB37 for ; Fri, 22 Aug 2003 17:47:51 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 57614-05 for ; Fri, 22 Aug 2003 17:47:47 -0300 (ADT) Received: from localhost.localdomain (unknown [65.217.53.66]) by svr1.postgresql.org (Postfix) with ESMTP id 08AEBD1BA75 for ; Fri, 22 Aug 2003 17:47:40 -0300 (ADT) Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h7MJX1qd012578; Fri, 22 Aug 2003 15:33:02 -0400 Received: from gnvex001.mmrd.com (gnvex001.mmrd.com [192.168.3.55]) by thorn.mmrd.com (8.11.6/8.11.6) with ESMTP id h7MKlkZ16093; Fri, 22 Aug 2003 16:47:46 -0400 Received: from camel.mmrd.com ([172.25.5.213]) by gnvex001.mmrd.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id Q65S2G55; Fri, 22 Aug 2003 16:47:44 -0400 Subject: Re: Tests From: Robert Treat To: Bill Moran Cc: Tomka Gergely , pgsql-performance@postgresql.org In-Reply-To: <3F450C9B.6000201@potentialtech.com> References: <3F450C9B.6000201@potentialtech.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 22 Aug 2003 16:47:45 -0400 Message-Id: <1061585266.3389.194.camel@camel> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/312 X-Sequence-Number: 3128 On Thu, 2003-08-21 at 14:16, Bill Moran wrote: > >>>What test are interesting? Plese give us tips and ideas. The guy has time > >>>for other test. > >> > >>It's a shame you didn't test ufs+softupdates. I'd be curious to see how > >>it stacked up against the others. > > > > Shame? I smell here a harcore BSD fighter :) > > Well, I suppose ... > Well I'm not a hardcore bsd fighter and I'd like to see how it stacks up as well. UFS+softupdates is supposed to be a very safe combination, if it performs well enough I could see a recommendation for it for those who are willing to look beyond linux. Robert Treat -- Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL From pgsql-performance-owner@postgresql.org Fri Aug 22 17:54:25 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 B7499D1BB22 for ; Fri, 22 Aug 2003 17:54:24 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 59667-01 for ; Fri, 22 Aug 2003 17:54:21 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id 0908DD1BA95 for ; Fri, 22 Aug 2003 17:54:11 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7MKsHi22998 for ; Fri, 22 Aug 2003 22:54:17 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7MKsGV22994; Fri, 22 Aug 2003 22:54:17 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id 0CBB56FCCA; Fri, 22 Aug 2003 22:54:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id 034237F6E7; Fri, 22 Aug 2003 22:54:06 +0200 (CEST) Date: Fri, 22 Aug 2003 22:54:05 +0200 (CEST) From: Tomka Gergely To: Robert Treat Cc: Bill Moran , Subject: Re: Tests In-Reply-To: <1061585266.3389.194.camel@camel> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/313 X-Sequence-Number: 3129 2003-08-22 ragyog=F3 napj=E1n Robert Treat ezt =FCzente: > On Thu, 2003-08-21 at 14:16, Bill Moran wrote: > > >>>What test are interesting? Plese give us tips and ideas. The guy has= time > > >>>for other test. > > >> > > >>It's a shame you didn't test ufs+softupdates. I'd be curious to see = how > > >>it stacked up against the others. > > > > > > Shame? I smell here a harcore BSD fighter :) > > > > Well, I suppose ... > > > > Well I'm not a hardcore bsd fighter and I'd like to see how it stacks up > as well. UFS+softupdates is supposed to be a very safe combination, if > it performs well enough I could see a recommendation for it for those > who are willing to look beyond linux. The guy who do the test have only a few weeks *bsd-experience, and i dont have bsd experience at all. The guy now planning tests on BSD, but he need some time to build up a good relationship with the *BSD. Ps.: i am a harcore linux-fgihter, so sorry :) --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-performance-owner@postgresql.org Fri Aug 22 18:01: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 9CA90D1BA95 for ; Fri, 22 Aug 2003 18:00:58 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 58802-09 for ; Fri, 22 Aug 2003 18:00:54 -0300 (ADT) Received: from mta6.adelphia.net (mta6.adelphia.net [68.168.78.190]) by svr1.postgresql.org (Postfix) with ESMTP id CA111D1BAA9 for ; Fri, 22 Aug 2003 18:00:45 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta6.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030822210046.TUFV1347.mta6.adelphia.net@potentialtech.com>; Fri, 22 Aug 2003 17:00:46 -0400 Message-ID: <3F46847C.4010900@potentialtech.com> Date: Fri, 22 Aug 2003 17:00:44 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomka Gergely Cc: Robert Treat , pgsql-performance@postgresql.org Subject: Re: Tests References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/314 X-Sequence-Number: 3130 Tomka Gergely wrote: > 2003-08-22 ragyog� napj�n Robert Treat ezt �zente: > >>On Thu, 2003-08-21 at 14:16, Bill Moran wrote: >> >>>>>>What test are interesting? Plese give us tips and ideas. The guy has time >>>>>>for other test. >>>>> >>>>>It's a shame you didn't test ufs+softupdates. I'd be curious to see how >>>>>it stacked up against the others. >>>> >>>>Shame? I smell here a harcore BSD fighter :) >>> >>>Well, I suppose ... >> >>Well I'm not a hardcore bsd fighter and I'd like to see how it stacks up >>as well. UFS+softupdates is supposed to be a very safe combination, if >>it performs well enough I could see a recommendation for it for those >>who are willing to look beyond linux. > > > The guy who do the test have only a few weeks *bsd-experience, and i dont > have bsd experience at all. The guy now planning tests on BSD, but he > need some time to build up a good relationship with the *BSD. > > Ps.: i am a harcore linux-fgihter, so sorry :) Well, as much as I _am_ a die-hard BSD geek, I'm far more interested in knowing what platform is really best when I need a top-notch PostgreSQL server. I'm going to try to force some time this weekend to do some tests ... we'll see if I succeed ... -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Fri Aug 22 19:19:31 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 BB2C0D1BA43 for ; Fri, 22 Aug 2003 19:19:26 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 84332-06 for ; Fri, 22 Aug 2003 19:19:23 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 17B83D1BA42 for ; Fri, 22 Aug 2003 19:19:15 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3540082; Fri, 22 Aug 2003 15:19:22 -0700 Content-Type: text/plain; charset="iso-8859-2" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Tomka Gergely , Robert Treat Subject: Re: Tests Date: Fri, 22 Aug 2003 15:17:33 -0700 User-Agent: KMail/1.4.3 Cc: Bill Moran , References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308221517.33924.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/315 X-Sequence-Number: 3131 Tomka, Did you get my test suggestion? It never hit the lists, so I wonder if yo= u=20 got it .... --=20 -Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Fri Aug 22 19:25:16 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 DD020D1BA80 for ; Fri, 22 Aug 2003 19:25:12 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 84374-07 for ; Fri, 22 Aug 2003 19:25:10 -0300 (ADT) Received: from localhost.localdomain (unknown [65.217.53.66]) by svr1.postgresql.org (Postfix) with ESMTP id 3AF7BD1BA82 for ; Fri, 22 Aug 2003 19:24:56 -0300 (ADT) Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h7MLAJqd013429; Fri, 22 Aug 2003 17:10:20 -0400 Received: from gnvex001.mmrd.com (gnvex001.mmrd.com [192.168.3.55]) by thorn.mmrd.com (8.11.6/8.11.6) with ESMTP id h7MMP3Z17927; Fri, 22 Aug 2003 18:25:04 -0400 Received: from camel.mmrd.com ([172.25.5.213]) by gnvex001.mmrd.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id Q65S2HJW; Fri, 22 Aug 2003 18:25:01 -0400 Subject: Re: Tests From: Robert Treat To: Tomka Gergely Cc: Bill Moran , pgsql-performance@postgresql.org In-Reply-To: References: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Mailer: Ximian Evolution 1.0.8 Date: 22 Aug 2003 18:25:03 -0400 Message-Id: <1061591103.3390.198.camel@camel> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/316 X-Sequence-Number: 3132 On Fri, 2003-08-22 at 16:54, Tomka Gergely wrote: > 2003-08-22 ragyog=F3 napj=E1n Robert Treat ezt =FCzente: >=20 > > On Thu, 2003-08-21 at 14:16, Bill Moran wrote: > > > >>>What test are interesting? Plese give us tips and ideas. The guy h= as time > > > >>>for other test. > > > >> > > > >>It's a shame you didn't test ufs+softupdates. I'd be curious to se= e how > > > >>it stacked up against the others. > > > > > > > > Shame? I smell here a harcore BSD fighter :) > > > > > > Well, I suppose ... > > > > > > > Well I'm not a hardcore bsd fighter and I'd like to see how it stacks up > > as well. UFS+softupdates is supposed to be a very safe combination, if > > it performs well enough I could see a recommendation for it for those > > who are willing to look beyond linux. >=20 > The guy who do the test have only a few weeks *bsd-experience, and i dont > have bsd experience at all. The guy now planning tests on BSD, but he > need some time to build up a good relationship with the *BSD. >=20 Another thought would be linux w/ xfs Also, can you post more complete hardware/ os info?=20 Oh, and vs 7.4beta1 would be great too.=20 :-) Robert Treat --=20 Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL From pgsql-performance-owner@postgresql.org Fri Aug 22 20:32: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 A23E5D1BA10 for ; Fri, 22 Aug 2003 20:32:08 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 99708-06 for ; Fri, 22 Aug 2003 20:32:06 -0300 (ADT) Received: from curry.tmsl.demon.co.uk (tmsl-adsl.demon.co.uk [80.177.114.181]) by svr1.postgresql.org (Postfix) with ESMTP id 1D5C0D1BA84 for ; Fri, 22 Aug 2003 20:31:57 -0300 (ADT) Received: from bacon.tmsl.demon.co.uk (bacon.tmsl.demon.co.uk [192.168.7.102]) by curry.tmsl.demon.co.uk (8.11.6/8.11.6) with ESMTP id h7MNW4u23303 for ; Sat, 23 Aug 2003 00:32:05 +0100 Date: Sat, 23 Aug 2003 00:32:00 +0100 From: Paul Thomas To: "pgsql-performance @ postgresql . org" Subject: Re: Tests Message-ID: <20030823003200.A3743@bacon> References: <3F46847C.4010900@potentialtech.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=ISO-8859-2 In-Reply-To: <3F46847C.4010900@potentialtech.com>; from wmoran@potentialtech.com on Fri, Aug 22, 2003 at 22:00:44 +0100 X-Mailer: Balsa 1.2.3 Lines: 31 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/317 X-Sequence-Number: 3133 On 22/08/2003 22:00 Bill Moran wrote: > [snip] Well, as much as I _am_ a die-hard BSD geek, I'm far more > interested in > knowing what platform is really best when I need a top-notch PostgreSQL > server. > > I'm going to try to force some time this weekend to do some tests ... > we'll see if I succeed ... I, for one, would be very interested to see your results (can't you find something better to at the weekend than **** about with computers ?:) What I'd really be interested in is a comparison of Linux vs BSD using each OS's variations of file system on the same single-processor Intel/AMD based hardware. Selfishness and sillyness aside, I'm sure your tests will of interest to us all. Thanks in advance -- Paul Thomas +------------------------------+---------------------------------------------+ | Thomas Micro Systems Limited | Software Solutions for the Smaller Business | | Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk | +------------------------------+---------------------------------------------+ From pgsql-performance-owner@postgresql.org Fri Aug 22 20:55:31 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 D2B31D1BA3E for ; Fri, 22 Aug 2003 20:55:28 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 03394-07 for ; Fri, 22 Aug 2003 20:55:26 -0300 (ADT) Received: from mta4.adelphia.net (mta4.adelphia.net [68.168.78.184]) by svr1.postgresql.org (Postfix) with ESMTP id E38D7D1BA5C for ; Fri, 22 Aug 2003 20:55:17 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta4.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030822235527.LZWU1348.mta4.adelphia.net@potentialtech.com>; Fri, 22 Aug 2003 19:55:27 -0400 Message-ID: <3F46AD6E.4080903@potentialtech.com> Date: Fri, 22 Aug 2003 19:55:26 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Paul Thomas Cc: "pgsql-performance @ postgresql . org" Subject: Re: Tests References: <3F46847C.4010900@potentialtech.com> <20030823003200.A3743@bacon> In-Reply-To: <20030823003200.A3743@bacon> 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: 200308/318 X-Sequence-Number: 3134 Paul Thomas wrote: > > On 22/08/2003 22:00 Bill Moran wrote: > >> [snip] Well, as much as I _am_ a die-hard BSD geek, I'm far more >> interested in >> knowing what platform is really best when I need a top-notch PostgreSQL >> server. >> >> I'm going to try to force some time this weekend to do some tests ... >> we'll see if I succeed ... > > I, for one, would be very interested to see your results (can't you find > something better to at the weekend than **** about with computers ?:) Unfortunately, no. I've been trying to get a date for a month and I'm about ready to give up ;) > > What I'd really be interested in is a comparison of Linux vs BSD using > each OS's variations of file system on the same single-processor > Intel/AMD based hardware. > That was what I was hoping to do. > Selfishness and sillyness aside, I'm sure your tests will of interest to > us all. Thanks in advance Oh great, now I feel obligated ... well, I guess I'd better get started. I'll post the results for as far as I get late sometime Sunday. I can't promise they'll be complete at that point, but we'll see what happens. -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Fri Aug 22 21:04:45 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 08F52D1BA3E for ; Fri, 22 Aug 2003 21:04:42 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 06074-03 for ; Fri, 22 Aug 2003 21:04:40 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 03B04D1BA29 for ; Fri, 22 Aug 2003 21:04:31 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3540518; Fri, 22 Aug 2003 17:02:05 -0700 Content-Type: text/plain; charset="iso-8859-2" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Tomka Gergely , Robert Treat Subject: Re: Tests Date: Fri, 22 Aug 2003 17:00:17 -0700 User-Agent: KMail/1.4.3 Cc: Bill Moran , References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308221700.17201.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/319 X-Sequence-Number: 3135 Tomka, Since this didn't post last time: Another good test to do would be one that measures simultaenous steaming=20 read-write. For example: create table_a, with at least 10,000 records, where field1 is the PK and=20 field2 is a text field.=20=20=20 create table_b, with 500,000 or more records, where field2 is an FK to=20 table_a, and field_3 is a text field. do the following: UPDATE table_b SET field3 =3D field3 || 'something' WHERE EXISTS (select field1 FROM table_a where table_a.field1 =3D table_b.field2 AND table_a.field_2 =3D 'x') For the test to be most effective, the condition above should affect about= =20 100,000 records of table_a, and the records should not be contiguos on disk= .=20=20 Further, tablea.field2 should not be indexed in order to force a disk scan. Also another test I'd really like to see is hardware raid (Adaptec, LSI)=20 against Linux software raid, and 5-disk RAID 5 against 4-disk RAID 1+0. --=20 -Josh Berkus Aglio Database Solutions San Francisco From pgsql-performance-owner@postgresql.org Sat Aug 23 02:23: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 6F72BD1D124 for ; Sat, 23 Aug 2003 02:20:42 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 94333-04 for ; Sat, 23 Aug 2003 02:20:32 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id 55BE7D1CE5A for ; Sat, 23 Aug 2003 02:20:30 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7N5KEi09605 for ; Sat, 23 Aug 2003 07:20:14 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7N5KCV09598; Sat, 23 Aug 2003 07:20:13 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id 0C88E6FCCC; Sat, 23 Aug 2003 07:20:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id 013E27F6D2; Sat, 23 Aug 2003 07:20:01 +0200 (CEST) Date: Sat, 23 Aug 2003 07:20:01 +0200 (CEST) From: Tomka Gergely To: Josh Berkus Cc: Robert Treat , Bill Moran , Subject: Re: Tests In-Reply-To: <200308221517.33924.josh@agliodbs.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/320 X-Sequence-Number: 3136 2003-08-22 ragyog=F3 napj=E1n Josh Berkus ezt =FCzente: > Tomka, > > Did you get my test suggestion? It never hit the lists, so I wonder if = you > got it .... Yes, we got it, and we use your ideas. Thanks. --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-performance-owner@postgresql.org Sat Aug 23 04:55:03 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 DF333D1BA95 for ; Sat, 23 Aug 2003 04:55:00 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 26449-08 for ; Sat, 23 Aug 2003 04:54:52 -0300 (ADT) Received: from sc8-sf-list1.sourceforge.net (lists.sourceforge.net [66.35.250.206]) by svr1.postgresql.org (Postfix) with ESMTP id 34D8BD1BA5D for ; Sat, 23 Aug 2003 04:54:50 -0300 (ADT) Received: from mail by sc8-sf-list1.sourceforge.net with local (Exim 3.31-VA-mm2 #1 (Debian)) id 19qTEZ-0002Yx-00 for ; Sat, 23 Aug 2003 00:54:51 -0700 X-Failed-Recipients: cellog@sourceforge.net From: Mail Delivery System To: pgsql-performance@postgresql.org Subject: Mail delivery failed: returning message to sender Message-Id: Date: Sat, 23 Aug 2003 00:54:51 -0700 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/321 X-Sequence-Number: 3137 This message was created automatically by mail delivery software (Exim). A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: cellog@sourceforge.net unknown local-part "cellog" in domain "sourceforge.net" ------ This is a copy of the message, including all the headers. ------ Return-path: Received: from bsn-95-242-77.dsl.siol.net ([193.95.242.77] helo=MORDOR) by sc8-sf-list1.sourceforge.net with esmtp (Exim 3.31-VA-mm2 #1 (Debian)) id 19qTEY-0002W8-00 for ; Sat, 23 Aug 2003 00:54:50 -0700 From: To: Subject: Thank you! Date: Sat, 23 Aug 2003 9:54:48 +0200 X-MailScanner: Found to be clean Importance: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MSMail-Priority: Normal X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="_NextPart_000_001AFC43" Message-Id: This is a multipart message in MIME format --_NextPart_000_001AFC43 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Please see the attached file for details. --_NextPart_000_001AFC43-- From pgsql-general-owner@postgresql.org Sun Aug 24 01:27:47 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3732ED1BA87 for ; Sun, 24 Aug 2003 01:27:44 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 29176-09 for ; Sun, 24 Aug 2003 01:27:12 -0300 (ADT) Received: from mail.travelamericas.com (dsl231-059-037.sea1.dsl.speakeasy.net [216.231.59.37]) by svr1.postgresql.org (Postfix) with SMTP id 18541D1B9BA for ; Sun, 24 Aug 2003 01:27:11 -0300 (ADT) Received: (qmail 6059 invoked from network); 24 Aug 2003 04:27:41 -0000 Received: from unknown (HELO travelamericas.com) (127.0.0.1) by localhost with SMTP; 24 Aug 2003 04:27:41 -0000 Message-ID: <3F483EBD.3020108@travelamericas.com> Date: Sat, 23 Aug 2003 21:27:41 -0700 From: Chris Travers User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: PgSQL General ML Subject: Replication Ideas Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1282 X-Sequence-Number: 47698 Hi-- I had been thinking of the issues of multimaster replication and how to do highly available, loadballanced clustering with PostgreSQL. Here is my outline, and I am looking for comments on the limitations of how this would work. Several PostgreSQL servers would share a virtual IP address, and would coordinate among themselves which will act as "Master" for the purposes of a single transaction (but connection could be easier). SELECT statements are handled exclusively by the transaction master while anything that writes to a database would be sent to all the the "Masters." At the end of each transaction the systems would poll eachother regarding whether they were all successful: 1: Any system which is successful in COMMITting the transaction must ignore any system which fails the transaction untill a recovery can be made. 2: Any system which fails in COMMITting the transaction must cease to be a master, provided that it recieves a signat from any other member of the cluster that indicates that that member succeeded in committing the transaction. 3: If all nodes fail to commit, then they all remain masters. Recovery would be done in several steps: 1: The database would be copied to the failed system using pg_dump. 2: A current recovery would be done from the transaction log. 3: This would be repeated in order to ensure that the database is up to date. 4: When two successive restores have been achieved with no new additions to the database, the "All Recovered" signal is sent to the cluster and the node is ready to start processing again. (need a better way of doing this). Note: Recovery is the problem, I know. my model is only a starting point for the purposes of discussion and trying to bring something to the conversation. Any thoughts or suggestions? Best Wishes, Chris Travers From pgsql-general-owner@postgresql.org Sun Aug 24 03:13:28 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 38BC6D1B952 for ; Sun, 24 Aug 2003 03:13:20 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 59251-02 for ; Sun, 24 Aug 2003 03:13:09 -0300 (ADT) Received: from lakemtao02.cox.net (lakemtao02.cox.net [68.1.17.243]) by svr1.postgresql.org (Postfix) with ESMTP id BF44BD1B550 for ; Sun, 24 Aug 2003 03:13:07 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao02.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030824061305.MDXL11854.lakemtao02.cox.net@lhosts> for ; Sun, 24 Aug 2003 02:13:05 -0400 Subject: Re: Replication Ideas From: Ron Johnson To: PgSQL General ML In-Reply-To: <3F483EBD.3020108@travelamericas.com> References: <3F483EBD.3020108@travelamericas.com> Content-Type: text/plain Message-Id: <1061705587.3733.452.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sun, 24 Aug 2003 01:13:08 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1283 X-Sequence-Number: 47699 On Sat, 2003-08-23 at 23:27, Chris Travers wrote: > Hi-- > > I had been thinking of the issues of multimaster replication and how to > do highly available, loadballanced clustering with PostgreSQL. Here is > my outline, and I am looking for comments on the limitations of how this > would work. > > Several PostgreSQL servers would share a virtual IP address, and would > coordinate among themselves which will act as "Master" for the purposes > of a single transaction (but connection could be easier). SELECT > statements are handled exclusively by the transaction master while > anything that writes to a database would be sent to all the the > "Masters." At the end of each transaction the systems would poll > eachother regarding whether they were all successful: > > 1: Any system which is successful in COMMITting the transaction must > ignore any system which fails the transaction untill a recovery can be made. > > 2: Any system which fails in COMMITting the transaction must cease to > be a master, provided that it recieves a signat from any other member of > the cluster that indicates that that member succeeded in committing the > transaction. > > 3: If all nodes fail to commit, then they all remain masters. > > Recovery would be done in several steps: > > 1: The database would be copied to the failed system using pg_dump. > 2: A current recovery would be done from the transaction log. > 3: This would be repeated in order to ensure that the database is up to > date. > 4: When two successive restores have been achieved with no new > additions to the database, the "All Recovered" signal is sent to the > cluster and the node is ready to start processing again. (need a better > way of doing this). > > Note: Recovery is the problem, I know. my model is only a starting > point for the purposes of discussion and trying to bring something to > the conversation. This is vaguely similar to Two Phase Commit, which is a sine qua non of distributed transactions, which is the s.q.n. of multi-master replication. -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "Eternal vigilance is the price of liberty: power is ever stealing from the many to the few. The manna of popular liberty must be gathered each day, or it is rotten... The hand entrusted with power becomes, either from human depravity or esprit de corps, the necessary enemy of the people. Only by continual oversight can the democrat in office be prevented from hardening into a despot: only by unintermitted agitation can a people be kept sufficiently awake to principle not to let liberty be smothered in material prosperity... Never look, for an age when the people can be quiet and safe. At such times despotism, like a shrouding mist, steals over the mirror of Freedom" Wendell Phillips From pgsql-performance-owner@postgresql.org Mon Aug 25 12:04: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 EA2B6D1B8D2 for ; Mon, 25 Aug 2003 12:03:34 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 38234-10 for ; Mon, 25 Aug 2003 12:03:20 -0300 (ADT) Received: from host2.hostseguro.com (unknown [200.198.188.133]) by svr1.postgresql.org (Postfix) with ESMTP id 10858D1B8C8 for ; Mon, 25 Aug 2003 12:03:19 -0300 (ADT) Received: from cpanel by host2.hostseguro.com with local (Exim 4.20) id 19rIsC-0000gC-4D for pgsql-performance@postgresql.org; Mon, 25 Aug 2003 12:03:12 -0300 Received: from 200.203.33.227 ([200.203.33.227]) by sistemica.info (IMP) with HTTP for ; Mon, 25 Aug 2003 12:03:12 -0300 Message-ID: <1061823792.3f4a253015fdc@sistemica.info> Date: Mon, 25 Aug 2003 12:03:12 -0300 From: Rhaoni Chiu Pereira To: PostgreSQL Performance Subject: Query too slow MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-MOQ1061823792f0203aabba46ce180b1ce3f6ce60d45f" User-Agent: Internet Messaging Program (IMP) 3.2.1 X-Originating-IP: 200.203.33.227 X-MailScanner-Information: Verificado pelo McAfee VirusScan / Scanned by McAfee VirusScan X-MailScanner: Nao infectado / Found to be clean X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host2.hostseguro.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [32001 32001] / [47 12] X-AntiAbuse: Sender Address Domain - sistemica.info X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/322 X-Sequence-Number: 3138 This message is in MIME format. ---MOQ1061823792f0203aabba46ce180b1ce3f6ce60d45f Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Hi List, I have posted a subjetc on the admin list but I thought that it might fit better on this list as follow: Hi List, As I said before, I'm not a DBA " yet" , but I'm learning ... and I already have a PostgreSQL running, so I have to ask some help... I got a SQL as folows : SELECT /*+ */ ftnfco00.estado_cliente , ftcofi00.grupo_faturamento , SUM( DECODE( ftcofi00.atual_fatura, '-', -(NVL (ftnfpr00.qtde_duzias,0)), '+', NVL(ftnfpr00.qtde_duzias,0), 0) ) , SUM( DECODE( ftcofi00.atual_fatura, '-', -(NVL(ftnfpr00.vlr_liquido,0)), '+', NVL(ftnfpr00.vlr_liquido,0), 0) ) , ftprod00.tipo_cadastro||ftprod00.codigo_produto||'||'||gsames00.ano_mes , ftprod00.descricao_produto||'||'||gsames00.descricao , DIVIDE( SUM( DECODE( ftcofi00.atual_fatura, '-', -(NVL (ftnfpr00.vlr_liquido,0)), '+', NVL(ftnfpr00.vlr_liquido,0), 0) *ftnfpr00.margem_comercial ), SUM( DECODE( ftcofi00.atual_fatura, '-', -(NVL (ftnfpr00.vlr_liquido,0)), '+', NVL(ftnfpr00.vlr_liquido,0), 0)) ) , SUM( DECODE( ftcofi00.nf_prodgratis, 'S', NVL(ftnfpr00.qtde_duzias,0), 0 ) ) , SUM( DECODE( ftcofi00.nf_prodgratis, 'S', NVL(ftnfpr00.vlr_liquido,0), 0 ) ) FROM ftprod00 , ftnfco00 , ftcgma00 , ftcgca00 , ftspro00 , ftclcr00 , gsames00 , ftcofi00 , ftrepr00 , gsesta00 , ftsupv00 , ftgrep00 , ftclgr00 , ftband00 , fttcli00 , ftredc00 , ftnfpr00 WHERE ftnfco00.emp = 909 AND ftnfpr00.fil IN ('101') AND ftnfco00.situacao_nf = 'N' AND TO_CHAR(ftnfco00.data_emissao,'YYYYMM') >= '200208' AND TO_CHAR(ftnfco00.data_emissao,'YYYYMM') <= '200304' AND ftcofi00.grupo_faturamento >= '01' AND (ftcofi00.atual_fatura IN ('+','-') OR ftcofi00.nf_prodgratis = 'S') AND ftcgma00.emp = ftprod00.emp AND ftcgma00.fil = ftprod00.fil AND ftcgma00.codigo = ftprod00.cla_marca AND ftcgca00.emp = ftprod00.emp AND ftcgca00.fil = ftprod00.fil AND ftcgca00.codigo = ftprod00.cla_categoria AND ftspro00.emp = ftprod00.emp AND ftspro00.fil = ftprod00.fil AND ftspro00.codigo = ftprod00.situacao AND ftclcr00.emp = ftnfco00.emp AND ftclcr00.fil = ftnfco00.empfil AND ftclcr00.tipo_cadastro = ftnfco00.tipo_cad_clicre AND ftclcr00.codigo = ftnfco00.cod_cliente AND gsames00.ano_mes = TO_CHAR(ftnfco00.data_emissao,'YYYYMM') AND ftcofi00.emp = ftnfco00.emp AND ftcofi00.fil = ftnfco00.empfil AND ftcofi00.codigo_fiscal = ftnfco00.cod_fiscal AND ftrepr00.emp = ftnfco00.emp AND ftrepr00.fil = ftnfco00.empfil AND ftrepr00.codigo_repr = ftnfco00.cod_repres AND gsesta00.estado_sigla = ftnfco00.estado_cliente AND ftsupv00.emp = ftrepr00.emp AND ftsupv00.fil = ftrepr00.fil AND ftsupv00.codigo_supervisor = ftrepr00.codigo_supervisor AND ftgrep00.emp = ftrepr00.emp AND ftgrep00.fil = ftrepr00.fil AND ftgrep00.codigo_grupo_rep = ftrepr00.codigo_grupo_rep AND ftclgr00.emp = ftclcr00.emp AND ftclgr00.fil = ftclcr00.fil AND ftclgr00.codigo = ftclcr00.codigo_grupo_cliente AND ftband00.emp = ftclcr00.emp AND ftband00.fil = ftclcr00.fil AND ftband00.codigo = ftclcr00.bandeira_cliente AND fttcli00.emp = ftclcr00.emp AND fttcli00.fil = ftclcr00.fil AND fttcli00.cod_tipocliente = ftclcr00.codigo_tipo_cliente AND ftredc00.emp = ftclcr00.emp AND ftredc00.fil = ftclcr00.fil AND ftredc00.tipo_contribuinte = ftclcr00.tipo_contribuinte AND ftredc00.codigo_rede = ftclcr00.codigo_rede AND gsesta00.estado_sigla = ftclcr00.emp_estado AND ftnfco00.emp = ftnfpr00.emp AND ftnfco00.fil = ftnfpr00.fil AND ftnfco00.nota_fiscal = ftnfpr00.nota_fiscal AND ftnfco00.serie = ftnfpr00.serie AND ftnfco00.data_emissao = ftnfpr00.data_emissao AND ftprod00.emp = ftnfpr00.emp AND ftprod00.fil = ftnfpr00.empfil AND ftprod00.tipo_cadastro = ftnfpr00.tipo_cad_promat AND ftprod00.codigo_produto= ftnfpr00.cod_produto GROUP BY ftnfco00.estado_cliente , ftcofi00.grupo_faturamento , ftprod00.tipo_cadastro||ftprod00.codigo_produto||'||'||gsames00.ano_mes , ftprod00.descricao_produto||'||'||gsames00.descricao I have created the decode, NVL and DIVIDE functions.... the problem is that the where condition makes this query to slow ( about 4 min ) and the same query in my Oracle database takes less than 40 seconds. I have tried to isolate the problem taking off some fields and I left justa the two first fields in the query ( ftnfco00.estado_cliente , ftcofi00.grupo_faturamento ) and it still taking almost 4 min to return. Does anyone have a hint to give me to make it faster ? Atached goes a explain analyze return os this query. Atenciosamente, Rhaoni Chiu Pereira Sist�mica Computadores Visite-nos na Web: http://sistemica.info Fone/Fax : +55 51 3328 1122 ---MOQ1061823792f0203aabba46ce180b1ce3f6ce60d45f Content-Type: text/plain; name="explain.sql" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="explain.sql" CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFFVRVJZIFBMQU4KCi0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0KIEFnZ3JlZ2F0ZSAgKGNvc3Q9Nzk3MS42 NS4uNzk3MS42OCByb3dzPTEgd2lkdGg9ODMzKSAoYWN0dWFsIHRpbWU9MTUw MTUyOS4xNi4uMTUwODA2Ni4zMiByb3dzPTE3NTUgbG9vcHM9MSkKICAgLT4g IEdyb3VwICAoY29zdD03OTcxLjY1Li43OTcxLjY2IHJvd3M9MSB3aWR0aD04 MzMpIChhY3R1YWwgdGltZT0xNTAxNDk1LjA3Li4xNTAyNTE3Ljk5IHJvd3M9 MjQxMTEgbG9vcHM9MSkKICAgICAgICAgLT4gIFNvcnQgIChjb3N0PTc5NzEu NjUuLjc5NzEuNjUgcm93cz0xIHdpZHRoPTgzMykgKGFjdHVhbCB0aW1lPTE1 MDE0OTUuMDMuLjE1MDE1NjMuODcgcm93cz0yNDExMSBsb29wcz0xKQogICAg ICAgICAgICAgICBTb3J0IEtleTogZnRuZmNvMDAuZXN0YWRvX2NsaWVudGUs IGZ0Y29maTAwLmdydXBvX2ZhdHVyYW1lbnRvLCAoKCgoZnRwcm9kMDAudGlw b19jYWRhc3Rybyk6OnRleHQgfHwgKGZ0cHJvZDAwLmNvZGlnb19wcm9kdXRv KTo6dGV4dCkgfHwgJ3x8Jzo6dGV4dCkgfHwgKGdzYW1lczAwLmFub19tZXMp Ojp0ZXh0KSwgKChmdHByb2QwMC5kZXNjcmljYW9fcHJvZHV0byB8fCAnfHwn OjpjaGFyYWN0ZXIgdmFyeWluZykgfHwgZ3NhbWVzMDAuZGVzY3JpY2FvKQog ICAgICAgICAgICAgICAtPiAgTmVzdGVkIExvb3AgIChjb3N0PTc5MTMuMzEu Ljc5NzEuNjQgcm93cz0xIHdpZHRoPTgzMykgKGFjdHVhbCB0aW1lPTEzODIy ODEuMjQuLjE0OTU3NDguNzkgcm93cz0yNDExMWxvb3BzPTEpCiAgICAgICAg ICAgICAgICAgICAgIEpvaW4gRmlsdGVyOiAoImlubmVyIi5lc3RhZG9fc2ln bGEgPSAib3V0ZXIiLmVzdGFkb19jbGllbnRlKQogICAgICAgICAgICAgICAg ICAgICAtPiAgTmVzdGVkIExvb3AgIChjb3N0PTc5MTMuMzEuLjc5NjkuOTAg cm93cz0xIHdpZHRoPTgyNykgKGFjdHVhbCB0aW1lPTEzODIyNzEuNDEuLjE0 OTA3MDIuMTEgcm93cz0yNDExMSBsb29wcz0xKQogICAgICAgICAgICAgICAg ICAgICAgICAgICBKb2luIEZpbHRlcjogKCgib3V0ZXIiLmVtcCA9ICJpbm5l ciIuZW1wKSBBTkQgKCJpbm5lciIuZmlsID0gIm91dGVyIi5lbXBmaWwpIEFO RCAoImlubmVyIi5jb2RpZ28gPSAib3V0ZXIiLmJhbmRlaXJhX2NsaWVudGUp KQogICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAgTmVzdGVkIExvb3Ag IChjb3N0PTc5MTMuMzEuLjc5NjguODcgcm93cz0xIHdpZHRoPTc5NSkgKGFj dHVhbCB0aW1lPTEzODIxNzkuODAuLjE0ODY0OTIuNjkgcm93cz0yNDExMSBs b29wcz0xKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKb2lu IEZpbHRlcjogKCgiaW5uZXIiLmVtcCA9ICJvdXRlciIuZW1wKSBBTkQgKCJv dXRlciIuY29kaWdvID0gImlubmVyIi5jbGFfY2F0ZWdvcmlhKUFORCAoIm91 dGVyIi5jb2RpZ28gPSAiaW5uZXIiLmNsYV9tYXJjYSkgQU5EICgib3V0ZXIi LmNvZGlnbyA9ICJpbm5lciIuc2l0dWFjYW8pKQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAtPiAgTmVzdGVkIExvb3AgIChjb3N0PTc5MTMu MzEuLjc5NTQuMzQgcm93cz0zIHdpZHRoPTcwNSkgKGFjdHVhbCB0aW1lPTEz ODE2MzIuNTcuLjE0NjQ2NTEuMzIgcm93cz0yNDExMTAgbG9vcHM9MSkKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSm9pbiBGaWx0 ZXI6ICgoIm91dGVyIi5lbXAgPSAiaW5uZXIiLmVtcCkgQU5EICgiaW5uZXIi LmZpbCA9ICJvdXRlciIuZW1wZmlsKSkgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAtPiAgTmVzdGVkIExvb3AgIChjb3N0PTc5MTMu MzEuLjc5NDEuODQgcm93cz0yIHdpZHRoPTY2NSkgKGFjdHVhbCB0aW1lPTEz ODE0NDQuODcuLjE0MDg1MzEuMjkgcm93cz0yNDExMTAgbG9vcHM9MSkKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSm9p biBGaWx0ZXI6ICgoImlubmVyIi5lbXAgPSAib3V0ZXIiLmVtcCkgQU5EICgi b3V0ZXIiLmZpbCA9ICJpbm5lciIuZW1wZmlsKSBBTkQoIm91dGVyIi5jb2Rp Z29fZ3J1cG9fcmVwID0gImlubmVyIi5jb2RpZ29fZ3J1cG9fcmVwKSkKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLT4g IFNlcSBTY2FuIG9uIGZ0Z3JlcDAwICAoY29zdD0wLjAwLi4xLjAxIHJvd3M9 MSB3aWR0aD0zMikgKGFjdHVhbCB0aW1lPTI4Ljk3Li4yOC45NyByb3dzPTEg bG9vcHM9MSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgLT4gIE1hdGVyaWFsaXplICAoY29zdD03OTQwLjc5Li43OTQw Ljc5IHJvd3M9MiB3aWR0aD02MzMpIChhY3R1YWwgdGltZT0xMzgxNDE1LjUx Li4xMzg1NDQ1LjM5IHJvd3M9MjQxMTEwIGxvb3BzPTEpCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0+ICBO ZXN0ZWQgTG9vcCAgKGNvc3Q9NzkxMy4zMS4uNzk0MC43OSByb3dzPTIgd2lk dGg9NjMzKSAoYWN0dWFsIHRpbWU9MTM0ODQwMC45Ni4uMTM3OTA5MC45MyBy b3dzPTI0MTExMCBsb29wcz0xKQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKb2luIEZpbHRlcjog KCgiaW5uZXIiLmVtcCA9ICJvdXRlciIuZW1wKSBBTkQgKCJvdXRlciIuZmls ID0gImlubmVyIi5lbXBmaWwpIEFORCAoIm91dGVyIi5jb2RpZ29fc3VwZXJ2 aXNvciA9ICJpbm5lciIuY29kaWdvX3N1cGVydmlzb3IpKQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAtPiAgU2VxIFNjYW4gb24gZnRzdXB2MDAgIChjb3N0PTAuMDAuLjEuMDEg cm93cz0xIHdpZHRoPTMyKSAoYWN0dWFsIHRpbWU9MTMuOTIuLjEzLjk0IHJv d3M9MSBsb29wcz0xKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAgTWF0ZXJpYWxpemUgIChj b3N0PTc5MzkuNzUuLjc5MzkuNzUgcm93cz0yIHdpZHRoPTYwMSkgKGFjdHVh bCB0aW1lPTEzNDgzODYuODguLjEzNTc4NTMuNzcgcm93cz0yNDExMTAgbG9v cHM9MSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLT4gIE5lc3RlZCBMb29wICAoY29z dD03OTEzLjMxLi43OTM5Ljc1IHJvd3M9MiB3aWR0aD02MDEpIChhY3R1YWwg dGltZT0yMzg1NDguODQuLjEzNDQzMzkuMzMgcm93cz0yNDExMTAgbG9vcHM9 MSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgSm9pbiBGaWx0ZXI6ICgoImlu bmVyIi5hbm9fbWVzKTo6dGV4dCA9IHRvX2NoYXIoIm91dGVyIi5kYXRhX2Vt aXNzYW8sICdZWVlZTU0nOjp0ZXh0KSkKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLT4gIE1lcmdlIEpvaW4gIChjb3N0PTc5MTMuMzEuLjc5MTMuNDUgcm93 cz0yIHdpZHRoPTU3NikoYWN0dWFsIHRpbWU9MjM4NTI0LjMxLi4yNzU3MjQu NDQgcm93cz0yNDExMTAgbG9vcHM9MSkKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgTWVyZ2UgQ29uZDogKCgib3V0ZXIiLmVtcGZpbCA9ICJpbm5l ciIuZmlsKSBBTkQgKCJvdXRlciIuY29kaWdvX3RpcG9fY2xpZW50ZSA9ICJp bm5lciIuY29kX3RpcG9jbGllbnRlKSBBTkQgKCJvdXRlciIuZW1wID0gImlu bmVyIi5lbXApKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAg U29ydCAgKGNvc3Q9NzkxMS43OS4uNzkxMS44MCByb3dzPTIgd2lkdGg9NTQz KShhY3R1YWwgdGltZT0yMzg1MjMuNDguLjI1NDI4NC4xMyByb3dzPTI0MTEx MCBsb29wcz0xKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBTb3J0IEtleTogZnRjbGNyMDAuZmlsLCBmdGNsY3IwMC5jb2RpZ29fdGlw b19jbGllbnRlLCBmdG5mcHIwMC5lbXAKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgLT4gIE5lc3RlZCBMb29wICAoY29zdD03ODUxLjI5 Li43OTExLjc4IHJvd3M9MiB3aWR0aD01NDMpIChhY3R1YWwgdGltZT04MDAw NS41NS4uMTQ0NzU1Ljg0IHJvd3M9MjQxMTEwIGxvb3BzPTEpCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEpvaW4gRmlsdGVy OiAoKCJpbm5lciIuZW1wX2VzdGFkbyA9ICJvdXRlciIuZXN0YWRvX2NsaWVu dGUpIEFORCAoIm91dGVyIi5jb2RpZ28gPSAiaW5uZXIiLmNvZGlnb19ncnVw b19jbGllbnRlKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgLT4gIE5lc3RlZCBMb29wICAoY29zdD03ODUxLjI5Li43ODUz LjIyIHJvd3M9MTAgd2lkdGg9NDQ5KSAoYWN0dWFsIHRpbWU9Nzk5NjAuNDgu Ljk0MjA2LjE3IHJvd3M9MjQxMTEwIGxvb3BzPTEpCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEpvaW4gRmlsdGVy OiAoKCJpbm5lciIuZW1wID0gIm91dGVyIi5lbXApIEFORCAoIm91dGVyIi5m aWwgPSAiaW5uZXIiLmVtcGZpbCkpCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC0+ICBTZXEgU2NhbiBvbiBmdGNs Z3IwMCAgKGNvc3Q9MC4wMC4uMS4wMSByb3dzPTEgd2lkdGg9MzIpIChhY3R1 YWwgdGltZT0xMi4yMS4uMTIuMjEgcm93cz0xIGxvb3BzPTEpICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0+ICBN YXRlcmlhbGl6ZSAgKGNvc3Q9Nzg1Mi4wNi4uNzg1Mi4wNiByb3dzPTEwIHdp ZHRoPTQxNykgKGFjdHVhbCB0aW1lPTc5OTQ4LjE2Li44MjA1MS4wMSByb3dz PTI0MTExMCBsb29wcz0xKQogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAKLT4gIE1lcmdlIEpvaW4gIChj b3N0PTc4NTEuMjkuLjc4NTIuMDYgcm93cz0xMCB3aWR0aD00MTcpIChhY3R1 YWwgdGltZT02NTUzNi4yMi4uNzg1MTUuMzAgcm93cz0yNDExMTAgbG9vcHM9 MSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIApNZXJnZSBDb25kOiAoKCJvdXRlciIuZW1wZmls ID0gImlubmVyIi5maWwpIEFORCAoIm91dGVyIi5jb2RfcmVwcmVzID0gImlu bmVyIi5jb2RpZ29fcmVwcikgQU5EICgib3V0ZXIiLmVtcCA9ICJpbm5lciIu ZW1wKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgCi0+ICBTb3J0ICAoY29zdD03ODQwLjUx Li43ODQwLjU0IHJvd3M9MTAgd2lkdGg9MzY0KSAoYWN0dWFsIHRpbWU9NjQy MDMuMzMuLjY1NTIyLjgwIHJvd3M9MjQxMTEwIGxvb3BzPTEpCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIApTb3J0IEtleTogZnRuZmNvMDAuZW1wZmlsLCBmdG5m Y28wMC5jb2RfcmVwcmVzLCBmdG5mcHIwMC5lbXAKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgCi0+ICBOZXN0ZWQgTG9vcAogIChjb3N0PTc1NjkuNTEuLjc4NDAu MzUgcm93cz0xMCB3aWR0aD0zNjQpIChhY3R1YWwgdGltZT0yMDk0LjM4Li4z MTQ2OS41MSByb3dzPTI0MTExMCBsb29wcz0xKQogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAKSm9pbiBGaWx0ZXI6ICgoIm91dGVyIi5lbXAgPSAiaW5u ZXIiLmVtcCkgQU5EICgib3V0ZXIiLmVtcGZpbCA9ICJpbm5lciIuZmlsKSkK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0+ICBOZXN0ZWQgTG9vcCAg KGNvc3Q9NzU2OS41MS4uNzgzOS4xMCByb3dzPTEgd2lkdGg9MzM3KSAoYWN0 dWFsIHRpbWU9MjA5NC4wMC4uMjE1NjguMDggcm93cz0yNDExMSBsb29wcz0x KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIApKb2luIEZpbHRlcjogKCgi b3V0ZXIiLmVtcCA9ICJpbm5lciIuZW1wKSBBTkQgKCJvdXRlciIuZW1wZmls ID0gImlubmVyIi5maWwpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIAotPiBOZXN0ZWQgTG9vcCAgKGNvc3Q9NzU2OS41MS4uNzgzOC4wNyBy b3dzPTEgd2lkdGg9MzA1KSAoYWN0dWFsIHRpbWU9MjA4Ni41OS4uMjA0NTYu MjQgcm93cz0yNDExMSBsb29wcz0xKQogICBKb2luIEZpbHRlcjogKCgib3V0 ZXIiLmVtcCA9ICJpbm5lciIuZW1wKSBBTkQgKCJvdXRlciIuZW1wZmlsID0g ImlubmVyIi5maWwpKQogICAtPiAgTmVzdGVkIExvb3AgIChjb3N0PTc1Njku NTEuLjc4MzcuMDUgcm93cz0xIHdpZHRoPTI3MykgKGFjdHVhbCB0aW1lPTIw NzguMjEuLjE5MzY4LjQyIHJvd3M9MjQxMTEgbG9vcHM9MSkKICAgICAgICAg LT4gIE1lcmdlIEpvaW4gIChjb3N0PTc1NjkuNTEuLjc1NzIuMDcgcm93cz00 NCB3aWR0aD0xNjEpIChhY3R1YWwgdGltZT0xOTkxLjAwLi4yMjYyLjU0IHJv d3M9NzcxOCBsb29wcz0xKQogICAgICAgICAgICAgICBNZXJnZSBDb25kOiAo KCJvdXRlciIuY29kX2Zpc2NhbCA9ICJpbm5lciIuY29kaWdvX2Zpc2NhbCkg QU5EICgib3V0ZXIiLmVtcGZpbCA9ICJpbm5lciIuZmlsKSBBTkQgKCJvdXRl ciIuZW1wID0gImlubmVyIi5lbXApKQogICAgICAgICAgICAgICAtPiAgU29y dCAgKGNvc3Q9NzUyMC43MS4uNzUyMS40NSByb3dzPTI5NSB3aWR0aD0xMDkp IChhY3R1YWwgdGltZT0xOTU4LjQwLi4xOTk0LjM4IHJvd3M9OTMzOSBsb29w cz0xKQogICAgICAgICAgICAgICAgICAgICBTb3J0IEtleTogZnRuZmNvMDAu Y29kX2Zpc2NhbCwgZnRuZmNvMDAuZW1wZmlsLCBmdG5mY28wMC5lbXAKICAg ICAgICAgICAgICAgICAgICAgLT4gIFNlcSBTY2FuIG9uIGZ0bmZjbzAwICAo Y29zdD0wLjAwLi43NTA4LjYwIHJvd3M9Mjk1IHdpZHRoPTEwOSkgKGFjdHVh bCB0aW1lPTE0LjUwLi4xNTgxLjgxIHJvd3M9OTMzOSBsb29wcz0xKQogICAg ICAgICAgICAgICAgICAgICAgICAgICBGaWx0ZXI6ICgoZW1wID0gOTA5Ojpu dW1lcmljKSBBTkQgKHNpdHVhY2FvX25mID0gJ04nOjpjaGFyYWN0ZXIgdmFy eWluZykgQU5EICh0b19jaGFyKGRhdGFfZW1pc3NhbywgJ1lZWVlNTSc6OnRl eHQpID49ICcyMDAyMDknOjp0ZXh0KSBBTkQgKHRvX2NoYXIoZGF0YV9lbWlz c2FvLCAnWVlZWU1NJzo6dGV4dCkgPD0gJzIwMDMwNCc6OnRleHQpKQogICAg ICAgICAgICAgICAtPiAgU29ydCAgKGNvc3Q9NDguODAuLjQ4Ljk4IHJvd3M9 NzIgd2lkdGg9NTIpIChhY3R1YWwgdGltZT0zMS44Ni4uNDMuNjkgcm93cz03 NzY1IGxvb3BzPTEpCiAgICAgICAgICAgICAgICAgICAgIFNvcnQgS2V5OiBm dGNvZmkwMC5jb2RpZ29fZmlzY2FsLCBmdGNvZmkwMC5maWwsIGZ0Y29maTAw LmVtcAogICAgICAgICAgICAgICAgICAgICAtPiAgU2VxIFNjYW4gb24gZnRj b2ZpMDAgIChjb3N0PTAuMDAuLjQ2LjU4IHJvd3M9NzIgd2lkdGg9NTIpIChh Y3R1YWwgdGltZT03LjYyLi4zMS4wNyByb3dzPTc1IGxvb3BzPTEpCiAgICAg ICAgICAgICAgICAgICAgICAgICAgIEZpbHRlcjogKChncnVwb19mYXR1cmFt ZW50byA+PSAnMDEnOjpjaGFyYWN0ZXIgdmFyeWluZykgQU5EICgoYXR1YWxf ZmF0dXJhID0gJysnOjpjaGFyYWN0ZXIgdmFyeWluZykgT1IgKGF0dWFsX2Zh dHVyYSA9ICctJzo6Y2hhcmFjdGVyIHZhcnlpbmcpIE9SIChuZl9wcm9kZ3Jh dGlzID0gJ1MnOjpjaGFyYWN0ZXIgdmFyeWluZykpKQogICAgICAgICAtPiAg SW5kZXggU2NhbiB1c2luZyBmdG5mcHIwMF9wa2V5IG9uIGZ0bmZwcjAwICAo Y29zdD0wLjAwLi41Ljk1IHJvd3M9MSB3aWR0aD0xMTIpIChhY3R1YWwgdGlt ZT0xLjQxLi4yLjE0IHJvd3M9MyBsb29wcz03NzE4KQogICAgICAgICAgICAg ICBJbmRleCBDb25kOiAoKCJvdXRlciIuZW1wID0gZnRuZnByMDAuZW1wKSBB TkQgKCJvdXRlciIuZmlsID0gZnRuZnByMDAuZmlsKSBBTkQgKGZ0bmZwcjAw LmZpbCA9IDEwMTo6bnVtZXJpYykgQU5EICgib3V0ZXIiLm5vdGFfZmlzY2Fs ID0gZnRuZnByMDAubm90YV9maXNjYWwpIEFORCAoIm91dGVyIi5zZXJpZSA9 IGZ0bmZwcjAwLnNlcmllKSBBTkQgKCJvdXRlciIuZGF0YV9lbWlzc2FvID0g ZnRuZnByMDAuZGF0YV9lbWlzc2FvKSkKICAgLT4gIFNlcSBTY2FuIG9uIGZ0 Y2djYTAwICAoY29zdD0wLjAwLi4xLjAxIHJvd3M9MSB3aWR0aD0zMikgKGFj dHVhbCB0aW1lPTAuMDEuLjAuMDEgcm93cz0xIGxvb3BzPTI0MTExKSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotPiBTZXEgU2NhbiBvbiBm dGNnbWEwMCAgKGNvc3Q9MC4wMC4uMS4wMSByb3dzPTEgd2lkdGg9MzIpIChh Y3R1YWwgdGltZT0wLjAxLi4wLjAxIHJvd3M9MSBsb29wcz0yNDExMSkgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAKLT4gIFNlcSBTY2FuIG9uIGZ0c3By bzAwICAoY29zdD0wLjAwLi4xLjEwIHJvd3M9MTAgd2lkdGg9MjcpIChhY3R1 YWwgdGltZT0wLjAwLi4wLjA0IHJvd3M9MTAgbG9vcHM9MjQxMTEpICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgCi0+ICBTb3J0ICAoY29zdD0xMC43OC4uMTEuMDUgcm93cz0x MDkgd2lkdGg9NTMpIChhY3R1YWwgdGltZT0xMzMyLjU0Li4xNTEwLjY5IHJv d3M9MjQxMTc1IGxvb3BzPTEpICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgClNvcnQg S2V5OiBmdHJlcHIwMC5maWwsIGZ0cmVwcjAwLmNvZGlnb19yZXByLCBmdHJl cHIwMC5lbXAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLT4gIFNlcSBTY2FuIG9u IGZ0cmVwcjAwICAoY29zdD0wLjAwLi43LjA5IHJvd3M9MTA5IHdpZHRoPTUz KSAoYWN0dWFsIHRpbWU9NDA2LjYzLi4xMzMxLjMzIHJvd3M9MTA5IGxvb3Bz PTEpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Ci0+ICBJbmRleCBTY2FuIHVzaW5nIGZ0Y2xjcjAxIG9uIGZ0Y2xjcjAwICAo Y29zdD0wLjAwLi41LjgzIHJvd3M9MSB3aWR0aD05NCkgKGFjdHVhbCB0aW1l PTAuMTMuLjAuMTQgcm93cz0xIGxvb3BzPTI0MTExMCkgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKSW5kZXggQ29u ZDogKChmdGNsY3IwMC5lbXAgPSAib3V0ZXIiLmVtcCkgQU5EIChmdGNsY3Iw MC5maWwgPSAib3V0ZXIiLmVtcGZpbCkgQU5EIChmdGNsY3IwMC50aXBvX2Nh ZGFzdHJvID0gIm91dGVyIi50aXBvX2NhZF9jbGljcmUpIEFORCAoZnRjbGNy MDAuY29kaWdvID0gIm91CnRlciIuY29kX2NsaWVudGUpKQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAtPiAgU29ydCAgKGNvc3Q9MS41Mi4uMS41 NiByb3dzPTE3IHdpZHRoPTMzKSAoYWN0dWFsIHRpbWU9MC42MS4uMjI1LjQz IHJvd3M9MjQwOTg2IGxvb3BzPTEpICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgClNvcnQgS2V5OiBmdHRjbGkwMC5maWwsIGZ0dGNsaTAw LmNvZF90aXBvY2xpZW50ZSwgZnR0Y2xpMDAuZW1wICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgCi0+ICBTZXEgU2NhbiBvbiBmdHRjbGkw MCAgKGNvc3Q9MC4wMC4uMS4xNyByb3dzPTE3IHdpZHRoPTMzKSAoYWN0dWFs IHRpbWU9MC4xMi4uMC4xNyByb3dzPTE3IGxvb3BzPTEpCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIC0+ICBTZXEgU2NhbiBvbiBnc2FtZXMwMCAgKGNvc3Q9 MC4wMC4uNi43MiByb3dzPTM3MiB3aWR0aD0yNSkgKGFjdHVhbCB0aW1lPTAu MDAuLjEuMjggcm93cz0zNzIgbG9vcHM9MjQxMTEwKQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAgSW5kZXggU2NhbiB1c2lu ZyBmdHJlZGMwMF9wa2V5IG9uIGZ0cmVkYzAwICAoY29zdD0wLjAwLi41Ljgz IHJvd3M9MSB3aWR0aD00MCkgKGFjdHVhbCB0aW1lPTAuMTIuLjAuMTIgcm93 cz0xIGxvb3BzPTI0MTExMCkKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgSW5kZXggQ29uZDogKChmdHJlZGMwMC5lbXAg PSAib3V0ZXIiLmVtcCkgQU5EIChmdHJlZGMwMC5maWwgPSAib3V0ZXIiLmZp bCkgQU5EIChmCnRyZWRjMDAudGlwb19jb250cmlidWludGUgPSAib3V0ZXIi LnRpcG9fY29udHJpYnVpbnRlKSBBTkQgKGZ0cmVkYzAwLmNvZGlnb19yZWRl ID0gIm91dGVyIi5jb2RpZ29fcmVkZSkpCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIC0+ICBJbmRleCBTY2FuIHVzaW5nIGZ0cHJvZDAwX3Br ZXkgb24gZnRwcm9kMDAgIChjb3N0PTAuMDAuLjUuNzQgcm93cz0xIHdpZHRo PTkwKSAoYWN0dWFsIHRpbWU9MC4wNi4uMC4wNiByb3dzPTEgbG9vcHM9MjQx MTEwKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJ bmRleCBDb25kOiAoKGZ0cHJvZDAwLmVtcCA9ICJvdXRlciIuZW1wKSBBTkQg KGZ0cHJvZDAwLmZpbCA9ICJvdXRlciIuZW1wZmlsKSBBTkQgKGZ0cHJvZDAw LnRpcG9fY2FkYXN0cm8gPSAib3V0ZXIiLnRpcG9fY2FkX3Byb21hdCkgQU5E IChmdHByb2QwMC5jb2RpZ29fcHJvZHV0byA9ICJvdXRlciIuY29kX3Byb2R1 dG8pKQogICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAgU2VxIFNjYW4g b24gZnRiYW5kMDAgIChjb3N0PTAuMDAuLjEuMDEgcm93cz0xIHdpZHRoPTMy KSAoYWN0dWFsIHRpbWU9MC4wMS4uMC4wMSByb3dzPTEgbG9vcHM9MjQxMTEp CiAgICAgICAgICAgICAgICAgICAgIC0+ICBTZXEgU2NhbiBvbiBnc2VzdGEw MCAgKGNvc3Q9MC4wMC4uMS4zMyByb3dzPTMzIHdpZHRoPTYpIChhY3R1YWwg dGltZT0wLjAxLi4wLjA4IHJvd3M9MzMgbG9vcHM9MjQxMTEpIFRvdGFsIHJ1 bnRpbWU6IDE1MDgyNTkuOTEgbXNlYwooNzQgcm93cykK ---MOQ1061823792f0203aabba46ce180b1ce3f6ce60d45f-- From pgsql-performance-owner@postgresql.org Mon Aug 25 12:19:50 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 4BE79D1B8AA for ; Mon, 25 Aug 2003 12:18:25 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 45528-06 for ; Mon, 25 Aug 2003 12:17:53 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 20022D1B8E3 for ; Mon, 25 Aug 2003 12:17:49 -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 h7PFFmvg025890; Mon, 25 Aug 2003 09:15:48 -0600 (MDT) Date: Mon, 25 Aug 2003 09:15:07 -0600 (MDT) From: "scott.marlowe" To: Josh Berkus Cc: Tomka Gergely , Robert Treat , Bill Moran , Subject: Re: Tests In-Reply-To: <200308221700.17201.josh@agliodbs.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner-ihs-com: Found to be clean X-MailScanner-SpamCheck-ihs-com: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/323 X-Sequence-Number: 3139 On Fri, 22 Aug 2003, Josh Berkus wrote: > Also another test I'd really like to see is hardware raid (Adaptec, LSI) > against Linux software raid, and 5-disk RAID 5 against 4-disk RAID 1+0. It would be nice to cross those, so you have RAID5 sw vs RAID5 hw, vs RAID1+0 sw vs RAID1+0 hw. Now if only I had the hardware. Time to scrounge. From pgsql-performance-owner@postgresql.org Mon Aug 25 12:24:12 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 25A5DD1B8CD for ; Mon, 25 Aug 2003 12:23:41 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 49719-04 for ; Mon, 25 Aug 2003 12:23:10 -0300 (ADT) Received: from mta5.adelphia.net (mta5.adelphia.net [68.168.78.187]) by svr1.postgresql.org (Postfix) with ESMTP id D31CED1B8BD for ; Mon, 25 Aug 2003 12:23:09 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta5.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030825152310.OHAX7719.mta5.adelphia.net@potentialtech.com> for ; Mon, 25 Aug 2003 11:23:10 -0400 Message-ID: <3F4A29DC.8010501@potentialtech.com> Date: Mon, 25 Aug 2003 11:23:08 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Tests 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: 200308/324 X-Sequence-Number: 3140 scott.marlowe wrote: > On Fri, 22 Aug 2003, Josh Berkus wrote: > >>Also another test I'd really like to see is hardware raid (Adaptec, LSI) >>against Linux software raid, and 5-disk RAID 5 against 4-disk RAID 1+0. > > It would be nice to cross those, so you have RAID5 sw vs RAID5 hw, vs > RAID1+0 sw vs RAID1+0 hw. > > Now if only I had the hardware. Time to scrounge. I just wanted to comment, that I don't know where you guys find the time and money to do all this. I pretty much blew my entire weekend running tests, and I'm still not done enough to post any results. The upshot being, thanks to everyone who donates time, money, spare parts or whatever. Sometimes I forget how valuable all that is. And I don't think it gets said often enough how much people like me appreciate all the hard work the developers and testers and everyone else involved does. I mean, PostgreSQL (like Linux or BSD or any other open-source project) is a fantastic piece of software! -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Mon Aug 25 12:28: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 C4160D1B8D1 for ; Mon, 25 Aug 2003 12:28:00 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 49921-07 for ; Mon, 25 Aug 2003 12:27:50 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id 3A855D1B8AA for ; Mon, 25 Aug 2003 12:27:49 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7PFRli12109 for ; Mon, 25 Aug 2003 17:27:47 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7PFRiV12095; Mon, 25 Aug 2003 17:27:44 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id 051816FCCD; Mon, 25 Aug 2003 17:27:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id EDE237F6DC; Mon, 25 Aug 2003 17:27:32 +0200 (CEST) Date: Mon, 25 Aug 2003 17:27:32 +0200 (CEST) From: Tomka Gergely To: "scott.marlowe" Cc: Josh Berkus , Robert Treat , Bill Moran , psql performance list Subject: Re: Tests In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/325 X-Sequence-Number: 3141 2003-08-25 ragyog=F3 napj=E1n scott.marlowe ezt =FCzente: > On Fri, 22 Aug 2003, Josh Berkus wrote: > > > Also another test I'd really like to see is hardware raid (Adaptec, LSI) > > against Linux software raid, and 5-disk RAID 5 against 4-disk RAID 1+0. > > It would be nice to cross those, so you have RAID5 sw vs RAID5 hw, vs > RAID1+0 sw vs RAID1+0 hw. > > Now if only I had the hardware. Time to scrounge. Hm. At first, now we dont have raid hardware, sorry. Second, in my practice the harware raid slower than sw raid, because now the cheapest computing power is the cpu. So i dont like hardware raid solutions, and even on ibm pc-servers i try not using them. --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-performance-owner@postgresql.org Mon Aug 25 12:45:46 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 347DCD1B8B5 for ; Mon, 25 Aug 2003 12:45:17 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 52714-07 for ; Mon, 25 Aug 2003 12:44:45 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id D6203D1B8C3 for ; Mon, 25 Aug 2003 12:44:44 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 3E27ED6FB; Mon, 25 Aug 2003 08:44:43 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 2DA8A5C0D; Mon, 25 Aug 2003 08:44:43 -0700 (PDT) Date: Mon, 25 Aug 2003 08:44:43 -0700 (PDT) From: Stephan Szabo To: Rhaoni Chiu Pereira Cc: PostgreSQL Performance Subject: Re: Query too slow In-Reply-To: <1061823792.3f4a253015fdc@sistemica.info> Message-ID: <20030825083343.H90125-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/326 X-Sequence-Number: 3142 On Mon, 25 Aug 2003, Rhaoni Chiu Pereira wrote: > Hi List, > > As I said before, I'm not a DBA " yet" , but I'm learning ... and I > already have a PostgreSQL running, so I have to ask some help... > I got a SQL as folows : ... Looking at the explain: It's choosing lots of nested loops because it's expecting a small number of rows to be returned at each step but in reality there are alot of rows so that's may not really be a good choice. For example the scan of ftnfco00 is expected to return 295 rows but actually returns 9339, and it looks like it's not estimating the number of matches between the tables very well either since the real count gets up to 240000 in a step where the estimated rows goes to 1. What does explain analyze give after set enable_nestloop=off;? From pgsql-performance-owner@postgresql.org Mon Aug 25 13:33:56 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 53291D1B8AA for ; Mon, 25 Aug 2003 13:33:50 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 69448-03 for ; Mon, 25 Aug 2003 13:33:19 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 56F91D1B89F for ; Mon, 25 Aug 2003 13:33:17 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7PGavVO016763 for ; Mon, 25 Aug 2003 22:06:57 +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 h7PGavQb016750 for ; Mon, 25 Aug 2003 22:06:57 +0530 From: "Shridhar Daithankar" To: PostgreSQL Performance Date: Mon, 25 Aug 2003 22:05:05 +0530 MIME-Version: 1.0 Subject: Re: Query too slow Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4A8811.17912.54E46A0@localhost> In-reply-to: <20030825083343.H90125-100000@megazone.bigpanda.com> References: <1061823792.3f4a253015fdc@sistemica.info> 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: 200308/327 X-Sequence-Number: 3143 On 25 Aug 2003 at 8:44, Stephan Szabo wrote: > On Mon, 25 Aug 2003, Rhaoni Chiu Pereira wrote: > > > Hi List, > > > > As I said before, I'm not a DBA " yet" , but I'm learning ... and I > > already have a PostgreSQL running, so I have to ask some help... > > I got a SQL as folows : > > ... > > Looking at the explain: > > It's choosing lots of nested loops because it's expecting a small number > of rows to be returned at each step but in reality there are alot of rows > so that's may not really be a good choice. > > For example the scan of ftnfco00 is expected to return 295 rows but > actually returns 9339, and it looks like it's not estimating the number of > matches between the tables very well either since the real count gets up > to 240000 in a step where the estimated rows goes to 1. > > What does explain analyze give after set enable_nestloop=off;? In addition to that if it is getting the stats wrong, does running vacuum analyze help? If stats are updated, it should pick up proper plans, right? Bye Shridhar -- Flon's Law: There is not now, and never will be, a language in which it is the least bit difficult to write bad programs. From pgsql-general-owner@postgresql.org Mon Aug 25 14:06:41 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 198EBD1B8B5 for ; Mon, 25 Aug 2003 14:06:25 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 80218-01 for ; Mon, 25 Aug 2003 14:05:53 -0300 (ADT) Received: from mail.travelamericas.com (dsl231-059-037.sea1.dsl.speakeasy.net [216.231.59.37]) by svr1.postgresql.org (Postfix) with SMTP id E239CD1B8DF for ; Mon, 25 Aug 2003 14:05:51 -0300 (ADT) Received: (qmail 28828 invoked from network); 25 Aug 2003 17:06:22 -0000 Received: from unknown (HELO travelamericas.com) (127.0.0.1) by localhost with SMTP; 25 Aug 2003 17:06:22 -0000 Message-ID: <3F4A420E.6090604@travelamericas.com> Date: Mon, 25 Aug 2003 10:06:22 -0700 From: Chris Travers User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ron Johnson , pgsql-general@postgresql.org Subject: Re: Replication Ideas References: <3F483EBD.3020108@travelamericas.com> <1061705587.3733.452.camel@haggis> In-Reply-To: <1061705587.3733.452.camel@haggis> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1302 X-Sequence-Number: 47718 Ron Johnson wrote: >This is vaguely similar to Two Phase Commit, which is a sine qua >non of distributed transactions, which is the s.q.n. of multi-master >replication. > > > I may be wrong, but if I recall correctly, one of the problems with a standard 2-phase commit is that if one server goes down, the other masters cannot commit their transactions. This would make a clustered database server have a downtime equivalent to the total downtime of all of its nodes. This is a real problem. Of course my understanding of Two Phase Commit may be incorrect, in which case, I would appreciate it if someone could point out where I am wrong. It had occurred to me that the issue was one of failure handling more than one of concept. I.e. the problem is how one node's failure is handled rather than the fundamental structure of Two Phase Commit. If a single node fails, we don't want that to take down the whole cluster, and I have actually revised my logic a bit more (to make it even safer). In this I assume that: 1: General failures on any one node are rare 2: A failure is more likely to prevent a transaction from being committed than allow one to be committed. This hot-failover solution requires a transparency from a client perspective-- i.e. the client should not have to choose a different server should one go and should not need to know when a server comes back up. This also means that we need to assume that a load balancing solution can be a part of the clustering solution. I would assume that this would require a shared IP address for the public interface of the server and a private communicatiions channel where each node has a separate IP address (similar to Microsoft's implimentation of Network Load Balancing). Also, different transactions within a single connection should be able to be handled by different nodes, so if one node goes down, users don't have to reconnect. So here is my suggested logic for high availablility/load balanced clustering: 1: All nodes recognize each user connection and delegage transactions rather than connections. 2: At the beginning of a transaction, nodes decide who will take it. Any operation which does not change the information or schema of the database is handled exclusively on that node. Other operations are distributed across nodes. 3: When the transaction is committed, the nodes "vote" on whether the commitment of the transaction is valid. Majority rules, and the minority must remove themselves from the cluster until they can synchronize their databases with the existing masters. If the vote is split 50/50 (i.e. one node fails in a 2 node cluster), success is considered more likely to be valid than failure, and the node(s) which failed to commit the transaction must remove themselves from the cluster until they can recover. Best Wishes, Chris Travers From pgsql-general-owner@postgresql.org Mon Aug 25 14:38:49 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C1584D1B8C6 for ; Mon, 25 Aug 2003 14:38:47 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 84902-09 for ; Mon, 25 Aug 2003 14:38:16 -0300 (ADT) Received: from lakemtao01.cox.net (lakemtao01.cox.net [68.1.17.244]) by svr1.postgresql.org (Postfix) with ESMTP id 8B9AED1B8D4 for ; Mon, 25 Aug 2003 14:38:15 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao01.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030825173816.PNLO5378.lakemtao01.cox.net@lhosts> for ; Mon, 25 Aug 2003 13:38:16 -0400 Subject: Re: Replication Ideas From: Ron Johnson To: PgSQL General ML In-Reply-To: <3F4A420E.6090604@travelamericas.com> References: <3F483EBD.3020108@travelamericas.com> <1061705587.3733.452.camel@haggis> <3F4A420E.6090604@travelamericas.com> Content-Type: text/plain Message-Id: <1061833095.11311.61.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Mon, 25 Aug 2003 12:38:16 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1304 X-Sequence-Number: 47720 On Mon, 2003-08-25 at 12:06, Chris Travers wrote: > Ron Johnson wrote: > > >This is vaguely similar to Two Phase Commit, which is a sine qua > >non of distributed transactions, which is the s.q.n. of multi-master > >replication. > > > > > > > > I may be wrong, but if I recall correctly, one of the problems with a > standard 2-phase commit is that if one server goes down, the other > masters cannot commit their transactions. This would make a clustered > database server have a downtime equivalent to the total downtime of all > of its nodes. This is a real problem. Of course my understanding of > Two Phase Commit may be incorrect, in which case, I would appreciate it > if someone could point out where I am wrong. Note that I didn't mean to imply that 2PC is sufficient to implement M-M. The DBMS designer(s) must decide what to do (like queue up changes) if 2PC fails. -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "Our computers and their computers are the same color. The conversion should be no problem!" Unknown From pgsql-general-owner@postgresql.org Mon Aug 25 15:25:25 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 572E3D1B8DD for ; Mon, 25 Aug 2003 15:25:22 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 99853-02 for ; Mon, 25 Aug 2003 15:24:51 -0300 (ADT) Received: from cm-lcon2-53-101.cm.vtr.net (CM-lcon2-53-101.cm.vtr.net [200.83.53.101]) by svr1.postgresql.org (Postfix) with ESMTP id A3C6FD1B8D1 for ; Mon, 25 Aug 2003 15:24:49 -0300 (ADT) Received: by cm-lcon2-53-101.cm.vtr.net (Postfix, from userid 500) id 7E59680223; Mon, 25 Aug 2003 14:24:41 -0400 (CLT) Date: Mon, 25 Aug 2003 14:24:41 -0400 From: Alvaro Herrera To: Chris Travers Cc: Ron Johnson , pgsql-general@postgresql.org Subject: Re: Replication Ideas Message-ID: <20030825182441.GB9597@dcc.uchile.cl> References: <3F483EBD.3020108@travelamericas.com> <1061705587.3733.452.camel@haggis> <3F4A420E.6090604@travelamericas.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4A420E.6090604@travelamericas.com> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1306 X-Sequence-Number: 47722 On Mon, Aug 25, 2003 at 10:06:22AM -0700, Chris Travers wrote: > Ron Johnson wrote: > > >This is vaguely similar to Two Phase Commit, which is a sine qua > >non of distributed transactions, which is the s.q.n. of multi-master > >replication. > > I may be wrong, but if I recall correctly, one of the problems with a > standard 2-phase commit is that if one server goes down, the other > masters cannot commit their transactions. Before the discussion goes any further, have you read the work related to Postgres-r? It's a substantially different animal from 2PC AFAIK. -- Alvaro Herrera () "Right now the sectors on the hard disk run clockwise, but I heard a rumor that you can squeeze 0.2% more throughput by running them counterclockwise. It's worth the effort. Recommended." (Gerry Pourwelle) From pgsql-general-owner@postgresql.org Mon Aug 25 15:38:15 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D6404D1B8AA for ; Mon, 25 Aug 2003 15:36:21 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 00413-08 for ; Mon, 25 Aug 2003 15:35:52 -0300 (ADT) Received: from mail.travelamericas.com (dsl231-059-037.sea1.dsl.speakeasy.net [216.231.59.37]) by svr1.postgresql.org (Postfix) with SMTP id 1DF3CD1B52C for ; Mon, 25 Aug 2003 15:35:49 -0300 (ADT) Received: (qmail 29258 invoked from network); 25 Aug 2003 18:36:20 -0000 Received: from unknown (HELO travelamericas.com) (127.0.0.1) by localhost with SMTP; 25 Aug 2003 18:36:20 -0000 Message-ID: <3F4A5724.3060002@travelamericas.com> Date: Mon, 25 Aug 2003 11:36:20 -0700 From: Chris Travers User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alvaro Herrera Cc: Ron Johnson , pgsql-general@postgresql.org Subject: Re: Replication Ideas References: <3F483EBD.3020108@travelamericas.com> <1061705587.3733.452.camel@haggis> <3F4A420E.6090604@travelamericas.com> <20030825182441.GB9597@dcc.uchile.cl> In-Reply-To: <20030825182441.GB9597@dcc.uchile.cl> 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: 200308/1307 X-Sequence-Number: 47723 Alvaro Herrera wrote: >Before the discussion goes any further, have you read the work related >to Postgres-r? It's a substantially different animal from 2PC AFAIK. > > > Yes I have. Postgres-r is not a high-availability solution which is capable of transparent failover, although it is a very useful project on its own. Best Wishes, Chris Travers. From pgsql-performance-owner@postgresql.org Mon Aug 25 17:22:20 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0E892D1B8E6 for ; Mon, 25 Aug 2003 17:21:58 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 31230-04 for ; Mon, 25 Aug 2003 17:21:49 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 70E03D1B8E3 for ; Mon, 25 Aug 2003 17:21:47 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h7PKLhek032527 for ; Mon, 25 Aug 2003 20:21:43 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7PJuf5U026008 for pgsql-performance@postgresql.org; Mon, 25 Aug 2003 19:56:41 GMT From: "Bupp Phillips" X-Newsgroups: comp.databases.postgresql.performance Subject: What is the fastest way to get a resultset Date: Mon, 25 Aug 2003 12:56:59 -0700 Organization: Hub.Org Networking Services Lines: 20 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/328 X-Sequence-Number: 3144 I'm very new to Postgresql, so don't beat me up to bad if you see a problem, just inform me what I've done wrong. I'm use Postgresql 7.2 (PeerDirect's Windows port) on Win2000 384MB RAM 10GB of Free space 800 Mhz, using the ODBC driver 7.03.01.00. I have a table that has 103,000 records in it (record size is about 953 bytes) and when I do a select all (select * from ) it takes a whopping 30 secs for the data to return!! SQLServer on the other hand takes 6 secs, but you can also use what is called a firehose cursor, which will return the data in < 1 sec. I have done everything that I know how to speed this up, does anyone have any advise? Thanks From pgsql-performance-owner@postgresql.org Tue Aug 26 02:58: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 50806D1B89D for ; Mon, 25 Aug 2003 17:38:24 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 33564-06 for ; Mon, 25 Aug 2003 17:37:55 -0300 (ADT) Received: from mail2.fbab.net (mail2.fbab.net [195.54.134.228]) by svr1.postgresql.org (Postfix) with SMTP id 5BE9DD1B550 for ; Mon, 25 Aug 2003 17:37:52 -0300 (ADT) Received: (qmail 31972 invoked by uid 136); 25 Aug 2003 20:37:37 -0000 Received: from mag@fbab.net by mail2.fbab.net by uid 133 with qmail-scanner-1.20rc1 (avp: 4.0.3.0. Clear:RC:0:. Processed in 0.058429 secs); 25 Aug 2003 20:37:37 -0000 Received: from unknown (HELO TEST11) (magpool1@195.54.134.132) by mail2.fbab.net with SMTP; 25 Aug 2003 20:37:37 -0000 Message-ID: <007f01c36b48$b0f06df0$f80c0a0a@mnd> From: "Magnus Naeslund(f)" To: "Bupp Phillips" Cc: References: Subject: Re: What is the fastest way to get a resultset Date: Mon, 25 Aug 2003 22:37:24 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/331 X-Sequence-Number: 3147 Bupp Phillips wrote: > I'm very new to Postgresql, so don't beat me up to bad if you see a > problem, just inform me what I've done wrong. > > I'm use Postgresql 7.2 (PeerDirect's Windows port) on Win2000 384MB > RAM 10GB of Free space 800 Mhz, using the ODBC driver 7.03.01.00. > > I have a table that has 103,000 records in it (record size is about > 953 bytes) and when I do a select all (select * from
) it > takes a whopping 30 secs for the data to return!! > > SQLServer on the other hand takes 6 secs, but you can also use what is > called a firehose cursor, which will return the data in < 1 sec. > > I have done everything that I know how to speed this up, does anyone > have any advise? > Probably you need to fetch more than one row at a time. I made that misstake once myself :) Magnus From pgsql-performance-owner@postgresql.org Tue Aug 26 02:57:32 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2E5A6D1B8AB for ; Mon, 25 Aug 2003 17:47:14 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 33568-09 for ; Mon, 25 Aug 2003 17:46:44 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id 29250D1B523 for ; Mon, 25 Aug 2003 17:46:27 -0300 (ADT) Received: (qmail 15815 invoked from network); 25 Aug 2003 20:46:34 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 25 Aug 2003 20:46:34 -0000 Date: Mon, 25 Aug 2003 16:46:34 -0400 (EDT) From: Jeff To: Bupp Phillips Cc: "pgsql-performance@postgresql.org" Subject: Re: What is the fastest way to get a resultset In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/330 X-Sequence-Number: 3146 On Mon, 25 Aug 2003, Bupp Phillips wrote: > > I have a table that has 103,000 records in it (record size is about 953 > bytes) and when I do a select all (select * from
) it takes a > whopping 30 secs for the data to return!! > > SQLServer on the other hand takes 6 secs, but you can also use what is > called a firehose cursor, which will return the data in < 1 sec. > You probably want a cursor. Typically what happens is postgres sends _all_ the data to the client - which can be rather substantial. A cursor allows you to say "get me the first 1000 records. now the next 1000" - it should get you the speed you want. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-general-owner@postgresql.org Tue Aug 26 02:54:34 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 6609FD1B8AA for ; Mon, 25 Aug 2003 18:12:03 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 38065-06 for ; Mon, 25 Aug 2003 18:11:33 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 13731D1B550 for ; Mon, 25 Aug 2003 18:11:31 -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 h7PL9J5H011628; Mon, 25 Aug 2003 17:09:19 -0400 (EDT) To: Chris Travers Cc: Alvaro Herrera , Ron Johnson , pgsql-general@postgresql.org Subject: Re: Replication Ideas In-reply-to: <3F4A5724.3060002@travelamericas.com> References: <3F483EBD.3020108@travelamericas.com> <1061705587.3733.452.camel@haggis> <3F4A420E.6090604@travelamericas.com> <20030825182441.GB9597@dcc.uchile.cl> <3F4A5724.3060002@travelamericas.com> Comments: In-reply-to Chris Travers message dated "Mon, 25 Aug 2003 11:36:20 -0700" Date: Mon, 25 Aug 2003 17:09:19 -0400 Message-ID: <11627.1061845759@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1328 X-Sequence-Number: 47744 Chris Travers writes: > Yes I have. Postgres-r is not a high-availability solution which is > capable of transparent failover, What makes you say that? My understanding is it's supposed to survive loss of individual servers. regards, tom lane From pgsql-general-owner@postgresql.org Mon Aug 25 19:16:45 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5F85BD1B8E4 for ; Mon, 25 Aug 2003 19:15:31 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 55635-06 for ; Mon, 25 Aug 2003 19:15:00 -0300 (ADT) Received: from mail.travelamericas.com (dsl231-059-037.sea1.dsl.speakeasy.net [216.231.59.37]) by svr1.postgresql.org (Postfix) with SMTP id 6B678D1B8DB for ; Mon, 25 Aug 2003 19:14:56 -0300 (ADT) Received: (qmail 30316 invoked from network); 25 Aug 2003 22:15:25 -0000 Received: from unknown (HELO travelamericas.com) (127.0.0.1) by localhost with SMTP; 25 Aug 2003 22:15:25 -0000 Message-ID: <3F4A8A7D.30308@travelamericas.com> Date: Mon, 25 Aug 2003 15:15:25 -0700 From: Chris Travers User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Alvaro Herrera , Ron Johnson , pgsql-general@postgresql.org Subject: Re: Replication Ideas References: <3F483EBD.3020108@travelamericas.com> <1061705587.3733.452.camel@haggis> <3F4A420E.6090604@travelamericas.com> <20030825182441.GB9597@dcc.uchile.cl> <3F4A5724.3060002@travelamericas.com> <11627.1061845759@sss.pgh.pa.us> In-Reply-To: <11627.1061845759@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1316 X-Sequence-Number: 47732 Tom Lane wrote: >Chris Travers writes: > > >>Yes I have. Postgres-r is not a high-availability solution which is >>capable of transparent failover, >> >> > >What makes you say that? My understanding is it's supposed to survive >loss of individual servers. > > regards, tom lane > > > > My mistake. I must have gotten them confused with another (asynchronous) replication project. Best Wishes, Chris Travers From pgsql-performance-owner@postgresql.org Tue Aug 26 02:49: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 DB8A9D1B8B3 for ; Mon, 25 Aug 2003 19:51:55 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 65487-02 for ; Mon, 25 Aug 2003 19:51:46 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 0BAD0D1B8CC for ; Mon, 25 Aug 2003 19:51:44 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h7PMphek065044 for ; Mon, 25 Aug 2003 22:51:43 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7PMSNUl060789 for pgsql-performance@postgresql.org; Mon, 25 Aug 2003 22:28:23 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Replication Ideas Date: Mon, 25 Aug 2003 18:28:09 -0400 Organization: cbbrowne Computing Inc Lines: 33 Message-ID: References: <3F483EBD.3020108@travelamericas.com> <1061705587.3733.452.camel@haggis> <3F4A420E.6090604@travelamericas.com> <20030825182441.GB9597@dcc.uchile.cl> <3F4A5724.3060002@travelamericas.com> <11627.1061845759@sss.pgh.pa.us> <3F4A8A7D.30308@travelamericas.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:7H3smKpt3QcyQw0V35isuFhnHnM= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/329 X-Sequence-Number: 3145 A long time ago, in a galaxy far, far away, "Bupp Phillips" wrote: >I have a table that has 103,000 records in it (record size is about >953 bytes) and when I do a select all (select * from
) it takes >a whopping 30 secs for the data to return!! >SQLServer on the other hand takes 6 secs, but you can also use what is >called a firehose cursor, which will return the data in < 1 sec. >I have done everything that I know how to speed this up, does anyone >have any advise? Have you VACUUMed the table? 30 seconds to start getting data back from such a query _seems_ a liittle high. It would be quite a reasonable idea to open up a CURSOR and request the data in more byte-sized pieces so that the result set wouldn't forcibly bloat in any one spot. You start by submitting the cursor definition, inside a transaction: begin transaction; declare cursor my_fire_hose for select * from
; You then iterate over the following, which fetches 1000 rows at a time: fetch forward 1000 in my_fire_hose; That should cut down the time it takes to start getting records to near enough to zero... -- output = reverse("gro.gultn" "@" "enworbbc") http://www3.sympatico.ca/cbbrowne/lisp.html "Microsoft is sort of a mixture between the Borg and the Ferengi. Combine the Borg marketing with Ferengi networking..." -- Andre Beck in dcouln From pgsql-general-owner@postgresql.org Wed Aug 27 15:49:50 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 24720D1B8B1 for ; Tue, 26 Aug 2003 03:02:05 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 92036-03 for ; Tue, 26 Aug 2003 03:01:35 -0300 (ADT) Received: from ganymede.hub.org (u173n10.eastlink.ca [24.224.173.10]) by svr1.postgresql.org (Postfix) with ESMTP id 49EC9D1B8B3 for ; Tue, 26 Aug 2003 03:01:32 -0300 (ADT) Received: by ganymede.hub.org (Postfix, from userid 1000) id ACEC33427F; Tue, 26 Aug 2003 03:01:26 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id A8F8033D0E; Tue, 26 Aug 2003 03:01:26 -0300 (ADT) Date: Tue, 26 Aug 2003 03:01:26 -0300 (ADT) From: "Marc G. Fournier" To: Tom Lane Cc: Chris Travers , Alvaro Herrera , Ron Johnson , pgsql-general@postgresql.org Subject: Re: Replication Ideas In-Reply-To: <11627.1061845759@sss.pgh.pa.us> Message-ID: <20030826025754.V691@ganymede.hub.org> References: <3F483EBD.3020108@travelamericas.com> <1061705587.3733.452.camel@haggis> <3F4A420E.6090604@travelamericas.com> <20030825182441.GB9597@dcc.uchile.cl> <3F4A5724.3060002@travelamericas.com> <11627.1061845759@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1458 X-Sequence-Number: 47874 On Mon, 25 Aug 2003, Tom Lane wrote: > Chris Travers writes: > > Yes I have. Postgres-r is not a high-availability solution which is > > capable of transparent failover, > > What makes you say that? My understanding is it's supposed to survive > loss of individual servers. How does it play 'catch up' went a server comes back online? note that I did go through the 'docs' on how it works, and am/was quite impressed at what they were doing ... but, if I have a large network, say, and one group is connecting to ServerA, and another group with ServerB, what happens when ServerA and ServerB loose network connectivity for any period of time? How do they re-sync when the network comes back up again? From pgsql-performance-owner@postgresql.org Tue Aug 26 03:46: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 55E64D1B8D3 for ; Tue, 26 Aug 2003 03:46:15 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 04626-04 for ; Tue, 26 Aug 2003 03:45:41 -0300 (ADT) Received: from cerebro.int-bytecraft.com (unknown [219.93.229.26]) by svr1.postgresql.org (Postfix) with ESMTP id 31A3BD1B8A5 for ; Tue, 26 Aug 2003 03:45:38 -0300 (ADT) Received: from bytecraft.com.my (home.int-bytecraft.com [127.0.0.1]) by cerebro.int-bytecraft.com (8.11.6/8.11.6) with ESMTP id h7Q6i4O16998; Tue, 26 Aug 2003 14:44:16 +0800 Message-ID: <3F4B02ED.4080704@bytecraft.com.my> Date: Tue, 26 Aug 2003 14:49:17 +0800 From: Ang Chin Han User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephan Szabo Cc: Rhaoni Chiu Pereira , PostgreSQL Performance Subject: Re: Query too slow References: <20030825083343.H90125-100000@megazone.bigpanda.com> In-Reply-To: <20030825083343.H90125-100000@megazone.bigpanda.com> X-Enigmail-Version: 0.76.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5822A8680F096BFD16C2E4ED" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/332 X-Sequence-Number: 3148 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5822A8680F096BFD16C2E4ED Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Stephan Szabo wrote: > Looking at the explain: Veering aside a bit, since we usually pinpoint performance problems by looking at EXPLAIN ANALYZE's differences between the planner's estimation and actual execution's stats, what's involved in parsing the EXPLAIN ANALYZE results, and highlighting the places where they are way different? Bold, underline, or put some asterisks in front of those steps. Makes looking at big EXPLAIN ANALYZE trees much easier. -- Linux homer 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386 GNU/Linux 2:30pm up 243 days, 5:48, 8 users, load average: 5.52, 5.29, 5.10 --------------enig5822A8680F096BFD16C2E4ED Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/SwLwNYbTUIgzwfARArG3AKCghYFWM/ukKYCQcXM1swDVeF9eqwCfUU4y +BJdOjxn5YOslSBfC4m+rQc= =Nw+o -----END PGP SIGNATURE----- --------------enig5822A8680F096BFD16C2E4ED-- From pgsql-performance-owner@postgresql.org Tue Aug 26 14:53:33 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 59B0FD1B8D1 for ; Tue, 26 Aug 2003 14:52:08 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 78176-01 for ; Tue, 26 Aug 2003 14:51:58 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 26711D1B8D0 for ; Tue, 26 Aug 2003 14:51:57 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h7QHpuek021378 for ; Tue, 26 Aug 2003 17:51:56 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7QHd1bN017932 for pgsql-performance@postgresql.org; Tue, 26 Aug 2003 17:39:01 GMT From: "Bupp Phillips" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: What is the fastest way to get a resultset Date: Tue, 26 Aug 2003 02:18:23 -0700 Organization: Hub.Org Networking Services Lines: 40 Message-ID: References: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/339 X-Sequence-Number: 3155 Is this something that can be done thru a SQL statement, or are you saying that I need to develop logic to handle this because the database won't hold the resultset on the server, but instead sends it all to the client? It there a way to get server side cursors with Postgresql like SQLServer has or is this a limitation that it has? Thanks "Jeff" wrote in message news:Pine.BSF.4.44.0308251645360.15800-100000@torgo.978.org... > On Mon, 25 Aug 2003, Bupp Phillips wrote: > > > > > I have a table that has 103,000 records in it (record size is about 953 > > bytes) and when I do a select all (select * from
) it takes a > > whopping 30 secs for the data to return!! > > > > SQLServer on the other hand takes 6 secs, but you can also use what is > > called a firehose cursor, which will return the data in < 1 sec. > > > You probably want a cursor. > Typically what happens is postgres sends _all_ the data to the client - > which can be rather substantial. A cursor allows you to say "get me the > first 1000 records. now the next 1000" - it should get you the speed you > want. > > > -- > Jeff Trout > http://www.jefftrout.com/ > http://www.stuarthamm.net/ > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > From pgsql-performance-owner@postgresql.org Tue Aug 26 14:01: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 540FED1B8B3 for ; Tue, 26 Aug 2003 09:34:27 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 94366-04 for ; Tue, 26 Aug 2003 09:33:58 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id C6A98D1B8B1 for ; Tue, 26 Aug 2003 09:33:54 -0300 (ADT) Received: (qmail 18713 invoked from network); 26 Aug 2003 12:34:01 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 26 Aug 2003 12:34:01 -0000 Date: Tue, 26 Aug 2003 08:34:01 -0400 (EDT) From: Jeff To: pgsql-performance@postgresql.org Subject: Sun vs a P2. Interesting results. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/336 X-Sequence-Number: 3152 Here's an interesting situation, and I think it may be just that Sun stinks. I was recently given the go ahead to switch from Informix to Postgres on one of our properties. (I had dozens of performance comparisons showing how slow Informix was compared to it and my boss seeing me struggle trying to make it run fast while Postgres, nearly out of the box, was simply spanking it.). Well, in order to facilitate things we were going to run pg on a 4 cpu (ultrasparc ii 400Mhz) sun with 4gb of memory (also the current informix box. It isn't very loaded). Now I know FreeBSD/Linux is preferred (and where I do a lot of development and testing). But check this out for interesting results. The Hardware: Machine A: 4 CPU Sun Ultrasparc II 400Mhz, 4GB mem, 20GB RAID5, Solaris 8 (32 bit mode) Machine B: 2 CPU Pentium II, 450Mhz, 512MB mem, 18GB RAID0 (2 old scsi disks) Linux 2.4.18 (Stock redhat 8.0) The software: PG 7.3.4 compiled myself. (Reading specs from /opt/sfw/lib/gcc-lib/sparc-sun-solaris2.9/2.95.3/specs gcc version 2.95.3 20010315 (release) (The solaris 8 box has no compilers, could this be the issue?) and (Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/u sr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i 386-redhat-linux --with-system-zlib --enable-__cxa_atexit Thread model: posix gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)) Ok. Maybe the compiler (I'll try installing a newer gcc for sun later today). The PG.conf: shared_buffers = 2000 sort_mem = 8192 effective_cache_size = 32000 tcpip_sockets = true The Schema: userprofile: userkey | character varying(128) | displayname | character varying(128) | displayname_v | boolean | default 'f' name | character varying(128) | name_v | boolean | default 'f' email | character varying(128) | email_v | boolean | default 'f' gender | character varying(1) | gender_v | boolean | default 'f' country | character varying(64) | country_v | boolean | default 'f' zip | character varying(10) | zip_v | boolean | default 'f' city | character varying(128) | city_v | boolean | default 'f' state | character varying(10) | state_v | boolean | default 'f' lang | character varying(2) | lang_v | boolean | default 'f' url | character varying(255) | url_v | boolean | default 'f' phone | character varying(64) | phone_v | boolean | default 'f' phonemobile | character varying(64) | phonemobile_v | boolean | default 'f' phonefax | character varying(64) | phonefax_v | boolean | default 'f' dob | timestamp with time zone | dob_v | boolean | default 'f' interests_v | boolean | default 'f' description | character varying(255) | description2 | character varying(255) | description_v | boolean | default 'f' (Yes, I kknow it isn't good - a lot of it is because it is the same schema I had to use on informix. Convienantly you cannot do much with a textblob on infomrix, so I have to use big varchar's, but that is a fiffernt story). The magic query: select userkey, dob, email, gender, country from imuserprofile where gender_v and gender='m' and country_v and country = 'br' and dob_v = 't' and dob >= 'now'::timestamptz - '29 years'::interval and dob <= 'now'::timestamptz - '18 years'::interval order by dob asc limit 20 offset 100 (Page 5 of male brazillians, 18-29) Now the P2 runs this in about 0.3 seconds, and hte sun box runs it in 1 second. Here's the explain analyze's on each: P2: Limit (cost=2484.52..2484.57 rows=20 width=67) (actual time=377.32..377.41 row s=20 loops=1) -> Sort (cost=2484.27..2484.74 rows=186 width=67) (actual time=377.02..377. 21 rows=121 loops=1) Sort Key: dob -> Seq Scan on userprofile (cost=0.00..2477.28 rows=186 width=67) ( actual time=0.15..350.93 rows=1783 loops=1) Filter: (gender_v AND (gender = 'm'::character varying) AND count ry_v AND (country = 'br'::character varying) AND (dob_v = true) AND (dob >= '197 4-08-26 07:13:15.903437-04'::timestamp with time zone) AND (dob <= '1985-08-26 0 7:13:15.903437-04'::timestamp with time zone)) Total runtime: 378.21 msec (6 rows) Sun: Limit (cost=2521.19..2521.24 rows=20 width=67) (actual time=1041.14..1041.20 r ows=20 loops=1) -> Sort (cost=2520.94..2521.39 rows=178 width=67) (actual time=1040.96..104 1.08 rows=121 loops=1) Sort Key: dob -> Seq Scan on userprofile (cost=0.00..2514.28 rows=178 width=67) ( actual time=0.37..1014.50 rows=1783 loops=1) Filter: (gender_v AND (gender = 'm'::character varying) AND count ry_v AND (country = 'br'::character varying) AND (dob_v = true) AND (dob >= '197 4-08-26 08:21:52.158181-04'::timestamp with time zone) AND (dob <= '1985-08-26 0 8:21:52.158181-04'::timestamp with time zone)) Total runtime: 1042.54 msec (6 rows) They are loaded with the exact same dataset - 53k rows, ~10MB Notice the estimates are roughly the same, but the execution time is different. I don't think it is the IO system, since 10MB will be cached by the OS and iostat reports no activity on the disks (when running the query many times over and over and in parellel). it is a simple query.. Could it just be that the sun sucks? (And for the record - same schema, nearly same query (modified for datetime syntax) on informix runs in 3 seconds). -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Tue Aug 26 13:48:28 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 7D571D1B4F0 for ; Tue, 26 Aug 2003 10:22:18 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 07346-06 for ; Tue, 26 Aug 2003 10:21:50 -0300 (ADT) Received: from gatekeeper.gmanetwork.com (unknown [202.61.78.68]) by svr1.postgresql.org (Postfix) with ESMTP id 0A681D1D153 for ; Tue, 26 Aug 2003 10:21:43 -0300 (ADT) Received: from gmanewmedia.com (mailhost.gmanmi.tv [192.168.6.3]) by gatekeeper.gmanetwork.com (8.11.0/8.11.0) with ESMTP id h7QDLei10926 for ; Tue, 26 Aug 2003 21:21:40 +0800 Received: from 192.168.6.40 ([192.168.6.40]) by gmanewmedia.com (8.11.1/) with ESMTP id h7QD2qo49233 for ; Tue, 26 Aug 2003 21:03:00 +0800 (PHT) (envelope-from jerome@gmanmi.tv) X-RAV-AntiVirus: This e-mail has been scanned for viruses on host: gmanewmedia.com From: JM Reply-To: jerome@gmanmi.tv Organization: GMANMI To: PgSQL Performance ML Subject: Best tweak for fast results.. ? Date: Tue, 26 Aug 2003 21:42:52 +0800 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308262142.52521.jerome@gmanmi.tv> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/335 X-Sequence-Number: 3151 need input on parameter values on confs... our database is getting 1000 transactions/sec on peak periods.. sitting on RH 7.3 2.4.7-10smp RAM: 1028400 SWAP: 2040244 queries are just simple select statements based on timestamps, varchars... less on joins... on a 300K rows.. TIA From pgsql-performance-owner@postgresql.org Tue Aug 26 12:48:33 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 E5C57D1B8A5 for ; Tue, 26 Aug 2003 12:48:24 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 41793-04 for ; Tue, 26 Aug 2003 12:47:54 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id CB517D1B574 for ; Tue, 26 Aug 2003 12:47:53 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 551A1D674; Tue, 26 Aug 2003 08:47:52 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 348CE5C10; Tue, 26 Aug 2003 08:47:52 -0700 (PDT) Date: Tue, 26 Aug 2003 08:47:52 -0700 (PDT) From: Stephan Szabo To: Ang Chin Han Cc: Rhaoni Chiu Pereira , PostgreSQL Performance Subject: Re: Query too slow In-Reply-To: <3F4B02ED.4080704@bytecraft.com.my> Message-ID: <20030826084326.M30963-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/333 X-Sequence-Number: 3149 On Tue, 26 Aug 2003, Ang Chin Han wrote: > Stephan Szabo wrote: > > > Looking at the explain: > > Veering aside a bit, since we usually pinpoint performance problems by > looking at EXPLAIN ANALYZE's differences between the planner's > estimation and actual execution's stats, what's involved in parsing the > EXPLAIN ANALYZE results, and highlighting the places where they are way > different? Bold, underline, or put some asterisks in front of those steps. The hardest part is determining where it matters I think. You can use the row counts as the base for that, but going from 1 row to 50 is not necessarily going to be an issue, but it might be if a nested loop is chosen. From pgsql-performance-owner@postgresql.org Tue Aug 26 13:02:32 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 AF770D1B8B6 for ; Tue, 26 Aug 2003 13:01:48 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 44067-05 for ; Tue, 26 Aug 2003 13:01:38 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 783A8D1B8AB for ; Tue, 26 Aug 2003 13:01:37 -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 h7QG1W5H027126; Tue, 26 Aug 2003 12:01:32 -0400 (EDT) To: Stephan Szabo Cc: Ang Chin Han , Rhaoni Chiu Pereira , PostgreSQL Performance Subject: Re: Query too slow In-reply-to: <20030826084326.M30963-100000@megazone.bigpanda.com> References: <20030826084326.M30963-100000@megazone.bigpanda.com> Comments: In-reply-to Stephan Szabo message dated "Tue, 26 Aug 2003 08:47:52 -0700" Date: Tue, 26 Aug 2003 12:01:32 -0400 Message-ID: <27125.1061913692@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/334 X-Sequence-Number: 3150 Stephan Szabo writes: > On Tue, 26 Aug 2003, Ang Chin Han wrote: >> Veering aside a bit, since we usually pinpoint performance problems by >> looking at EXPLAIN ANALYZE's differences between the planner's >> estimation and actual execution's stats, what's involved in parsing the >> EXPLAIN ANALYZE results, and highlighting the places where they are way >> different? Bold, underline, or put some asterisks in front of those steps. > The hardest part is determining where it matters I think. You can use the > row counts as the base for that, but going from 1 row to 50 is not > necessarily going to be an issue, but it might be if a nested loop is > chosen. We've been chatting about this idea among the Red Hat group. The RHDB Visual Explain tool (get it at http://sources.redhat.com/rhdb/) already computes the percent of total runtime represented by each plan node. It seems like we could highlight nodes based on a large difference between estimated and actual percentage, or just highlight the nodes that are more than X percent of the runtime. regards, tom lane From pgsql-general-owner@postgresql.org Tue Aug 26 14:12:42 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id A0987D1B8AA for ; Tue, 26 Aug 2003 14:12:12 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 69731-02 for ; Tue, 26 Aug 2003 14:11:42 -0300 (ADT) Received: from lakemtao02.cox.net (lakemtao02.cox.net [68.1.17.243]) by svr1.postgresql.org (Postfix) with ESMTP id 38AE8D1B8A9 for ; Tue, 26 Aug 2003 14:11:41 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao02.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030826171135.ZOSL11854.lakemtao02.cox.net@lhosts> for ; Tue, 26 Aug 2003 13:11:35 -0400 Subject: Re: [PERFORM] Best tweak for fast results.. ? From: Ron Johnson To: PgSQL General ML In-Reply-To: <200308262142.52521.jerome@gmanmi.tv> References: <200308262142.52521.jerome@gmanmi.tv> Content-Type: text/plain Message-Id: <1061917901.18108.109.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Tue, 26 Aug 2003 12:11:41 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1385 X-Sequence-Number: 47801 On Tue, 2003-08-26 at 08:42, JM wrote: > need input on parameter values on confs... > > our database is getting 1000 transactions/sec on peak periods.. > > sitting on RH 7.3 > 2.4.7-10smp > RAM: 1028400 > SWAP: 2040244 > > queries are just simple select statements based on timestamps, varchars... > less on joins... on a 300K rows.. Could it be that 1000tps is as good as your h/w can do? You didn't mention what kind and speed of CPU(s), SCSI-or-IDE controller(s) and type/speed of disk(s) you have. -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "Oh, great altar of passive entertainment, bestow upon me thy discordant images at such speed as to render linear thought impossible" Calvin, regarding TV From pgsql-general-owner@postgresql.org Tue Aug 26 14:21:19 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 9AF47D1B8A4 for ; Tue, 26 Aug 2003 14:20:21 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 70215-06 for ; Tue, 26 Aug 2003 14:19:50 -0300 (ADT) Received: from snoopy.oit.edu (snoopy.OIT.EDU [140.211.135.12]) by svr1.postgresql.org (Postfix) with ESMTP id 3B0E5D1B8AD for ; Tue, 26 Aug 2003 14:19:49 -0300 (ADT) Received: from fireserve.net (purvine-141-62.oit.edu [140.211.141.62]) by snoopy.oit.edu (8.12.9/8.12.9/OIT-4.0) with ESMTP id h7QHJmWD018332; Tue, 26 Aug 2003 10:19:48 -0700 Message-ID: <3F4B9808.1080804@fireserve.net> Date: Tue, 26 Aug 2003 10:25:28 -0700 From: Dennis Gearon User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, ru, es-mx MIME-Version: 1.0 To: Ron Johnson Cc: PgSQL General ML Subject: Re: [PERFORM] Best tweak for fast results.. ? References: <200308262142.52521.jerome@gmanmi.tv> <1061917901.18108.109.camel@haggis> In-Reply-To: <1061917901.18108.109.camel@haggis> 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: 200308/1387 X-Sequence-Number: 47803 actually, isin't 1000 tps pretty good? Ron Johnson wrote: >On Tue, 2003-08-26 at 08:42, JM wrote: > > >>need input on parameter values on confs... >> >>our database is getting 1000 transactions/sec on peak periods.. >> >>sitting on RH 7.3 >>2.4.7-10smp >>RAM: 1028400 >>SWAP: 2040244 >> >>queries are just simple select statements based on timestamps, varchars... >>less on joins... on a 300K rows.. >> >> > >Could it be that 1000tps is as good as your h/w can do? You didn't >mention what kind and speed of CPU(s), SCSI-or-IDE controller(s) and >type/speed of disk(s) you have. > > > From pgsql-performance-owner@postgresql.org Tue Aug 26 14:45:23 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 52B53D1B8A9 for ; Tue, 26 Aug 2003 14:44:53 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 75314-09 for ; Tue, 26 Aug 2003 14:44:23 -0300 (ADT) Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by svr1.postgresql.org (Postfix) with ESMTP id 1F149D1B8AB for ; Tue, 26 Aug 2003 14:44:22 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-31.mail.demon.net with esmtp (Exim 3.35 #1) id 19rhrh-0000E1-0V; Tue, 26 Aug 2003 18:44:22 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 99F291595F; Tue, 26 Aug 2003 18:44:20 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id E602F15955; Tue, 26 Aug 2003 18:44:19 +0100 (BST) From: Richard Huxton To: jerome@gmanmi.tv, PgSQL Performance ML Subject: Re: Best tweak for fast results.. ? Date: Tue, 26 Aug 2003 18:44:19 +0100 User-Agent: KMail/1.5 References: <200308262142.52521.jerome@gmanmi.tv> In-Reply-To: <200308262142.52521.jerome@gmanmi.tv> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308261844.19268.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/337 X-Sequence-Number: 3153 On Tuesday 26 August 2003 14:42, JM wrote: > need input on parameter values on confs... > > our database is getting 1000 transactions/sec on peak periods.. > > sitting on RH 7.3 > 2.4.7-10smp > RAM: 1028400 > SWAP: 2040244 > > queries are just simple select statements based on timestamps, varchars... > less on joins... on a 300K rows.. Assuming you're getting good query plans (check the output of EXPLAIN ANALYSE)... Start by checking the output of vmstat/iostat during busy periods - this will tell you whether CPU/IO/RAM is the bottleneck. There is a good starter for tuning PG at: http://www.varlena.com/varlena/GeneralBits/Tidbits/index.php Assuming your rows aren't too wide, they're probably mostly cached by Linux, so you probably don't want to overdo the shared buffers/sort memory and make sure the effective cache size is accurate. -- Richard Huxton Archonet Ltd From pgsql-performance-owner@postgresql.org Tue Aug 26 14:49: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 36FD1D1B8E2 for ; Tue, 26 Aug 2003 14:48:47 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 76994-03 for ; Tue, 26 Aug 2003 14:48:15 -0300 (ADT) Received: from mail2.dbitech.ca (radius.wavefire.com [64.141.13.252]) by svr1.postgresql.org (Postfix) with SMTP id EF1F4D1B8C8 for ; Tue, 26 Aug 2003 14:48:13 -0300 (ADT) Received: (qmail 15693 invoked from network); 26 Aug 2003 18:10:19 -0000 Received: from dbitech.wavefire.com (HELO dbitech) (darcy@64.141.15.253) by radius.wavefire.com with SMTP; 26 Aug 2003 18:10:19 -0000 Content-Type: text/plain; charset="iso-8859-1" From: Darcy Buskermolen Organization: Wavefire Technologies Corp. To: Jeff , pgsql-performance@postgresql.org Subject: Re: Sun vs a P2. Interesting results. Date: Tue, 26 Aug 2003 10:48:10 -0700 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308261048.10817.darcy@wavefire.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/338 X-Sequence-Number: 3154 I spoke with my SUN admin, and this is what he had to say about what you ar= e=20 seeing. Sun gear is known to show a lower than Intel performance on light loads, re= run=20 your test with 100 concurrent users (queries) and see what happens. Also h= e=20 recommends installing a 64bit version of Solaris, the 32bit robs a lot of= =20 performance as well. On Tuesday 26 August 2003 05:34, Jeff wrote: > Here's an interesting situation, and I think it may be just that Sun > stinks. > > I was recently given the go ahead to switch from Informix to Postgres on > one of our properties. (I had dozens of performance comparisons showing > how slow Informix was compared to it and my boss seeing me struggle trying > to make it run fast while Postgres, nearly out of the box, was simply > spanking it.). > > > Well, in order to facilitate things we were going to run pg on a 4 cpu > (ultrasparc ii 400Mhz) sun with 4gb of memory (also the current informix > box. It isn't very loaded). Now I know FreeBSD/Linux is preferred (and > where I do a lot of development and testing). But check this out for > interesting results. > > The Hardware: > Machine A: 4 CPU Sun Ultrasparc II 400Mhz, 4GB mem, 20GB RAID5, Solaris 8 > (32 bit mode) > > Machine B: 2 CPU Pentium II, 450Mhz, 512MB mem, 18GB RAID0 (2 old scsi > disks) Linux 2.4.18 (Stock redhat 8.0) > > The software: PG 7.3.4 compiled myself. (Reading specs from > /opt/sfw/lib/gcc-lib/sparc-sun-solaris2.9/2.95.3/specs gcc version 2.95.3 > 20010315 (release) (The solaris 8 box has no compilers, could this be the > issue?) and (Reading specs from > /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs > Configured with: ../configure --prefix=3D/usr --mandir=3D/usr/share/man > --infodir=3D/u > sr/share/info --enable-shared --enable-threads=3Dposix --disable-checking > --host=3Di > 386-redhat-linux --with-system-zlib --enable-__cxa_atexit > Thread model: posix > gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)) > > Ok. Maybe the compiler (I'll try installing a newer gcc for sun later > today). > > The PG.conf: > shared_buffers =3D 2000 > sort_mem =3D 8192 > effective_cache_size =3D 32000 > tcpip_sockets =3D true > > The Schema: > > userprofile: > > userkey | character varying(128) | > displayname | character varying(128) | > displayname_v | boolean | default 'f' > name | character varying(128) | > name_v | boolean | default 'f' > email | character varying(128) | > email_v | boolean | default 'f' > gender | character varying(1) | > gender_v | boolean | default 'f' > country | character varying(64) | > country_v | boolean | default 'f' > zip | character varying(10) | > zip_v | boolean | default 'f' > city | character varying(128) | > city_v | boolean | default 'f' > state | character varying(10) | > state_v | boolean | default 'f' > lang | character varying(2) | > lang_v | boolean | default 'f' > url | character varying(255) | > url_v | boolean | default 'f' > phone | character varying(64) | > phone_v | boolean | default 'f' > phonemobile | character varying(64) | > phonemobile_v | boolean | default 'f' > phonefax | character varying(64) | > phonefax_v | boolean | default 'f' > dob | timestamp with time zone | > dob_v | boolean | default 'f' > interests_v | boolean | default 'f' > description | character varying(255) | > description2 | character varying(255) | > description_v | boolean | default 'f' > > (Yes, I kknow it isn't good - a lot of it is because it is the same schema > I had to use on informix. Convienantly you cannot do much with a textblob > on infomrix, so I have to use big varchar's, but that is a fiffernt > story). > > The magic query: > > select userkey, dob, email, gender, country from imuserprofile > where gender_v and gender=3D'm' > and country_v and country =3D 'br' > and dob_v =3D 't' > and dob >=3D 'now'::timestamptz - '29 years'::interval > and dob <=3D 'now'::timestamptz - '18 years'::interval > order by dob asc > limit 20 > offset 100 > > (Page 5 of male brazillians, 18-29) > > Now the P2 runs this in about 0.3 seconds, and hte sun box runs it in 1 > second. > Here's the explain analyze's on each: > > P2: > Limit (cost=3D2484.52..2484.57 rows=3D20 width=3D67) (actual > time=3D377.32..377.41 row > s=3D20 loops=3D1) > -> Sort (cost=3D2484.27..2484.74 rows=3D186 width=3D67) (actual > time=3D377.02..377. > 21 rows=3D121 loops=3D1) > Sort Key: dob > -> Seq Scan on userprofile (cost=3D0.00..2477.28 rows=3D186 > width=3D67) ( > actual time=3D0.15..350.93 rows=3D1783 loops=3D1) > Filter: (gender_v AND (gender =3D 'm'::character varying) = AND > count > ry_v AND (country =3D 'br'::character varying) AND (dob_v =3D true) AND (= dob > > >=3D '197 > > 4-08-26 07:13:15.903437-04'::timestamp with time zone) AND (dob <=3D > '1985-08-26 0 > 7:13:15.903437-04'::timestamp with time zone)) > Total runtime: 378.21 msec > (6 rows) > > Sun: > Limit (cost=3D2521.19..2521.24 rows=3D20 width=3D67) (actual > time=3D1041.14..1041.20 r > ows=3D20 loops=3D1) > -> Sort (cost=3D2520.94..2521.39 rows=3D178 width=3D67) (actual > time=3D1040.96..104 > 1.08 rows=3D121 loops=3D1) > Sort Key: dob > -> Seq Scan on userprofile (cost=3D0.00..2514.28 rows=3D178 > width=3D67) ( > actual time=3D0.37..1014.50 rows=3D1783 loops=3D1) > Filter: (gender_v AND (gender =3D 'm'::character varying) = AND > count > ry_v AND (country =3D 'br'::character varying) AND (dob_v =3D true) AND (= dob > > >=3D '197 > > 4-08-26 08:21:52.158181-04'::timestamp with time zone) AND (dob <=3D > '1985-08-26 0 > 8:21:52.158181-04'::timestamp with time zone)) > Total runtime: 1042.54 msec > (6 rows) > > They are loaded with the exact same dataset - 53k rows, ~10MB > Notice the estimates are roughly the same, but the execution time is > different. > > I don't think it is the IO system, since 10MB will be cached by the OS and > iostat reports no activity on the disks (when running the query many > times over and over and in parellel). it is a simple query.. > > Could it just be that the sun sucks? (And for the record - same schema, > nearly same query (modified for datetime syntax) on informix runs in 3 > seconds). --=20 Darcy Buskermolen Wavefire Technologies Corp. ph: 250.717.0200 fx: 250.763.1759 http://www.wavefire.com From pgsql-performance-owner@postgresql.org Tue Aug 26 15:05:15 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 14EDCD1B8AB for ; Tue, 26 Aug 2003 15:04:23 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 80764-03 for ; Tue, 26 Aug 2003 15:03:52 -0300 (ADT) Received: from mail2.dbitech.ca (radius.wavefire.com [64.141.13.252]) by svr1.postgresql.org (Postfix) with SMTP id 274A3D1B8BB for ; Tue, 26 Aug 2003 15:03:51 -0300 (ADT) Received: (qmail 16564 invoked from network); 26 Aug 2003 18:25:57 -0000 Received: from dbitech.wavefire.com (HELO dbitech) (darcy@64.141.15.253) by radius.wavefire.com with SMTP; 26 Aug 2003 18:25:57 -0000 Content-Type: text/plain; charset="iso-8859-1" From: Darcy Buskermolen Organization: Wavefire Technologies Corp. To: Jeff , pgsql-performance@postgresql.org Subject: Re: Sun vs a P2. Interesting results. Date: Tue, 26 Aug 2003 11:03:48 -0700 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308261103.48539.darcy@wavefire.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/340 X-Sequence-Number: 3156 Also, after having taken another look at this, you aren't preforming the sa= me=20 query on both datasets, so you can't expect them to generate the same=20 results, or the same query plans, or even comparable times. Please retry yo= ur=20 tests with identical queries , specify the dates, don;t use a function like= =20 now() to retrieve them. On Tuesday 26 August 2003 05:34, Jeff wrote: > Here's an interesting situation, and I think it may be just that Sun > stinks. > > I was recently given the go ahead to switch from Informix to Postgres on > one of our properties. (I had dozens of performance comparisons showing > how slow Informix was compared to it and my boss seeing me struggle trying > to make it run fast while Postgres, nearly out of the box, was simply > spanking it.). > > > Well, in order to facilitate things we were going to run pg on a 4 cpu > (ultrasparc ii 400Mhz) sun with 4gb of memory (also the current informix > box. It isn't very loaded). Now I know FreeBSD/Linux is preferred (and > where I do a lot of development and testing). But check this out for > interesting results. > > The Hardware: > Machine A: 4 CPU Sun Ultrasparc II 400Mhz, 4GB mem, 20GB RAID5, Solaris 8 > (32 bit mode) > > Machine B: 2 CPU Pentium II, 450Mhz, 512MB mem, 18GB RAID0 (2 old scsi > disks) Linux 2.4.18 (Stock redhat 8.0) > > The software: PG 7.3.4 compiled myself. (Reading specs from > /opt/sfw/lib/gcc-lib/sparc-sun-solaris2.9/2.95.3/specs gcc version 2.95.3 > 20010315 (release) (The solaris 8 box has no compilers, could this be the > issue?) and (Reading specs from > /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs > Configured with: ../configure --prefix=3D/usr --mandir=3D/usr/share/man > --infodir=3D/u > sr/share/info --enable-shared --enable-threads=3Dposix --disable-checking > --host=3Di > 386-redhat-linux --with-system-zlib --enable-__cxa_atexit > Thread model: posix > gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)) > > Ok. Maybe the compiler (I'll try installing a newer gcc for sun later > today). > > The PG.conf: > shared_buffers =3D 2000 > sort_mem =3D 8192 > effective_cache_size =3D 32000 > tcpip_sockets =3D true > > The Schema: > > userprofile: > > userkey | character varying(128) | > displayname | character varying(128) | > displayname_v | boolean | default 'f' > name | character varying(128) | > name_v | boolean | default 'f' > email | character varying(128) | > email_v | boolean | default 'f' > gender | character varying(1) | > gender_v | boolean | default 'f' > country | character varying(64) | > country_v | boolean | default 'f' > zip | character varying(10) | > zip_v | boolean | default 'f' > city | character varying(128) | > city_v | boolean | default 'f' > state | character varying(10) | > state_v | boolean | default 'f' > lang | character varying(2) | > lang_v | boolean | default 'f' > url | character varying(255) | > url_v | boolean | default 'f' > phone | character varying(64) | > phone_v | boolean | default 'f' > phonemobile | character varying(64) | > phonemobile_v | boolean | default 'f' > phonefax | character varying(64) | > phonefax_v | boolean | default 'f' > dob | timestamp with time zone | > dob_v | boolean | default 'f' > interests_v | boolean | default 'f' > description | character varying(255) | > description2 | character varying(255) | > description_v | boolean | default 'f' > > (Yes, I kknow it isn't good - a lot of it is because it is the same schema > I had to use on informix. Convienantly you cannot do much with a textblob > on infomrix, so I have to use big varchar's, but that is a fiffernt > story). > > The magic query: > > select userkey, dob, email, gender, country from imuserprofile > where gender_v and gender=3D'm' > and country_v and country =3D 'br' > and dob_v =3D 't' > and dob >=3D 'now'::timestamptz - '29 years'::interval > and dob <=3D 'now'::timestamptz - '18 years'::interval > order by dob asc > limit 20 > offset 100 > > (Page 5 of male brazillians, 18-29) > > Now the P2 runs this in about 0.3 seconds, and hte sun box runs it in 1 > second. > Here's the explain analyze's on each: > > P2: > Limit (cost=3D2484.52..2484.57 rows=3D20 width=3D67) (actual > time=3D377.32..377.41 row > s=3D20 loops=3D1) > -> Sort (cost=3D2484.27..2484.74 rows=3D186 width=3D67) (actual > time=3D377.02..377. > 21 rows=3D121 loops=3D1) > Sort Key: dob > -> Seq Scan on userprofile (cost=3D0.00..2477.28 rows=3D186 > width=3D67) ( > actual time=3D0.15..350.93 rows=3D1783 loops=3D1) > Filter: (gender_v AND (gender =3D 'm'::character varying) = AND > count > ry_v AND (country =3D 'br'::character varying) AND (dob_v =3D true) AND (= dob > > >=3D '197 > > 4-08-26 07:13:15.903437-04'::timestamp with time zone) AND (dob <=3D > '1985-08-26 0 > 7:13:15.903437-04'::timestamp with time zone)) > Total runtime: 378.21 msec > (6 rows) > > Sun: > Limit (cost=3D2521.19..2521.24 rows=3D20 width=3D67) (actual > time=3D1041.14..1041.20 r > ows=3D20 loops=3D1) > -> Sort (cost=3D2520.94..2521.39 rows=3D178 width=3D67) (actual > time=3D1040.96..104 > 1.08 rows=3D121 loops=3D1) > Sort Key: dob > -> Seq Scan on userprofile (cost=3D0.00..2514.28 rows=3D178 > width=3D67) ( > actual time=3D0.37..1014.50 rows=3D1783 loops=3D1) > Filter: (gender_v AND (gender =3D 'm'::character varying) = AND > count > ry_v AND (country =3D 'br'::character varying) AND (dob_v =3D true) AND (= dob > > >=3D '197 > > 4-08-26 08:21:52.158181-04'::timestamp with time zone) AND (dob <=3D > '1985-08-26 0 > 8:21:52.158181-04'::timestamp with time zone)) > Total runtime: 1042.54 msec > (6 rows) > > They are loaded with the exact same dataset - 53k rows, ~10MB > Notice the estimates are roughly the same, but the execution time is > different. > > I don't think it is the IO system, since 10MB will be cached by the OS and > iostat reports no activity on the disks (when running the query many > times over and over and in parellel). it is a simple query.. > > Could it just be that the sun sucks? (And for the record - same schema, > nearly same query (modified for datetime syntax) on informix runs in 3 > seconds). --=20 Darcy Buskermolen Wavefire Technologies Corp. ph: 250.717.0200 fx: 250.763.1759 http://www.wavefire.com From pgsql-performance-owner@postgresql.org Tue Aug 26 15:29:25 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 07626D1B897 for ; Tue, 26 Aug 2003 15:27:10 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 92056-01 for ; Tue, 26 Aug 2003 15:26:40 -0300 (ADT) Received: from home.samurai.com (home.samurai.com [205.207.28.66]) by svr1.postgresql.org (Postfix) with ESMTP id CA48ED1B8B7 for ; Tue, 26 Aug 2003 15:26:38 -0300 (ADT) Received: by home.samurai.com (Postfix, from userid 1014) id 409C92621E; Tue, 26 Aug 2003 14:26:24 -0400 (EDT) Date: Tue, 26 Aug 2003 14:26:24 -0400 From: Neil Conway To: Bupp Phillips Cc: pgsql-performance@postgresql.org Subject: Re: What is the fastest way to get a resultset Message-ID: <20030826182624.GF64198@home.samurai.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/341 X-Sequence-Number: 3157 On Tue, Aug 26, 2003 at 02:18:23AM -0700, Bupp Phillips wrote: > It there a way to get server side cursors with Postgresql like SQLServer has > or is this a limitation that it has? http://www.postgresql.org/docs/7.3/static/sql-declare.html http://www.postgresql.org/docs/7.3/static/sql-fetch.html -Neil From pgsql-performance-owner@postgresql.org Tue Aug 26 15:42: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 91FCAD1B8B4 for ; Tue, 26 Aug 2003 15:42:18 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 96370-01 for ; Tue, 26 Aug 2003 15:41:47 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id F06B6D1B8D0 for ; Tue, 26 Aug 2003 15:41:30 -0300 (ADT) Received: (qmail 20153 invoked from network); 26 Aug 2003 18:41:36 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 26 Aug 2003 18:41:36 -0000 Date: Tue, 26 Aug 2003 14:41:36 -0400 (EDT) From: Jeff To: Darcy Buskermolen Cc: "pgsql-performance@postgresql.org" Subject: Re: Sun vs a P2. Interesting results. In-Reply-To: <200308261103.48539.darcy@wavefire.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/342 X-Sequence-Number: 3158 On Tue, 26 Aug 2003, Darcy Buskermolen wrote: > Also, after having taken another look at this, you aren't preforming the same > query on both datasets, so you can't expect them to generate the same > results, or the same query plans, or even comparable times. Please retry your > tests with identical queries , specify the dates, don;t use a function like > now() to retrieve them. > Given what you said in the previous email and this one here's some new information. I redid the query to use a static starting time and I ran 19 beaters in parallel. After I send this mail out I'll try it with 40. New Query: select userkey, dob, email, gender, country from userprofile where gender_v and gender='m' and country_v and country = 'br' and dob_v and dob >= '2003-08-26'::timestamptz - '29 years'::interval and dob <= '2003-08-26'::timestamptz - '18 years'::interval order by dob asc limit 20 offset 100 Explain Analyze's: (basically the same) Sun: Limit (cost=2390.05..2390.10 rows=20 width=67) (actual time=1098.34..1098.39 rows=20 loops=1) -> Sort (cost=2389.80..2390.24 rows=178 width=67) (actual time=1098.16..1098.28 rows=121 loops=1) Sort Key: dob -> Seq Scan on imuserprofile (cost=0.00..2383.14 rows=178 width=67) (actual time=0.38..1068.94 rows=1783 loops=1) Filter: (gender_v AND (gender = 'm'::character varying) AND country_v AND (country = 'br'::character varying) AND dob_v AND (dob >= '1974-08-26 00:00:00-04'::timestamp with time zone) AND (dob <= '1985-08-26 00:00:00-04'::timestamp with time zone)) Total runtime: 1099.93 msec (6 rows) p2 Limit (cost=2353.38..2353.43 rows=20 width=67) (actual time=371.75..371.83 rows=20 loops=1) -> Sort (cost=2353.13..2353.60 rows=186 width=67) (actual time=371.46..371.63 rows=121 loops=1) Sort Key: dob -> Seq Scan on imuserprofile (cost=0.00..2346.14 rows=186 width=67) (actual time=0.17..345.53 rows=1783 loops=1) Filter: (gender_v AND (gender = 'm'::character varying) AND country_v AND (country = 'br'::character varying) AND dob_v AND (dob >= '1974-08-26 00:00:00-04'::timestamp with time zone) AND (dob <= '1985-08-26 00:00:00-04'::timestamp with time zone)) Total runtime: 372.63 msec (6 rows) I ran this query 100 times per beater (no prepared queries) and ran 19 beaters in parellel. P2 Machine: 345sec avg Sun: 565sec avg I know solaris/sun isn't the preferred pg platform, and we have plenty of capicty even with these numbers, I just find it a little suprising the speed difference. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Tue Aug 26 16:03:41 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 59967D1B8C3 for ; Tue, 26 Aug 2003 16:02:26 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 01238-04 for ; Tue, 26 Aug 2003 16:02:16 -0300 (ADT) Received: from mail2.dbitech.ca (radius.wavefire.com [64.141.13.252]) by svr1.postgresql.org (Postfix) with SMTP id CA3F3D1B8A5 for ; Tue, 26 Aug 2003 16:02:13 -0300 (ADT) Received: (qmail 20326 invoked from network); 26 Aug 2003 19:24:05 -0000 Received: from dbitech.wavefire.com (HELO dbitech) (darcy@64.141.15.253) by radius.wavefire.com with SMTP; 26 Aug 2003 19:24:05 -0000 Content-Type: text/plain; charset="iso-8859-1" From: Darcy Buskermolen Organization: Wavefire Technologies Corp. To: Jeff Subject: Re: Sun vs a P2. Interesting results. Date: Tue, 26 Aug 2003 12:01:55 -0700 User-Agent: KMail/1.4.3 Cc: "pgsql-performance@postgresql.org" References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308261201.55733.darcy@wavefire.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/343 X-Sequence-Number: 3159 I'm still seeing differences in the planner estimates, have you run a VACUU= M=20 ANALYZE prior to running these tests? Also, are the disk subsystems in these 2 systems the same? You may be seein= g=20 some discrepancies in things spindle speed, U160 vs U320, throughput on=20 specific RAID controlers, different blocksize, ect. On Tuesday 26 August 2003 11:41, Jeff wrote: > On Tue, 26 Aug 2003, Darcy Buskermolen wrote: > > Also, after having taken another look at this, you aren't preforming the > > same query on both datasets, so you can't expect them to generate the > > same results, or the same query plans, or even comparable times. Please > > retry your tests with identical queries , specify the dates, don;t use a > > function like now() to retrieve them. > > Given what you said in the previous email and this one here's some new > information. I redid the query to use a static starting time and I ran > 19 beaters in parallel. After I send this mail out I'll try it with 40. > > New Query: > > select userkey, dob, email, gender, country from userprofile > where gender_v and gender=3D'm' > and country_v and country =3D 'br' > and dob_v > and dob >=3D '2003-08-26'::timestamptz - '29 > years'::interval > and dob <=3D '2003-08-26'::timestamptz - '18 years'::interval > order by dob asc > limit 20 > offset 100 > > Explain Analyze's: (basically the same) > Sun: > Limit (cost=3D2390.05..2390.10 rows=3D20 width=3D67) (actual > time=3D1098.34..1098.39 rows=3D20 loops=3D1) > -> Sort (cost=3D2389.80..2390.24 rows=3D178 width=3D67) (actual > time=3D1098.16..1098.28 rows=3D121 loops=3D1) > Sort Key: dob > -> Seq Scan on imuserprofile (cost=3D0.00..2383.14 rows=3D178 > width=3D67) (actual time=3D0.38..1068.94 rows=3D1783 loops=3D1) > Filter: (gender_v AND (gender =3D 'm'::character varying) = AND > country_v AND (country =3D 'br'::character varying) AND dob_v AND (dob >= =3D > '1974-08-26 00:00:00-04'::timestamp with time zone) AND (dob <=3D > '1985-08-26 00:00:00-04'::timestamp with time zone)) > Total runtime: 1099.93 msec > (6 rows) > > > p2 > > Limit (cost=3D2353.38..2353.43 rows=3D20 width=3D67) (actual > time=3D371.75..371.83 rows=3D20 loops=3D1) > -> Sort (cost=3D2353.13..2353.60 rows=3D186 width=3D67) (actual > time=3D371.46..371.63 rows=3D121 loops=3D1) > Sort Key: dob > -> Seq Scan on imuserprofile (cost=3D0.00..2346.14 rows=3D186 > width=3D67) (actual time=3D0.17..345.53 rows=3D1783 loops=3D1) > Filter: (gender_v AND (gender =3D 'm'::character varying) = AND > country_v AND (country =3D 'br'::character varying) AND dob_v AND (dob >= =3D > '1974-08-26 00:00:00-04'::timestamp with time zone) AND (dob <=3D > '1985-08-26 00:00:00-04'::timestamp with time zone)) > Total runtime: 372.63 msec > (6 rows) > > > I ran this query 100 times per beater (no prepared queries) and ran > 19 beaters in parellel. > > P2 Machine: 345sec avg > Sun: 565sec avg > > > > I know solaris/sun isn't the preferred pg platform, and we have plenty of > capicty even with these numbers, I just find it a little suprising the > speed difference. --=20 Darcy Buskermolen Wavefire Technologies Corp. ph: 250.717.0200 fx: 250.763.1759 http://www.wavefire.com From pgsql-performance-owner@postgresql.org Tue Aug 26 16:07:24 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 740C8D1B8B4 for ; Tue, 26 Aug 2003 16:05:17 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 99833-10 for ; Tue, 26 Aug 2003 16:05:08 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id 5C384D1B8A5 for ; Tue, 26 Aug 2003 16:05:06 -0300 (ADT) Received: (qmail 20350 invoked from network); 26 Aug 2003 19:05:12 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 26 Aug 2003 19:05:12 -0000 Date: Tue, 26 Aug 2003 15:05:12 -0400 (EDT) From: Jeff To: Darcy Buskermolen Cc: "pgsql-performance@postgresql.org" Subject: Re: Sun vs a P2. Interesting results. In-Reply-To: <200308261201.55733.darcy@wavefire.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/344 X-Sequence-Number: 3160 On Tue, 26 Aug 2003, Darcy Buskermolen wrote: > I'm still seeing differences in the planner estimates, have you run a VACUUM > ANALYZE prior to running these tests? > I did. I shall retry that.. but the numbers (the cost estimates) are pretty close on both. the actual times are very different. > Also, are the disk subsystems in these 2 systems the same? You may be seeing > some discrepancies in things spindle speed, U160 vs U320, throughput on > specific RAID controlers, different blocksize, ect. > As I said in my first email IO isn't the problem here - the data set is small enough that it is all cached (~10MB). iostat reports 0 activity on the disks on both the sun and p2. and I just ran teh test again with 40 clients: 730s for hte p2, 1100 for the sun. (0% idle on both of them, no IO). I think the next I may try is recompiling with a newer gcc. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Tue Aug 26 16:43: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 843C1D1B8BD for ; Tue, 26 Aug 2003 16:38:04 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 13415-09 for ; Tue, 26 Aug 2003 16:37:31 -0300 (ADT) Received: from home.samurai.com (home.samurai.com [205.207.28.66]) by svr1.postgresql.org (Postfix) with ESMTP id 08628D1B8AD for ; Tue, 26 Aug 2003 16:37:29 -0300 (ADT) Received: by home.samurai.com (Postfix, from userid 1014) id 964B42622B; Tue, 26 Aug 2003 15:37:29 -0400 (EDT) Date: Tue, 26 Aug 2003 15:37:29 -0400 From: Neil Conway To: Jeff Cc: Darcy Buskermolen , "pgsql-performance@postgresql.org" Subject: Re: Sun vs a P2. Interesting results. Message-ID: <20030826193729.GG64198@home.samurai.com> References: <200308261201.55733.darcy@wavefire.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/345 X-Sequence-Number: 3161 On Tue, Aug 26, 2003 at 03:05:12PM -0400, Jeff wrote: > On Tue, 26 Aug 2003, Darcy Buskermolen wrote: > > I'm still seeing differences in the planner estimates, have you run a VACUUM > > ANALYZE prior to running these tests? > > > I did. I shall retry that.. but the numbers (the cost estimates) are > pretty close on both. the actual times are very different. I don't see why you need to bother, the query plans & cost estimates are similar enough I doubt that's the problem. > As I said in my first email IO isn't the problem here - the data set is > small enough that it is all cached (~10MB). iostat reports 0 activity on > the disks on both the sun and p2. Would it be possible to get a profile (e.g. gprof output) for a postgres backend executing the query on the Sun machine? -Neil From pgsql-performance-owner@postgresql.org Thu Aug 28 00:13: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 75895D1B56C for ; Tue, 26 Aug 2003 19:13:17 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 62676-02 for ; Tue, 26 Aug 2003 19:12:47 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 3E239D1B8B3 for ; Tue, 26 Aug 2003 19:12:41 -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 h7QMBPxD014542; Tue, 26 Aug 2003 16:11:26 -0600 (MDT) Date: Tue, 26 Aug 2003 16:10:35 -0600 (MDT) From: "scott.marlowe" To: JM Cc: PgSQL Performance ML Subject: Re: Best tweak for fast results.. ? In-Reply-To: <200308262142.52521.jerome@gmanmi.tv> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner-ihs-com: Found to be clean X-MailScanner-SpamCheck-ihs-com: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/381 X-Sequence-Number: 3197 On Tue, 26 Aug 2003, JM wrote: > need input on parameter values on confs... > > our database is getting 1000 transactions/sec on peak periods.. > > sitting on RH 7.3 > 2.4.7-10smp > RAM: 1028400 > SWAP: 2040244 1: Upgrade your kernel. 2.4.7 on RH3 was updated to 2.4.18-24 in March, and the 2.4.18 kernel is MUCH faster and has many bugs squashed. 2: Upgrade to the latest stable version of postgresql, 7.3.4 3: Make sure your kernels file-nr settings, and shm settings are big enough to handle load. 4: Edit the $PGDATA/postgresql.conf file to reflect all that extra cache you've got etc.... shared_buffers = 5000 sort_mem = 16384 effective_cache_size = (size of cache/buffer mem divided by 8192) 5: Look at moving WAL to it's own spindle(s), as it is often the choke point when doing lots of transactions. 6: Look at using more drives in a RAID 1+0 array for the data (as well as a seperate one for WAL if you can afford it.) 7: Make sure your drives are mounted noatime. 8: If you don't mind living dangerously, or the data can be reproduced from source files (i.e. catastrophic failure of your data set won't set you back) look at both mounting the drives async (the default for linux, slightly dangerous) and turning fsync off (quite dangerous, in case of crashed hardware / OS, you very well might lose data. From pgsql-performance-owner@postgresql.org Tue Aug 26 22:39: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 8EC93D1B8AB for ; Tue, 26 Aug 2003 22:35:57 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 17324-02 for ; Tue, 26 Aug 2003 22:35:30 -0300 (ADT) Received: from wight.ymogen.net (unknown [217.27.240.153]) by svr1.postgresql.org (Postfix) with SMTP id 692C8D1B8A5 for ; Tue, 26 Aug 2003 22:35:25 -0300 (ADT) Received: (qmail 17552 invoked from network); 27 Aug 2003 01:35:13 -0000 Received: from dsl-217-155-239-50.zen.co.uk (217.155.239.50) by wight.ymogen.net with SMTP; 27 Aug 2003 01:35:13 -0000 Subject: Hardware recommendations to scale to silly load From: matt To: pgsql-performance@postgresql.org Content-Type: text/plain Organization: Message-Id: <1061948112.15800.53.camel@gibraltar.mattclark.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 27 Aug 2003 02:35:13 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/346 X-Sequence-Number: 3162 I'm wondering if the good people out there could perhaps give me some pointers on suitable hardware to solve an upcoming performance issue. I've never really dealt with these kinds of loads before, so any experience you guys have would be invaluable. Apologies in advance for the amount of info below... My app is likely to come under some serious load in the next 6 months, but the increase will be broadly predictable, so there is time to throw hardware at the problem. Currently I have a ~1GB DB, with the largest (and most commonly accessed and updated) two tables having 150,000 and 50,000 rows. A typical user interaction with the system involves about 15 single-table selects, 5 selects with joins or subqueries, 3 inserts, and 3 updates. The current hardware probably (based on benchmarking and profiling) tops out at about 300 inserts/updates *or* 2500 selects per second. There are multiple indexes on each table that updates & inserts happen on. These indexes are necessary to provide adequate select performance. Current hardware/software: Quad 700MHz PIII Xeon/1MB cache 3GB RAM RAID 10 over 4 18GB/10,000rpm drives 128MB battery backed controller cache with write-back enabled Redhat 7.3, kernel 2.4.20 Postgres 7.2.3 (stock redhat issue) I need to increase the overall performance by a factor of 10, while at the same time the DB size increases by a factor of 50. e.g. 3000 inserts/updates or 25,000 selects per second, over a 25GB database with most used tables of 5,000,000 and 1,000,000 rows. Notably, the data is very time-sensitive, so the active dataset at any hour is almost certainly going to be more on the order of 5GB than 25GB (plus I'll want all the indexes in RAM of course). Also, and importantly, the load comes but one hour per week, so buying a Starfire isn't a real option, as it'd just sit idle the rest of the time. I'm particularly interested in keeping the cost down, as I'm a shareholder in the company! So what do I need? Can anyone who has (or has ever had) that kind of load in production offer any pointers, anecdotes, etc? Any theoretical musings also more than welcome. Comments upon my sanity will be referred to my doctor. If the best price/performance option is a second hand 32-cpu Alpha running VMS I'd be happy to go that way ;-) Many thanks for reading this far. Matt From pgsql-general-owner@postgresql.org Tue Aug 26 22:48:58 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C6AFED1B8C0 for ; Tue, 26 Aug 2003 22:45:03 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 18277-05 for ; Tue, 26 Aug 2003 22:44:36 -0300 (ADT) Received: from smtp018.mail.yahoo.com (smtp018.mail.yahoo.com [216.136.174.115]) by svr1.postgresql.org (Postfix) with SMTP id 173DED1B523 for ; Tue, 26 Aug 2003 22:44:32 -0300 (ADT) Received: from pcp01341166pcs.wilog301.pa.comcast.net (HELO europa.janwieck.net) (janwieck@68.80.245.191 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 27 Aug 2003 01:44:35 -0000 Received: from Yahoo.com (ganymed.janwieck.net [192.168.192.17]) (authenticated) by europa.janwieck.net (8.11.6/8.11.6) with ESMTP id h7R1iQ621159; Tue, 26 Aug 2003 21:44:29 -0400 Message-ID: <3F4C0CAE.3030901@Yahoo.com> Date: Tue, 26 Aug 2003 21:43:10 -0400 From: Jan Wieck Organization: Unorganized User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Chris Travers Cc: Tom Lane , Alvaro Herrera , Ron Johnson , pgsql-general@postgresql.org Subject: Re: Replication Ideas References: <3F483EBD.3020108@travelamericas.com> <1061705587.3733.452.camel@haggis> <3F4A420E.6090604@travelamericas.com> <20030825182441.GB9597@dcc.uchile.cl> <3F4A5724.3060002@travelamericas.com> <11627.1061845759@sss.pgh.pa.us> <3F4A8A7D.30308@travelamericas.com> In-Reply-To: <3F4A8A7D.30308@travelamericas.com> 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: 200308/1424 X-Sequence-Number: 47840 WARNING: This is getting long ... Postgres-R is a very interesting and inspiring idea. And I've been kicking that concept around for a while now. What I don't like about it is that it requires fundamental changes in the lock mechanism and that it is based on the assumption of very low lock conflict. In Postgres-R a committing transaction sends it's workset (WS - a list of all updates done in this transaction) to the group communication system (GC). The GC guarantees total order, meaning that all nodes will receive all WSs in the same order, no matter how they have been sent. If a node receives back it's own WS before any error occured, it goes ahead and finalizes the commit. If it receives a foreign WS, it has to apply the whole WS and commit it before it can process anything else. If now a local transaction, in progress or while waiting for it's WS to come back, holds a lock that is required to process such remote WS, the local transaction needs to be aborted to unlock it's resources ... it lost the total order race. Postgres-R requires that all remote WSs are applied and committed before a local transaction can commit. Otherwise it couldn't correctly detect a lock conflict. So there will not be any read ahead. And since the total order really counts here, it cannot apply any two remote WSs in parallel, a race condition could possibly exist and a later WS in the total order runs faster and locks up a previous one, so we have to squeeze all remote WSs through one single replication work process. And all the locally parallel executed transactions that wait for their WSs to come back have to wait until that poor little worker is done with the whole pile. Bye bye concurrency. And I don't know how the GC will deal with the backlog either. Could well choke on it. I do not see how this will scale well in a multi-SMP-system cluster. At least the serialization of WSs will become a horror if there is significant lock contention like in a standard TPC-C on the district row containing the order number counter. I don't know for sure, but I suspect that with this kind of bottleneck, Postgres-R will have to rollback more than 50% of it's transactions when there are more than 4 nodes under heavy load (like in a benchmark run). That will suck ... But ... initially I said that it is an inspiring concept ... soooo ... I am currently hacking around with some C+PL/TclU+Spread constructs that might form a rude kind of prototype creature. My changes to the Postgres-R concept are that there will be as many replicating slave processes as there are in summary masters out in the cluster ... yes, it will try to utilize all the CPU's in the cluster! For failover reliability, A committing transaction will hold before finalizing the commit and send it's "I'm ready" to the GC. Every replicator that reaches the same state send's "I'm ready" too. Spread guarantees in SAFE_MESS mode that messages are delivered to all nodes in a group or that at least LEAVE/DISCONNECT messages are deliverd before. So if a node receives more than 50% of "I'm ready", there would be a very small gap where multiple nodes have to fail in the same split second so that the majority of nodes does NOT commit. A node that reported "I'm ready" but lost more than 50% of the cluster before committing has to rollback and rejoin or wait for operator intervention. Now the idea is to split up the communication into GC distribution groups per transaction. So working master backends and associated replication backends will join/leave a unique group for every transaction in the cluster. This way, the per process communication is reduced to the required minimum. As said, I am hacking on some code ... Jan Chris Travers wrote: > Tom Lane wrote: > >>Chris Travers writes: >> >> >>>Yes I have. Postgres-r is not a high-availability solution which is >>>capable of transparent failover, >>> >>> >> >>What makes you say that? My understanding is it's supposed to survive >>loss of individual servers. >> >> regards, tom lane >> >> >> >> > My mistake. I must have gotten them confused with another > (asynchronous) replication project. > > Best Wishes, > Chris Travers > > > ---------------------------(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 -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com # From pgsql-performance-owner@postgresql.org Wed Aug 27 23:54:26 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 9BA43D1B8BF for ; Tue, 26 Aug 2003 22:48:30 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 17416-10 for ; Tue, 26 Aug 2003 22:48:03 -0300 (ADT) Received: from mta5.adelphia.net (mta5.adelphia.net [68.168.78.187]) by svr1.postgresql.org (Postfix) with ESMTP id 285C5D1B8A4 for ; Tue, 26 Aug 2003 22:47:44 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta5.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030827014749.ZYNY7719.mta5.adelphia.net@potentialtech.com> for ; Tue, 26 Aug 2003 21:47:49 -0400 Message-ID: <3F4C0DC4.8070105@potentialtech.com> Date: Tue, 26 Aug 2003 21:47:48 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: The results of my PostgreSQL/filesystem performance tests 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: 200308/379 X-Sequence-Number: 3195 Hey all. I said I was going to do it, and I finally did it. As with all performance tests/benchmarks, there are probably dozens or more reasons why these results aren't as accurate or wonderful as they should be. Take them for what they are and hopefully everyone can learn a few things from them. Intelligent feedback is welcome. http://www.potentialtech.com/wmoran/postgresql.php -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Wed Aug 27 23:53: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 00019D1B89B for ; Tue, 26 Aug 2003 23:12:03 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 28783-04 for ; Tue, 26 Aug 2003 23:11:48 -0300 (ADT) Received: from mta8.adelphia.net (mta8.adelphia.net [68.168.78.196]) by svr1.postgresql.org (Postfix) with ESMTP id 7A68DD1B52C for ; Tue, 26 Aug 2003 23:11:44 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta8.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030827021150.YAPV18971.mta8.adelphia.net@potentialtech.com>; Tue, 26 Aug 2003 22:11:50 -0400 Message-ID: <3F4C1364.6080602@potentialtech.com> Date: Tue, 26 Aug 2003 22:11:48 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: matt Cc: pgsql-performance@postgresql.org Subject: Re: Hardware recommendations to scale to silly load References: <1061948112.15800.53.camel@gibraltar.mattclark.net> In-Reply-To: <1061948112.15800.53.camel@gibraltar.mattclark.net> 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: 200308/378 X-Sequence-Number: 3194 matt wrote: > I'm wondering if the good people out there could perhaps give me some > pointers on suitable hardware to solve an upcoming performance issue. > I've never really dealt with these kinds of loads before, so any > experience you guys have would be invaluable. Apologies in advance for > the amount of info below... > > My app is likely to come under some serious load in the next 6 months, > but the increase will be broadly predictable, so there is time to throw > hardware at the problem. > > Currently I have a ~1GB DB, with the largest (and most commonly accessed > and updated) two tables having 150,000 and 50,000 rows. > > A typical user interaction with the system involves about 15 > single-table selects, 5 selects with joins or subqueries, 3 inserts, and > 3 updates. The current hardware probably (based on benchmarking and > profiling) tops out at about 300 inserts/updates *or* 2500 selects per > second. > > There are multiple indexes on each table that updates & inserts happen > on. These indexes are necessary to provide adequate select performance. Are you sure? Have you tested the overall application to see if possibly you gain more on insert performance than you lose on select performanc? (Hey, you asked for musings ...) > Current hardware/software: > Quad 700MHz PIII Xeon/1MB cache > 3GB RAM > RAID 10 over 4 18GB/10,000rpm drives > 128MB battery backed controller cache with write-back enabled > Redhat 7.3, kernel 2.4.20 > Postgres 7.2.3 (stock redhat issue) It's possible that compiling Postgres manually with proper optimizations could yield some improvements, as well as building a custom kernel in Redhat. Also, you don't mention which filesystem you're using: http://www.potentialtech.com/wmoran/postgresql.php > I need to increase the overall performance by a factor of 10, while at > the same time the DB size increases by a factor of 50. e.g. 3000 > inserts/updates or 25,000 selects per second, over a 25GB database with > most used tables of 5,000,000 and 1,000,000 rows. > > Notably, the data is very time-sensitive, so the active dataset at any > hour is almost certainly going to be more on the order of 5GB than 25GB > (plus I'll want all the indexes in RAM of course). > > Also, and importantly, the load comes but one hour per week, so buying a > Starfire isn't a real option, as it'd just sit idle the rest of the > time. I'm particularly interested in keeping the cost down, as I'm a > shareholder in the company! I can't say for sure without looking at your application overall, but many applications I've seen could be optimized. It's usually a few seconds here and there that take hours to find and tweak. But if you're in the situation where you have more time than money, you may find that an overall audit of your app is worthwhile. Consider taking parts that are in perl (for example) and recoding them into C (that is, unless you've already identified that all the bottlenecks are at the PostgreSQL server) I doubt if the suggestions I've made are going to get you 10x, but they may get you 2x, and then you only need the hardware to do 5x. -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Wed Aug 27 23:50:51 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 46820D1B8C3 for ; Tue, 26 Aug 2003 23:59:19 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 36852-06 for ; Tue, 26 Aug 2003 23:59:07 -0300 (ADT) Received: from lakemtao01.cox.net (lakemtao01.cox.net [68.1.17.244]) by svr1.postgresql.org (Postfix) with ESMTP id 8A48ED1B52C for ; Tue, 26 Aug 2003 23:59:07 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao01.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030827025906.QRSV5378.lakemtao01.cox.net@lhosts> for ; Tue, 26 Aug 2003 22:59:06 -0400 Subject: Re: Hardware recommendations to scale to silly load From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <1061948112.15800.53.camel@gibraltar.mattclark.net> References: <1061948112.15800.53.camel@gibraltar.mattclark.net> Content-Type: text/plain Message-Id: <1061953146.18108.291.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Tue, 26 Aug 2003 21:59:06 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/377 X-Sequence-Number: 3193 On Tue, 2003-08-26 at 20:35, matt wrote: > I'm wondering if the good people out there could perhaps give me some > pointers on suitable hardware to solve an upcoming performance issue. > I've never really dealt with these kinds of loads before, so any > experience you guys have would be invaluable. Apologies in advance for > the amount of info below... > > My app is likely to come under some serious load in the next 6 months, > but the increase will be broadly predictable, so there is time to throw > hardware at the problem. > > Currently I have a ~1GB DB, with the largest (and most commonly accessed > and updated) two tables having 150,000 and 50,000 rows. > > A typical user interaction with the system involves about 15 > single-table selects, 5 selects with joins or subqueries, 3 inserts, and > 3 updates. The current hardware probably (based on benchmarking and > profiling) tops out at about 300 inserts/updates *or* 2500 selects per > second. > > There are multiple indexes on each table that updates & inserts happen > on. These indexes are necessary to provide adequate select performance. > > Current hardware/software: > Quad 700MHz PIII Xeon/1MB cache > 3GB RAM > RAID 10 over 4 18GB/10,000rpm drives > 128MB battery backed controller cache with write-back enabled Much more cache needed. Say 512MB per controller? > Redhat 7.3, kernel 2.4.20 > Postgres 7.2.3 (stock redhat issue) Upgrade to Pg 7.3.4! > I need to increase the overall performance by a factor of 10, while at > the same time the DB size increases by a factor of 50. e.g. 3000 Are you *sure* about that???? 3K updates/inserts per second xlates to 10,800,000 per hour. That, my friend, is a WHOLE HECK OF A LOT! > inserts/updates or 25,000 selects per second, over a 25GB database with Likewise: 90,000,000 selects per hour. > most used tables of 5,000,000 and 1,000,000 rows. > > Notably, the data is very time-sensitive, so the active dataset at any During the 1 hour surge, will SELECTs at 10 minutes after the hour depend on INSERTs at 5 minutes after the hour? If not, maybe you could pump the INSERT/UPDATE records into flat files, to be processed after the 1-hour surge is complete. That may reduce the h/w requirements. > hour is almost certainly going to be more on the order of 5GB than 25GB > (plus I'll want all the indexes in RAM of course). > > Also, and importantly, the load comes but one hour per week, so buying a Only one hour out of 168????? May I ask what kind of app it is? > Starfire isn't a real option, as it'd just sit idle the rest of the > time. I'm particularly interested in keeping the cost down, as I'm a > shareholder in the company! What a fun exercises. Ok, lets see: Postgres 7.3.4 RH AS 2.1 12GB RAM motherboard with 64 bit 66MHz PCI slots 4 - Xenon 3.0GHz (1MB cache) CPUs 8 - 36GB 15K RPM as RAID10 on a 64 bit 66MHz U320 controller having 512MB cache (for database) 2 - 36GB 15K RPM as RAID1 on a 64 bit 66MHz U320 controller having 512MB cache (for OS, swap, WAL files) 1 - library tape drive plugged into the OS' SCSI controller. I prefer DLT, but that's my DEC bias. 1 - 1000 volt UPS. If you know when the flood will be coming, you could perform SELECT * FROM ... WHERE statements on an indexed field, to pull the relevant data into Linux's buffers. Yes, the 8 disks is capacity-overkill, but the 8 high-speed spindles is what you're looking for. > So what do I need? Can anyone who has (or has ever had) that kind of > load in production offer any pointers, anecdotes, etc? Any theoretical > musings also more than welcome. Comments upon my sanity will be > referred to my doctor. > > If the best price/performance option is a second hand 32-cpu Alpha > running VMS I'd be happy to go that way ;-) I'd love to work on a GS320! You may even pick one up for a million or 2. The license costs for VMS & Rdb would eat you, though. Rdb *does* have ways, though, using large buffers and hashed indexes, with the table tuples stored on the same page as the hashed index keys, to make such accesses *blazingly* fast. > Many thanks for reading this far. -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "A C program is like a fast dance on a newly waxed dance floor by people carrying razors." Waldi Ravens From pgsql-hackers-owner@postgresql.org Wed Aug 27 04:51:53 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 11DD7D1B8A4 for ; Wed, 27 Aug 2003 00:26:34 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 49743-09 for ; Wed, 27 Aug 2003 00:26:23 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 92508D1B8C5 for ; Wed, 27 Aug 2003 00:26:21 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7R3PfI24921; Tue, 26 Aug 2003 23:25:41 -0400 (EDT) From: Bruce Momjian Message-Id: <200308270325.h7R3PfI24921@candle.pha.pa.us> Subject: Re: [GENERAL] Replication Ideas In-Reply-To: <3F4C0CAE.3030901@Yahoo.com> To: Jan Wieck Date: Tue, 26 Aug 2003 23:25:41 -0400 (EDT) Cc: Chris Travers , Tom Lane , Alvaro Herrera , Ron Johnson , PostgreSQL-development X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1092 X-Sequence-Number: 42749 [ Moved to hackers.] Jan Wieck wrote: > I am currently hacking around with some C+PL/TclU+Spread constructs that > might form a rude kind of prototype creature. > > My changes to the Postgres-R concept are that there will be as many > replicating slave processes as there are in summary masters out in the > cluster ... yes, it will try to utilize all the CPU's in the cluster! Interesting --- so your idea is to have the group sets run in parallel, and detecting if the groups themselves are in conflict --- makes sense. If you can detect if outside transactions conflict with your transaction, you should be able to determine if the outside transactions conflict with each other. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-hackers-owner@postgresql.org Wed Aug 27 00:42:22 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 8694ED1B915 for ; Wed, 27 Aug 2003 00:37:45 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 51036-10 for ; Wed, 27 Aug 2003 00:37:34 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 3F472D1B8B9 for ; Wed, 27 Aug 2003 00:37:34 -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 h7R3bB5H006359; Tue, 26 Aug 2003 23:37:11 -0400 (EDT) To: Bruce Momjian Cc: Jan Wieck , Chris Travers , Alvaro Herrera , Ron Johnson , PostgreSQL-development Subject: Re: [GENERAL] Replication Ideas In-reply-to: <200308270325.h7R3PfI24921@candle.pha.pa.us> References: <200308270325.h7R3PfI24921@candle.pha.pa.us> Comments: In-reply-to Bruce Momjian message dated "Tue, 26 Aug 2003 23:25:41 -0400" Date: Tue, 26 Aug 2003 23:37:10 -0400 Message-ID: <6358.1061955430@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1087 X-Sequence-Number: 42744 Bruce Momjian writes: > If you can detect if outside transactions conflict with your > transaction, you should be able to determine if the outside transactions > conflict with each other. Uh ... not necessarily. That amounts to assuming that every xact has complete knowledge of the actions of every other, which is an assumption I'd rather not make. Detecting that what you've done conflicts with someone else is one thing, detecting that party B has conflicted with party C is another league entirely. regards, tom lane From pgsql-hackers-owner@postgresql.org Wed Aug 27 04:37:20 2003 X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 6D7D8D1B94F for ; Wed, 27 Aug 2003 00:58:11 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 57363-10 for ; Wed, 27 Aug 2003 00:57:59 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 51069D1B8B4 for ; Wed, 27 Aug 2003 00:57:57 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7R3vQQ27987; Tue, 26 Aug 2003 23:57:26 -0400 (EDT) From: Bruce Momjian Message-Id: <200308270357.h7R3vQQ27987@candle.pha.pa.us> Subject: Re: [GENERAL] Replication Ideas In-Reply-To: <6358.1061955430@sss.pgh.pa.us> To: Tom Lane Date: Tue, 26 Aug 2003 23:57:26 -0400 (EDT) Cc: Jan Wieck , Chris Travers , Alvaro Herrera , Ron Johnson , PostgreSQL-development X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1091 X-Sequence-Number: 42748 Tom Lane wrote: > Bruce Momjian writes: > > If you can detect if outside transactions conflict with your > > transaction, you should be able to determine if the outside transactions > > conflict with each other. > > Uh ... not necessarily. That amounts to assuming that every xact has > complete knowledge of the actions of every other, which is an assumption > I'd rather not make. Detecting that what you've done conflicts with > someone else is one thing, detecting that party B has conflicted with > party C is another league entirely. Yep. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Wed Aug 27 01:09: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 6E186D1B8BD for ; Wed, 27 Aug 2003 01:08:16 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 62221-03 for ; Wed, 27 Aug 2003 01:08:05 -0300 (ADT) Received: from symler1.mail.eds.com (symler1.mail.eds.com [207.169.189.141]) by svr1.postgresql.org (Postfix) with ESMTP id 1A975D1B8B3 for ; Wed, 27 Aug 2003 01:08:04 -0300 (ADT) Received: from symlir1.mail.eds.com (symlir1.mail.eds.com [192.85.216.71]) by symler1.mail.eds.com (8.11.6/8.11.6) with ESMTP id h7R482s13336 for ; Wed, 27 Aug 2003 14:08:03 +1000 Received: from symlir1.mail.eds.com (localhost [127.0.0.1]) by symlir1.mail.eds.com (8.11.6p2/8.11.6) with ESMTP id h7R482611225 for ; Wed, 27 Aug 2003 14:08:02 +1000 Received: from ausym000.exau01.exch.eds.com ([134.251.177.117]) by symlir1.mail.eds.com (8.11.6p2/8.11.6) with ESMTP id h7R482i11211 for ; Wed, 27 Aug 2003 14:08:02 +1000 Received: by ausym000.exau01.exch.eds.com with Internet Mail Service (5.5.2656.59) id ; Wed, 27 Aug 2003 14:08:01 +1000 Message-ID: From: "Castle, Lindsay" To: pgsql-performance@postgresql.org Subject: 8 way Intel Xeon system Date: Wed, 27 Aug 2003 14:07:56 +1000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2656.59) Content-Type: text/plain X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=BAYES_30, RCVD_IN_OSIRUSOFT_COM X-Spam-Level: X-Archive-Number: 200308/347 X-Sequence-Number: 3163 Hi all, Hopefully a quick query. Is there anything special I should look at when configuring either PostgreSQL and Linux to work together on an 8-way Intel P-III based system? I currently have the database system running fairly nicely on a 2 CPU Pentium-II 400 server with 512MB memory, hardware RAID with 32MB cache on the controllers, unfortunately the db file systems are RAID-5 but I am not in a position to change that. I'm mainly interested in what I should concentrate on from a Linux/PostgreSQL config point of view to see if we can take advantage of the extra CPUs. - Yes it's overkill but this is a piece of surplus hardware we don't have to buy. Perhaps some may say Linux isn't the best option for an 8 CPU server but this is what I have to work with for reasons we won't get into :-) The current usage is along the lines of a few thousands updates spread over the space of a few hours in the morning then followed by a thousand select queries to do some reporting. The server also runs an apache web server for people to access but is only used to view html files on a fairly ad-hoc basis, nothing serious on the web side of things. Currently RedHat 9 with PostgreSQL 7.3.2 installed. Thanks for your time Linz From pgsql-general-owner@postgresql.org Wed Aug 27 02:57:15 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id B0F4BD1B914 for ; Wed, 27 Aug 2003 01:38:12 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 71635-06 for ; Wed, 27 Aug 2003 01:37:41 -0300 (ADT) Received: from phaze.fireserve.net (phaze.fireserve.net [207.109.249.2]) by svr1.postgresql.org (Postfix) with ESMTP id 88819D1B8BF for ; Wed, 27 Aug 2003 01:37:36 -0300 (ADT) Received: from fireserve.net (dh0032.moore-s.fireserve.net [207.109.249.161]) by phaze.fireserve.net (8.11.6p2/linuxconf) with ESMTP id h7R4Ymt26977; Tue, 26 Aug 2003 21:34:48 -0700 Message-ID: <3F4C34B7.3050307@fireserve.net> Date: Tue, 26 Aug 2003 21:33:59 -0700 From: Dennis Gearon User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en, ru MIME-Version: 1.0 To: Jan Wieck Cc: Chris Travers , Tom Lane , Alvaro Herrera , Ron Johnson , pgsql-general@postgresql.org Subject: Re: Replication Ideas References: <3F483EBD.3020108@travelamericas.com> <1061705587.3733.452.camel@haggis> <3F4A420E.6090604@travelamericas.com> <20030825182441.GB9597@dcc.uchile.cl> <3F4A5724.3060002@travelamericas.com> <11627.1061845759@sss.pgh.pa.us> <3F4A8A7D.30308@travelamericas.com> <3F4C0CAE.3030901@Yahoo.com> In-Reply-To: <3F4C0CAE.3030901@Yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MailScanner: Found to be clean X-MailScanner-SpamCheck: not spam, SpamAssassin (Disabled due to 20 consecutive timeouts) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1434 X-Sequence-Number: 47850 Jan Wieck wrote: > WARNING: This is getting long ... > > Postgres-R is a very interesting and inspiring idea. And I've been > kicking that concept around for a while now. What I don't like about > it is that it requires fundamental changes in the lock mechanism and > that it is based on the assumption of very low lock conflict. > > > In Postgres-R a committing transaction sends it's workset (WS - a list > of all updates done in this transaction) to the group communication > system (GC). The GC guarantees total order, meaning that all nodes > will receive all WSs in the same order, no matter how they have been > sent. > > If a node receives back it's own WS before any error occured, it goes > ahead and finalizes the commit. If it receives a foreign WS, it has to > apply the whole WS and commit it before it can process anything else. > If now a local transaction, in progress or while waiting for it's WS > to come back, holds a lock that is required to process such remote WS, > the local transaction needs to be aborted to unlock it's resources ... > it lost the total order race. > > > Postgres-R requires that all remote WSs are applied and committed > before a local transaction can commit. Otherwise it couldn't correctly > detect a lock conflict. So there will not be any read ahead. And since > the total order really counts here, it cannot apply any two remote WSs > in parallel, a race condition could possibly exist and a later WS in > the total order runs faster and locks up a previous one, so we have to > squeeze all remote WSs through one single replication work process. > And all the locally parallel executed transactions that wait for their > WSs to come back have to wait until that poor little worker is done > with the whole pile. Bye bye concurrency. And I don't know how the GC > will deal with the backlog either. Could well choke on it. > > I do not see how this will scale well in a multi-SMP-system cluster. > At least the serialization of WSs will become a horror if there is > significant lock contention like in a standard TPC-C on the district > row containing the order number counter. I don't know for sure, but I > suspect that with this kind of bottleneck, Postgres-R will have to > rollback more than 50% of it's transactions when there are more than 4 > nodes under heavy load (like in a benchmark run). That will suck ... > > > But ... initially I said that it is an inspiring concept ... soooo ... > > I am currently hacking around with some C+PL/TclU+Spread constructs > that might form a rude kind of prototype creature. > > My changes to the Postgres-R concept are that there will be as many > replicating slave processes as there are in summary masters out in the > cluster ... yes, it will try to utilize all the CPU's in the cluster! > For failover reliability, A committing transaction will hold before > finalizing the commit and send it's "I'm ready" to the GC. Every > replicator that reaches the same state send's "I'm ready" too. Spread > guarantees in SAFE_MESS mode that messages are delivered to all nodes > in a group or that at least LEAVE/DISCONNECT messages are deliverd > before. So if a node receives more than 50% of "I'm ready", there > would be a very small gap where multiple nodes have to fail in the > same split second so that the majority of nodes does NOT commit. A > node that reported "I'm ready" but lost more than 50% of the cluster > before committing has to rollback and rejoin or wait for operator > intervention. > > Now the idea is to split up the communication into GC distribution > groups per transaction. So working master backends and associated > replication backends will join/leave a unique group for every > transaction in the cluster. This way, the per process communication is > reduced to the required minimum. > > > As said, I am hacking on some code ... > > > Jan > > Chris Travers wrote: > >> Tom Lane wrote: >> >>> Chris Travers writes: >>> >>> >>>> Yes I have. Postgres-r is not a high-availability solution which is >>>> capable of transparent failover, >>>> >>> >>> >>> What makes you say that? My understanding is it's supposed to survive >>> loss of individual servers. >>> >>> regards, tom lane >>> >>> >>> >>> >> My mistake. I must have gotten them confused with another >> (asynchronous) replication project. >> >> Best Wishes, >> Chris Travers >> >> >> ---------------------------(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 > > > As my british friends would say, "Bully for you",and I applaud you playing, struggling, learning from this for our sakes. Jeez, all I think about is me,huh? From pgsql-performance-owner@postgresql.org Wed Aug 27 04:12:59 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D3076D1B95B for ; Wed, 27 Aug 2003 03:22:19 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 10069-02 for ; Wed, 27 Aug 2003 03:22:09 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 157C0D1B550 for ; Wed, 27 Aug 2003 03:22:07 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h7R6M3em078150 for ; Wed, 27 Aug 2003 06:22:07 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7R5tuD0072163 for pgsql-performance@postgresql.org; Wed, 27 Aug 2003 05:55:56 GMT From: "Bupp Phillips" X-Newsgroups: comp.databases.postgresql.performance Subject: Re: What is the fastest way to get a resultset Date: Tue, 26 Aug 2003 22:56:10 -0700 Organization: Hub.Org Networking Services Lines: 27 Message-ID: References: <20030826182624.GF64198@home.samurai.com> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/350 X-Sequence-Number: 3166 So there are no settings for PG to can give me this same (fast) capability just by issuing a SQL statement thru the ODBC driver? The reason I can't go the route of a DECLARE CURSOR is because my application runs on multiple databases, so I have stay clear of certain routines that may are may not be supported on another database. "Neil Conway" wrote in message news:20030826182624.GF64198@home.samurai.com... > On Tue, Aug 26, 2003 at 02:18:23AM -0700, Bupp Phillips wrote: > > It there a way to get server side cursors with Postgresql like SQLServer has > > or is this a limitation that it has? > > http://www.postgresql.org/docs/7.3/static/sql-declare.html > http://www.postgresql.org/docs/7.3/static/sql-fetch.html > > -Neil > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > From pgsql-performance-owner@postgresql.org Wed Aug 27 03:53:41 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 F163AD1B8A3 for ; Wed, 27 Aug 2003 03:53:18 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 14987-08 for ; Wed, 27 Aug 2003 03:52:49 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 7A064D1B550 for ; Wed, 27 Aug 2003 03:52:46 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7R6uv8N012922 for ; Wed, 27 Aug 2003 12:26:57 +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 h7R6uuhi012896 for ; Wed, 27 Aug 2003 12:26:56 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Wed, 27 Aug 2003 12:24:40 +0530 MIME-Version: 1.0 Subject: Re: Sun vs a P2. Interesting results. Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4CA308.15268.327E2C9@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: 200308/348 X-Sequence-Number: 3164 On 26 Aug 2003 at 8:34, Jeff wrote: > Could it just be that the sun sucks? (And for the record - same schema, > nearly same query (modified for datetime syntax) on informix runs in 3 > seconds). My impression is IPC on sun has higher initial latency than linux. But given that you also ran the tests with multiple connections and results were of similar pattern, I can't help to conclude that postgresql has to find a way to have faste IPC on solaris. I know I will be flamed for repeatedly making this suggestion. But what does tests with sparc linux on same machine yield? Bye Shridhar -- untold wealth, n.: What you left out on April 15th. From pgsql-performance-owner@postgresql.org Wed Aug 27 03:59:36 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 E1C41D1B8BD for ; Wed, 27 Aug 2003 03:58:51 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 15832-09 for ; Wed, 27 Aug 2003 03:58:42 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 6BBDED1B948 for ; Wed, 27 Aug 2003 03:58:39 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7R72oLv014592 for ; Wed, 27 Aug 2003 12:32:50 +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 h7R72ohi014579 for ; Wed, 27 Aug 2003 12:32:50 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Wed, 27 Aug 2003 12:30:33 +0530 MIME-Version: 1.0 Subject: Re: 8 way Intel Xeon system Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4CA469.27749.32D48FD@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: 200308/349 X-Sequence-Number: 3165 On 27 Aug 2003 at 14:07, Castle, Lindsay wrote: > I'm mainly interested in what I should concentrate on from a > Linux/PostgreSQL config point of view to see if we can take advantage of the > extra CPUs. - Yes it's overkill but this is a piece of surplus hardware we > don't have to buy. First of all whatever you do, add multiple connections using a middle layer. That will keep your CPU busy. Of course there are few things need to be done over single connection but this should help at least in some scenarios. > Perhaps some may say Linux isn't the best option for an 8 CPU server but > this is what I have to work with for reasons we won't get into :-) I think if you can afford a performance benchmark trial, give 2.6.0-testx a try. They should be much better than 2.4.x. > The current usage is along the lines of a few thousands updates spread over > the space of a few hours in the morning then followed by a thousand select > queries to do some reporting. In case of such IO intensive and update/delete heavy load, might be a good idea to move WAL to a separate SCSI channel. I believe merely moving it to another drive would not yield as much boost. > Currently RedHat 9 with PostgreSQL 7.3.2 installed. Get 7.4CVS head. and don't forget to use a autovacuum daemon. It's in contrib dir. HTH Bye Shridhar -- Ogden's Law: The sooner you fall behind, the more time you have to catch up. From pgsql-general-owner@postgresql.org Wed Aug 27 23:48:41 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 52232D1B8CC for ; Wed, 27 Aug 2003 05:12:42 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 33646-10 for ; Wed, 27 Aug 2003 05:12:32 -0300 (ADT) Received: from lakemtao01.cox.net (lakemtao01.cox.net [68.1.17.244]) by svr1.postgresql.org (Postfix) with ESMTP id A49D1D1B550 for ; Wed, 27 Aug 2003 05:12:30 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao01.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030827081232.TLII5378.lakemtao01.cox.net@lhosts> for ; Wed, 27 Aug 2003 04:12:32 -0400 Subject: Re: Replication Ideas From: Ron Johnson To: PgSQL General ML In-Reply-To: <6358.1061955430@sss.pgh.pa.us> References: <200308270325.h7R3PfI24921@candle.pha.pa.us> <6358.1061955430@sss.pgh.pa.us> Content-Type: text/plain Message-Id: <1061971951.18060.357.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 27 Aug 2003 03:12:31 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1527 X-Sequence-Number: 47943 On Tue, 2003-08-26 at 22:37, Tom Lane wrote: > Bruce Momjian writes: > > If you can detect if outside transactions conflict with your > > transaction, you should be able to determine if the outside transactions > > conflict with each other. > > Uh ... not necessarily. That amounts to assuming that every xact has > complete knowledge of the actions of every other, which is an assumption > I'd rather not make. Detecting that what you've done conflicts with > someone else is one thing, detecting that party B has conflicted with > party C is another league entirely. Maybe some sort of Lock Manager? A process running on each node keeps a tree structure of all locks, requested locks, what is (requested to be) locked, and the type of lock. If you are running multi-master replication, each LM keeps in sync with each other, thus creating a Distributed Lock Manager. (This would also be the key to implementing database clusters. Of course, the interface to the DLM would have to be pretty deep within Postgres itself...) Using a DLM, the postmaster on node_a would know that the postmaster on node_b has just locked a certain set of tuples and index keys, and (1) will queue up it's request to lock that data into that node's LM, (2) which will propagate it to the other nodes, (3) then when the node_a postmaster executes the COMMIT WORK, the node_b postmaster can obtain it's desired locks. (4) If the postmaster on node_[ac-z] needs to lock the that same data, it will then similarly queue up to wait until the node_b postmaster executes it's COMMIT WORK. Notes: a) this is, of course, not *sufficient* for multi-master b) yes, you need a fast, low latency network for the DLM chatter. This is a tried and true method of synchronization. DEC Rdb/VMS has been using it for 19 years as the underpinnings of it's cluster technology, and Oracle licensed it from them (well, really Compaq) for it's 9i RAC. -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "The UN couldn't break up a cookie fight in a Brownie meeting." Larry Miller From pgsql-performance-owner@postgresql.org Wed Aug 27 23:44: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 2E2C7D1B924 for ; Wed, 27 Aug 2003 05:57:27 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 42844-09 for ; Wed, 27 Aug 2003 05:56:58 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id 20827D1B94F for ; Wed, 27 Aug 2003 05:56:55 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7R8usi15392 for ; Wed, 27 Aug 2003 10:56:54 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7R8uqV15368; Wed, 27 Aug 2003 10:56:52 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id 47C816FCCC; Wed, 27 Aug 2003 10:56:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id 3D7057F6E6; Wed, 27 Aug 2003 10:56:41 +0200 (CEST) Date: Wed, 27 Aug 2003 10:56:41 +0200 (CEST) From: Tomka Gergely To: "Castle, Lindsay" Cc: Subject: Re: 8 way Intel Xeon system In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/376 X-Sequence-Number: 3192 2003-08-27 ragyog=F3 napj=E1n Castle, Lindsay ezt =FCzente: > Perhaps some may say Linux isn't the best option for an 8 CPU server but > this is what I have to work with for reasons we won't get into :-) This is not true, 2.4 series AFAIK run nicely on these monstrums. If you want some thrill, try 2.6-test series. Linux Is Good For You (tm) :) --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-performance-owner@postgresql.org Wed Aug 27 23:18:21 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 BCFE3D1B8BF for ; Wed, 27 Aug 2003 08:40:15 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 75293-07 for ; Wed, 27 Aug 2003 08:40:07 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 2039FD1B550 for ; Wed, 27 Aug 2003 08:40:04 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19ryel-0002QQ-00 for ; Wed, 27 Aug 2003 07:40:07 -0400 Received: by dba2 (Postfix, from userid 1019) id 5BC42CF15; Wed, 27 Aug 2003 07:40:07 -0400 (EDT) Date: Wed, 27 Aug 2003 07:40:07 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: Hardware recommendations to scale to silly load Message-ID: <20030827114007.GD13190@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <1061948112.15800.53.camel@gibraltar.mattclark.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1061948112.15800.53.camel@gibraltar.mattclark.net> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/373 X-Sequence-Number: 3189 On Wed, Aug 27, 2003 at 02:35:13AM +0100, matt wrote: > I need to increase the overall performance by a factor of 10, while at > the same time the DB size increases by a factor of 50. e.g. 3000 > inserts/updates or 25,000 selects per second, over a 25GB database with > most used tables of 5,000,000 and 1,000,000 rows. Your problem is mostly going to be disk related. You can only get in there as many tuples in a second as your disk rotates per second. I suspect what you need is really expensive disk hardware (sorry to tell you that) set up as RAID 1+0 on fibre channel or something. 3000 write transactions per second is probably too much to ask for any standard hardware. But given that you are batching this once a week, and trying to avoid big expenses, are you use this is the right approach? Perhaps you should consider a redesign using COPY and such? A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Wed Aug 27 23:11:50 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 5580ED1B920 for ; Wed, 27 Aug 2003 09:34:01 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 85805-08 for ; Wed, 27 Aug 2003 09:33:32 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id 7B576D1B8AB for ; Wed, 27 Aug 2003 09:33:28 -0300 (ADT) Received: (qmail 24418 invoked from network); 27 Aug 2003 12:33:34 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 27 Aug 2003 12:33:34 -0000 Date: Wed, 27 Aug 2003 08:33:34 -0400 (EDT) From: Jeff To: Neil Conway Cc: Darcy Buskermolen , "pgsql-performance@postgresql.org" Subject: Re: Sun vs a P2. Interesting results. In-Reply-To: <20030826193729.GG64198@home.samurai.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/372 X-Sequence-Number: 3188 On Tue, 26 Aug 2003, Neil Conway wrote: > > Would it be possible to get a profile (e.g. gprof output) for a postgres > backend executing the query on the Sun machine? > Heh. Never thought of doing a profile! I attached the entire gprof output, but here's the top few functions. I did the test, 1 beater, 100 searches: 148 seconds total. 30.9 45.55 45.55 nocachegetattr [16] 16.0 69.20 23.65 internal_mcount [22] 6.9 79.37 10.17 5245902 0.00 0.00 heapgettup [21] 6.0 88.28 8.91 3663201 0.00 0.00 ExecMakeFunctionResult [23] 5.4 96.27 7.99 11431400 0.00 0.00 ExecEvalVar [25] 3.0 100.73 4.46 18758201 0.00 0.00 ExecEvalExpr [24] 3.0 105.17 4.44 5246005 0.00 0.00 AllocSetReset [29] 2.5 108.89 3.72 5245700 0.00 0.00 HeapTupleSatisfiesSnapshot [30] 2.0 111.78 2.89 5650632 0.00 0.00 LWLockRelease [32] 1.6 114.10 2.32 5650632 0.00 0.00 LWLockAcquire [34] 1.6 116.40 2.30 5245800 0.00 0.01 SeqNext [17] 1.4 118.54 2.14 5438301 0.00 0.00 ExecStoreTuple [27] 1.4 120.62 2.08 5245700 0.00 0.01 ExecQual [18] 1.3 122.50 1.88 5379202 0.00 0.00 ReleaseAndReadBuffer [35] 1.1 124.16 1.66 178400 0.01 0.40 ExecScan [15] 1.1 125.80 1.64 _mcount (6247) 1.1 127.41 1.61 5245902 0.00 0.01 heap_getnext [20] .. as it turns out the profile gzipped is still huge (100kb) so I put it on my web server - snag it at http://www.jefftrout.com/~threshar/postgres/postgres-7.3.4-sol8-gprof.txt.gz I'll do a profile for hte p2 and send post that in an hour or two -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Wed Aug 27 23:11:40 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 087CAD1B550 for ; Wed, 27 Aug 2003 09:40:44 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 86435-09 for ; Wed, 27 Aug 2003 09:40:16 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id 107C6D1B920 for ; Wed, 27 Aug 2003 09:40:12 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7RCeEi20821 for ; Wed, 27 Aug 2003 14:40:14 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7RCeDV20817 for ; Wed, 27 Aug 2003 14:40:14 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id 7FDC46FCCC; Wed, 27 Aug 2003 14:40:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id 753697F6E6 for ; Wed, 27 Aug 2003 14:40:02 +0200 (CEST) Date: Wed, 27 Aug 2003 14:40:02 +0200 (CEST) From: Tomka Gergely To: Subject: Re: Tests In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/371 X-Sequence-Number: 3187 http://mail.sth.sze.hu/~hsz/sql/ New, upgraded test results. As we see, the developers works hard, and with good results. Million thanks and congratulations. Sorry *BSD-lovers, if you send a new hard drive, our tester can do bsd tests also. Life is hard. And last, but not least, thanks for the tests, Horv=E1th Szabolcs --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-bugs-owner@postgresql.org Wed Aug 27 23:08:16 2003 X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 65208D1B8AC; Wed, 27 Aug 2003 09:51:03 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 90757-02; Wed, 27 Aug 2003 09:50:34 -0300 (ADT) Received: from kiwi.iasi.rdsnet.ro (kiwi.iasi.rdsnet.ro [213.157.176.3]) by svr1.postgresql.org (Postfix) with ESMTP id 6EAA6D1B8BD; Wed, 27 Aug 2003 09:50:30 -0300 (ADT) Received: from blackblue.iasi.rdsnet.ro (blackblue.iasi.rdsnet.ro [213.157.176.7]) by kiwi.iasi.rdsnet.ro (8.12.9/8.12.9) with ESMTP id h7RCoXaM021933 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 Aug 2003 15:50:33 +0300 Received: from blackblue.iasi.rdsnet.ro (localhost.localdomain [127.0.0.1]) by blackblue.iasi.rdsnet.ro (8.12.9/8.12.9) with ESMTP id h7RCoXxv022298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 Aug 2003 15:50:33 +0300 Received: from localhost (Mituc@localhost) by blackblue.iasi.rdsnet.ro (8.12.9/8.12.9/Submit) with ESMTP id h7RCoW7A022294; Wed, 27 Aug 2003 15:50:33 +0300 X-Authentication-Warning: blackblue.iasi.rdsnet.ro: Mituc owned process doing -bs Date: Wed, 27 Aug 2003 15:50:32 +0300 (EEST) From: Tarhon-Onu Victor To: pgsql-bugs@postgresql.org Cc: pgsql-performance@postgresql.org Subject: pgsql inserts problem Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/232 X-Sequence-Number: 6604 Hi, I have a (big) problem with postgresql when making lots of inserts per second. I have a tool that is generating an output of ~2500 lines per seconds. I write a script in PERL that opens a pipe to that tool, reads every line and inserts data. I tryed both commited and not commited variants (the inserts were commited at every 60 seconds), and the problem persists. The problems is that only ~15% of the lines are inserted into the database. The same script modified to insert the same data in a similar table created in a MySQL database inserts 100%. I also dropped the indexes on various columns, just to make sure that the overhead is not to big (but I also need that indexes because I'll make lots of SELECTs from that table). I tried both variants: connecting to a host and localy (through postgresql server's socket (/tmp/s.PGSQL.5432). Where can be the problem? I'm using postgresql 7.4 devel snapshot 20030628 and 20030531. Some of the settings are: shared_buffers = 520 max_locks_per_transaction = 128 wal_buffers = 8 max_fsm_relations = 30000 max_fsm_pages = 482000 sort_mem = 131072 vacuum_mem = 131072 effective_cache_size = 10000 random_page_cost = 2 -- Any views or opinions presented within this e-mail are solely those of the author and do not necessarily represent those of any company, unless otherwise expressly stated. From pgsql-performance-owner@postgresql.org Wed Aug 27 23:03: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 3C2CBD1B8B9 for ; Wed, 27 Aug 2003 10:18:18 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 98127-01 for ; Wed, 27 Aug 2003 10:17:49 -0300 (ADT) Received: from wight.ymogen.net (unknown [217.27.240.153]) by svr1.postgresql.org (Postfix) with SMTP id B37F9D1B8BF for ; Wed, 27 Aug 2003 10:17:41 -0300 (ADT) Received: (qmail 11297 invoked from network); 27 Aug 2003 13:17:45 -0000 Received: from dsl-217-155-239-50.zen.co.uk (217.155.239.50) by wight.ymogen.net with SMTP; 27 Aug 2003 13:17:45 -0000 Subject: Re: Hardware recommendations to scale to silly load From: matt To: Bill Moran Cc: pgsql-performance@postgresql.org In-Reply-To: <3F4C1364.6080602@potentialtech.com> References: <1061948112.15800.53.camel@gibraltar.mattclark.net> <3F4C1364.6080602@potentialtech.com> Content-Type: text/plain Organization: Message-Id: <1061990263.15800.124.camel@gibraltar.mattclark.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 27 Aug 2003 14:17:44 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/369 X-Sequence-Number: 3185 > Are you sure? Have you tested the overall application to see if possibly > you gain more on insert performance than you lose on select performanc? Unfortunately dropping any of the indexes results in much worse select performance that is not remotely clawed back by the improvement in insert performance. Actually there doesn't really seem to *be* that much improvement in insert performance when going from 3 indexes to 2. I guess indexes must be fairly cheap for PG to maintain? > It's possible that compiling Postgres manually with proper optimizations > could yield some improvements, as well as building a custom kernel in > Redhat. > > Also, you don't mention which filesystem you're using: > http://www.potentialtech.com/wmoran/postgresql.php Yeah, I can imagine getting 5% extra from a slim kernel and super-optimised PG. The FS is ext3, metadata journaling (the default), mounted noatime. > But if you're in the situation where you have more time than money, > you may find that an overall audit of your app is worthwhile. Consider > taking parts that are in perl (for example) and recoding them into C > (that is, unless you've already identified that all the bottlenecks are > at the PostgreSQL server) I can pretty cheaply add more CPU horsepower for the app servers, as they scale horizontally, so I can chuck in a couple (or 3, or 4, or ...) more dual-cpu boxen with a gig of ram and tell the load balancer about them. The problem with the DB is that that approach simply won't work - the box just has to get bigger! > I doubt if the suggestions I've made are going to get you 10x, but they > may get you 2x, and then you only need the hardware to do 5x. It all helps :-) A few percent here, a few percent there, pretty soon you're talking serious improvements... Thanks Matt From pgsql-performance-owner@postgresql.org Wed Aug 27 22:56: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 7B38BD1B8CC for ; Wed, 27 Aug 2003 10:56:28 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 06004-03 for ; Wed, 27 Aug 2003 10:56:01 -0300 (ADT) Received: from ram.rentec.com (unknown [192.5.35.66]) by svr1.postgresql.org (Postfix) with ESMTP id C516ED1B8E6 for ; Wed, 27 Aug 2003 10:55:56 -0300 (ADT) Received: from rentec.com (IDENT:618@murre.rentec.com [192.5.35.148]) by ram.rentec.com (8.12.1/8.12.1) with ESMTP id h7RDu0WU024096 for ; Wed, 27 Aug 2003 09:56:00 -0400 (EDT) Message-ID: <3F4CB86F.1020901@rentec.com> Date: Wed, 27 Aug 2003 09:55:59 -0400 From: Michael Guerin User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Simple queries take forever to run Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/366 X-Sequence-Number: 3182 I'm running into some performance problems trying to execute simple queries. postgresql version 7.3.3 .conf params changed from defaults. shared_buffers = 64000 sort_mem = 64000 fsync = false effective_cache_size = 400000 ex. query: select * from x where id in (select id from y); There's an index on each table for id. SQL Server takes <1s to return, postgresql doesn't return at all, neither does explain analyze. x has 1200673 rows y has 1282 rows It seems like its ignoring the index and not using enough memory.. any ideas? From pgsql-performance-owner@postgresql.org Wed Aug 27 11:20: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 276CBD1B52C for ; Wed, 27 Aug 2003 11:18:30 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 10014-05 for ; Wed, 27 Aug 2003 11:18:01 -0300 (ADT) Received: from mta11.adelphia.net (mta11.adelphia.net [68.168.78.205]) by svr1.postgresql.org (Postfix) with ESMTP id 8C620D1B8E4 for ; Wed, 27 Aug 2003 11:17:42 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta11.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030827141748.SKKJ19795.mta11.adelphia.net@potentialtech.com>; Wed, 27 Aug 2003 10:17:48 -0400 Message-ID: <3F4CBD8A.4050309@potentialtech.com> Date: Wed, 27 Aug 2003 10:17:46 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: matt Cc: pgsql-performance@postgresql.org Subject: Re: Hardware recommendations to scale to silly load References: <1061948112.15800.53.camel@gibraltar.mattclark.net> <3F4C1364.6080602@potentialtech.com> <1061990263.15800.124.camel@gibraltar.mattclark.net> In-Reply-To: <1061990263.15800.124.camel@gibraltar.mattclark.net> 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: 200308/351 X-Sequence-Number: 3167 matt wrote: >>Are you sure? Have you tested the overall application to see if possibly >>you gain more on insert performance than you lose on select performanc? > > Unfortunately dropping any of the indexes results in much worse select > performance that is not remotely clawed back by the improvement in > insert performance. Bummer. It was just a thought: never assume dropping indexes will hurt performance. But, since you've obviously tested ... > Actually there doesn't really seem to *be* that much improvement in > insert performance when going from 3 indexes to 2. I guess indexes must > be fairly cheap for PG to maintain? Don't know how "cheap" they are. I have an app that does large batch updates. I found that if I dropped the indexes, did the updates and recreated the indexes, it was faster than doing the updates while the indexes were intact. It doesn't sound like your app can use that approach, but I thought I'd throw it out there. >>It's possible that compiling Postgres manually with proper optimizations >>could yield some improvements, as well as building a custom kernel in >>Redhat. >> >>Also, you don't mention which filesystem you're using: >>http://www.potentialtech.com/wmoran/postgresql.php > > Yeah, I can imagine getting 5% extra from a slim kernel and > super-optimised PG. > > The FS is ext3, metadata journaling (the default), mounted noatime. ext3 is more reliable than ext2, but it's 1.1x slower. You can squeeze a little performance by using Reiser or JFS, if you're not willing to take the risk of ext2, either way, it's a pretty minor improvement. Does noatime make much difference on a PostgreSQL database? I haven't tested that yet. >>But if you're in the situation where you have more time than money, >>you may find that an overall audit of your app is worthwhile. Consider >>taking parts that are in perl (for example) and recoding them into C >>(that is, unless you've already identified that all the bottlenecks are >>at the PostgreSQL server) > > I can pretty cheaply add more CPU horsepower for the app servers, as > they scale horizontally, so I can chuck in a couple (or 3, or 4, or ...) > more dual-cpu boxen with a gig of ram and tell the load balancer about > them. The problem with the DB is that that approach simply won't work - > the box just has to get bigger! Can you split it onto multiple boxes? Some database layouts lend themselves to this, others don't. Obviously you can't do joins from one server to another, so you may lose more in multiple queries than you gain by having multiple servers. It's worth looking into though. I know my answers aren't quite the ones you were looking for, but my experience is that many people try to solve poor application design by simply throwing bigger hardware at the problem. It appears as though you've already done your homework, though. Hope this has been _some_ help. -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Wed Aug 27 22:44: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 9F8D5D1B91E for ; Wed, 27 Aug 2003 11:34:29 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 15243-07 for ; Wed, 27 Aug 2003 11:33:59 -0300 (ADT) Received: from ainea-ag.de (unknown [195.145.148.245]) by svr1.postgresql.org (Postfix) with SMTP id 3E01FD1B8EE for ; Wed, 27 Aug 2003 11:33:53 -0300 (ADT) Received: (qmail 9843 invoked from network); 27 Aug 2003 14:34:06 -0000 Received: from kanzler.ainea-ag.de (HELO allanon.ainea-ag.de) (@195.145.148.242) by grinch.ainea-ag.de with SMTP; 27 Aug 2003 14:34:06 -0000 Message-Id: <5.1.0.14.0.20030827162734.03b77c58@195.145.148.245> X-Sender: fkreitner@195.145.148.245 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Wed, 27 Aug 2003 16:36:14 +0200 To: pgsql-performance@postgresql.org From: Fabian Kreitner Subject: Improving simple textsearch? In-Reply-To: <3F4CBD8A.4050309@potentialtech.com> References: <1061990263.15800.124.camel@gibraltar.mattclark.net> <1061948112.15800.53.camel@gibraltar.mattclark.net> <3F4C1364.6080602@potentialtech.com> <1061990263.15800.124.camel@gibraltar.mattclark.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/365 X-Sequence-Number: 3181 Hi, can anyone point me to information regarding this please? Objective is to find entries that match one (or more) supplied strings in two tables. The first has about 20.000 entries with 1 varchar field to check, the other about 40.000 with 5 varchar fields to check. The currently used sequential scan is getting too expensive. Thanks, Fabian From pgsql-performance-owner@postgresql.org Wed Aug 27 22:40:41 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 4B1A0D1B8E7 for ; Wed, 27 Aug 2003 11:37:58 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 18708-09 for ; Wed, 27 Aug 2003 11:37:31 -0300 (ADT) Received: from wight.ymogen.net (unknown [217.27.240.153]) by svr1.postgresql.org (Postfix) with SMTP id 17795D1B95A for ; Wed, 27 Aug 2003 11:37:26 -0300 (ADT) Received: (qmail 16948 invoked from network); 27 Aug 2003 14:37:14 -0000 Received: from dsl-217-155-239-50.zen.co.uk (217.155.239.50) by wight.ymogen.net with SMTP; 27 Aug 2003 14:37:14 -0000 Subject: Re: Hardware recommendations to scale to silly load From: matt To: Bill Moran Cc: pgsql-performance@postgresql.org In-Reply-To: <3F4CBD8A.4050309@potentialtech.com> References: <1061948112.15800.53.camel@gibraltar.mattclark.net> <3F4C1364.6080602@potentialtech.com> <1061990263.15800.124.camel@gibraltar.mattclark.net> <3F4CBD8A.4050309@potentialtech.com> Content-Type: text/plain Organization: Message-Id: <1061995033.15800.138.camel@gibraltar.mattclark.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 27 Aug 2003 15:37:14 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/364 X-Sequence-Number: 3180 > Don't know how "cheap" they are. > > I have an app that does large batch updates. I found that if I dropped > the indexes, did the updates and recreated the indexes, it was faster > than doing the updates while the indexes were intact. Yeah, unfortunately it's not batch work, but real time financial work. If I drop all the indexes my select performance goes through the floor, as you'd expect. > Does noatime make much difference on a PostgreSQL database? I haven't > tested that yet. Yup, it does. In fact it should probably be in the standard install documentation (unless someone has a reason why it shouldn't). Who *cares* when PG last looked at the tables? If 'nomtime' was available that would probably be a good thing too. > Can you split it onto multiple boxes? Some database layouts lend themselves > to this, others don't. Obviously you can't do joins from one server to > another, so you may lose more in multiple queries than you gain by having > multiple servers. It's worth looking into though. I'm considering that. There are some tables which I might be able to split out. There amy even be some things I can pull from the DB altogether (session info in particular, so long as I can reliably send a given user's requests to the same app server each time, bearing in mind I can't see the cookies too easily because 50% of the requests are over SSL) > I know my answers aren't quite the ones you were looking for, but my > experience is that many people try to solve poor application design > by simply throwing bigger hardware at the problem. It appears as though > you've already done your homework, though. Well, I *hope* that's the case! The core issue is simply that we have to deal with an insane load for 1 hour a week, and there's just no avoiding it. Maybe I can get Sun/HP/IBM to lend some gear (it's a pretty high-profile site). From pgsql-performance-owner@postgresql.org Wed Aug 27 22:30:36 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 89F89D1B8AC for ; Wed, 27 Aug 2003 12:20:33 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 36967-04 for ; Wed, 27 Aug 2003 12:20:01 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id ED847D1B8B1 for ; Wed, 27 Aug 2003 12:20:00 -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 h7RFIbxD006003; Wed, 27 Aug 2003 09:18:38 -0600 (MDT) Date: Wed, 27 Aug 2003 09:17:42 -0600 (MDT) From: "scott.marlowe" To: matt Cc: Subject: Re: Hardware recommendations to scale to silly load In-Reply-To: <1061948112.15800.53.camel@gibraltar.mattclark.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner-ihs-com: Found to be clean X-MailScanner-SpamCheck-ihs-com: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/363 X-Sequence-Number: 3179 On 27 Aug 2003, matt wrote: > I'm wondering if the good people out there could perhaps give me some > pointers on suitable hardware to solve an upcoming performance issue. > I've never really dealt with these kinds of loads before, so any > experience you guys have would be invaluable. Apologies in advance for > the amount of info below... > > My app is likely to come under some serious load in the next 6 months, > but the increase will be broadly predictable, so there is time to throw > hardware at the problem. > > Currently I have a ~1GB DB, with the largest (and most commonly accessed > and updated) two tables having 150,000 and 50,000 rows. > > A typical user interaction with the system involves about 15 > single-table selects, 5 selects with joins or subqueries, 3 inserts, and > 3 updates. The current hardware probably (based on benchmarking and > profiling) tops out at about 300 inserts/updates *or* 2500 selects per > second. > > There are multiple indexes on each table that updates & inserts happen > on. These indexes are necessary to provide adequate select performance. > > Current hardware/software: > Quad 700MHz PIII Xeon/1MB cache > 3GB RAM > RAID 10 over 4 18GB/10,000rpm drives > 128MB battery backed controller cache with write-back enabled > Redhat 7.3, kernel 2.4.20 > Postgres 7.2.3 (stock redhat issue) > > I need to increase the overall performance by a factor of 10, while at > the same time the DB size increases by a factor of 50. e.g. 3000 > inserts/updates or 25,000 selects per second, over a 25GB database with > most used tables of 5,000,000 and 1,000,000 rows. It will likely take a combination of optimizing your database structure / methods and increasing your hardware / OS performance. You probably, more than anything, should look at some kind of superfast, external storage array that has dozens of drives, and a large battery backed cache. You may be able to approximate this yourself with just a few dual channel Ultra 320 SCSI cards and a couple dozen hard drives. The more spindles you throw at a database, generally speaking, the more parallel load it can handle. You may find that once you get to 10 or 20 drives, RAID 5 or 5+0 or 0+5 will be outrunning 1+0/0+1 due to fewer writes. You likely want to look at the fastest CPUs with the fastest memory you can afford. those 700MHz xeons are likely using PC133 memory, which is painfully slow compared to the stuff pumping data out at 4 to 8 times the rate of the older stuff. Maybe an SGI Altix could do this? Have you looked at them? They're not cheap, but they do look to be quite fast, and can scale to 64 CPUs if need be. They're interbox communication fabric is faster than most CPU's front side busses. > Notably, the data is very time-sensitive, so the active dataset at any > hour is almost certainly going to be more on the order of 5GB than 25GB > (plus I'll want all the indexes in RAM of course). > > Also, and importantly, the load comes but one hour per week, so buying a > Starfire isn't a real option, as it'd just sit idle the rest of the > time. I'm particularly interested in keeping the cost down, as I'm a > shareholder in the company! Interesting. If you can't spread the load out, can you batch some parts of it? Or is the whole thing interactive therefore needing to all be done in real time at once? > So what do I need? whether you like it or not, you're gonna need heavy iron if you need to do this all in one hour once a week. > Can anyone who has (or has ever had) that kind of > load in production offer any pointers, anecdotes, etc? Any theoretical > musings also more than welcome. Comments upon my sanity will be > referred to my doctor. > > If the best price/performance option is a second hand 32-cpu Alpha > running VMS I'd be happy to go that way ;-) Actually, I've seen stuff like that going on Ebay pretty cheap lately. I saw a 64 CPU E10k (366 MHz CPUs) with 64 gigs ram and 20 hard drives going for $24,000 a month ago. Put Linux or BSD on it and Postgresql should fly. From pgsql-performance-owner@postgresql.org Wed Aug 27 12:35:33 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 BF876D1B915 for ; Wed, 27 Aug 2003 12:31:08 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 38385-06 for ; Wed, 27 Aug 2003 12:30:36 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 8C3EED1B8E3 for ; Wed, 27 Aug 2003 12:30:34 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7RFYnKn027397 for ; Wed, 27 Aug 2003 21:04:49 +0530 Received: from daithan.intranet.pspl.co.in (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 h7RFYlhi027383 for ; Wed, 27 Aug 2003 21:04:48 +0530 From: Shridhar Daithankar To: pgsql-performance@postgresql.org Subject: Comparing postgresql7.4 CVS head on linux 2.4.20 and 2.6.0-test4 Date: Wed, 27 Aug 2003 21:02:25 +0530 User-Agent: KMail/1.5.2 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_J8MT/AB1qsXdxbm" Message-Id: <200308272102.26319.shridhar_daithankar@persistent.co.in> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/352 X-Sequence-Number: 3168 --Boundary-00=_J8MT/AB1qsXdxbm Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, I did some benchmarking using pgbench and postgresql CVS head, compiled yesterday. The results are attached. It looks like 2.6.0-test4 does better under load but under light load the performance isn't that great. OTOH 2.4.20 suffer major degradation compare to 2.6. Looks like linux is also getting heavy at lower end. Of course it isn't as bad as solaris as yet..:-) IIRC in a kernel release note recently, it was commented that IO scheduler is still being worked on and does not perform as much for random seeks, which exaclty what database needs. How does these number stack up with other platforms? Anybody with SCSI disks out there? I doubt IDE has some role to play with this. Comments? Shridhar --Boundary-00=_J8MT/AB1qsXdxbm Content-Type: text/plain; charset="us-ascii"; name="pgbench.7.4CVSHEAD.2.6.0-test4" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pgbench.7.4CVSHEAD.2.6.0-test4" Vacumm full done after each run. pg_resetlog run between each server start Scaling factor: 10 Initialization time: real 1m42.282s user 0m1.787s sys 0m0.121s Kernel 2.6.0-test4 Effective cache size 38400 (300MB) checkpoint segments=6 1)Shared buffers 1000 pgbench -c5 -t100 test1 tps = 131.962542 (including connections establishing) tps = 134.418358 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 79.301493 (including connections establishing) tps = 79.393258 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 64.917044 (including connections establishing) tps = 65.438067 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 66.135615 (including connections establishing) tps = 66.193039 (excluding connections establishing) 2) Shared buffers 2000 pgbench -c5 -t100 test1 tps = 135.598994 (including connections establishing) tps = 138.296634 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 81.331678 (including connections establishing) tps = 81.425369 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 116.524476 (including connections establishing) tps = 118.388407 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 64.659894 (including connections establishing) tps = 64.719829 (excluding connections establishing) 3) Shared buffers 3000 pgbench -c5 -t100 test tps = 132.489569 (including connections establishing) tps = 135.177003 (excluding connections establishing) pgbench -c5 -t1000 test tps = 70.272855 (including connections establishing) tps = 70.343452 (excluding connections establishing) pgbench -c10 -t100 test tps = 121.624524 (including connections establishing) tps = 123.549086 (excluding connections establishing) pgbench -c10 -t1000 test tps = 64.124644 (including connections establishing) tps = 64.183736 (excluding connections establishing) 4) noatime enabled Shared buffers 3000 pgbench -c5 -t100 test tps = 90.850600 (including connections establishing) tps = 92.053686 (excluding connections establishing) pgbench -c5 -t1000 test tps = 92.209724 (including connections establishing) tps = 92.329682 (excluding connections establishing) pgbench -c10 -t100 test tps = 79.264231 (including connections establishing) tps = 80.145448 (excluding connections establishing) pgbench -c10 -t1000 test tps = 70.439082 (including connections establishing) tps = 70.506189 (excluding connections establishing) --Boundary-00=_J8MT/AB1qsXdxbm Content-Type: text/plain; charset="us-ascii"; name="pgbench.7.4CVSHEAD.24.20" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pgbench.7.4CVSHEAD.24.20" Vacumm full done after each run. pg_resetlog run between each server start Scaling factor: 10 Initialization time: real 1m32.551s user 0m1.710s sys 0m0.130s Kernel 2.4.20 Effective cache size 38400 (300MB) checkpoint segments=6 1)Shared buffers 1000 pgbench -c5 -t100 test1 tps = 145.504917 (including connections establishing) tps = 147.991299 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 70.785341 (including connections establishing) tps = 70.849065 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 147.605267 (including connections establishing) tps = 149.944123 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 55.646866 (including connections establishing) tps = 55.678399 (excluding connections establishing) 2) Shared buffers 2000 pgbench -c5 -t100 test1 tps = 140.115444 (including connections establishing) tps = 142.441377 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 77.015876 (including connections establishing) tps = 77.084474 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 128.512768 (including connections establishing) tps = 130.314689 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 55.003077 (including connections establishing) tps = 55.035001 (excluding connections establishing) 3) Shared buffers 3000 pgbench -c5 -t100 test1 tps = 153.142499 (including connections establishing) tps = 156.094637 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 81.391878 (including connections establishing) tps = 81.472845 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 120.420876 (including connections establishing) tps = 122.066975 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 56.766460 (including connections establishing) tps = 56.801117 (excluding connections establishing) 4) Shared buffers 3000, noatime pgbench -c5 -t100 test1 tps = 140.464589 (including connections establishing) tps = 143.152323 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 94.718161 (including connections establishing) tps = 94.826618 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 131.925129 (including connections establishing) tps = 133.826403 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 65.374006 (including connections establishing) tps = 65.458626 (excluding connections establishing) --Boundary-00=_J8MT/AB1qsXdxbm-- From pgsql-performance-owner@postgresql.org Wed Aug 27 22:28:42 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 A7995D1B8AC for ; Wed, 27 Aug 2003 12:52:16 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 43388-03 for ; Wed, 27 Aug 2003 12:51:45 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id F36EAD1B52C for ; Wed, 27 Aug 2003 12:51:28 -0300 (ADT) Received: (qmail 25131 invoked from network); 27 Aug 2003 15:51:29 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 27 Aug 2003 15:51:29 -0000 Date: Wed, 27 Aug 2003 11:51:29 -0400 (EDT) From: Jeff To: pgsql-performance@postgresql.org Subject: Re: Sun vs a P2. Interesting results. In-Reply-To: <3F4CA308.15268.327E2C9@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/362 X-Sequence-Number: 3178 Well, installing gcc 3.3.1 and using -mcpu=v9 didn't help. in fact it made things worse. Unless someone has something clever I'm just gonna stop tinkering with it - my goal was met (it is several orders of magnitude faster than informix ) and the hardware is being replaced in a month or two. thanks for the ideas / comments. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Wed Aug 27 22:11:58 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id B76BED1B897 for ; Wed, 27 Aug 2003 16:51:15 +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 58414-04 for ; Wed, 27 Aug 2003 13:50:45 -0300 (ADT) Received: from wight.ymogen.net (unknown [217.27.240.153]) by svr1.postgresql.org (Postfix) with SMTP id B682CD1B8A3 for ; Wed, 27 Aug 2003 13:50:43 -0300 (ADT) Received: (qmail 28684 invoked from network); 27 Aug 2003 16:49:26 -0000 Received: from dsl-217-155-239-50.zen.co.uk (217.155.239.50) by wight.ymogen.net with SMTP; 27 Aug 2003 16:49:26 -0000 Subject: Re: Hardware recommendations to scale to silly load From: matt To: "scott.marlowe" Cc: pgsql-performance@postgresql.org In-Reply-To: References: Content-Type: text/plain Organization: Message-Id: <1062002965.15800.208.camel@gibraltar.mattclark.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 27 Aug 2003 17:49:25 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/357 X-Sequence-Number: 3173 > You probably, more than anything, should look at some kind of > superfast, external storage array Yeah, I think that's going to be a given. Low end EMC FibreChannel boxes can do around 20,000 IOs/sec, which is probably close to good enough. You mentioned using multiple RAID controllers as a boost - presumably the trick here is to split the various elements (WAL, tables, indexes) across different controllers using symlinks or suchlike? Can I feasibly split the DB tables across 5 or more controllers? > > Also, and importantly, the load comes but one hour per week, so buying a > > Starfire isn't a real option, as it'd just sit idle the rest of the > > time. I'm particularly interested in keeping the cost down, as I'm a > > shareholder in the company! > > Interesting. If you can't spread the load out, can you batch some parts > of it? Or is the whole thing interactive therefore needing to all be > done in real time at once? All interactive I'm afraid. It's a micropayment system that's going to be used here in the UK to do online voting for a popular TV programme. The phone voting system has a hard limit of [redacted] million votes per hour, and the producers would like to be able to tell people to vote online if the phone lines are busy. They can vote online anyway, but we expect the average viewer to have to make 10 calls just to get through during peak times, so the attraction is obvious. > whether you like it or not, you're gonna need heavy iron if you need to do > this all in one hour once a week. Yeah, I need to rent a Starfire for a month later this year, anybody got one lying around? Near London? > Actually, I've seen stuff like that going on Ebay pretty cheap lately. I > saw a 64 CPU E10k (366 MHz CPUs) with 64 gigs ram and 20 hard drives going > for $24,000 a month ago. Put Linux or BSD on it and Postgresql should > fly. Jeez, and I thought I was joking about the Starfire. Even Slowaris would be OK on one of them. The financial issue is that there's just not that much money in the micropayments game for bursty sales. If I was doing these loads *continuously* then I wouldn't be working, I'd be in the Maldives :-) I'm also looking at renting equipment, or even trying out IBM/HP's 'on-demand' offerings. From pgsql-advocacy-owner@postgresql.org Wed Aug 27 22:04:00 2003 X-Original-To: pgsql-advocacy-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 81BB4D1B8AB; Wed, 27 Aug 2003 17:32:12 +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 69516-10; Wed, 27 Aug 2003 14:31:41 -0300 (ADT) Received: from snoopy.oit.edu (snoopy.OIT.EDU [140.211.135.12]) by svr1.postgresql.org (Postfix) with ESMTP id 7FAC4D1B550; Wed, 27 Aug 2003 14:31:39 -0300 (ADT) Received: from oit.edu (purvine-141-62.oit.edu [140.211.141.62]) by snoopy.oit.edu (8.12.9/8.12.9/OIT-4.0) with ESMTP id h7RGqFUm028830; Wed, 27 Aug 2003 09:52:16 -0700 Message-ID: <3F4CE300.3010205@oit.edu> Date: Wed, 27 Aug 2003 09:57:36 -0700 From: Dennis Gearon User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, ru, es-mx MIME-Version: 1.0 To: undisclosed-recipients: ; Subject: Please scan your computer Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/199 X-Sequence-Number: 2077 Someone who has my: gearond@oit.edu email address has an infected computer, infected with the SoBig.F virus. I'm getting 200+ infected emails a day from that person(s). Go to this site and do a free online virus scan. It's safe, and done by one of the two top virus scanning companies in world. I've done it several times. http://housecall.antivirus.com/ -- Dennis Gearon From pgsql-general-owner@postgresql.org Wed Aug 27 21:21:55 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id E83B6D1B8AE for ; Wed, 27 Aug 2003 19:39: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 07657-10 for ; Wed, 27 Aug 2003 16:38:37 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 11235D1B8E4 for ; Wed, 27 Aug 2003 16:38: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 h7RJcJ5H025357; Wed, 27 Aug 2003 15:38:19 -0400 (EDT) To: "Marc G. Fournier" Cc: Chris Travers , Alvaro Herrera , Ron Johnson , pgsql-general@postgresql.org Subject: Re: Replication Ideas In-reply-to: <20030826025754.V691@ganymede.hub.org> References: <3F483EBD.3020108@travelamericas.com> <1061705587.3733.452.camel@haggis> <3F4A420E.6090604@travelamericas.com> <20030825182441.GB9597@dcc.uchile.cl> <3F4A5724.3060002@travelamericas.com> <11627.1061845759@sss.pgh.pa.us> <20030826025754.V691@ganymede.hub.org> Comments: In-reply-to "Marc G. Fournier" message dated "Tue, 26 Aug 2003 03:01:26 -0300" Date: Wed, 27 Aug 2003 15:38:19 -0400 Message-ID: <25356.1062013099@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1469 X-Sequence-Number: 47885 "Marc G. Fournier" writes: > On Mon, 25 Aug 2003, Tom Lane wrote: >> What makes you say that? My understanding is it's supposed to survive >> loss of individual servers. > How does it play 'catch up' went a server comes back online? The recovered server has to run through the part of the GCS data stream that it missed the first time. This is not conceptually different from recovering using archived WAL logs (or archived trigger-driven replication data streams). As with using WAL for recovery, you have to be able to archive the message stream until you don't need it any more. regards, tom lane From pgsql-performance-owner@postgresql.org Wed Aug 27 20:46: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 940C8D1B897 for ; Wed, 27 Aug 2003 18:41:30 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 45034-09 for ; Wed, 27 Aug 2003 18:40:59 -0300 (ADT) Received: from ram.rentec.com (ram.rentec.com [192.5.35.66]) by svr1.postgresql.org (Postfix) with ESMTP id 110CAD1BA97 for ; Wed, 27 Aug 2003 18:40:05 -0300 (ADT) Received: from rentec.com (IDENT:618@murre.rentec.com [192.5.35.148]) by ram.rentec.com (8.12.1/8.12.1) with ESMTP id h7RLe5YL023567 for ; Wed, 27 Aug 2003 17:40:06 -0400 (EDT) Message-ID: <3F4D2535.8050103@rentec.com> Date: Wed, 27 Aug 2003 17:40:05 -0400 From: Michael Guerin User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Simple queries take forever to run Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/355 X-Sequence-Number: 3171 I'm running into some performance problems trying to execute simple queries. postgresql version 7.3.3 .conf params changed from defaults. shared_buffers = 64000 sort_mem = 64000 fsync = false effective_cache_size = 400000 ex. query: select * from x where id in (select id from y); There's an index on each table for id. SQL Server takes <1s to return, postgresql doesn't return at all, neither does explain analyze. x has 1200673 rows y has 1282 rows It seems like its ignoring the index and not using enough memory.. any ideas? From pgsql-performance-owner@postgresql.org Wed Aug 27 20:27: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 CEACDD1B550 for ; Wed, 27 Aug 2003 23:00:43 +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 66759-08 for ; Wed, 27 Aug 2003 20:00:15 -0300 (ADT) Received: from home.samurai.com (home.samurai.com [205.207.28.66]) by svr1.postgresql.org (Postfix) with ESMTP id 44C86D1B8AB for ; Wed, 27 Aug 2003 20:00:12 -0300 (ADT) Received: by home.samurai.com (Postfix, from userid 1014) id 9146D2622F; Wed, 27 Aug 2003 19:00:14 -0400 (EDT) Date: Wed, 27 Aug 2003 19:00:14 -0400 From: Neil Conway To: Shridhar Daithankar Cc: pgsql-performance@postgresql.org Subject: Re: Comparing postgresql7.4 CVS head on linux 2.4.20 and 2.6.0-test4 Message-ID: <20030827230014.GA63737@home.samurai.com> References: <200308272102.26319.shridhar_daithankar@persistent.co.in> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200308272102.26319.shridhar_daithankar@persistent.co.in> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/354 X-Sequence-Number: 3170 On Wed, Aug 27, 2003 at 09:02:25PM +0530, Shridhar Daithankar wrote: > IIRC in a kernel release note recently, it was commented that IO scheduler is > still being worked on and does not perform as much for random seeks, which > exaclty what database needs. Yeah, I've read that as well. It would be interesting to see how 2.6 performs with the traditional (non-anticipatory) scheduler -- I believe you can switch from one I/O scheduler to another via a sysctl. > pgbench -c10 -t100 test1 > tps = 64.917044 (including connections establishing) > tps = 65.438067 (excluding connections establishing) Interesting that the performance of 2.4.20 for this particular benchmark is a little less than 3 times faster than 2.6 > 3) Shared buffers 3000 > > pgbench -c5 -t100 test > tps = 132.489569 (including connections establishing) > tps = 135.177003 (excluding connections establishing) > > pgbench -c5 -t1000 test > tps = 70.272855 (including connections establishing) > tps = 70.343452 (excluding connections establishing) > > pgbench -c10 -t100 test > tps = 121.624524 (including connections establishing) > tps = 123.549086 (excluding connections establishing) [...] > 4) noatime enabled Shared buffers 3000 > > pgbench -c5 -t100 test > tps = 90.850600 (including connections establishing) > tps = 92.053686 (excluding connections establishing) > > pgbench -c5 -t1000 test > tps = 92.209724 (including connections establishing) > tps = 92.329682 (excluding connections establishing) > > pgbench -c10 -t100 test > tps = 79.264231 (including connections establishing) > tps = 80.145448 (excluding connections establishing) I'm a little skeptical of the consistency of these numbers (several people have observed in the past that it's difficult to get pgbench to produce reliable results) -- how is it possible that using noatime can possibly *reduce* performance by 50%, in the case of the first and third benchmarks? -Neil From pgsql-performance-owner@postgresql.org Wed Aug 27 20:26:41 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 5A685D1B8BD for ; Wed, 27 Aug 2003 23:07:52 +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 66514-10 for ; Wed, 27 Aug 2003 20:07:24 -0300 (ADT) Received: from harrier.cohaesio.com (harrier.cohaesio.com [212.97.128.50]) by svr1.postgresql.org (Postfix) with ESMTP id ED0B9D1B8AE for ; Wed, 27 Aug 2003 20:07:20 -0300 (ADT) Received: by harrier.cohaesio.com (Postfix, from userid 88) id 4126486; Thu, 28 Aug 2003 01:07:07 +0200 (CEST) X-Original-To: news2mail@news.cohaesio.com From: "Anders K. Pedersen" Subject: Queries sometimes take 1000 times the normal time Date: Thu, 28 Aug 2003 01:07:05 +0200 Organization: Cohaesio A/S Lines: 31 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: harrier.cohaesio.com 1062025626 30491 212.97.128.160 (27 Aug 2003 23:07:06 GMT) X-Complaints-To: newsmaster@news.cohaesio.com X-Accept-Language: da, en-us, en To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/353 X-Sequence-Number: 3169 Hello, We're running a set of Half-Life based game servers that lookup user privileges from a central PostgreSQL 7.3.4 database server (I recently ported the MySQL code in Adminmod to PostgreSQL to be able to do this). The data needed by the game servers are combined from several different tables, so we have some views set up to provide the data in the format needed. Currently there's only a few users in the database for testing purposes, and most of the time the user lookup's take 2-3 ms (I have syslog'ing of queries and duration turned on), but several times per hour the duration for one of the queries is 2-3 seconds (1000 times larger), while the surrounding lookups take the usual 2-3 ms. This is rather critical, as the game server software isn't asynchonous and thus waits for a reply before continuing, so when someone connects, and the user lookup happens to have one of these very long durations, the players on this server experience a major lag spike, which isn't very popular :-( All the game servers and the database server are connected to the same switch, so I don't think, that it is a network problem. So far I've been unable to locate the problem, so any suggestions are very welcome. Regards, Anders K. Pedersen From pgsql-performance-owner@postgresql.org Wed Aug 27 22:28:33 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 8B04ED1B8D2 for ; Wed, 27 Aug 2003 23:39:43 +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 77319-03 for ; Wed, 27 Aug 2003 20:39:14 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 5731BD1B8AB for ; Wed, 27 Aug 2003 20:39:11 -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 h7RNd95H028673; Wed, 27 Aug 2003 19:39:09 -0400 (EDT) To: "Anders K. Pedersen" Cc: pgsql-performance@postgresql.org Subject: Re: Queries sometimes take 1000 times the normal time In-reply-to: References: Comments: In-reply-to "Anders K. Pedersen" message dated "Thu, 28 Aug 2003 01:07:05 +0200" Date: Wed, 27 Aug 2003 19:39:08 -0400 Message-ID: <28672.1062027548@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/361 X-Sequence-Number: 3177 "Anders K. Pedersen" writes: > Currently there's only a few users in the database for testing purposes, > and most of the time the user lookup's take 2-3 ms (I have syslog'ing of > queries and duration turned on), but several times per hour the duration > for one of the queries is 2-3 seconds (1000 times larger), while the > surrounding lookups take the usual 2-3 ms. One thing that comes to mind is that the slow query could be occurring at the same time as a checkpoint, or some other cycle-chewing background operation. It's not clear why a checkpoint would slow things down that much, though. Anyway I'd suggest looking for such activities; once we know if that's the issue or not, we can make some progress. regards, tom lane From pgsql-performance-owner@postgresql.org Wed Aug 27 22:26:42 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 13D9FD1B8A5 for ; Thu, 28 Aug 2003 00:11: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 78302-07 for ; Wed, 27 Aug 2003 21:11:19 -0300 (ADT) Received: from home.samurai.com (home.samurai.com [205.207.28.66]) by svr1.postgresql.org (Postfix) with ESMTP id 189E3D1B8E6 for ; Wed, 27 Aug 2003 21:11:16 -0300 (ADT) Received: by home.samurai.com (Postfix, from userid 1014) id 430BD26224; Wed, 27 Aug 2003 20:11:19 -0400 (EDT) Date: Wed, 27 Aug 2003 20:11:19 -0400 From: Neil Conway To: Michael Guerin Cc: pgsql-performance@postgresql.org Subject: Re: Simple queries take forever to run Message-ID: <20030828001119.GB63737@home.samurai.com> References: <3F4D2535.8050103@rentec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4D2535.8050103@rentec.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/360 X-Sequence-Number: 3176 On Wed, Aug 27, 2003 at 05:40:05PM -0400, Michael Guerin wrote: > ex. query: select * from x where id in (select id from y); > > There's an index on each table for id. SQL Server takes <1s to return, > postgresql doesn't return at all, neither does explain analyze. This particular form of query is a known performance problem for PostgreSQL 7.3 and earlier -- the problem should hopefully be fixed in 7.4 (currently in beta). Check the archives for more discussion on this topic. -Neil From pgsql-performance-owner@postgresql.org Wed Aug 27 22:17:23 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 8041FD1B8A3 for ; Thu, 28 Aug 2003 01:14:31 +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 91122-05 for ; Wed, 27 Aug 2003 22:14:03 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 5B307D1B550 for ; Wed, 27 Aug 2003 22:13:59 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 581021025B; Wed, 27 Aug 2003 21:06:07 -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 28B2710248; Wed, 27 Aug 2003 21:06:05 -0400 (EDT) Subject: Re: Queries sometimes take 1000 times the normal time From: Rod Taylor To: "Anders K. Pedersen" Cc: Postgresql Performance In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-YhYgy3Doxue4upJh2YKq" Message-Id: <1062033258.71328.2.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 27 Aug 2003 21:14:19 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/358 X-Sequence-Number: 3174 --=-YhYgy3Doxue4upJh2YKq Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > Currently there's only a few users in the database for testing purposes,= =20 > and most of the time the user lookup's take 2-3 ms (I have syslog'ing of= =20 > queries and duration turned on), but several times per hour the duration= =20 > for one of the queries is 2-3 seconds (1000 times larger), while the=20 > surrounding lookups take the usual 2-3 ms. Are there any other jobs running at the time of these excessive queries? --=-YhYgy3Doxue4upJh2YKq 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/TVdq6DETLow6vwwRAthZAJ9F9d2a/jlNXbV78ppkWXTaGCopFQCfaN1n Hao4JtQXlcR4cYWY7wbpeGU= =+wtK -----END PGP SIGNATURE----- --=-YhYgy3Doxue4upJh2YKq-- From pgsql-performance-owner@postgresql.org Wed Aug 27 22:25: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 C9260D1B97C for ; Thu, 28 Aug 2003 01:22:50 +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 97972-06 for ; Wed, 27 Aug 2003 22:22:23 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id 91BF6D1B9B4 for ; Wed, 27 Aug 2003 22:22:19 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id B8B1FD64A; Wed, 27 Aug 2003 18:22:23 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 9E2E75C11; Wed, 27 Aug 2003 18:22:23 -0700 (PDT) Date: Wed, 27 Aug 2003 18:22:23 -0700 (PDT) From: Stephan Szabo To: Michael Guerin Cc: Subject: Re: Simple queries take forever to run In-Reply-To: <3F4D2535.8050103@rentec.com> Message-ID: <20030827182051.W85397-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/359 X-Sequence-Number: 3175 On Wed, 27 Aug 2003, Michael Guerin wrote: > I'm running into some performance problems trying to execute simple > queries. > > postgresql version 7.3.3 > .conf params changed from defaults. > shared_buffers = 64000 > sort_mem = 64000 > fsync = false > effective_cache_size = 400000 > > ex. query: select * from x where id in (select id from y); > > There's an index on each table for id. SQL Server takes <1s to return, > postgresql doesn't return at all, neither does explain analyze. IN(subquery) is known to run poorly in 7.3.x and earlier. 7.4 is generally much better (for reasonably sized subqueries) but in earlier versions you'll probably want to convert into an EXISTS or join form. From pgsql-performance-owner@postgresql.org Wed Aug 27 23:01:57 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 1F3E4D1B914 for ; Thu, 28 Aug 2003 01:27: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 97916-07 for ; Wed, 27 Aug 2003 22:26:34 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id 0DA28D1B8AB for ; Wed, 27 Aug 2003 22:26:29 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h7S1QWLt012958; Thu, 28 Aug 2003 09:26:32 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <010101c36d03$c2dae240$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "Michael Guerin" , References: <3F4D2535.8050103@rentec.com> Subject: Re: Simple queries take forever to run Date: Thu, 28 Aug 2003 09:29:01 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/368 X-Sequence-Number: 3184 > postgresql version 7.3.3 > .conf params changed from defaults. > shared_buffers = 64000 > sort_mem = 64000 > fsync = false > effective_cache_size = 400000 > > ex. query: select * from x where id in (select id from y); > > There's an index on each table for id. SQL Server takes <1s to return, > postgresql doesn't return at all, neither does explain analyze. > x has 1200673 rows > y has 1282 rows > > It seems like its ignoring the index and not using enough memory.. any > ideas? This is a known problem in 7.3, it is much faster in 7.4b1. This should be very, very fast though, and do exactly the same thing: select * from x where exists (select id from y where y.id=x.id); Chris From pgsql-performance-owner@postgresql.org Wed Aug 27 22:57: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 BAF9AD1B91E for ; Thu, 28 Aug 2003 01:52:41 +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 02334-08 for ; Wed, 27 Aug 2003 22:52:14 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 56A4FD1B916 for ; Wed, 27 Aug 2003 22:52: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 h7S1qAek049585 for ; Thu, 28 Aug 2003 01:52:10 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7S1WfNK046229 for pgsql-performance@postgresql.org; Thu, 28 Aug 2003 01:32:41 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Hardware recommendations to scale to silly load Date: Wed, 27 Aug 2003 21:32:16 -0400 Organization: cbbrowne Computing Inc Lines: 28 Message-ID: References: <1062002965.15800.208.camel@gibraltar.mattclark.net> 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:REqCi3ViYd6EAkWAC+mKyFF6EhY= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/367 X-Sequence-Number: 3183 Martha Stewart called it a Good Thing whenmatt@ymogen.net (matt)wrote: > I'm also looking at renting equipment, or even trying out IBM/HP's > 'on-demand' offerings. You're assuming that this is likely to lead to REAL savings, and that seems unlikely. During the recent power outage in the NorthEast, people looking for generators and fuel were paying _premium_ prices, not discounted prices. If your hardware requirement leads to someone having to buy hardware to support your peak load, then _someone_ has to pay the capital cost, and that someone is unlikely to be IBM or HP. "Peak demand" equipment is likely to attract pretty "peaked" prices. If you can find someone who needs the hardware during the day, but who _never_ needs it during your needful hours, then there might be an arrangement to be had, assuming the "someone else" trusts you to use what's, at other times, their hardware, and assuming you trust them with the financial information you're managing. -- select 'cbbrowne' || '@' || 'ntlug.org'; http://www3.sympatico.ca/cbbrowne/linux.html Rules of the Evil Overlord #170. "I will be an equal-opportunity despot and make sure that terror and oppression is distributed fairly, not just against one particular group that will form the core of a rebellion." From pgsql-performance-owner@postgresql.org Wed Aug 27 23:24:28 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 B6AC8D1B8A5 for ; Thu, 28 Aug 2003 02:22:46 +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 13878-01 for ; Wed, 27 Aug 2003 23:22:18 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 74F78D1B95B for ; Wed, 27 Aug 2003 23:22: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 h7S2MAek055357 for ; Thu, 28 Aug 2003 02:22:10 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7S27Wjb052828 for pgsql-performance@postgresql.org; Thu, 28 Aug 2003 02:07:32 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Hardware recommendations to scale to silly load Date: Wed, 27 Aug 2003 22:07:20 -0400 Organization: cbbrowne Computing Inc Lines: 22 Message-ID: References: <1061948112.15800.53.camel@gibraltar.mattclark.net> 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:Avfjn3vaxcf7lUjjnf8QraKP8jQ= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/374 X-Sequence-Number: 3190 After takin a swig o' Arrakan spice grog, scott.marlowe@ihs.com ("scott.marlowe") belched out... :-): > whether you like it or not, you're gonna need heavy iron if you need > to do this all in one hour once a week. The other thing worth considering is trying to see if there is a way of partitioning the workload across multiple hosts. At the point that you start going past hardware that is "over-the-counter commodity" stuff, the premiums start getting pretty high. Dual-CPU Intel boxes are pretty cheap compared to buncha-CPU Sparc boxes. If some sort of segmentation of the workload can be done, whether by area code, postal code, or perhaps the last couple digits of the caller's phone number, or even a "round robin," it's likely to be a lot cheaper to get an array of 4 Dual-Xeon boxes with 8 disk drives apiece than a Sun/HP/IBM box with 16 CPUs. -- let name="cbbrowne" and tld="ntlug.org" in name ^ "@" ^ tld;; http://cbbrowne.com/info/linuxxian.html "Show me... show me... show me... COMPUTERS!" From pgsql-performance-owner@postgresql.org Wed Aug 27 23:30: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 CA5B8D1B8E7 for ; Thu, 28 Aug 2003 02:26: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 13736-06 for ; Wed, 27 Aug 2003 23:26:03 -0300 (ADT) Received: from mta2.adelphia.net (mta2.adelphia.net [68.168.78.178]) by svr1.postgresql.org (Postfix) with ESMTP id 1CE6AD1B8AC for ; Wed, 27 Aug 2003 23:25:59 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta2.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030828022602.VSNB12648.mta2.adelphia.net@potentialtech.com>; Wed, 27 Aug 2003 22:26:02 -0400 Message-ID: <3F4D6839.2030004@potentialtech.com> Date: Wed, 27 Aug 2003 22:26:01 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Christopher Browne Cc: pgsql-performance@postgresql.org Subject: Re: Hardware recommendations to scale to silly load References: <1062002965.15800.208.camel@gibraltar.mattclark.net> 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: 200308/375 X-Sequence-Number: 3191 Christopher Browne wrote: > Martha Stewart called it a Good Thing whenmatt@ymogen.net (matt)wrote: > >>I'm also looking at renting equipment, or even trying out IBM/HP's >>'on-demand' offerings. > > You're assuming that this is likely to lead to REAL savings, and that > seems unlikely. > > During the recent power outage in the NorthEast, people looking for > generators and fuel were paying _premium_ prices, not discounted > prices. > > If your hardware requirement leads to someone having to buy hardware > to support your peak load, then _someone_ has to pay the capital cost, > and that someone is unlikely to be IBM or HP. "Peak demand" equipment > is likely to attract pretty "peaked" prices. > > If you can find someone who needs the hardware during the day, but who > _never_ needs it during your needful hours, then there might be an > arrangement to be had, assuming the "someone else" trusts you to use > what's, at other times, their hardware, and assuming you trust them > with the financial information you're managing. I hadn't considered this, but that's not a bad idea. With FreeBSD, you have jails, which allow multiple users to share hardware without having to worry about user A looking at user B's stuff. Does such a paradigm exist on any heavy iron? I have no idea where you'd go to find this kind of "co-op" server leasing, but it sure sounds like it could work. -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Thu Aug 28 00:05:32 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 5DFEBD1B8AC for ; Thu, 28 Aug 2003 02:52:41 +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 17412-02 for ; Wed, 27 Aug 2003 23:52:14 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 51B38D1B52C for ; Wed, 27 Aug 2003 23:52: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 h7S2qAek060160 for ; Thu, 28 Aug 2003 02:52:10 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7S2nYZi059634 for pgsql-performance@postgresql.org; Thu, 28 Aug 2003 02:49:34 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: 8 way Intel Xeon system Date: Wed, 27 Aug 2003 22:49:23 -0400 Organization: cbbrowne Computing Inc Lines: 18 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit 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:dNWBox8T74183jaTesxyWt8tX/8= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/380 X-Sequence-Number: 3196 After a long battle with technology,tomka@zeus.gau.hu (Tomka Gergely), an earthling, wrote: > 2003-08-27 ragyog� napj�n Castle, Lindsay ezt �zente: >> Perhaps some may say Linux isn't the best option for an 8 CPU >> server but this is what I have to work with for reasons we won't >> get into :-) > > This is not true, 2.4 series AFAIK run nicely on these monstrums. If > you want some thrill, try 2.6-test series. Linux Is Good For You > (tm) :) The other "bleeding edge" that it'll be interesting to see, um, "coagulate," is Dragonfly BSD, which plans to do some really interesting SMP stuff as a fork of FreeBSD... -- let name="cbbrowne" and tld="ntlug.org" in String.concat "@" [name;tld];; http://www.ntlug.org/~cbbrowne/nonrdbms.html "People are more vocally opposed to fur than leather because it's easier to harass rich women than motorcycle gangs." [bumper sticker] From pgsql-performance-owner@postgresql.org Thu Aug 28 00:33:36 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 3FE82D1B8AD for ; Thu, 28 Aug 2003 03:16: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 25618-02 for ; Thu, 28 Aug 2003 00:15:56 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id DA4A8D1B8C6 for ; Thu, 28 Aug 2003 00:15:55 -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 h7S3FZ5H015121; Wed, 27 Aug 2003 23:15:35 -0400 (EDT) To: Jeff Cc: Neil Conway , Darcy Buskermolen , "pgsql-performance@postgresql.org" Subject: Re: Sun vs a P2. Interesting results. In-reply-to: References: Comments: In-reply-to Jeff message dated "Wed, 27 Aug 2003 08:33:34 -0400" Date: Wed, 27 Aug 2003 23:15:35 -0400 Message-ID: <15120.1062040535@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/383 X-Sequence-Number: 3199 Jeff writes: > I'll do a profile for hte p2 and send post that in an hour or two Please redo the linux profile after recompiling postmaster.c with -DLINUX_PROFILE added (I use "make PROFILE='-pg -DLINUX_PROFILE'" when building for profile on Linux). regards, tom lane From pgsql-bugs-owner@postgresql.org Thu Aug 28 00:31:11 2003 X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 92F90D1B97C for ; Thu, 28 Aug 2003 03:18:31 +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 23894-08 for ; Thu, 28 Aug 2003 00:17:59 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 1D923D1B8CC for ; Thu, 28 Aug 2003 00:17:59 -0300 (ADT) Received: (qmail 7371 invoked by uid 500); 28 Aug 2003 03:23:56 -0000 Date: Wed, 27 Aug 2003 22:23:56 -0500 From: Bruno Wolff III To: Tarhon-Onu Victor Cc: pgsql-bugs@postgresql.org, pgsql-performance@postgresql.org Subject: Re: [PERFORM] pgsql inserts problem Message-ID: <20030828032356.GC7185@wolff.to> Mail-Followup-To: Tarhon-Onu Victor , pgsql-bugs@postgresql.org, pgsql-performance@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/235 X-Sequence-Number: 6607 On Wed, Aug 27, 2003 at 15:50:32 +0300, Tarhon-Onu Victor wrote: > > The problems is that only ~15% of the lines are inserted into > the database. The same script modified to insert the same data in a > similar table created in a MySQL database inserts 100%. Did you check the error status for the records that weren't entered? My first guess is that you have some bad data you are trying to insert. From pgsql-bugs-owner@postgresql.org Thu Aug 28 01:13:21 2003 X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id CD5CBD1B8B5; Thu, 28 Aug 2003 03:59:46 +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 31881-08; Thu, 28 Aug 2003 00:59:15 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id 04AC5D1B8CD; Thu, 28 Aug 2003 00:59:14 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h7S3x2Lt016361; Thu, 28 Aug 2003 11:59:02 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <039101c36d19$146ca3e0$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "Bruno Wolff III" , "Tarhon-Onu Victor" Cc: , References: <20030828032356.GC7185@wolff.to> Subject: Re: [PERFORM] pgsql inserts problem Date: Thu, 28 Aug 2003 12:01:37 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/236 X-Sequence-Number: 6608 > > The problems is that only ~15% of the lines are inserted into > > the database. The same script modified to insert the same data in a > > similar table created in a MySQL database inserts 100%. > > Did you check the error status for the records that weren't entered? > > My first guess is that you have some bad data you are trying to insert. I wouldn't be surprised, MySQL will just insert a zero instead of failing in most cases :P Chris From pgsql-performance-owner@postgresql.org Thu Aug 28 01:09:26 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 21DF7D1B947 for ; Thu, 28 Aug 2003 04:08: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 35316-02 for ; Thu, 28 Aug 2003 01:07:37 -0300 (ADT) Received: from lakemtao03.cox.net (lakemtao03.cox.net [68.1.17.242]) by svr1.postgresql.org (Postfix) with ESMTP id 95B33D1B8B9 for ; Thu, 28 Aug 2003 01:07:36 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao03.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030828040732.THHZ10977.lakemtao03.cox.net@lhosts> for ; Thu, 28 Aug 2003 00:07:32 -0400 Subject: Re: Hardware recommendations to scale to silly load From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <3F4D6839.2030004@potentialtech.com> References: <1062002965.15800.208.camel@gibraltar.mattclark.net> <3F4D6839.2030004@potentialtech.com> Content-Type: text/plain Message-Id: <1062043655.25752.118.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 27 Aug 2003 23:07:35 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/385 X-Sequence-Number: 3201 On Wed, 2003-08-27 at 21:26, Bill Moran wrote: > Christopher Browne wrote: > > Martha Stewart called it a Good Thing whenmatt@ymogen.net (matt)wrote: [snip] > With FreeBSD, you have jails, which allow multiple users to share > hardware without having to worry about user A looking at user B's > stuff. Does such a paradigm exist on any heavy iron? I have no IBM invented the idea (or maybe stole it) back in the '70s. The VM hypervisor was designed as a conversion tool, to let customers run both OS/MVS and DOS/VSE, to aid in converting from VSE to MVS. Customers, the cheap, uncooperative beasts, liked VSE, but also liked VM, since it let them have, for example, a dev, test, and production "systems" all on the same piece of h/w, thus saving them oodles of money in h/w costs and maintenance fees. Yes, yes, the modern term for this is "server consolidation", and VMware does the same thing, 30 years after dinosaur customers had it on boxen that academics, analysts and "young whippersnappers" said were supposed to be extinct 20 years ago. -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "Knowledge should be free for all." Harcourt Fenton Mudd, Star Trek:TOS, "I, Mudd" From pgsql-performance-owner@postgresql.org Thu Aug 28 02:22: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 8CEA7D1B8B1 for ; Thu, 28 Aug 2003 05:22:04 +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 56078-05 for ; Thu, 28 Aug 2003 02:21:34 -0300 (ADT) Received: from v2.intertune.com (unknown [209.75.26.20]) by svr1.postgresql.org (Postfix) with ESMTP id D469CD1B8AB for ; Thu, 28 Aug 2003 02:21:32 -0300 (ADT) Received: from MOBILE01 (66-75-2-227.san.rr.com [66.75.2.227]) (authenticated) by v2.intertune.com (8.11.6/8.11.6) with ESMTP id h7S5gI313831 for ; Wed, 27 Aug 2003 22:42:18 -0700 From: "Balazs Wellisch" To: Subject: Re: The results of my PostgreSQL/filesystem performance tests Date: Wed, 27 Aug 2003 22:21:23 -0700 Message-ID: <001201c36d24$3c572460$0500a8c0@MOBILE01> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 Importance: Normal In-Reply-To: <3F4C0DC4.8070105@potentialtech.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/386 X-Sequence-Number: 3202 Bill, Very interesting results. I'd like to command you on your honesty. Having started out with the intentions of proving that FreeBSD is faster than Linux only to find that the opposite is true must not have been rewarding for you. However, these unexpected results serve only to reinforce the integrity of your tests. Thanks for all the work. Balazs -----Original Message----- From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Bill Moran Sent: Tuesday, August 26, 2003 6:48 PM To: pgsql-performance@postgresql.org Subject: [PERFORM] The results of my PostgreSQL/filesystem performance tests Hey all. I said I was going to do it, and I finally did it. As with all performance tests/benchmarks, there are probably dozens or more reasons why these results aren't as accurate or wonderful as they should be. Take them for what they are and hopefully everyone can learn a few things from them. Intelligent feedback is welcome. http://www.potentialtech.com/wmoran/postgresql.php -- Bill Moran Potential Technologies http://www.potentialtech.com ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings From pgsql-performance-owner@postgresql.org Thu Aug 28 02:25:38 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 83666D1B8CC for ; Thu, 28 Aug 2003 05:25:34 +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 56080-07 for ; Thu, 28 Aug 2003 02:25:03 -0300 (ADT) Received: from v2.intertune.com (unknown [209.75.26.20]) by svr1.postgresql.org (Postfix) with ESMTP id 83C46D1B8B1 for ; Thu, 28 Aug 2003 02:24:57 -0300 (ADT) Received: from MOBILE01 (66-75-2-227.san.rr.com [66.75.2.227]) (authenticated) by v2.intertune.com (8.11.6/8.11.6) with ESMTP id h7S5jh313844 for ; Wed, 27 Aug 2003 22:45:43 -0700 From: "Balazs Wellisch" To: Subject: Re: Tests Date: Wed, 27 Aug 2003 22:24:48 -0700 Message-ID: <001301c36d24$b6ab8490$0500a8c0@MOBILE01> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/387 X-Sequence-Number: 3203 Nicely done! Thanks, Balazs -----Original Message----- From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Tomka Gergely Sent: Wednesday, August 27, 2003 5:40 AM To: pgsql-performance@postgresql.org Subject: Re: [PERFORM] Tests http://mail.sth.sze.hu/~hsz/sql/ New, upgraded test results. As we see, the developers works hard, and with good results. Million thanks and congratulations. Sorry *BSD-lovers, if you send a new hard drive, our tester can do bsd tests also. Life is hard. And last, but not least, thanks for the tests, Horv=E1th Szabolcs --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings From pgsql-performance-owner@postgresql.org Thu Aug 28 03:29:39 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 6DEECD1B8AC for ; Thu, 28 Aug 2003 06:29:38 +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 68427-02 for ; Thu, 28 Aug 2003 03:29:07 -0300 (ADT) Received: from kiwi.iasi.rdsnet.ro (kiwi.iasi.rdsnet.ro [213.157.176.3]) by svr1.postgresql.org (Postfix) with ESMTP id 9DDD2D1B574 for ; Thu, 28 Aug 2003 03:29:05 -0300 (ADT) Received: from blackblue.iasi.rdsnet.ro (blackblue.iasi.rdsnet.ro [213.157.176.7]) by kiwi.iasi.rdsnet.ro (8.12.9/8.12.9) with ESMTP id h7S6T4aM012755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 28 Aug 2003 09:29:04 +0300 Received: from blackblue.iasi.rdsnet.ro (localhost.localdomain [127.0.0.1]) by blackblue.iasi.rdsnet.ro (8.12.9/8.12.9) with ESMTP id h7S6T4xv013431 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 28 Aug 2003 09:29:04 +0300 Received: from localhost (Mituc@localhost) by blackblue.iasi.rdsnet.ro (8.12.9/8.12.9/Submit) with ESMTP id h7S6T36P013427; Thu, 28 Aug 2003 09:29:03 +0300 X-Authentication-Warning: blackblue.iasi.rdsnet.ro: Mituc owned process doing -bs Date: Thu, 28 Aug 2003 09:29:03 +0300 (EEST) From: Tarhon-Onu Victor To: Bruno Wolff III Cc: pgsql-performance@postgresql.org Subject: Re: pgsql inserts problem In-Reply-To: <20030828032356.GC7185@wolff.to> Message-ID: References: <20030828032356.GC7185@wolff.to> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/388 X-Sequence-Number: 3204 On Wed, 27 Aug 2003, Bruno Wolff III wrote: > Did you check the error status for the records that weren't entered? > > My first guess is that you have some bad data you are trying to insert. Of course, I checked the error status for every insert, there is no error. It seems like in my case the postgres server cannot handle so much inserts per second some of the lines are not being parsed and data inserted into the database. I don't know where can be the problem: in the DBD::Pg Perl DBI driver or my postgresql server settings are not optimal. -- Any views or opinions presented within this e-mail are solely those of the author and do not necessarily represent those of any company, unless otherwise expressly stated. From pgsql-performance-owner@postgresql.org Thu Aug 28 03:40:43 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 DA607D1B574 for ; Thu, 28 Aug 2003 06:40:42 +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 67100-06 for ; Thu, 28 Aug 2003 03:40:03 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id EF71DD1B8A5 for ; Thu, 28 Aug 2003 03:39:57 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7S6dvi29156 for ; Thu, 28 Aug 2003 08:39:57 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7S6cwV29121; Thu, 28 Aug 2003 08:38:58 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id 1E31A6FCCE; Thu, 28 Aug 2003 08:38:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id 132117F6E7; Thu, 28 Aug 2003 08:38:47 +0200 (CEST) Date: Thu, 28 Aug 2003 08:38:47 +0200 (CEST) From: Tomka Gergely To: matt Cc: Bill Moran , Subject: Re: Hardware recommendations to scale to silly load In-Reply-To: <1061990263.15800.124.camel@gibraltar.mattclark.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/389 X-Sequence-Number: 3205 2003-08-27 ragyog=F3 napj=E1n matt ezt =FCzente: > Yeah, I can imagine getting 5% extra from a slim kernel and > super-optimised PG. Hm, about 20%, but only for the correctness - 20% not help you also :( > The FS is ext3, metadata journaling (the default), mounted noatime. Worst fs under linux :) Try xfs. --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-performance-owner@postgresql.org Thu Aug 28 03:45: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 689CDD1B994 for ; Thu, 28 Aug 2003 06:45: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 70323-03 for ; Thu, 28 Aug 2003 03:44:34 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id D9811D1B8AD for ; Thu, 28 Aug 2003 03:43:27 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7S6ljYm024021 for ; Thu, 28 Aug 2003 12:17:45 +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 h7S6ljhi024008 for ; Thu, 28 Aug 2003 12:17:45 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Thu, 28 Aug 2003 12:15:14 +0530 MIME-Version: 1.0 Subject: Re: The results of my PostgreSQL/filesystem performance tests Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4DF252.3395.332BF0F@localhost> In-reply-to: <3F4C0DC4.8070105@potentialtech.com> 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: 200308/390 X-Sequence-Number: 3206 On 26 Aug 2003 at 21:47, Bill Moran wrote: > Hey all. > > I said I was going to do it, and I finally did it. > > As with all performance tests/benchmarks, there are probably dozens or > more reasons why these results aren't as accurate or wonderful as they > should be. Take them for what they are and hopefully everyone can > learn a few things from them. > > Intelligent feedback is welcome. > > http://www.potentialtech.com/wmoran/postgresql.php Can we have these benchmarks and relevant information stored in a central archive at techdocs(Say)? That would be better than searching mail archives.. Bye Shridhar -- "... freedom ... is a worship word..." "It is our worship word too." -- Cloud William and Kirk, "The Omega Glory", stardate unknown From pgsql-performance-owner@postgresql.org Thu Aug 28 03:47:50 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 8FDD3D1B4F0 for ; Thu, 28 Aug 2003 06:47:49 +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 69871-05 for ; Thu, 28 Aug 2003 03:47:16 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 9856BD1B8E7 for ; Thu, 28 Aug 2003 03:47:10 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7S6pcu3025539 for ; Thu, 28 Aug 2003 12:21:38 +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 h7S6pchi025526 for ; Thu, 28 Aug 2003 12:21:38 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Thu, 28 Aug 2003 12:19:07 +0530 MIME-Version: 1.0 Subject: Re: Queries sometimes take 1000 times the normal time Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4DF33B.11939.3364D27@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: 200308/391 X-Sequence-Number: 3207 On 28 Aug 2003 at 1:07, Anders K. Pedersen wrote: > Hello, > > We're running a set of Half-Life based game servers that lookup user > privileges from a central PostgreSQL 7.3.4 database server (I recently > ported the MySQL code in Adminmod to PostgreSQL to be able to do this). > > The data needed by the game servers are combined from several different > tables, so we have some views set up to provide the data in the format > needed. > > Currently there's only a few users in the database for testing purposes, > and most of the time the user lookup's take 2-3 ms (I have syslog'ing of > queries and duration turned on), but several times per hour the duration > for one of the queries is 2-3 seconds (1000 times larger), while the > surrounding lookups take the usual 2-3 ms. Check vmstat during the same period if it is syncing at that point as Tom suggested. Are you using pooled connections? If yes you could shorten life of a connection and force making a new connection every 10-15 minutes say. That would avoid IO avelanche at the end of the hour types. HTH. Bye Shridhar -- ignorance, n.: When you don't know anything, and someone else finds out. From pgsql-performance-owner@postgresql.org Thu Aug 28 03:52:25 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 CE2D7D1B8A3 for ; Thu, 28 Aug 2003 06:52: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 65376-10 for ; Thu, 28 Aug 2003 03:51:52 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id 6927BD1B8A5 for ; Thu, 28 Aug 2003 03:51:50 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7S6pmi00717 for ; Thu, 28 Aug 2003 08:51:48 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7S6pjV00693; Thu, 28 Aug 2003 08:51:45 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id 9FB0E6FCCE; Thu, 28 Aug 2003 08:51:33 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id 94A567F6E7; Thu, 28 Aug 2003 08:51:33 +0200 (CEST) Date: Thu, 28 Aug 2003 08:51:33 +0200 (CEST) From: Tomka Gergely To: Bill Moran Cc: Christopher Browne , Subject: Re: Hardware recommendations to scale to silly load In-Reply-To: <3F4D6839.2030004@potentialtech.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/393 X-Sequence-Number: 3209 2003-08-27 ragyog=F3 napj=E1n Bill Moran ezt =FCzente: > With FreeBSD, you have jails, which allow multiple users to share > hardware without having to worry about user A looking at user B's > stuff. Does such a paradigm exist on any heavy iron? I have no Of course. All IBM hw can do this, because on all ibm hw runs linux, and linux have more ways to do this :) --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-performance-owner@postgresql.org Thu Aug 28 03:50:49 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 9B027D1B8AB for ; Thu, 28 Aug 2003 06:50: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 69792-08 for ; Thu, 28 Aug 2003 03:50:18 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 9FED0D1B4F0 for ; Thu, 28 Aug 2003 03:50:10 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7S6sX1N026251 for ; Thu, 28 Aug 2003 12:24:33 +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 h7S6sWhi026238 for ; Thu, 28 Aug 2003 12:24:32 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Thu, 28 Aug 2003 12:22:02 +0530 MIME-Version: 1.0 Subject: Re: pgsql inserts problem Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4DF3EA.6723.338F5D1@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: 200308/392 X-Sequence-Number: 3208 On 27 Aug 2003 at 15:50, Tarhon-Onu Victor wrote: > > Hi, > > I have a (big) problem with postgresql when making lots of > inserts per second. I have a tool that is generating an output of ~2500 > lines per seconds. I write a script in PERL that opens a pipe to that > tool, reads every line and inserts data. > I tryed both commited and not commited variants (the inserts > were commited at every 60 seconds), and the problem persists. Assuming one record per line, you are committing after 150K records, that's not good. Try committing every 5 seconds. And open more than one conenction. That will certainly improve performance. Afterall concurrency is biggest assset of postgresql. Fiddle around with combination and see which works best for you. Bye Shridhar -- Mencken and Nathan's Ninth Law of The Average American: The quality of a champagne is judged by the amount of noise the cork makes when it is popped. From pgsql-performance-owner@postgresql.org Thu Aug 28 03:52:45 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 5A82DD1B8A3 for ; Thu, 28 Aug 2003 06:52:43 +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 66619-10 for ; Thu, 28 Aug 2003 03:52:13 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id C493FD1B8B3 for ; Thu, 28 Aug 2003 03:51:58 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7S6uPKI026911 for ; Thu, 28 Aug 2003 12:26:25 +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 h7S6uOhi026898 for ; Thu, 28 Aug 2003 12:26:24 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Thu, 28 Aug 2003 12:23:54 +0530 MIME-Version: 1.0 Subject: Re: Comparing postgresql7.4 CVS head on linux 2.4.20 and 2.6.0-test4 Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4DF45A.20421.33AABBF@localhost> In-reply-to: <20030827230014.GA63737@home.samurai.com> References: <200308272102.26319.shridhar_daithankar@persistent.co.in> 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: 200308/394 X-Sequence-Number: 3210 On 27 Aug 2003 at 19:00, Neil Conway wrote: > On Wed, Aug 27, 2003 at 09:02:25PM +0530, Shridhar Daithankar wrote: > > IIRC in a kernel release note recently, it was commented that IO scheduler is > > still being worked on and does not perform as much for random seeks, which > > exaclty what database needs. > > Yeah, I've read that as well. It would be interesting to see how 2.6 > performs with the traditional (non-anticipatory) scheduler -- I believe > you can switch from one I/O scheduler to another via a sysctl. I will repeat the tests after get that setting. Will google for it.. > > > pgbench -c10 -t100 test1 > > tps = 64.917044 (including connections establishing) > > tps = 65.438067 (excluding connections establishing) > > Interesting that the performance of 2.4.20 for this particular > benchmark is a little less than 3 times faster than 2.6 Yeah but 2.4 drops like anything.. > > 4) noatime enabled Shared buffers 3000 > > > > pgbench -c5 -t100 test > > tps = 90.850600 (including connections establishing) > > tps = 92.053686 (excluding connections establishing) > > > > pgbench -c5 -t1000 test > > tps = 92.209724 (including connections establishing) > > tps = 92.329682 (excluding connections establishing) > > > > pgbench -c10 -t100 test > > tps = 79.264231 (including connections establishing) > > tps = 80.145448 (excluding connections establishing) > > I'm a little skeptical of the consistency of these numbers > (several people have observed in the past that it's difficult > to get pgbench to produce reliable results) -- how is it > possible that using noatime can possibly *reduce* performance > by 50%, in the case of the first and third benchmarks? I know. I am puzzled too. Probably I didn't put noatime properly in /etc/fstab. Unfortunately I have only one linux partition. So I prefer to boot rather than remounting root. I will redo the bechmarks and post the results.. Bye Shridhar -- Law of Communications: The inevitable result of improved and enlarged communications between different levels in a hierarchy is a vastly increased area of misunderstanding. From pgsql-performance-owner@postgresql.org Thu Aug 28 03:56:49 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 346BDD1B8E0 for ; Thu, 28 Aug 2003 06:56:49 +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 71622-02 for ; Thu, 28 Aug 2003 03:56:17 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id 15CD0D1B8AC for ; Thu, 28 Aug 2003 03:56:15 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7S6uBi01675 for ; Thu, 28 Aug 2003 08:56:11 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7S6u7V01635; Thu, 28 Aug 2003 08:56:07 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id DDAEB6FCCE; Thu, 28 Aug 2003 08:55:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id D1C3A7F6E7; Thu, 28 Aug 2003 08:55:55 +0200 (CEST) Date: Thu, 28 Aug 2003 08:55:55 +0200 (CEST) From: Tomka Gergely To: Christopher Browne Cc: Subject: Re: 8 way Intel Xeon system In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/395 X-Sequence-Number: 3211 2003-08-27 ragyog=F3 napj=E1n Christopher Browne ezt =FCzente: > After a long battle with technology,tomka@zeus.gau.hu (Tomka Gergely), an= earthling, wrote: > > 2003-08-27 ragyog=F3 napj=E1n Castle, Lindsay ezt =FCzente: > >> Perhaps some may say Linux isn't the best option for an 8 CPU > >> server but this is what I have to work with for reasons we won't > >> get into :-) > > > > This is not true, 2.4 series AFAIK run nicely on these monstrums. If > > you want some thrill, try 2.6-test series. Linux Is Good For You > > (tm) :) > > The other "bleeding edge" that it'll be interesting to see, um, > "coagulate," is Dragonfly BSD, which plans to do some really > interesting SMP stuff as a fork of FreeBSD... As isee the pages (what a beautiul insect:) tehy not reach te limit of useability - or i am wrong? --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-general-owner@postgresql.org Thu Aug 28 04:06:35 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id B8F9FD1B8BC for ; Thu, 28 Aug 2003 07:06:33 +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 69376-10 for ; Thu, 28 Aug 2003 04:06:03 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 0E94CD1B8B3 for ; Thu, 28 Aug 2003 04:05:58 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7S7APuN029954 for ; Thu, 28 Aug 2003 12:40:25 +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 h7S7AOhi029941 for ; Thu, 28 Aug 2003 12:40:24 +0530 From: "Shridhar Daithankar" To: pgsql-general@postgresql.org Date: Thu, 28 Aug 2003 12:37:53 +0530 MIME-Version: 1.0 Subject: Re: Replication Ideas Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4DF7A1.21007.3477A6E@localhost> In-reply-to: <20030826025754.V691@ganymede.hub.org> References: <11627.1061845759@sss.pgh.pa.us> 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: 200308/1569 X-Sequence-Number: 47985 On 26 Aug 2003 at 3:01, Marc G. Fournier wrote: > > > On Mon, 25 Aug 2003, Tom Lane wrote: > > > Chris Travers writes: > > > Yes I have. Postgres-r is not a high-availability solution which is > > > capable of transparent failover, > > > > What makes you say that? My understanding is it's supposed to survive > > loss of individual servers. > > How does it play 'catch up' went a server comes back online? PITR + archive logs daemon? Chances of a node and an archive log daemon going down simalrenously are pretty low. If archive log daemon works on another machin, the MTBF should be pretty acceptable.. Bye Shridhar -- The Briggs-Chase Law of Program Development: To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units. From pgsql-performance-owner@postgresql.org Thu Aug 28 04:32:31 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 13AE4D1B8ED for ; Thu, 28 Aug 2003 07:32:28 +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 71771-09 for ; Thu, 28 Aug 2003 04:31:50 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id 037A1D1B8BC for ; Thu, 28 Aug 2003 04:31:45 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h7S7VULt019852; Thu, 28 Aug 2003 15:31:30 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <04fa01c36d36$c79099f0$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "Tarhon-Onu Victor" , "Bruno Wolff III" Cc: References: <20030828032356.GC7185@wolff.to> Subject: Re: pgsql inserts problem Date: Thu, 28 Aug 2003 15:34:12 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/396 X-Sequence-Number: 3212 > Of course, I checked the error status for every insert, there is > no error. It seems like in my case the postgres server cannot handle so > much inserts per second some of the lines are not being parsed and data > inserted into the database. That sounds extremely unlikely. Postgres is not one to fail without any sort of error. There's something else that is the problem. More than likely, it's a problem in your code. Chris From pgsql-performance-owner@postgresql.org Thu Aug 28 05:11: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 4C839D1D89A for ; Thu, 28 Aug 2003 08:11:34 +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 78528-08 for ; Thu, 28 Aug 2003 05:11:04 -0300 (ADT) Received: from zigo.dhs.org (as2-4-3.an.g.bonet.se [194.236.34.191]) by svr1.postgresql.org (Postfix) with ESMTP id 0B90ED1B8B9 for ; Thu, 28 Aug 2003 05:11:02 -0300 (ADT) Received: from zigo.dhs.org (zigo [127.0.0.1]) by zigo.dhs.org (8.12.8/8.12.8) with ESMTP id h7S8B3MG004015; Thu, 28 Aug 2003 10:11:03 +0200 Received: from localhost (db@localhost) by zigo.dhs.org (8.12.8/8.12.8/Submit) with ESMTP id h7S8B3Uq004011; Thu, 28 Aug 2003 10:11:03 +0200 Date: Thu, 28 Aug 2003 10:11:02 +0200 (CEST) From: =?ISO-8859-1?Q?Dennis_Bj=F6rklund?= To: Bill Moran Cc: pgsql-performance@postgresql.org Subject: Re: The results of my PostgreSQL/filesystem performance In-Reply-To: <3F4C0DC4.8070105@potentialtech.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/397 X-Sequence-Number: 3213 On Tue, 26 Aug 2003, Bill Moran wrote: > As with all performance tests/benchmarks, there are probably dozens or > more reasons why these results aren't as accurate or wonderful as they > should be. Take them for what they are and hopefully everyone can > learn a few things from them. What version of pg was used in debian and redhat? For freebsd it's 7.2.4 it says on the page, but I see nothing about the other two. The version that comes with Redhat 9 (Shrike) is 7.3.2. -- /Dennis From pgsql-performance-owner@postgresql.org Thu Aug 28 05:17:57 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 ED2A3D1D89A for ; Thu, 28 Aug 2003 08:17: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 78213-09 for ; Thu, 28 Aug 2003 05:17:25 -0300 (ADT) Received: from wight.ymogen.net (unknown [217.27.240.153]) by svr1.postgresql.org (Postfix) with SMTP id 6E1C5D1DA47 for ; Thu, 28 Aug 2003 05:17:22 -0300 (ADT) Received: (qmail 9938 invoked from network); 28 Aug 2003 08:17:22 -0000 Received: from dsl-217-155-239-50.zen.co.uk (217.155.239.50) by wight.ymogen.net with SMTP; 28 Aug 2003 08:17:22 -0000 Subject: Re: Hardware recommendations to scale to silly load From: matt To: Ron Johnson Cc: PgSQL Performance ML In-Reply-To: <1061953146.18108.291.camel@haggis> References: <1061948112.15800.53.camel@gibraltar.mattclark.net> <1061953146.18108.291.camel@haggis> Content-Type: text/plain Organization: Message-Id: <1062058639.15800.247.camel@gibraltar.mattclark.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 28 Aug 2003 09:17:20 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/398 X-Sequence-Number: 3214 > Are you *sure* about that???? 3K updates/inserts per second xlates > to 10,800,000 per hour. That, my friend, is a WHOLE HECK OF A LOT! Yup, I know! > During the 1 hour surge, will SELECTs at 10 minutes after the > hour depend on INSERTs at 5 minutes after the hour? Yes, they do. It's a payments system, so things like account balances and purchase histories have to be updated in real time. > Only one hour out of 168????? May I ask what kind of app it is? Online voting for an unnamed TV show... > > If the best price/performance option is a second hand 32-cpu Alpha > > running VMS I'd be happy to go that way ;-) > > I'd love to work on a GS320! You may even pick one up for a million > or 2. The license costs for VMS & Rdb would eat you, though. You'd be amazed how little they do go for actually :-) From pgsql-performance-owner@postgresql.org Thu Aug 28 06:03:12 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 37D62D1DA3B for ; Thu, 28 Aug 2003 09:03: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 87119-03 for ; Thu, 28 Aug 2003 06:02:37 -0300 (ADT) Received: from lakemtao04.cox.net (lakemtao04.cox.net [68.1.17.241]) by svr1.postgresql.org (Postfix) with ESMTP id 64315D1B8AC for ; Thu, 28 Aug 2003 06:02:35 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao04.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030828090237.WTER419.lakemtao04.cox.net@lhosts> for ; Thu, 28 Aug 2003 05:02:37 -0400 Subject: Re: Hardware recommendations to scale to silly load From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <1062058639.15800.247.camel@gibraltar.mattclark.net> References: <1061948112.15800.53.camel@gibraltar.mattclark.net> <1061953146.18108.291.camel@haggis> <1062058639.15800.247.camel@gibraltar.mattclark.net> Content-Type: text/plain Message-Id: <1062061355.25752.164.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 28 Aug 2003 04:02:36 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/399 X-Sequence-Number: 3215 On Thu, 2003-08-28 at 03:17, matt wrote: > > Are you *sure* about that???? 3K updates/inserts per second xlates > > to 10,800,000 per hour. That, my friend, is a WHOLE HECK OF A LOT! > > Yup, I know! > > > During the 1 hour surge, will SELECTs at 10 minutes after the > > hour depend on INSERTs at 5 minutes after the hour? > > Yes, they do. It's a payments system, so things like account balances > and purchase histories have to be updated in real time. > > > Only one hour out of 168????? May I ask what kind of app it is? > > Online voting for an unnamed TV show... > > > > If the best price/performance option is a second hand 32-cpu Alpha > > > running VMS I'd be happy to go that way ;-) > > > > I'd love to work on a GS320! You may even pick one up for a million > > or 2. The license costs for VMS & Rdb would eat you, though. > > You'd be amazed how little they do go for actually :-) Then that's what I'd do. VMS, Rdb, (your favorite 3GL language). Presumably the SELECT statements will be direct lookup instead of range retrieval? If so, then I'd create a *large* amount of GLOBAL BUFFERS, many MIXED AREAs, tables PLACED VIA HASHED INDEXES so that the index nodes are on the same page as the corresponding tuples. Thus, 1 disk I/O gets both the relevant index key, plus the tuple. (Each I/O reads 3 pages into GBs [Global Buffers], so that if a later statement needs a records nearby, it's already in RAM.) With fast storage controllers (dual-redundant, with 512MB each) you could even use RAID5, and your app may not even know the diffie. Of course, since the requirements are *so* extreme, better still stick to RAID10. I know that a certain pharmaceutical company had a similar situation, where test results would flood in every morning. A certain North- eastern US wireless phone company needed to record every time every phone call was started and stopped. The technique I described is how both of these high-volume apps solved The Need For Speed. With VMS 7.3 and Rdb 7.1.04 and, oh, 16GB RAM, a carefully crafted stored procedure run an hour or 2 before the show could pull the necessary 5GB slice of the DB into GBs, and you'd reduce the I/O load during the show itself. Sorry it's not PostgreSQL, but I *know* that Rdb+VMS could handle the task... -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "You ask us the same question every day, and we give you the same answer every day. Someday, we hope that you will believe us..." U.S. Secretary of Defense Donald Rumsfeld, to a reporter From pgsql-performance-owner@postgresql.org Thu Aug 28 06:03:21 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 BACD0D1DA57 for ; Thu, 28 Aug 2003 09:03:19 +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 87179-02 for ; Thu, 28 Aug 2003 06:02:48 -0300 (ADT) Received: from mta03-svc.ntlworld.com (mta03-svc.ntlworld.com [62.253.162.43]) by svr1.postgresql.org (Postfix) with ESMTP id 635C7D1B8B5 for ; Thu, 28 Aug 2003 06:02:45 -0300 (ADT) Received: from russell ([81.99.189.14]) by mta03-svc.ntlworld.com (InterMail vM.4.01.03.37 201-229-121-137-20020806) with SMTP id <20030828090247.BDEO14590.mta03-svc.ntlworld.com@russell> for ; Thu, 28 Aug 2003 10:02:47 +0100 From: "Russell Garrett" To: Subject: Re: Queries sometimes take 1000 times the normal time Date: Thu, 28 Aug 2003 10:02:46 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/400 X-Sequence-Number: 3216 We have a somewhat similar situation - we're running a fairly constant, but low priority, background load of about 70 selects and 40 inserts per second (batched into fairly large transactions), and on top of that we're trying to run time-sensitive queries for a web site (well two). I should emphasize that this is low low priority - if a query is delayed by an hour here, it doesn't matter. The web site queries will jump up one or two orders of magnitude (I have seen a normally 100ms query take in excess of 30 seconds) in duration at seemingly random points. It's not always when the transactions are committing, and it doesn't seem to be during checkpointing either. The same thing happens with WAL switched off. It appears to happen the first time the query runs after a while. If I run the same query immediately afterwards, it will take the normal amount of time. Any ideas? Cheers, Russ Garrett pgsql-performance-owner@postgresql.org wrote: > Subject: [PERFORM] Queries sometimes take 1000 times the normal time > > > Hello, > > We're running a set of Half-Life based game servers that lookup user > privileges from a central PostgreSQL 7.3.4 database server (I recently > ported the MySQL code in Adminmod to PostgreSQL to be able to do > this). > > The data needed by the game servers are combined from several > different tables, so we have some views set up to provide the data in > the format needed. > > Currently there's only a few users in the database for testing > purposes, and most of the time the user lookup's take 2-3 ms (I have > syslog'ing of queries and duration turned on), but several times per > hour the duration for one of the queries is 2-3 seconds (1000 times > larger), while the surrounding lookups take the usual 2-3 ms. > > This is rather critical, as the game server software isn't asynchonous > and thus waits for a reply before continuing, so when someone > connects, and the user lookup happens to have one of these very long > durations, the players on this server experience a major lag spike, > which isn't very popular :-( > > All the game servers and the database server are connected to the same > switch, so I don't think, that it is a network problem. > > So far I've been unable to locate the problem, so any suggestions are > very welcome. > > Regards, > Anders K. Pedersen From pgsql-performance-owner@postgresql.org Thu Aug 28 06:09:29 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 1A247D1B947 for ; Thu, 28 Aug 2003 09:09:10 +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 85708-06 for ; Thu, 28 Aug 2003 06:08:38 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id EFBE0D1DA4D for ; Thu, 28 Aug 2003 06:08:19 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7S9Cb55010815 for ; Thu, 28 Aug 2003 14:42:37 +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 h7S9Cahi010802 for ; Thu, 28 Aug 2003 14:42:37 +0530 From: "Shridhar Daithankar" To: Date: Thu, 28 Aug 2003 14:40:03 +0530 MIME-Version: 1.0 Subject: Re: Queries sometimes take 1000 times the normal time Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4E1443.7646.12E864@localhost> In-reply-to: References: 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: 200308/401 X-Sequence-Number: 3217 On 28 Aug 2003 at 10:02, Russell Garrett wrote: > The web site queries will jump up one or two orders of magnitude (I have > seen a normally 100ms query take in excess of 30 seconds) in duration at > seemingly random points. It's not always when the transactions are > committing, and it doesn't seem to be during checkpointing either. The same > thing happens with WAL switched off. It appears to happen the first time the > query runs after a while. If I run the same query immediately afterwards, it > will take the normal amount of time. Looks like it got flushed out of every type of cache and IO scheduler could not deliver immediately because of other loads... Bye Shridhar -- Abstainer, n.: A weak person who yields to the temptation of denying himself a pleasure. -- Ambrose Bierce, "The Devil's Dictionary" From pgsql-performance-owner@postgresql.org Thu Aug 28 06:19: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 B4A93D1DA61 for ; Thu, 28 Aug 2003 09:19:52 +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 86686-08 for ; Thu, 28 Aug 2003 06:19:22 -0300 (ADT) Received: from lakemtao04.cox.net (lakemtao04.cox.net [68.1.17.241]) by svr1.postgresql.org (Postfix) with ESMTP id 98084D1DA4D for ; Thu, 28 Aug 2003 06:19:19 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao04.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030828091922.WUTV419.lakemtao04.cox.net@lhosts> for ; Thu, 28 Aug 2003 05:19:22 -0400 Subject: Re: The results of my PostgreSQL/filesystem performance From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <3F4C0DC4.8070105@potentialtech.com> References: <3F4C0DC4.8070105@potentialtech.com> Content-Type: text/plain Message-Id: <1062062361.25751.179.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 28 Aug 2003 04:19:21 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/402 X-Sequence-Number: 3218 On Tue, 2003-08-26 at 20:47, Bill Moran wrote: > Hey all. > > I said I was going to do it, and I finally did it. > > As with all performance tests/benchmarks, there are probably dozens or > more reasons why these results aren't as accurate or wonderful as they > should be. Take them for what they are and hopefully everyone can > learn a few things from them. > > Intelligent feedback is welcome. > > http://www.potentialtech.com/wmoran/postgresql.php Hi, Woody has pg 7.2.1. Note also that Woody comes with kernel 2.4.18. It would be interesting to see how Debian Sid (kernel 2.4.21 and pg 7.3.3) would perform. Thanks for the results! -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "Oh, great altar of passive entertainment, bestow upon me thy discordant images at such speed as to render linear thought impossible" Calvin, regarding TV From pgsql-performance-owner@postgresql.org Thu Aug 28 06:24: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 DD349D1B8B5 for ; Thu, 28 Aug 2003 09:23:59 +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 89618-02 for ; Thu, 28 Aug 2003 06:23:29 -0300 (ADT) Received: from lakemtao01.cox.net (lakemtao01.cox.net [68.1.17.244]) by svr1.postgresql.org (Postfix) with ESMTP id 6FF73D1B8AD for ; Thu, 28 Aug 2003 06:23:27 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao01.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030828092328.JMKF5378.lakemtao01.cox.net@lhosts> for ; Thu, 28 Aug 2003 05:23:28 -0400 Subject: Re: The results of my PostgreSQL/filesystem performance From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <3F4C0DC4.8070105@potentialtech.com> References: <3F4C0DC4.8070105@potentialtech.com> Content-Type: text/plain Message-Id: <1062062608.25226.182.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 28 Aug 2003 04:23:29 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/403 X-Sequence-Number: 3219 On Tue, 2003-08-26 at 20:47, Bill Moran wrote: > Hey all. > > I said I was going to do it, and I finally did it. > > As with all performance tests/benchmarks, there are probably dozens or > more reasons why these results aren't as accurate or wonderful as they > should be. Take them for what they are and hopefully everyone can > learn a few things from them. > > Intelligent feedback is welcome. > > http://www.potentialtech.com/wmoran/postgresql.php I notice that the Linux FSs weren't tested with noatime. Any reason? -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "As I like to joke, I may have invented it, but Microsoft made it popular" David Bradley, regarding Ctrl-Alt-Del From pgsql-performance-owner@postgresql.org Thu Aug 28 06:29: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 53685D1B550 for ; Thu, 28 Aug 2003 09:29: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 85284-10 for ; Thu, 28 Aug 2003 06:28:30 -0300 (ADT) Received: from mta06-svc.ntlworld.com (mta06-svc.ntlworld.com [62.253.162.46]) by svr1.postgresql.org (Postfix) with ESMTP id BFF53D1B947 for ; Thu, 28 Aug 2003 06:28:27 -0300 (ADT) Received: from russell ([81.99.189.14]) by mta06-svc.ntlworld.com (InterMail vM.4.01.03.37 201-229-121-137-20020806) with SMTP id <20030828092829.KUWY9588.mta06-svc.ntlworld.com@russell> for ; Thu, 28 Aug 2003 10:28:29 +0100 From: "Russell Garrett" To: Subject: Re: Queries sometimes take 1000 times the normal time Date: Thu, 28 Aug 2003 10:28:29 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <3F4E1443.7646.12E864@localhost> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/404 X-Sequence-Number: 3220 >> The web site queries will jump up one or two orders of magnitude (I >> have seen a normally 100ms query take in excess of 30 seconds) in >> duration at seemingly random points. It's not always when the >> transactions are committing, and it doesn't seem to be during >> checkpointing either. The same thing happens with WAL switched off. >> It appears to happen the first time the query runs after a while. If >> I run the same query immediately afterwards, it will take the normal >> amount of time. > > Looks like it got flushed out of every type of cache and IO scheduler > could not deliver immediately because of other loads... Yeah, I wasn't sure what (or how) Postgres caches. The db server does have 2Gb of memory, but then again the database amounts to more than 2Gb, so it's fairly possible it's getting pushed out of cache. It's also fairly possible that it's not tuned completely optimally. I wonder if FreeBSD/kernel 2.6 would perform better in such a situation... Russ From pgsql-performance-owner@postgresql.org Thu Aug 28 09:22: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 0F36CD1B8E7 for ; Thu, 28 Aug 2003 12:22:51 +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 06598-05 for ; Thu, 28 Aug 2003 09:22:23 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id CABE2D1B8B1 for ; Thu, 28 Aug 2003 09:22:19 -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 h7SCMJem084268 for ; Thu, 28 Aug 2003 12:22:19 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7SBrCAV076633 for pgsql-performance@postgresql.org; Thu, 28 Aug 2003 11:53:12 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: The results of my PostgreSQL/filesystem performance tests Date: Thu, 28 Aug 2003 07:48:07 -0400 Organization: cbbrowne Computing Inc Lines: 27 Message-ID: References: <3F4C0DC4.8070105@potentialtech.com> <001201c36d24$3c572460$0500a8c0@MOBILE01> 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:6KlW8VHh8eU4/H9nNw98r1rGIpE= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/406 X-Sequence-Number: 3222 A long time ago, in a galaxy far, far away, balazs@neusolutions.com ("Balazs Wellisch") wrote: > Very interesting results. I'd like to command you on your honesty. > Having started out with the intentions of proving that FreeBSD is faster > than Linux only to find that the opposite is true must not have been > rewarding for you. However, these unexpected results serve only to > reinforce the integrity of your tests. Well put. To see a result that the tester didn't really want to see/present does suggest good things about the tester's honesty. There was incentive to hide unfavorable results. What it still leaves quite open is just what happens when the OS has more than one disk drive or CPU to play with. It's not clear what happens in such cases, whether FreeBSD would catch up, or be "left further in the dust." The traditional "propaganda" has been that there are all sorts of reasons to expect PostgreSQL on FreeBSD to run a bit faster than on Linux; it is a bit unexpected for the opposite to seem true. -- output = reverse("gro.mca" "@" "enworbbc") http://www3.sympatico.ca/cbbrowne/sap.html "I am aware of the benefits of a micro kernel approach. However, the fact remains that Linux is here, and GNU isn't --- and people have been working on Hurd for a lot longer than Linus has been working on Linux." -- Ted T'so, 1992. From pgsql-performance-owner@postgresql.org Thu Aug 28 09:05:43 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 9096ED1B8A9 for ; Thu, 28 Aug 2003 12:05:41 +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 04574-06 for ; Thu, 28 Aug 2003 09:05:12 -0300 (ADT) Received: from freeman.netbox.cz (freeman.netbox.cz [212.96.166.34]) by svr1.postgresql.org (Postfix) with ESMTP id F1816D1D9EE for ; Thu, 28 Aug 2003 09:05:07 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by freeman.netbox.cz (Postfix) with ESMTP id E6542138244; Thu, 28 Aug 2003 14:04:40 +0200 (CEST) Received: from freeman.netbox.cz ([127.0.0.1]) by localhost (freeman [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 32422-10; Thu, 28 Aug 2003 14:04:40 +0200 (CEST) Received: from smtp.pzkagis.cz (gis.netbox.cz [212.96.173.85]) by freeman.netbox.cz (Postfix) with ESMTP id 0CE72138E38; Thu, 28 Aug 2003 14:04:38 +0200 (CEST) Received: (from luf@localhost) by smtp.pzkagis.cz (8.11.6/8.11.6) id h7SC55Y18133; Thu, 28 Aug 2003 14:05:05 +0200 Date: Thu, 28 Aug 2003 14:05:05 +0200 From: Ludek Finstrle To: pgsql-performance@postgresql.org Cc: Bill Moran Subject: Re: The results of my PostgreSQL/filesystem performance tests Message-ID: <20030828120505.GA16573@soptik.pzkagis.cz> References: <3F4C0DC4.8070105@potentialtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4C0DC4.8070105@potentialtech.com> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new-20030314-p2 (Debian) at netbox.cz X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/405 X-Sequence-Number: 3221 > Intelligent feedback is welcome. > > http://www.potentialtech.com/wmoran/postgresql.php Good work. But I can't find information about xfs. Do you plan to add this one FS in test? Luf From pgsql-performance-owner@postgresql.org Thu Aug 28 09:25: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 DC1E3D1B8B1 for ; Thu, 28 Aug 2003 12:25:49 +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 06232-08 for ; Thu, 28 Aug 2003 09:25:17 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id 228F8D1DA3C for ; Thu, 28 Aug 2003 09:25:13 -0300 (ADT) Received: (qmail 30534 invoked from network); 28 Aug 2003 12:25:18 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 28 Aug 2003 12:25:18 -0000 Date: Thu, 28 Aug 2003 08:25:18 -0400 (EDT) From: Jeff To: Bill Moran Cc: "pgsql-performance@postgresql.org" Subject: Re: The results of my PostgreSQL/filesystem performance In-Reply-To: <3F4C0DC4.8070105@potentialtech.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/407 X-Sequence-Number: 3223 On Tue, 26 Aug 2003, Bill Moran wrote: > > Intelligent feedback is welcome. > That's some good work there, Lou. You'll make sgt for that someday. But I think the next step, before trying out other filesystems and options would be concurrency. Run a bunch of these beasts together and see what happens (I don't think too many of us have a single session running). Perhaps even make them "interfere" with each other to create as much "pain" as possible? on a side note - I might be blind here - I didn't see what version of pg you were using or any postgresql.conf tweaks - or did you just use whatever came with each distro? -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-bugs-owner@postgresql.org Thu Aug 28 11:47:32 2003 X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0918CD1DA63; Thu, 28 Aug 2003 12:57:51 +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 12282-02; Thu, 28 Aug 2003 09:57:22 -0300 (ADT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id BB9D4D1D9F4; Thu, 28 Aug 2003 09:56:58 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 19sMKZ-0007gP-0Z; Thu, 28 Aug 2003 13:56:52 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 054A416DC3; Thu, 28 Aug 2003 13:56:51 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 12F9916DA4; Thu, 28 Aug 2003 13:56:50 +0100 (BST) From: Richard Huxton To: Tarhon-Onu Victor , pgsql-bugs@postgresql.org Subject: Re: [PERFORM] pgsql inserts problem Date: Thu, 28 Aug 2003 13:56:49 +0100 User-Agent: KMail/1.5 Cc: pgsql-performance@postgresql.org References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308281356.49450.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/240 X-Sequence-Number: 6612 On Wednesday 27 August 2003 13:50, Tarhon-Onu Victor wrote: > > shared_buffers = 520 > max_locks_per_transaction = 128 > wal_buffers = 8 > max_fsm_relations = 30000 > max_fsm_pages = 482000 > sort_mem = 131072 > vacuum_mem = 131072 > effective_cache_size = 10000 > random_page_cost = 2 Slightly off-topic, but I think your tuning settings are a bit out. You've got 4MB allocated to shared_buffers but 128MB allocated to sort_mem? And only 80MB to effective_cache_size? Your settings might be right, but you'd need a very strange set of circumstances. As for PG silently discarding inserts, your best bet might be to write a short Perl script to reproduce the problem. Without that, people are likely to be sceptical - if PG tended to do this sort of thing, none of us would use it. -- Richard Huxton Archonet Ltd From pgsql-performance-owner@postgresql.org Thu Aug 28 10:44:33 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 C777DD1B8A8 for ; Thu, 28 Aug 2003 13:44: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 17981-02 for ; Thu, 28 Aug 2003 10:44:02 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 14EDFD1B8EF for ; Thu, 28 Aug 2003 10:43:58 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 0171D10248; Thu, 28 Aug 2003 09:36:04 -0400 (EDT) Received: from [10.0.2.5] (unknown [10.0.2.5]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 495171024D; Thu, 28 Aug 2003 09:36:02 -0400 (EDT) Subject: Re: The results of my PostgreSQL/filesystem performance tests From: Rod Taylor To: Bill Moran Cc: Postgresql Performance In-Reply-To: <3F4C0DC4.8070105@potentialtech.com> References: <3F4C0DC4.8070105@potentialtech.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-gN9s8XGNhM2qO/kp/76l" Message-Id: <1062078257.79027.5.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 28 Aug 2003 09:44:18 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/409 X-Sequence-Number: 3225 --=-gN9s8XGNhM2qO/kp/76l Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Couple of questions: What was the postgresql.conf configuration used? Default? How many threads of the script ran? Looks like a single user only. I assume there was nothing else running at the time (cron, sendmail, etc. were all off?) Do you know whether the machines were disk or I/O bound? Was PostgreSQL compiled the same for each OS or did you use the rpm, deb, tgz that were available? On Tue, 2003-08-26 at 21:47, Bill Moran wrote: > Hey all. >=20 > I said I was going to do it, and I finally did it. >=20 > As with all performance tests/benchmarks, there are probably dozens or > more reasons why these results aren't as accurate or wonderful as they > should be. Take them for what they are and hopefully everyone can > learn a few things from them. >=20 > Intelligent feedback is welcome. >=20 > http://www.potentialtech.com/wmoran/postgresql.php --=-gN9s8XGNhM2qO/kp/76l 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/Tgcx6DETLow6vwwRApR+AJ9Vjw1f2yzXJanIxNVyaIGmRaCpCwCeO5DL Ky3s2eNe0c841HSL/AITjug= =KF6J -----END PGP SIGNATURE----- --=-gN9s8XGNhM2qO/kp/76l-- From pgsql-performance-owner@postgresql.org Thu Aug 28 10:45:45 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 1A804D1DA65 for ; Thu, 28 Aug 2003 13:45:43 +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 14705-08 for ; Thu, 28 Aug 2003 10:45:13 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id 44E62D1D888 for ; Thu, 28 Aug 2003 10:45:08 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7SDjAi27217 for ; Thu, 28 Aug 2003 15:45:10 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7SDjAV27213 for ; Thu, 28 Aug 2003 15:45:10 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id E82706FCCE; Thu, 28 Aug 2003 15:44:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id DED817F6EA for ; Thu, 28 Aug 2003 15:44:58 +0200 (CEST) Date: Thu, 28 Aug 2003 15:44:58 +0200 (CEST) From: Tomka Gergely Cc: psql performance list Subject: Re: The results of my PostgreSQL/filesystem performance In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/410 X-Sequence-Number: 3226 2003-08-28 ragyog=F3 napj=E1n Christopher Browne ezt =FCzente: > A long time ago, in a galaxy far, far away, balazs@neusolutions.com ("Bal= azs Wellisch") wrote: > > Very interesting results. I'd like to command you on your honesty. > > Having started out with the intentions of proving that FreeBSD is faster > > than Linux only to find that the opposite is true must not have been > > rewarding for you. However, these unexpected results serve only to > > reinforce the integrity of your tests. > > Well put. > > To see a result that the tester didn't really want to see/present does > suggest good things about the tester's honesty. There was incentive > to hide unfavorable results. > > What it still leaves quite open is just what happens when the OS has > more than one disk drive or CPU to play with. It's not clear what > happens in such cases, whether FreeBSD would catch up, or be "left > further in the dust." The traditional "propaganda" has been that > there are all sorts of reasons to expect PostgreSQL on FreeBSD to run > a bit faster than on Linux; it is a bit unexpected for the opposite to > seem true. AFAIK *BSD better in the handling of big loads - maybe when multiple concurrent tests run against a linux and a bsd box, we see better result. Or not. --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-performance-owner@postgresql.org Thu Aug 28 10:46: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 24F02D1DA71 for ; Thu, 28 Aug 2003 13:46:24 +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 18385-03 for ; Thu, 28 Aug 2003 10:45:55 -0300 (ADT) Received: from gate.gau.hu (gate.gau.hu [192.188.242.65]) by svr1.postgresql.org (Postfix) with ESMTP id B8262D1DA67 for ; Thu, 28 Aug 2003 10:45:50 -0300 (ADT) Received: from gate.gau.hu (localhost [127.0.0.1]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7SDjsi27247 for ; Thu, 28 Aug 2003 15:45:54 +0200 (MEST) Received: from zeus.gau.hu (zeus.gau.hu [192.188.242.66]) by gate.gau.hu (8.11.6+Sun/8.11.6/1.0) with ESMTP id h7SDjrV27243; Thu, 28 Aug 2003 15:45:53 +0200 (MEST) Received: by zeus.gau.hu (Postfix, from userid 1004) id 8968B6FCCE; Thu, 28 Aug 2003 15:45:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zeus.gau.hu (Postfix) with ESMTP id 803267F6EA; Thu, 28 Aug 2003 15:45:42 +0200 (CEST) Date: Thu, 28 Aug 2003 15:45:42 +0200 (CEST) From: Tomka Gergely To: Ludek Finstrle Cc: , Bill Moran Subject: Re: The results of my PostgreSQL/filesystem performance In-Reply-To: <20030828120505.GA16573@soptik.pzkagis.cz> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/411 X-Sequence-Number: 3227 2003-08-28 ragyog=F3 napj=E1n Ludek Finstrle ezt =FCzente: > > Intelligent feedback is welcome. > > > > http://www.potentialtech.com/wmoran/postgresql.php > > Good work. But I can't find information about xfs. Do you plan to add > this one FS in test? http://mail.sth.sze.hu/~hsz/sql/ --=20 Tomka Gergely "S most - vajon barb=E1rok n=E9lk=FCl mi lesz vel=FCnk? =D5k m=E9giscsak megold=E1s voltak valahogy..." From pgsql-performance-owner@postgresql.org Thu Aug 28 11:09:42 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 8C013D1B8CF for ; Thu, 28 Aug 2003 14:09:39 +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 21614-03 for ; Thu, 28 Aug 2003 11:09:10 -0300 (ADT) Received: from wired.hub.org (u173n10.eastlink.ca [24.224.173.10]) by svr1.postgresql.org (Postfix) with ESMTP id 631B1D1B8AE for ; Thu, 28 Aug 2003 11:09:05 -0300 (ADT) Received: from [192.168.1.3] ([192.168.1.3]) by wired.hub.org (8.12.9/8.12.9) with ESMTP id h7SE87N2003385; Thu, 28 Aug 2003 11:08:07 -0300 (ADT) (envelope-from excalibur@hub.org) Subject: Re: Hardware recommendations to scale to silly load From: Chris Bowlby Reply-To: excalibur@hub.org To: Ron Johnson Cc: PgSQL Performance ML In-Reply-To: <1061953146.18108.291.camel@haggis> References: <1061948112.15800.53.camel@gibraltar.mattclark.net> <1061953146.18108.291.camel@haggis> Content-Type: text/plain Organization: Hub.Org Networking Services Message-Id: <1062079515.88334.24.camel@morpheus> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 28 Aug 2003 11:05:17 -0300 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/412 X-Sequence-Number: 3228 On Tue, 2003-08-26 at 23:59, Ron Johnson wrote: > What a fun exercises. Ok, lets see: > Postgres 7.3.4 > RH AS 2.1 > 12GB RAM > motherboard with 64 bit 66MHz PCI slots > 4 - Xenon 3.0GHz (1MB cache) CPUs > 8 - 36GB 15K RPM as RAID10 on a 64 bit 66MHz U320 controller > having 512MB cache (for database) > 2 - 36GB 15K RPM as RAID1 on a 64 bit 66MHz U320 controller > having 512MB cache (for OS, swap, WAL files) > 1 - library tape drive plugged into the OS' SCSI controller. I > prefer DLT, but that's my DEC bias. > 1 - 1000 volt UPS. Be careful here, we've seen that with the P4 Xeon's that are hyper-threaded and a system that has very high disk I/O causes the system to be sluggish and slow. But after disabling the hyper-threading itself, our system flew.. -- Chris Bowlby Hub.Org Networking Services From pgsql-performance-owner@postgresql.org Thu Aug 28 11:22: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 76498D1D9EE for ; Thu, 28 Aug 2003 14:22: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 22099-06 for ; Thu, 28 Aug 2003 11:21:28 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id C053AD1DA4D for ; Thu, 28 Aug 2003 11:21:14 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7SEPoLw005860 for ; Thu, 28 Aug 2003 19:55:50 +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 h7SEPnhi005832 for ; Thu, 28 Aug 2003 19:55:49 +0530 From: "Shridhar Daithankar" To: PgSQL Performance ML Date: Thu, 28 Aug 2003 19:53:13 +0530 MIME-Version: 1.0 Subject: Re: Hardware recommendations to scale to silly load Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4E5DA9.6396.5C8916@localhost> In-reply-to: <1062079515.88334.24.camel@morpheus> References: <1061953146.18108.291.camel@haggis> 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: 200308/413 X-Sequence-Number: 3229 On 28 Aug 2003 at 11:05, Chris Bowlby wrote: > On Tue, 2003-08-26 at 23:59, Ron Johnson wrote: > > > What a fun exercises. Ok, lets see: > > Postgres 7.3.4 > > RH AS 2.1 > > 12GB RAM > > motherboard with 64 bit 66MHz PCI slots > > 4 - Xenon 3.0GHz (1MB cache) CPUs > > 8 - 36GB 15K RPM as RAID10 on a 64 bit 66MHz U320 controller > > having 512MB cache (for database) > > 2 - 36GB 15K RPM as RAID1 on a 64 bit 66MHz U320 controller > > having 512MB cache (for OS, swap, WAL files) > > 1 - library tape drive plugged into the OS' SCSI controller. I > > prefer DLT, but that's my DEC bias. > > 1 - 1000 volt UPS. > > Be careful here, we've seen that with the P4 Xeon's that are > hyper-threaded and a system that has very high disk I/O causes the > system to be sluggish and slow. But after disabling the hyper-threading > itself, our system flew.. Anybody has opteron working? Hows' the performance? Bye Shridhar -- A father doesn't destroy his children. -- Lt. Carolyn Palamas, "Who Mourns for Adonais?", stardate 3468.1. From pgsql-performance-owner@postgresql.org Thu Aug 28 11:38: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 A599CD1DA77 for ; Thu, 28 Aug 2003 14:38: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 23283-07 for ; Thu, 28 Aug 2003 11:38:16 -0300 (ADT) Received: from ram.rentec.com (ram.rentec.com [192.5.35.66]) by svr1.postgresql.org (Postfix) with ESMTP id 43142D1B8A8 for ; Thu, 28 Aug 2003 11:38:06 -0300 (ADT) Received: from rentec.com (IDENT:618@murre.rentec.com [192.5.35.148]) by ram.rentec.com (8.12.1/8.12.1) with ESMTP id h7SEc7w5000586; Thu, 28 Aug 2003 10:38:08 -0400 (EDT) Message-ID: <3F4E13CF.7080202@rentec.com> Date: Thu, 28 Aug 2003 10:38:07 -0400 From: Michael Guerin User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephan Szabo Cc: pgsql-performance@postgresql.org Subject: Re: Simple queries take forever to run References: <20030827182051.W85397-100000@megazone.bigpanda.com> In-Reply-To: <20030827182051.W85397-100000@megazone.bigpanda.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/414 X-Sequence-Number: 3230 Stephan Szabo wrote: >On Wed, 27 Aug 2003, Michael Guerin wrote: > > > >>I'm running into some performance problems trying to execute simple >>queries. >> >>postgresql version 7.3.3 >>.conf params changed from defaults. >>shared_buffers = 64000 >>sort_mem = 64000 >>fsync = false >>effective_cache_size = 400000 >> >>ex. query: select * from x where id in (select id from y); >> >>There's an index on each table for id. SQL Server takes <1s to return, >>postgresql doesn't return at all, neither does explain analyze. >> >> > >IN(subquery) is known to run poorly in 7.3.x and earlier. 7.4 is >generally much better (for reasonably sized subqueries) but in earlier >versions you'll probably want to convert into an EXISTS or join form. > > > > Something else seems to be going on, even switching to an exists clause gives much better but poor performance. count(*) where exists clause: Postgresql 19s, SQL Server <1s count(*) where not exists: 23.3s SQL Server 1.5s SQL Server runs on a dual 1.4 with 4gigs, win2k Postgresql runs on a quad 900 with 8 gigs, sunos 5.8 From pgsql-performance-owner@postgresql.org Thu Aug 28 11:40: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 D4E8ED1DA67 for ; Thu, 28 Aug 2003 14:39:50 +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 26183-01 for ; Thu, 28 Aug 2003 11:39:22 -0300 (ADT) Received: from lorax.kciLink.com (lorax.kciLink.com [206.112.95.1]) by svr1.postgresql.org (Postfix) with ESMTP id B758FD1DA5B for ; Thu, 28 Aug 2003 11:39:10 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by lorax.kciLink.com (Postfix) with ESMTP id 30D8C3E24 for ; Thu, 28 Aug 2003 10:39:05 -0400 (EDT) Received: from lorax.kciLink.com ([127.0.0.1]) by localhost (lorax.kciLink.com [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 83540-03 for ; Thu, 28 Aug 2003 10:38:54 -0400 (EDT) Received: from lorax.kciLink.com (localhost [127.0.0.1]) by lorax.kciLink.com (Postfix) with ESMTP id A33323E07 for ; Thu, 28 Aug 2003 10:38:54 -0400 (EDT) Received: (from news@localhost) by lorax.kciLink.com (8.12.8p1/8.12.8/Submit) id h7SEcsw0095679 for pgsql-performance@postgresql.org; Thu, 28 Aug 2003 10:38:54 -0400 (EDT) To: pgsql-performance@postgresql.org Path: not-for-mail From: Vivek Khera Newsgroups: ml.postgres.performance Subject: Re: Hardware recommendations to scale to silly load Date: Thu, 28 Aug 2003 10:38:54 -0400 Organization: Khera Communications, Inc., Rockville, MD Lines: 23 Message-ID: References: NNTP-Posting-Host: yertle.kcilink.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: lorax.kciLink.com 1062081534 70958 216.194.193.105 (28 Aug 2003 14:38:54 GMT) X-Complaints-To: daemon@kciLink.com NNTP-Posting-Date: Thu, 28 Aug 2003 14:38:54 +0000 (UTC) User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Portable Code, berkeley-unix) Cancel-Lock: sha1:MSU5ZEGWMrhK+vkcq+fG/5pfm3c= X-Virus-Scanned: by amavisd-new at kciLink.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/415 X-Sequence-Number: 3231 sm> On 27 Aug 2003, matt wrote: >> My app is likely to come under some serious load in the next 6 months, >> but the increase will be broadly predictable, so there is time to throw >> hardware at the problem. >> >> Currently I have a ~1GB DB, with the largest (and most commonly accessed >> and updated) two tables having 150,000 and 50,000 rows. Just how big do you expect your DB to grow? For a 1GB disk-space database, I'd probably just splurge for an SSD hooked up either via SCSI or FibreChannel. Heck, up to about 5Gb or so it is not that expensive (about $25k) and adding another 5Gb should set you back probably another $20k. I use an SSD from Imperial Technology ( http://www.imperialtech.com/ ) for mail spools. My database is way to big for my budget to put in SSD. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D. Khera Communications, Inc. Internet: khera@kciLink.com Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/ From pgsql-performance-owner@postgresql.org Thu Aug 28 11:55: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 D3884D1B8A8 for ; Thu, 28 Aug 2003 14:42: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 24756-06 for ; Thu, 28 Aug 2003 11:41:38 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 13B36D1B8AC for ; Thu, 28 Aug 2003 11:41:34 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id D99DE1025B; Thu, 28 Aug 2003 10:33:38 -0400 (EDT) Received: from [10.0.2.5] (unknown [10.0.2.5]) by mailav.tor1.inquent.com (Postfix) with ESMTP id E479B10248; Thu, 28 Aug 2003 10:33:36 -0400 (EDT) Subject: Re: Hardware recommendations to scale to silly load From: Rod Taylor To: matt Cc: Postgresql Performance In-Reply-To: <1061948112.15800.53.camel@gibraltar.mattclark.net> References: <1061948112.15800.53.camel@gibraltar.mattclark.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-8Ri+bSb4TjfLFIlUn21U" Message-Id: <1062081711.79027.55.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 28 Aug 2003 10:41:52 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/417 X-Sequence-Number: 3233 --=-8Ri+bSb4TjfLFIlUn21U Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > I need to increase the overall performance by a factor of 10, while at > the same time the DB size increases by a factor of 50. e.g. 3000 > inserts/updates or 25,000 selects per second, over a 25GB database with > most used tables of 5,000,000 and 1,000,000 rows. Ok.. I would be surprised if you needed much more actual CPU power. I suspect they're mostly idle waiting on data -- especially with a Quad Xeon (shared memory bus is it not?). I'd be looking to get your hands on a large pSeries machine from IBM or perhaps an 8-way Opteron (not that hard to come by today, should be easy in the near future). The key is low latency ram tied to a chip rather than a centralized bus -- a 3800 SunFire would do too ;). Write performance won't matter very much. 3000 inserts/second isn't high -- some additional battery backed write cache may be useful but not overly important with enough ram to hold the complete dataset. I suspect those are slow due to things like foreign keys -- which of course are=20 selects. > Notably, the data is very time-sensitive, so the active dataset at any > hour is almost certainly going to be more on the order of 5GB than 25GB > (plus I'll want all the indexes in RAM of course). Very good. Find yourself 8GB to 12GB ram and you should be fine. In this case, additional ram will keep the system from hitting the disk for writes as well. You may want to play around with checkpoints. Prevention of a checkpoint during this hour will help prevent peaks. Be warned though, WAL will grow very large, and recovery time should a crash occur could be painful. You say the data is very time sensitive -- how time sensitive? Are the selects all based on this weeks data? A copy of the database on a second machine (say your Quad Xeon) for static per client data would be very useful to reduce needless load. I assume the application servers have already cached any static global data by this point. Finally, upgrade to 7.4. Do use prepared statements. Do limit the number of connections any given application server is allowed (especially for short transactions). 3 PostgreSQL processes per CPU (where the box limit is not Disk) seems to be about right -- your OS may vary. Pre-calculate anything you can. Are the $ amounts for a transaction generally the the same? Do you tend to have repeat clients? Great -- make your current clients transactions a day in advance. Now you have a pair of selects and 1 update (mark it with the time the client actually approved it). If the client doesn't approve of the pre-calculated transaction, throw it away at some later time. --=-8Ri+bSb4TjfLFIlUn21U 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/ThSu6DETLow6vwwRAvAKAJ45oyRPzstiRHLsN2kHrWUzNbhN8QCfVTC8 IG0hzGbNR9gS57QkEA+C7Fw= =TChY -----END PGP SIGNATURE----- --=-8Ri+bSb4TjfLFIlUn21U-- From pgsql-performance-owner@postgresql.org Thu Aug 28 11:48: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 B314AD1DA57 for ; Thu, 28 Aug 2003 14:44:21 +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 26183-03 for ; Thu, 28 Aug 2003 11:43:46 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id E6411D1DA4D for ; Thu, 28 Aug 2003 11:43:39 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7SEmHTx012387 for ; Thu, 28 Aug 2003 20:18:17 +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 h7SEmGhi012374 for ; Thu, 28 Aug 2003 20:18:16 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Thu, 28 Aug 2003 20:15:40 +0530 MIME-Version: 1.0 Subject: Re: Simple queries take forever to run Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4E62EC.15091.71172C@localhost> In-reply-to: <3F4E13CF.7080202@rentec.com> References: <20030827182051.W85397-100000@megazone.bigpanda.com> 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: 200308/416 X-Sequence-Number: 3232 On 28 Aug 2003 at 10:38, Michael Guerin wrote: > >IN(subquery) is known to run poorly in 7.3.x and earlier. 7.4 is > >generally much better (for reasonably sized subqueries) but in earlier > >versions you'll probably want to convert into an EXISTS or join form. > Something else seems to be going on, even switching to an exists clause > gives much better but poor performance. > count(*) where exists clause: Postgresql 19s, SQL Server <1s > count(*) where not exists: 23.3s SQL Server 1.5s This was with 7.4? Can you try downloading 7.4CVS and try? > > SQL Server runs on a dual 1.4 with 4gigs, win2k > Postgresql runs on a quad 900 with 8 gigs, sunos 5.8 SunOS...Not the impala out there but anyways I would refrain from slipping in that.. Parden me if this is a repeatation, have you set your effective cache size? Bye Shridhar -- Nouvelle cuisine, n.: French for "not enough food".Continental breakfast, n.: English for "not enough food".Tapas, n.: Spanish for "not enough food".Dim Sum, n.: Chinese for more food than you've ever seen in your entire life. From pgsql-performance-owner@postgresql.org Thu Aug 28 12:31:25 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 57364D1B8B4 for ; Thu, 28 Aug 2003 15:31:24 +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 33815-07 for ; Thu, 28 Aug 2003 12:30:52 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id A868CD1B8BD for ; Thu, 28 Aug 2003 12:30:48 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id C9A58D627; Thu, 28 Aug 2003 08:19:53 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id B67515C0E; Thu, 28 Aug 2003 08:19:53 -0700 (PDT) Date: Thu, 28 Aug 2003 08:19:53 -0700 (PDT) From: Stephan Szabo To: Michael Guerin Cc: Subject: Re: Simple queries take forever to run In-Reply-To: <3F4E13CF.7080202@rentec.com> Message-ID: <20030828081914.A6403-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/418 X-Sequence-Number: 3234 On Thu, 28 Aug 2003, Michael Guerin wrote: > Stephan Szabo wrote: > > >On Wed, 27 Aug 2003, Michael Guerin wrote: > > > > > > > >>I'm running into some performance problems trying to execute simple > >>queries. > >> > >>postgresql version 7.3.3 > >>.conf params changed from defaults. > >>shared_buffers = 64000 > >>sort_mem = 64000 > >>fsync = false > >>effective_cache_size = 400000 > >> > >>ex. query: select * from x where id in (select id from y); > >> > >>There's an index on each table for id. SQL Server takes <1s to return, > >>postgresql doesn't return at all, neither does explain analyze. > >> > >> > > > >IN(subquery) is known to run poorly in 7.3.x and earlier. 7.4 is > >generally much better (for reasonably sized subqueries) but in earlier > >versions you'll probably want to convert into an EXISTS or join form. > > > > > > > > > Something else seems to be going on, even switching to an exists clause > gives much better but poor performance. > count(*) where exists clause: Postgresql 19s, SQL Server <1s > count(*) where not exists: 23.3s SQL Server 1.5s What does explain analyze show for the two queries? From pgsql-performance-owner@postgresql.org Thu Aug 28 12:35:52 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 D2B88D1B8B1 for ; Thu, 28 Aug 2003 15:35:51 +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 36291-04 for ; Thu, 28 Aug 2003 12:35:20 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 368FFD1B8AC for ; Thu, 28 Aug 2003 12:35:20 -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 h7SFYIp5007365; Thu, 28 Aug 2003 09:34:20 -0600 (MDT) Date: Thu, 28 Aug 2003 09:33:15 -0600 (MDT) From: "scott.marlowe" To: matt Cc: Subject: Re: Hardware recommendations to scale to silly load In-Reply-To: <1062002965.15800.208.camel@gibraltar.mattclark.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner-ihs-com: Found to be clean X-MailScanner-SpamCheck-ihs-com: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/419 X-Sequence-Number: 3235 On 27 Aug 2003, matt wrote: > > You probably, more than anything, should look at some kind of > > superfast, external storage array > > Yeah, I think that's going to be a given. Low end EMC FibreChannel > boxes can do around 20,000 IOs/sec, which is probably close to good > enough. > > You mentioned using multiple RAID controllers as a boost - presumably > the trick here is to split the various elements (WAL, tables, indexes) > across different controllers using symlinks or suchlike? Can I feasibly > split the DB tables across 5 or more controllers? I'm not sure I'd split the tables by hand right up front. Try getting as many hard drives as you can afford hooked up at once, and then try different ways of partitioning them. I'm guessing that making two fairly good sized 1+0 sets, one for data and one for WAL might be the best answer. > > Actually, I've seen stuff like that going on Ebay pretty cheap lately. I > > saw a 64 CPU E10k (366 MHz CPUs) with 64 gigs ram and 20 hard drives going > > for $24,000 a month ago. Put Linux or BSD on it and Postgresql should > > fly. > > Jeez, and I thought I was joking about the Starfire. Even Slowaris > would be OK on one of them. > > The financial issue is that there's just not that much money in the > micropayments game for bursty sales. If I was doing these loads > *continuously* then I wouldn't be working, I'd be in the Maldives :-) $24,000 isn't that much for a server really, and if you can leverage this one "sale" to get more, then it would likely pay for itself over time. If you have problems keeping up with load, it will be harder to get more customers, so you kinda wanna do this as well as possible the first time. From pgsql-performance-owner@postgresql.org Thu Aug 28 15:23:38 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 AE5ACD1B8E5 for ; Thu, 28 Aug 2003 18:23: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 69053-06 for ; Thu, 28 Aug 2003 15:23:04 -0300 (ADT) Received: from perrin.nxad.com (internal.ext.nxad.com [69.1.70.251]) by svr1.postgresql.org (Postfix) with ESMTP id 02840D1B8A8 for ; Thu, 28 Aug 2003 15:23:03 -0300 (ADT) Received: by perrin.nxad.com (Postfix, from userid 1001) id AFF8F21058; Thu, 28 Aug 2003 11:23:01 -0700 (PDT) Resent-From: sean@chittenden.org Resent-Date: Thu, 28 Aug 2003 11:23:01 -0700 Resent-Message-ID: <20030828182301.GJ83759@perrin.nxad.com> Resent-To: pgsql-performance@postgresql.org Date: Thu, 28 Aug 2003 09:12:33 -0700 From: Sean Chittenden To: Christopher Browne Cc: pgsql-performance@postgresql.org Subject: Re: The results of my PostgreSQL/filesystem performance tests Message-ID: <20030828161233.GB83759@perrin.nxad.com> References: <3F4C0DC4.8070105@potentialtech.com> <001201c36d24$3c572460$0500a8c0@MOBILE01> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/431 X-Sequence-Number: 3247 > What it still leaves quite open is just what happens when the OS has > more than one disk drive or CPU to play with. It's not clear what > happens in such cases, whether FreeBSD would catch up, or be "left > further in the dust." The traditional "propaganda" has been that > there are all sorts of reasons to expect PostgreSQL on FreeBSD to > run a bit faster than on Linux; it is a bit unexpected for the > opposite to seem true. Let me nip this in the butt before people run away with ideas that aren't correct. When the tests were performed in FreeBSD 5.1 and Linux, the hard drives were running UDMA. When running 4.8, for some reason his drives settled in on PIO mode: ad0s1a: UDMA ICRC error writing fsbn 1458368 of 729184-729215 (ad0s1 bn 1458368; cn 241 tn 12 sn 44) retrying ad0s1a: UDMA ICRC error writing fsbn 1458368 of 729184-729215 (ad0s1 bn 1458368; cn 241 tn 12 sn 44) retrying ad0s1a: UDMA ICRC error writing fsbn 1458368 of 729184-729215 (ad0s1 bn 1458368; cn 241 tn 12 sn 44) retrying ad0s1a: UDMA ICRC error writing fsbn 1458368 of 729184-729215 (ad0s1 bn 1458368; cn 241 tn 12 sn 44) falling back to PIO mode The benchmarks were hardly conclusive as UDMA runs vastly faster than PIO. Until we hear back as to whether cables were jarred loose between the tests or hearing if something else changed, I'd hardly consider these conclusive tests given PIO/UDMA is apples to oranges in terms of speed and I fully expect that FreeBSD 4.8 will perform at least faster than 5.1 (5.x is still being unwound from Giant), but should out perform Linux as well if industry experience iss any indicator. -sc -- Sean Chittenden From pgsql-performance-owner@postgresql.org Thu Aug 28 13:20:28 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 DE03FD1B8B3 for ; Thu, 28 Aug 2003 16:20:26 +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 47215-02 for ; Thu, 28 Aug 2003 13:19:56 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 6A05CD1B8B1 for ; Thu, 28 Aug 2003 13:19:55 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19sPV5-0007wq-00 for ; Thu, 28 Aug 2003 12:19:55 -0400 Received: by dba2 (Postfix, from userid 1019) id 3DE77CF47; Thu, 28 Aug 2003 12:19:53 -0400 (EDT) Date: Thu, 28 Aug 2003 12:19:53 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: Hardware recommendations to scale to silly load Message-ID: <20030828161953.GG16942@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <1062002965.15800.208.camel@gibraltar.mattclark.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1062002965.15800.208.camel@gibraltar.mattclark.net> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/420 X-Sequence-Number: 3236 On Wed, Aug 27, 2003 at 05:49:25PM +0100, matt wrote: > > I'm also looking at renting equipment, or even trying out IBM/HP's > 'on-demand' offerings. To handle that kind of load, you're not going to be able to do it with cheap hardware. Renting may be your answer. a -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Thu Aug 28 13:31: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 CE286D1B8AD for ; Thu, 28 Aug 2003 16:31:16 +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 47404-04 for ; Thu, 28 Aug 2003 13:30:46 -0300 (ADT) Received: from wight.ymogen.net (unknown [217.27.240.153]) by svr1.postgresql.org (Postfix) with SMTP id B6529D1B8A9 for ; Thu, 28 Aug 2003 13:30:44 -0300 (ADT) Received: (qmail 25853 invoked from network); 28 Aug 2003 16:29:36 -0000 Received: from unknown (HELO solent) (213.165.136.12) by wight.ymogen.net with SMTP; 28 Aug 2003 16:29:36 -0000 From: "Matt Clark" To: "Vivek Khera" , Subject: Re: Hardware recommendations to scale to silly load Date: Thu, 28 Aug 2003 17:29:39 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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) Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/421 X-Sequence-Number: 3237 > Just how big do you expect your DB to grow? For a 1GB disk-space > database, I'd probably just splurge for an SSD hooked up either via > SCSI or FibreChannel. Heck, up to about 5Gb or so it is not that > expensive (about $25k) and adding another 5Gb should set you back > probably another $20k. I use an SSD from Imperial Technology > ( http://www.imperialtech.com/ ) for mail spools. My database is way > to big for my budget to put in SSD. I may well be able to split some tables that aren't used in joins into a separate DB, and could well use an SSD for those. In fact two of the inserts per user interaction could be split off, and they're not financially important tables, so fsync=false could be enabled for those, in which case an SSD might be overkill... The whole thing will definitely *not* fit in an SSD for a sensible price, but the WAL might well! From pgsql-performance-owner@postgresql.org Thu Aug 28 13:42:42 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 8F049D1B8B3 for ; Thu, 28 Aug 2003 16:42:41 +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 49772-01 for ; Thu, 28 Aug 2003 13:42:11 -0300 (ADT) Received: from wight.ymogen.net (unknown [217.27.240.153]) by svr1.postgresql.org (Postfix) with SMTP id CF646D1B8AB for ; Thu, 28 Aug 2003 13:42:09 -0300 (ADT) Received: (qmail 27964 invoked from network); 28 Aug 2003 16:37:21 -0000 Received: from unknown (HELO solent) (213.165.136.12) by wight.ymogen.net with SMTP; 28 Aug 2003 16:37:21 -0000 From: "Matt Clark" To: "Rod Taylor" Cc: "Postgresql Performance" Subject: Re: Hardware recommendations to scale to silly load Date: Thu, 28 Aug 2003 17:37:24 +0100 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) Importance: Normal In-Reply-To: <1062081711.79027.55.camel@jester> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/422 X-Sequence-Number: 3238 > Ok.. I would be surprised if you needed much more actual CPU power. I > suspect they're mostly idle waiting on data -- especially with a Quad > Xeon (shared memory bus is it not?). In reality the CPUs get pegged: about 65% PG and 35% system. But I agree that memory throughput and latency is an issue. > Write performance won't matter very much. 3000 inserts/second isn't high > -- some additional battery backed write cache may be useful but not > overly important with enough ram to hold the complete dataset. I suspect > those are slow due to things like foreign keys -- which of course are > selects. 3000 inserts/sec isn't high when they're inside one transaction, but if each is inside its own transaction then that's 3000 commits/second. > case, additional ram will keep the system from hitting the disk for > writes as well. How does that work? > You may want to play around with checkpoints. Prevention of a checkpoint > during this hour will help prevent peaks. Be warned though, WAL will > grow very large, and recovery time should a crash occur could be > painful. Good point. I'll have a think about that. From pgsql-performance-owner@postgresql.org Thu Aug 28 14:22:56 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 87E77D1B8A8 for ; Thu, 28 Aug 2003 17:22: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 58101-03 for ; Thu, 28 Aug 2003 14:22:24 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id DA3CED1B574 for ; Thu, 28 Aug 2003 14:22:22 -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 h7SHMMek070239 for ; Thu, 28 Aug 2003 17:22:22 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7SHFv9T068699 for pgsql-performance@postgresql.org; Thu, 28 Aug 2003 17:15:57 GMT From: teknokrat X-Newsgroups: comp.databases.postgresql.performance Subject: performance of foreign key constraints Date: Thu, 28 Aug 2003 18:15:57 +0100 Organization: Hub.Org Networking Services Lines: 7 Message-ID: Reply-To: teknokrat@yahoo.com 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 (X11; U; Linux i686; en-US; rv:1.0.0+) Gecko/20020518 X-Accept-Language: en-us, en, ko To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/423 X-Sequence-Number: 3239 I have a table that has about 20 foreign key constraints on it. I think this is a bit excessive and am considering removing them ( they are all related to the same table and I don't think there is much chance of any integrity violations ). Would this improve performance or not? thanks From pgsql-performance-owner@postgresql.org Thu Aug 28 14:26: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 10681D1B8A8 for ; Thu, 28 Aug 2003 17:26:12 +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 58776-02 for ; Thu, 28 Aug 2003 14:25:41 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id D4C8FD1B8AC for ; Thu, 28 Aug 2003 14:25:39 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19sQWi-0000gG-00 for ; Thu, 28 Aug 2003 13:25:40 -0400 Received: by dba2 (Postfix, from userid 1019) id E92E7D0AA; Thu, 28 Aug 2003 13:25:39 -0400 (EDT) Date: Thu, 28 Aug 2003 13:25:39 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: performance of foreign key constraints Message-ID: <20030828172539.GA17195@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/424 X-Sequence-Number: 3240 On Thu, Aug 28, 2003 at 06:15:57PM +0100, teknokrat wrote: > I have a table that has about 20 foreign key constraints on it. I think > this is a bit excessive and am considering removing them ( they are all > related to the same table and I don't think there is much chance of any > integrity violations ). Would this improve performance or not? Almost certainly. But there's probably room for some middle ground between 20 and none. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Thu Aug 28 14:28: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 2F9F3D1B8A9 for ; Thu, 28 Aug 2003 17:28: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 58101-04 for ; Thu, 28 Aug 2003 14:28:24 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id A2542D1B8A8 for ; Thu, 28 Aug 2003 14:28:19 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 08A58D595; Thu, 28 Aug 2003 10:28:20 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id F29315C02; Thu, 28 Aug 2003 10:28:19 -0700 (PDT) Date: Thu, 28 Aug 2003 10:28:19 -0700 (PDT) From: Stephan Szabo To: teknokrat Cc: Subject: Re: performance of foreign key constraints In-Reply-To: Message-ID: <20030828102646.Q9762-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/425 X-Sequence-Number: 3241 On Thu, 28 Aug 2003, teknokrat wrote: > I have a table that has about 20 foreign key constraints on it. I think > this is a bit excessive and am considering removing them ( they are all > related to the same table and I don't think there is much chance of any > integrity violations ). Would this improve performance or not? It depends on your frequency of inserts/updates to the table with the constraint and the frequency of update/delete to the table(s) being refered to. My guess is probably. You may wish to leave some of the constraints (decide which are the most important), but 20 does seem a bit excessive in general. From pgsql-performance-owner@postgresql.org Thu Aug 28 14:43: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 9CA38D1B8A4 for ; Thu, 28 Aug 2003 17:43:12 +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 60654-01 for ; Thu, 28 Aug 2003 14:42:41 -0300 (ADT) Received: from ram.rentec.com (ram.rentec.com [192.5.35.66]) by svr1.postgresql.org (Postfix) with ESMTP id 7C92ED1B8BC for ; Thu, 28 Aug 2003 14:42:36 -0300 (ADT) Received: from rentec.com (IDENT:618@murre.rentec.com [192.5.35.148]) by ram.rentec.com (8.12.1/8.12.1) with ESMTP id h7SHgZw5011314; Thu, 28 Aug 2003 13:42:35 -0400 (EDT) Message-ID: <3F4E3F0B.9000802@rentec.com> Date: Thu, 28 Aug 2003 13:42:35 -0400 From: Michael Guerin User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephan Szabo Cc: pgsql-performance@postgresql.org Subject: Re: Simple queries take forever to run References: <20030828081914.A6403-100000@megazone.bigpanda.com> In-Reply-To: <20030828081914.A6403-100000@megazone.bigpanda.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/426 X-Sequence-Number: 3242 Stephan Szabo wrote: >On Thu, 28 Aug 2003, Michael Guerin wrote: > > > >>Stephan Szabo wrote: >> >> >> >>>On Wed, 27 Aug 2003, Michael Guerin wrote: >>> >>> >>> >>> >>> >>>>I'm running into some performance problems trying to execute simple >>>>queries. >>>> >>>>postgresql version 7.3.3 >>>>.conf params changed from defaults. >>>>shared_buffers = 64000 >>>>sort_mem = 64000 >>>>fsync = false >>>>effective_cache_size = 400000 >>>> >>>>ex. query: select * from x where id in (select id from y); >>>> >>>>There's an index on each table for id. SQL Server takes <1s to return, >>>>postgresql doesn't return at all, neither does explain analyze. >>>> >>>> >>>> >>>> >>>IN(subquery) is known to run poorly in 7.3.x and earlier. 7.4 is >>>generally much better (for reasonably sized subqueries) but in earlier >>>versions you'll probably want to convert into an EXISTS or join form. >>> >>> >>> >>> >>> >>> >>Something else seems to be going on, even switching to an exists clause >>gives much better but poor performance. >>count(*) where exists clause: Postgresql 19s, SQL Server <1s >>count(*) where not exists: 23.3s SQL Server 1.5s >> >> > >What does explain analyze show for the two queries? > > > > explain analyze select count(*) from tbltimeseries where exists(select uniqid from tblobjectname where timeseriesid = uniqid); Aggregate (cost=5681552.18..5681552.18 rows=1 width=0) (actual time=22756.64..22756.64 rows=1 loops=1) -> Seq Scan on tbltimeseries (cost=0.00..5680051.34 rows=600336 width=0) (actual time=22.06..21686.78 rows=1200113 loops=1) Filter: (NOT (subplan)) SubPlan -> Index Scan using idx_objectname on tblobjectname (cost=0.00..4.70 rows=1 width=4) (actual time=0.01..0.01 rows=0 loops=1200673) Index Cond: ($0 = uniqid) Total runtime: 22756.83 msec (7 rows) fiasco=# explain analyze select count(*) from tbltimeseries where exists(select uniqid from tblobjectname where timeseriesid = uniqid); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------ explain analyze select count(*) from tbltimeseries where exists(select uniqid from tblobjectname where timeseriesid = uniqid); Aggregate (cost=5681552.18..5681552.18 rows=1 width=0) (actual time=19558.77..19558.77 rows=1 loops=1) -> Seq Scan on tbltimeseries (cost=0.00..5680051.34 rows=600336 width=0) (actual time=0.21..19557.73 rows=560 loops=1) Filter: (subplan) SubPlan -> Index Scan using idx_objectname on tblobjectname (cost=0.00..4.70 rows=1 width=4) (actual time=0.01..0.01 rows=0 loops=1200673) Index Cond: ($0 = uniqid) Total runtime: 19559.04 msec (7 rows) From pgsql-performance-owner@postgresql.org Thu Aug 28 15:22: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 D7F0ED1B8CD for ; Thu, 28 Aug 2003 18:22: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 65798-07 for ; Thu, 28 Aug 2003 15:22:23 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id C07A1D1B8BC for ; Thu, 28 Aug 2003 15:22:22 -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 h7SIMMek087739 for ; Thu, 28 Aug 2003 18:22:22 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7SHsd2S079486 for pgsql-performance@postgresql.org; Thu, 28 Aug 2003 17:54:39 GMT From: teknokrat X-Newsgroups: comp.databases.postgresql.performance Subject: Re: performance of foreign key constraints Date: Thu, 28 Aug 2003 18:54:40 +0100 Organization: Hub.Org Networking Services Lines: 25 Message-ID: References: <20030828102646.Q9762-100000@megazone.bigpanda.com> Reply-To: teknokrat@yahoo.com 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 (X11; U; Linux i686; en-US; rv:1.0.0+) Gecko/20020518 X-Accept-Language: en-us, en, ko In-Reply-To: <20030828102646.Q9762-100000@megazone.bigpanda.com> To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/430 X-Sequence-Number: 3246 Stephan Szabo wrote: > On Thu, 28 Aug 2003, teknokrat wrote: > > >>I have a table that has about 20 foreign key constraints on it. I think >>this is a bit excessive and am considering removing them ( they are all >>related to the same table and I don't think there is much chance of any >>integrity violations ). Would this improve performance or not? > > > It depends on your frequency of inserts/updates to the table with the > constraint and the frequency of update/delete to the table(s) being > refered to. My guess is probably. You may wish to leave some of the > constraints (decide which are the most important), but 20 does seem a bit > excessive in general. > The references are all to the same table i.e. they are employee ids, so leaving some and not others would make no sense. The table has no deletes, small amount of inserts and moderate amount of updates. However there are many selects and its their performance I am most concerned with. thanks From pgsql-performance-owner@postgresql.org Thu Aug 28 15:00:03 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 A939CD1B8AC for ; Thu, 28 Aug 2003 18:00: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 60572-06 for ; Thu, 28 Aug 2003 14:59:30 -0300 (ADT) Received: from harrier.cohaesio.com (harrier.cohaesio.com [212.97.128.50]) by svr1.postgresql.org (Postfix) with ESMTP id A99A8D1B8E7 for ; Thu, 28 Aug 2003 14:59:29 -0300 (ADT) Received: by harrier.cohaesio.com (Postfix, from userid 88) id 5B39987; Thu, 28 Aug 2003 19:59:10 +0200 (CEST) X-Original-To: news2mail@news.cohaesio.com From: "Anders K. Pedersen" Subject: Re: Queries sometimes take 1000 times the normal time Date: Thu, 28 Aug 2003 19:59:09 +0200 Organization: Cohaesio A/S Lines: 28 Message-ID: References: <1062033258.71328.2.camel@jester> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: harrier.cohaesio.com 1062093549 9649 212.97.128.160 (28 Aug 2003 17:59:09 GMT) X-Complaints-To: newsmaster@news.cohaesio.com X-Accept-Language: da, en-us, en To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/427 X-Sequence-Number: 3243 Rod Taylor wrote: >>Currently there's only a few users in the database for testing purposes, >>and most of the time the user lookup's take 2-3 ms (I have syslog'ing of >>queries and duration turned on), but several times per hour the duration >>for one of the queries is 2-3 seconds (1000 times larger), while the >>surrounding lookups take the usual 2-3 ms. > > Are there any other jobs running at the time of these excessive queries? I don't know if you're referring to jobs inside the PostgreSQL database or just jobs on the server, but I'm pretty sure that nothing major is going on inside the database - the only other job using it is doing an insert whenever one of our game admins executes an administrative command (like ban or kick), but this doesn't happen all that often, and according the PostgreSQL log isn't happening at the same times as the long queries. With regards to other jobs on the server, there is a MySQL server on it as well, which from time to time has some multi-second queries generated from a webserver also on this host, but the MySQL is running with nice 10 (PostgreSQL isn't nice'd). Someone else asked about vmstat results, and I've been running this for a while now, and I will report the results shortly. Regards, Anders K. Pedersen From pgsql-performance-owner@postgresql.org Thu Aug 28 15:17:10 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5F505D1B8BD for ; Thu, 28 Aug 2003 18:17: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 61986-09 for ; Thu, 28 Aug 2003 15:16:36 -0300 (ADT) Received: from harrier.cohaesio.com (harrier.cohaesio.com [212.97.128.50]) by svr1.postgresql.org (Postfix) with ESMTP id 4DA35D1B8A9 for ; Thu, 28 Aug 2003 15:16:35 -0300 (ADT) Received: by harrier.cohaesio.com (Postfix, from userid 88) id B117A86; Thu, 28 Aug 2003 20:16:35 +0200 (CEST) X-Original-To: news2mail@news.cohaesio.com From: "Anders K. Pedersen" Subject: Re: Queries sometimes take 1000 times the normal time Date: Thu, 28 Aug 2003 20:16:34 +0200 Organization: Cohaesio A/S Lines: 78 Message-ID: References: <3F4DF33B.11939.3364D27@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: harrier.cohaesio.com 1062094595 10051 212.97.128.160 (28 Aug 2003 18:16:35 GMT) X-Complaints-To: newsmaster@news.cohaesio.com X-Accept-Language: da, en-us, en To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/428 X-Sequence-Number: 3244 Shridhar Daithankar wrote: > On 28 Aug 2003 at 1:07, Anders K. Pedersen wrote: >>We're running a set of Half-Life based game servers that lookup user >>privileges from a central PostgreSQL 7.3.4 database server (I recently >>ported the MySQL code in Adminmod to PostgreSQL to be able to do this). >> >>The data needed by the game servers are combined from several different >>tables, so we have some views set up to provide the data in the format >>needed. >> >>Currently there's only a few users in the database for testing purposes, >>and most of the time the user lookup's take 2-3 ms (I have syslog'ing of >>queries and duration turned on), but several times per hour the duration >>for one of the queries is 2-3 seconds (1000 times larger), while the >>surrounding lookups take the usual 2-3 ms. > > > Check vmstat during the same period if it is syncing at that point as Tom > suggested. I've been running a vmstat 1 logging process for a while now, and the sample below shows what happende around one of these spikes - at 18:18:03 specifically (actually there were two 1 second long queries, that finished at 18:18:03). Thu Aug 28 18:17:53 2003 0 0 0 40904 4568 22288 404352 0 0 12 0 181 362 2 1 97 Thu Aug 28 18:17:54 2003 0 0 0 40904 4580 22260 404380 0 0 128 0 205 330 2 3 95 Thu Aug 28 18:17:55 2003 0 0 2 40904 4576 22264 404380 0 0 0 284 224 127 0 1 99 Thu Aug 28 18:17:56 2003 0 0 2 40904 5008 22268 404512 0 0 128 728 571 492 2 3 95 Thu Aug 28 18:17:57 2003 0 0 1 40904 5000 22276 404512 0 0 0 120 201 181 1 0 99 Thu Aug 28 18:17:58 2003 0 0 1 40904 4936 22284 404528 0 0 8 0 1147 2204 12 3 85 Thu Aug 28 18:17:59 2003 0 0 0 40904 4784 22304 404660 0 0 148 0 2112 3420 2 3 95 Thu Aug 28 18:18:00 2003 1 1 3 40904 4760 22324 404664 0 0 20 456 2374 3277 2 1 97 Thu Aug 28 18:18:01 2003 0 2 10 40904 4436 22000 401456 0 0 144 540 510 457 11 6 83 Thu Aug 28 18:18:02 2003 1 1 2 40904 8336 22032 401512 0 0 68 676 1830 2540 4 3 93 Thu Aug 28 18:18:04 2003 1 0 1 40904 8160 22052 401664 0 0 140 220 2308 3253 2 3 95 Thu Aug 28 18:18:05 2003 0 0 1 40904 7748 22064 402064 0 0 288 0 1941 2856 1 3 96 Thu Aug 28 18:18:06 2003 0 0 3 40904 6704 22064 403100 0 0 496 992 2326 3510 0 5 95 Thu Aug 28 18:18:07 2003 1 0 0 40904 6324 22088 402716 0 0 260 188 1984 2927 11 4 85 Thu Aug 28 18:18:08 2003 0 0 0 40904 6920 22088 402828 0 0 72 0 419 1473 17 5 78 Thu Aug 28 18:18:09 2003 0 0 0 40904 6784 22088 402964 0 0 128 0 235 476 2 1 97 Thu Aug 28 18:18:10 2003 0 0 1 40904 6404 22088 402980 0 0 0 0 343 855 14 2 84 As this shows, some disk I/O and an increased amount of interrupts and context switches is taking place at this time, and this also happens at the same time as all the other long queries I examined. However, vmstat also shows this pattern at a lot of other times, where the queries aren't affected by it. > Are you using pooled connections? If yes you could shorten life of a connection > and force making a new connection every 10-15 minutes say. That would avoid IO > avelanche at the end of the hour types. I'm not quite sure, what you mean by "pooled connections". Each game server has one connection to the PostgreSQL server, which is opened, when the server is first started, and then never closed (until the game server terminates, but there's days between this happens). Regards, Anders K. Pedersen From pgsql-performance-owner@postgresql.org Thu Aug 28 15:17:37 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 231FED1B8CD for ; Thu, 28 Aug 2003 18:17: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 62788-08 for ; Thu, 28 Aug 2003 15:17:25 -0300 (ADT) Received: from hosting.commandprompt.com (209.commandprompt.com [207.173.200.209]) by svr1.postgresql.org (Postfix) with ESMTP id 4C91BD1B8AB for ; Thu, 28 Aug 2003 15:17:23 -0300 (ADT) Received: from commandprompt.com (dsl093-077-251.sea2.dsl.speakeasy.net [66.93.77.251]) (authenticated) by hosting.commandprompt.com (8.11.6/8.11.6) with ESMTP id h7SIHLl30728 for ; Thu, 28 Aug 2003 11:17:22 -0700 Date: Thu, 28 Aug 2003 11:17:16 -0700 Subject: Re: The results of my PostgreSQL/filesystem performance tests Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) From: Al Hulaton To: Content-Transfer-Encoding: 7bit In-Reply-To: <001201c36d24$3c572460$0500a8c0@MOBILE01> Message-Id: X-Mailer: Apple Mail (2.552) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/429 X-Sequence-Number: 3245 > http://www.potentialtech.com/wmoran/postgresql.php > -- > Bill Moran > Potential Technologies > http://www.potentialtech.com Adding my voice to the many, thanks for sharing your results Bill. Very instructive. -- Best, Al Hulaton | Sr. Account Engineer | Command Prompt, Inc. 503.222.2783 | ahulaton@commandprompt.com Home of Mammoth PostgreSQL and 'Practical PostgreSQL' Managed PostgreSQL, Linux services and consulting Read and Search O'Reilly's 'Practical PostgreSQL' at http://www.commandprompt.com From pgsql-performance-owner@postgresql.org Thu Aug 28 15:24: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 8FD96D1B8A4 for ; Thu, 28 Aug 2003 18:23:57 +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 69730-03 for ; Thu, 28 Aug 2003 15:23:48 -0300 (ADT) Received: from harrier.cohaesio.com (harrier.cohaesio.com [212.97.128.50]) by svr1.postgresql.org (Postfix) with ESMTP id C9758D1B8C5 for ; Thu, 28 Aug 2003 15:23:46 -0300 (ADT) Received: by harrier.cohaesio.com (Postfix, from userid 88) id 5224286; Thu, 28 Aug 2003 20:23:47 +0200 (CEST) X-Original-To: news2mail@news.cohaesio.com From: "Anders K. Pedersen" Subject: Re: Queries sometimes take 1000 times the normal time Date: Thu, 28 Aug 2003 20:23:46 +0200 Organization: Cohaesio A/S Lines: 36 Message-ID: References: <28672.1062027548@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: harrier.cohaesio.com 1062095026 10096 212.97.128.160 (28 Aug 2003 18:23:46 GMT) X-Complaints-To: newsmaster@news.cohaesio.com X-Accept-Language: da, en-us, en To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/432 X-Sequence-Number: 3248 Tom Lane wrote: > "Anders K. Pedersen" writes: > >>Currently there's only a few users in the database for testing purposes, >>and most of the time the user lookup's take 2-3 ms (I have syslog'ing of >>queries and duration turned on), but several times per hour the duration >>for one of the queries is 2-3 seconds (1000 times larger), while the >>surrounding lookups take the usual 2-3 ms. > > > One thing that comes to mind is that the slow query could be occurring > at the same time as a checkpoint, or some other cycle-chewing background > operation. It's not clear why a checkpoint would slow things down that > much, though. Anyway I'd suggest looking for such activities; once we > know if that's the issue or not, we can make some progress. One of my colleagues suggested looking for checkpoints as well; I searched the log, but only the following messages turned up: Aug 11 15:21:04 gs1 postgres[5447]: [2] LOG: checkpoint record is at 0/80193C Aug 23 13:59:51 gs1 postgres[16451]: [2] LOG: checkpoint record is at 0/201EB74 Aug 25 02:48:17 gs1 postgres[1059]: [2] LOG: checkpoint record is at 0/2B787D0 Currently there are only relatively few changes to the database - one INSERT everytime one of our game admins executes an administrative command (like ban or kick), and this happens at most 10 times per hour. As I understand checkpoints, this should mean, that they aren't happening very often, and when they do, should be able to finish almost immediately. Regards, Anders K. Pedersen From pgsql-performance-owner@postgresql.org Thu Aug 28 15:29:24 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id E5311D1B8BD for ; Thu, 28 Aug 2003 18:29: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 65798-10 for ; Thu, 28 Aug 2003 15:28:52 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 3586AD1B8C6 for ; Thu, 28 Aug 2003 15:28:51 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 9DEA910259; Thu, 28 Aug 2003 14:20:51 -0400 (EDT) Received: from [10.0.2.5] (unknown [10.0.2.5]) by mailav.tor1.inquent.com (Postfix) with ESMTP id C183C10248; Thu, 28 Aug 2003 14:20:49 -0400 (EDT) Subject: Re: Hardware recommendations to scale to silly load From: Rod Taylor To: Matt Clark Cc: Postgresql Performance In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-GMeJR8ov1t2fNdR4EpNd" Message-Id: <1062095341.79027.201.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 28 Aug 2003 14:29:02 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/433 X-Sequence-Number: 3249 --=-GMeJR8ov1t2fNdR4EpNd Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, 2003-08-28 at 12:37, Matt Clark wrote: > > Ok.. I would be surprised if you needed much more actual CPU power. I > > suspect they're mostly idle waiting on data -- especially with a Quad > > Xeon (shared memory bus is it not?). >=20 > In reality the CPUs get pegged: about 65% PG and 35% system. But I agree= that memory throughput and latency is an issue. system in this case is dealing with disk activity or process switches? Usually the 65% includes the CPU waiting on a request for data from main memory. Since you will be moving a lot of data through the CPU, the L1 / L2 cache doesn't help too much (even large cache), but low latency high=20 bandwidth memory will make a significant difference. CPUs not having to wait on other CPUs doing a memory fetch will make an even larger difference (dedicated memory bus per CPU). Good memory is the big ticket item. Sun CPUs are not better than Intel CPUs, for simple DB interaction. It's the additional memory bandwidth that makes them shine. Incidentally, Suns are quite slow with PG for calculation intensive work on a small dataset. > > Write performance won't matter very much. 3000 inserts/second isn't high > > -- some additional battery backed write cache may be useful but not > > overly important with enough ram to hold the complete dataset. I suspect > > those are slow due to things like foreign keys -- which of course are > > selects. >=20 > 3000 inserts/sec isn't high when they're inside one transaction, but if e= ach is inside its own transaction then that's 3000 > commits/second. Still not anything to concern yourself with. WAL on battery backed write cache (with a good controller) will more than suffice -- boils down to the same as if fsync was disabled. You might want to try putting it onto it's own controller, but I don't think you will see much of a change. 20k WAL operations / sec would be something to worry about. > > case, additional ram will keep the system from hitting the disk for > > writes as well. >=20 > How does that work? Simple. Your OS will buffer writes in memory until they are required to hit disk (fsync or similar). Modify the appropriate sysctl to inform the OS it can use more than 10% (10% is the FreeBSD default I believe) of the memory for writes. Buffering 4GB of work in memory (WAL logs will ensure this is crash safe) will nearly eliminate I/O. When the OS is no longer busy, it will filter the writes from ram back to disk. Visibly, there is no change to the user aside from a speed increase. > > You may want to play around with checkpoints. Prevention of a checkpoint > > during this hour will help prevent peaks. Be warned though, WAL will > > grow very large, and recovery time should a crash occur could be > > painful. >=20 > Good point. I'll have a think about that. This is more important with a larger buffer. A checkpoint informs the OS to dump the buffer to disk so it can guarantee it hit hardware (thus allowing PG to remove / recycle WAL files). I do think your best bet is to segregate the DB. Read / write, by user location, first 4 digits of the credit card, anything will make a much better system. Keep a master with all of the data that can take the full week to process it. --=-GMeJR8ov1t2fNdR4EpNd 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/Tknt6DETLow6vwwRAq86AJ9qr+CMP0QEHWPHdFOXMc20G5UJoQCfXRtT KoJwIRkCpMbvEAPw0BRfFw4= =fH2r -----END PGP SIGNATURE----- --=-GMeJR8ov1t2fNdR4EpNd-- From pgsql-performance-owner@postgresql.org Thu Aug 28 15:33:25 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 BB483D1B8BB for ; Thu, 28 Aug 2003 18:33:23 +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 69524-08 for ; Thu, 28 Aug 2003 15:33:11 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 897BAD1B8AB for ; Thu, 28 Aug 2003 15:33:10 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id EC9D41024D; Thu, 28 Aug 2003 14:25:14 -0400 (EDT) Received: from [10.0.2.5] (unknown [10.0.2.5]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 55FA610248; Thu, 28 Aug 2003 14:25:12 -0400 (EDT) Subject: Re: Queries sometimes take 1000 times the normal time From: Rod Taylor To: "Anders K. Pedersen" Cc: Postgresql Performance In-Reply-To: References: <1062033258.71328.2.camel@jester> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-MA5LX7Kj9shonc9JZCr3" Message-Id: <1062095603.79027.205.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 28 Aug 2003 14:33:24 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/434 X-Sequence-Number: 3250 --=-MA5LX7Kj9shonc9JZCr3 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > With regards to other jobs on the server, there is a MySQL server on it= =20 > as well, which from time to time has some multi-second queries generated= =20 > from a webserver also on this host, but the MySQL is running with nice=20 > 10 (PostgreSQL isn't nice'd). Do those MySQL queries hit disk hard? I've never seen PostgreSQL have hicups like you describe when running on a machine by itself. I have experienced similar issues when another process (cron job in my case) caused brief swapping to occur. --=-MA5LX7Kj9shonc9JZCr3 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/Tkrz6DETLow6vwwRAtulAJ0YVZ1cDQCgs/woxrjoXHTDvCAYzACfUDm/ BVFt6GQZE39FcBGmXe8eX7Q= =RiGI -----END PGP SIGNATURE----- --=-MA5LX7Kj9shonc9JZCr3-- From pgsql-performance-owner@postgresql.org Thu Aug 28 15:49:34 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 2FBC8D1B8CF for ; Thu, 28 Aug 2003 18:49:32 +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 72025-04 for ; Thu, 28 Aug 2003 15:49:01 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id 14C19D1B8A9 for ; Thu, 28 Aug 2003 15:49:00 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 03A79D593; Thu, 28 Aug 2003 11:49:00 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id ED95E5C0B; Thu, 28 Aug 2003 11:49:00 -0700 (PDT) Date: Thu, 28 Aug 2003 11:49:00 -0700 (PDT) From: Stephan Szabo To: Michael Guerin Cc: Subject: Re: Simple queries take forever to run In-Reply-To: <3F4E3F0B.9000802@rentec.com> Message-ID: <20030828114452.B11166-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/435 X-Sequence-Number: 3251 On Thu, 28 Aug 2003, Michael Guerin wrote: > Stephan Szabo wrote: > > >On Thu, 28 Aug 2003, Michael Guerin wrote: > > > > > > > >>Stephan Szabo wrote: > >> > >> > >> > >>>On Wed, 27 Aug 2003, Michael Guerin wrote: > >>> > >>> > >>> > >>> > >>> > >>>>I'm running into some performance problems trying to execute simple > >>>>queries. > >>>> > >>>>postgresql version 7.3.3 > >>>>.conf params changed from defaults. > >>>>shared_buffers = 64000 > >>>>sort_mem = 64000 > >>>>fsync = false > >>>>effective_cache_size = 400000 > >>>> > >>>>ex. query: select * from x where id in (select id from y); > >>>> > >>>>There's an index on each table for id. SQL Server takes <1s to return, > >>>>postgresql doesn't return at all, neither does explain analyze. > >>>> > >>>> > >>>> > >>>> > >>>IN(subquery) is known to run poorly in 7.3.x and earlier. 7.4 is > >>>generally much better (for reasonably sized subqueries) but in earlier > >>>versions you'll probably want to convert into an EXISTS or join form. > >>> > >>> > >>> > >>> > >>> > >>> > >>Something else seems to be going on, even switching to an exists clause > >>gives much better but poor performance. > >>count(*) where exists clause: Postgresql 19s, SQL Server <1s > >>count(*) where not exists: 23.3s SQL Server 1.5s > >> > >> > > > >What does explain analyze show for the two queries? > > > > > > > > > explain analyze select count(*) from tbltimeseries where exists(select > uniqid from tblobjectname where timeseriesid = uniqid); > Aggregate (cost=5681552.18..5681552.18 rows=1 width=0) (actual > time=22756.64..22756.64 rows=1 loops=1) > -> Seq Scan on tbltimeseries (cost=0.00..5680051.34 rows=600336 > width=0) (actual time=22.06..21686.78 rows=1200113 loops=1) > Filter: (NOT (subplan)) > SubPlan > -> Index Scan using idx_objectname on tblobjectname > (cost=0.00..4.70 rows=1 width=4) (actual time=0.01..0.01 rows=0 > loops=1200673) > Index Cond: ($0 = uniqid) > Total runtime: 22756.83 msec > (7 rows) Hmm... I'd thought that it had options for a better plan than that. What do things like: explain analyze select count(distinct timeseriesid) from tbltimeseries, tblobjectname where timeseriesid=uniquid; and explain analyze select count(distinct timeseriesid) from tbltimeseries left outer join tblobjectname on (timeseriesid=uniqid) where uniqid is null; give you? From pgsql-performance-owner@postgresql.org Thu Aug 28 15:51:40 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 B4971D1B8A4 for ; Thu, 28 Aug 2003 18:51:38 +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 71943-05 for ; Thu, 28 Aug 2003 15:51:09 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id 5FAE9D1B8BB for ; Thu, 28 Aug 2003 15:51:07 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 7E6AAD64A; Thu, 28 Aug 2003 11:51:08 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 7410D5C0B; Thu, 28 Aug 2003 11:51:08 -0700 (PDT) Date: Thu, 28 Aug 2003 11:51:08 -0700 (PDT) From: Stephan Szabo To: teknokrat Cc: Subject: Re: performance of foreign key constraints In-Reply-To: Message-ID: <20030828114947.B11166-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/436 X-Sequence-Number: 3252 On Thu, 28 Aug 2003, teknokrat wrote: > Stephan Szabo wrote: > > > On Thu, 28 Aug 2003, teknokrat wrote: > > > > > >>I have a table that has about 20 foreign key constraints on it. I think > >>this is a bit excessive and am considering removing them ( they are all > >>related to the same table and I don't think there is much chance of any > >>integrity violations ). Would this improve performance or not? > > > > > > It depends on your frequency of inserts/updates to the table with the > > constraint and the frequency of update/delete to the table(s) being > > refered to. My guess is probably. You may wish to leave some of the > > constraints (decide which are the most important), but 20 does seem a bit > > excessive in general. > > > > The references are all to the same table i.e. they are employee ids, so > leaving some and not others would make no sense. The table has no > deletes, small amount of inserts and moderate amount of updates. However > there are many selects and its their performance I am most concerned with. The foreign keys should only really affect insert/update/delete performance. If you're using 7.3.4 (I think) then updates to the fk table that don't change any of the keys should be relatively cheap. I'd be much more worried if you had any changes the the referenced employee table that might change the key because that could get relatively expensive. From pgsql-performance-owner@postgresql.org Thu Aug 28 15:57:16 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 2F8C5D1B8AD for ; Thu, 28 Aug 2003 18:57:15 +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 71080-07 for ; Thu, 28 Aug 2003 15:57:04 -0300 (ADT) Received: from harrier.cohaesio.com (harrier.cohaesio.com [212.97.128.50]) by svr1.postgresql.org (Postfix) with ESMTP id 97663D1B8CD for ; Thu, 28 Aug 2003 15:57:02 -0300 (ADT) Received: by harrier.cohaesio.com (Postfix, from userid 88) id 6607186; Thu, 28 Aug 2003 20:57:03 +0200 (CEST) X-Original-To: news2mail@news.cohaesio.com From: "Anders K. Pedersen" Subject: Re: Queries sometimes take 1000 times the normal time Date: Thu, 28 Aug 2003 20:57:02 +0200 Organization: Cohaesio A/S Lines: 27 Message-ID: References: <1062033258.71328.2.camel@jester> <1062095603.79027.205.camel@jester> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: harrier.cohaesio.com 1062097022 10377 212.97.128.160 (28 Aug 2003 18:57:02 GMT) X-Complaints-To: newsmaster@news.cohaesio.com X-Accept-Language: da, en-us, en To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/437 X-Sequence-Number: 3253 Rod Taylor wrote: >>With regards to other jobs on the server, there is a MySQL server on it >>as well, which from time to time has some multi-second queries generated >>from a webserver also on this host, but the MySQL is running with nice >>10 (PostgreSQL isn't nice'd). > > Do those MySQL queries hit disk hard? I guess they may be able to do so - the MySQL database is 450 MB, and the server has 512 MB RAM, and some of the queries pretty summarizes everything in the database. However, I just cross-referenced the access logs from the webserver with the duration logs, and although some of the spikes did happen, while there would have been some MySQL activity (I can't tell for sure, if it was simple queries or the long ones), other spikes happened without any website activity in the surrounding minutes. > I've never seen PostgreSQL have hicups like you describe when running on > a machine by itself. I have experienced similar issues when another > process (cron job in my case) caused brief swapping to occur. OK. I may have to try to put the database on a separate server. Regards, Anders K. Pedersen From pgsql-performance-owner@postgresql.org Thu Aug 28 15:58: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 B4241D1B8B3 for ; Thu, 28 Aug 2003 18:58:15 +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 73253-02 for ; Thu, 28 Aug 2003 15:58:05 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 258E8D1B8A9 for ; Thu, 28 Aug 2003 15:58:04 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 247D91024D; Thu, 28 Aug 2003 14:50:08 -0400 (EDT) Received: from [10.0.2.5] (unknown [10.0.2.5]) by mailav.tor1.inquent.com (Postfix) with ESMTP id D1FBD10248; Thu, 28 Aug 2003 14:50:05 -0400 (EDT) Subject: Re: performance of foreign key constraints From: Rod Taylor To: teknokrat@yahoo.com Cc: Postgresql Performance In-Reply-To: References: <20030828102646.Q9762-100000@megazone.bigpanda.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-X0iTVE9TY5IHRIQvfunB" Message-Id: <1062097097.79027.214.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 28 Aug 2003 14:58:18 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/438 X-Sequence-Number: 3254 --=-X0iTVE9TY5IHRIQvfunB Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > The references are all to the same table i.e. they are employee ids, so= =20 > leaving some and not others would make no sense. The table has no=20 > deletes, small amount of inserts and moderate amount of updates. However= =20 > there are many selects and its their performance I am most concerned with. Foreign keys have no impact on selects. Although this does sound like a rather strange design to me (20+ columns wide and they're all employee ids?) --=-X0iTVE9TY5IHRIQvfunB 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/TlDI6DETLow6vwwRAqoQAJ0QqXBGDyDrWVSOzkNLjgyUNcOdewCfUngw WovGaADRmUrXn7CfgHnD6eY= =l6L4 -----END PGP SIGNATURE----- --=-X0iTVE9TY5IHRIQvfunB-- From pgsql-performance-owner@postgresql.org Thu Aug 28 16:16:46 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 CE7CED1B8A8 for ; Thu, 28 Aug 2003 19:16: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 80132-02 for ; Thu, 28 Aug 2003 16:16:12 -0300 (ADT) Received: from mta7.adelphia.net (mta7.adelphia.net [68.168.78.193]) by svr1.postgresql.org (Postfix) with ESMTP id E6487D1B8BB for ; Thu, 28 Aug 2003 16:16:10 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta7.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030828191613.UVC18798.mta7.adelphia.net@potentialtech.com>; Thu, 28 Aug 2003 15:16:13 -0400 Message-ID: <3F4E54FB.3020408@potentialtech.com> Date: Thu, 28 Aug 2003 15:16:11 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sean Chittenden Cc: pgsql-performance@postgresql.org Subject: Re: The results of my PostgreSQL/filesystem performance References: <3F4C0DC4.8070105@potentialtech.com> <001201c36d24$3c572460$0500a8c0@MOBILE01> <20030828161233.GB83759@perrin.nxad.com> In-Reply-To: <20030828161233.GB83759@perrin.nxad.com> 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: 200308/439 X-Sequence-Number: 3255 I need to step in and do 2 things: First, apologize for posting inaccurate test results. Second, verify that Sean is absolutely correct. FreeBSD 4.8 was accessing the drives in PIO mode, which is significantly lousier than DMA, which RedHat was able to use. As a result, the tests are unreasonably skewed in favor of Linux. The only thing that the currently posted results prove is that Linux is better at dealing with crappy hardware than BSD (which I feel we already knew). I did some rescrounging, and found some newer hardware stuffed in a corner that I had forgotten was even around. I am currently re-running the tests and will post new results as soon as there are enough to be interesting to talk about. In an attempt to avoid the same mistake, I did a timed test with dd(1) to a raw partition on both Linux and FreeBSD to ensure that both systems are able to access the hardware at more or less the same speed. The results of this will be included. I'm also gathering considerably more information about the state of the system during the tests, which should answer a number of questions I've been getting. To the many people who asked questions like "why not try filesystem x on distribution y" and similar questions, the answer in most cases is time. I've pared the tests down some so they run faster, and I'm hoping to be able to run more tests on more combinations of configurations as a result. Also, I never intended for anyone to assume that I was _done_ testing, just that I had enough results for folks to talk about. I'll post again when I have enough results to be interesting, until then, I apologize again for the inaccurate results. Sean Chittenden wrote: >>What it still leaves quite open is just what happens when the OS has >>more than one disk drive or CPU to play with. It's not clear what >>happens in such cases, whether FreeBSD would catch up, or be "left >>further in the dust." The traditional "propaganda" has been that >>there are all sorts of reasons to expect PostgreSQL on FreeBSD to >>run a bit faster than on Linux; it is a bit unexpected for the >>opposite to seem true. > > Let me nip this in the butt before people run away with ideas that > aren't correct. When the tests were performed in FreeBSD 5.1 and > Linux, the hard drives were running UDMA. When running 4.8, for some > reason his drives settled in on PIO mode: > > ad0s1a: UDMA ICRC error writing fsbn 1458368 of 729184-729215 (ad0s1 bn 1458368; cn 241 tn 12 sn 44) retrying > ad0s1a: UDMA ICRC error writing fsbn 1458368 of 729184-729215 (ad0s1 bn 1458368; cn 241 tn 12 sn 44) retrying > ad0s1a: UDMA ICRC error writing fsbn 1458368 of 729184-729215 (ad0s1 bn 1458368; cn 241 tn 12 sn 44) retrying > ad0s1a: UDMA ICRC error writing fsbn 1458368 of 729184-729215 (ad0s1 bn 1458368; cn 241 tn 12 sn 44) falling back to PIO mode > > The benchmarks were hardly conclusive as UDMA runs vastly faster than > PIO. Until we hear back as to whether cables were jarred loose > between the tests or hearing if something else changed, I'd hardly > consider these conclusive tests given PIO/UDMA is apples to oranges in > terms of speed and I fully expect that FreeBSD 4.8 will perform at > least faster than 5.1 (5.x is still being unwound from Giant), but > should out perform Linux as well if industry experience iss any > indicator. -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Thu Aug 28 16:22:37 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 DD3E3D1B8E3 for ; Thu, 28 Aug 2003 19:22:34 +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 73388-09 for ; Thu, 28 Aug 2003 16:22:24 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id C5857D1B8AE for ; Thu, 28 Aug 2003 16:22:22 -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 h7SJMMek050430 for ; Thu, 28 Aug 2003 19:22:22 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7SJGvcp038757 for pgsql-performance@postgresql.org; Thu, 28 Aug 2003 19:16:57 GMT From: teknokrat X-Newsgroups: comp.databases.postgresql.performance Subject: Re: performance of foreign key constraints Date: Thu, 28 Aug 2003 20:16:59 +0100 Organization: Hub.Org Networking Services Lines: 16 Message-ID: References: <20030828102646.Q9762-100000@megazone.bigpanda.com> <1062097097.79027.214.camel@jester> Reply-To: teknokrat@yahoo.com 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 (X11; U; Linux i686; en-US; rv:1.0.0+) Gecko/20020518 X-Accept-Language: en-us, en, ko In-Reply-To: <1062097097.79027.214.camel@jester> To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/440 X-Sequence-Number: 3256 Rod Taylor wrote: >>The references are all to the same table i.e. they are employee ids, so >>leaving some and not others would make no sense. The table has no >>deletes, small amount of inserts and moderate amount of updates. However >>there are many selects and its their performance I am most concerned with. > > > Foreign keys have no impact on selects. > > Although this does sound like a rather strange design to me (20+ columns > wide and they're all employee ids?) There are more than 20 fieldss. Its a report that can get updated by different employees and we wish to keep a record of which employee completed which section. Couldn't think of any other way to do it. From pgsql-performance-owner@postgresql.org Thu Aug 28 16:31:36 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 B6446D1B8A8 for ; Thu, 28 Aug 2003 19:31:34 +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 81034-02 for ; Thu, 28 Aug 2003 16:31:25 -0300 (ADT) Received: from perrin.nxad.com (internal.ext.nxad.com [69.1.70.251]) by svr1.postgresql.org (Postfix) with ESMTP id 0325AD1B52C for ; Thu, 28 Aug 2003 16:31:23 -0300 (ADT) Received: by perrin.nxad.com (Postfix, from userid 1001) id A175120F01; Thu, 28 Aug 2003 12:31:23 -0700 (PDT) Date: Thu, 28 Aug 2003 12:31:23 -0700 From: Sean Chittenden To: Bill Moran Cc: pgsql-performance@postgresql.org Subject: Re: The results of my PostgreSQL/filesystem performance tests Message-ID: <20030828193123.GI83317@perrin.nxad.com> References: <3F4C0DC4.8070105@potentialtech.com> <001201c36d24$3c572460$0500a8c0@MOBILE01> <20030828161233.GB83759@perrin.nxad.com> <3F4E54FB.3020408@potentialtech.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline In-Reply-To: <3F4E54FB.3020408@potentialtech.com> X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/441 X-Sequence-Number: 3257 --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > I need to step in and do 2 things: Thanks for posting that. Let me know if you have any questions while doing your testing. I've found that using 16K blocks on FreeBSD results in about an 8% speedup in writes to the database, fwiw. I'm likely going to make this the default for PostgreSQL on FreeBSD starting with 7.4 (just posted something to -hackers about this)f. If you'd like to do this in your testing, just apply the following patch. Right now PostgreSQL defaults to 8K blocks, but FreeBSD uses 16K blocks which means that currently, reading two blocks of data in PG is two read calls to the OS, one reads 16K of data off disk and returns the 1st page, the 2nd call pulls the 2nd block from the FS cache. In making things 16K, it avoids the need for the 2nd system call which is where the performance difference is coming from, afaikt. -sc -- Sean Chittenden --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch Index: src/include/pg_config_manual.h =================================================================== RCS file: /home/ncvs/pgsql/pgsql-server/src/include/pg_config_manual.h,v retrieving revision 1.5 diff -u -r1.5 pg_config_manual.h --- src/include/pg_config_manual.h 4 Aug 2003 00:43:29 -0000 1.5 +++ src/include/pg_config_manual.h 27 Aug 2003 17:40:12 -0000 @@ -23,7 +23,7 @@ * * Changing BLCKSZ requires an initdb. */ -#define BLCKSZ 8192 +#define BLCKSZ 16384 /* * RELSEG_SIZE is the maximum number of blocks allowed in one disk --ReaqsoxgOBHFXBhH-- From pgsql-performance-owner@postgresql.org Thu Aug 28 19:03:24 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id AB02FD1B8E5 for ; Thu, 28 Aug 2003 21:18:58 +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 05279-09 for ; Thu, 28 Aug 2003 18:18:28 -0300 (ADT) Received: from ram.rentec.com (unknown [192.5.35.66]) by svr1.postgresql.org (Postfix) with ESMTP id 11764D1D0A5 for ; Thu, 28 Aug 2003 17:07:47 -0300 (ADT) Received: from rentec.com (IDENT:618@murre.rentec.com [192.5.35.148]) by ram.rentec.com (8.12.1/8.12.1) with ESMTP id h7SK7kw5019553; Thu, 28 Aug 2003 16:07:47 -0400 (EDT) Message-ID: <3F4E6112.2060807@rentec.com> Date: Thu, 28 Aug 2003 16:07:46 -0400 From: Michael Guerin User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephan Szabo Cc: pgsql-performance@postgresql.org Subject: Re: Simple queries take forever to run References: <20030828114452.B11166-100000@megazone.bigpanda.com> In-Reply-To: <20030828114452.B11166-100000@megazone.bigpanda.com> 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: 200308/447 X-Sequence-Number: 3263 Stephan Szabo wrote: >On Thu, 28 Aug 2003, Michael Guerin wrote: > > > >>Stephan Szabo wrote: >> >> >> >>>On Thu, 28 Aug 2003, Michael Guerin wrote: >>> >>> >>> >>> >>> >>>>Stephan Szabo wrote: >>>> >>>> >>>> >>>> >>>> >>>>>On Wed, 27 Aug 2003, Michael Guerin wrote: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>>I'm running into some performance problems trying to execute simple >>>>>>queries. >>>>>> >>>>>>postgresql version 7.3.3 >>>>>>.conf params changed from defaults. >>>>>>shared_buffers = 64000 >>>>>>sort_mem = 64000 >>>>>>fsync = false >>>>>>effective_cache_size = 400000 >>>>>> >>>>>>ex. query: select * from x where id in (select id from y); >>>>>> >>>>>>There's an index on each table for id. SQL Server takes <1s to return, >>>>>>postgresql doesn't return at all, neither does explain analyze. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>IN(subquery) is known to run poorly in 7.3.x and earlier. 7.4 is >>>>>generally much better (for reasonably sized subqueries) but in earlier >>>>>versions you'll probably want to convert into an EXISTS or join form. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>Something else seems to be going on, even switching to an exists clause >>>>gives much better but poor performance. >>>>count(*) where exists clause: Postgresql 19s, SQL Server <1s >>>>count(*) where not exists: 23.3s SQL Server 1.5s >>>> >>>> >>>> >>>> >>>What does explain analyze show for the two queries? >>> >>> >>> >>> >>> >>> >>explain analyze select count(*) from tbltimeseries where exists(select >>uniqid from tblobjectname where timeseriesid = uniqid); >>Aggregate (cost=5681552.18..5681552.18 rows=1 width=0) (actual >>time=22756.64..22756.64 rows=1 loops=1) >> -> Seq Scan on tbltimeseries (cost=0.00..5680051.34 rows=600336 >>width=0) (actual time=22.06..21686.78 rows=1200113 loops=1) >> Filter: (NOT (subplan)) >> SubPlan >> -> Index Scan using idx_objectname on tblobjectname >>(cost=0.00..4.70 rows=1 width=4) (actual time=0.01..0.01 rows=0 >>loops=1200673) >> Index Cond: ($0 = uniqid) >> Total runtime: 22756.83 msec >>(7 rows) >> >> > >Hmm... I'd thought that it had options for a better plan than that. > >What do things like: > >explain analyze select count(distinct timeseriesid) from tbltimeseries, > tblobjectname where timeseriesid=uniquid; > >and > >explain analyze select count(distinct timeseriesid) from > tbltimeseries left outer join tblobjectname on (timeseriesid=uniqid) > where uniqid is null; > >give you? > > > > much better performance: explain analyze select count(distinct timeseriesid) from tbltimeseries, tblobjectname where timeseriesid=uniquid; Aggregate (cost=7384.03..7384.03 rows=1 width=8) (actual time=668.15..668.15 rows=1 loops=1) -> Nested Loop (cost=0.00..7380.83 rows=1282 width=8) (actual time=333.31..666.13 rows=561 loops=1) -> Seq Scan on tblobjectname (cost=0.00..33.82 rows=1282 width=4) (actual time=0.05..4.98 rows=1282 loops=1) -> Index Scan using xx on tbltimeseries (cost=0.00..5.72 rows=1 width=4) (actual time=0.51..0.51 rows=0 loops=1282) Index Cond: (tbltimeseries.timeseriesid = "outer".uniqid) Total runtime: 669.61 msec (6 rows) explain analyze select count(distinct timeseriesid) from tbltimeseries left outer join tblobjectname on (timeseriesid=uniqid) where uniqid is null; Aggregate (cost=59144.19..59144.19 rows=1 width=8) (actual time=12699.47..12699.47 rows=1 loops=1) -> Hash Join (cost=37.02..56142.51 rows=1200673 width=8) (actual time=7.41..6376.12 rows=1200113 loops=1) Hash Cond: ("outer".timeseriesid = "inner".uniqid) Filter: ("inner".uniqid IS NULL) -> Seq Scan on tbltimeseries (cost=0.00..44082.73 rows=1200673 width=4) (actual time=0.01..3561.61 rows=1200673 loops=1) -> Hash (cost=33.82..33.82 rows=1282 width=4) (actual time=4.84..4.84 rows=0 loops=1) -> Seq Scan on tblobjectname (cost=0.00..33.82 rows=1282 width=4) (actual time=0.04..2.84 rows=1282 loops=1) Total runtime: 12699.76 msec (8 rows) From pgsql-performance-owner@postgresql.org Thu Aug 28 18:18:40 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 21DEED1B8CF for ; Thu, 28 Aug 2003 21:18:25 +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 05286-06 for ; Thu, 28 Aug 2003 18:18:15 -0300 (ADT) Received: from lorax.kciLink.com (lorax.kciLink.com [206.112.95.1]) by svr1.postgresql.org (Postfix) with ESMTP id 0B4D7D1D1B8 for ; Thu, 28 Aug 2003 17:20:36 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by lorax.kciLink.com (Postfix) with ESMTP id A9FAF3E7B for ; Thu, 28 Aug 2003 16:20:36 -0400 (EDT) Received: from lorax.kciLink.com ([127.0.0.1]) by localhost (lorax.kciLink.com [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 10424-09 for ; Thu, 28 Aug 2003 16:20:26 -0400 (EDT) Received: from lorax.kciLink.com (localhost [127.0.0.1]) by lorax.kciLink.com (Postfix) with ESMTP id 337253E5B for ; Thu, 28 Aug 2003 16:20:26 -0400 (EDT) Received: (from news@localhost) by lorax.kciLink.com (8.12.8p1/8.12.8/Submit) id h7SKKOlS015145 for pgsql-performance@postgresql.org; Thu, 28 Aug 2003 16:20:24 -0400 (EDT) To: pgsql-performance@postgresql.org Path: not-for-mail From: Vivek Khera Newsgroups: ml.postgres.performance Subject: Re: The results of my PostgreSQL/filesystem performance tests Date: Thu, 28 Aug 2003 16:20:24 -0400 Organization: Khera Communications, Inc., Rockville, MD Lines: 20 Message-ID: References: <3F4C0DC4.8070105@potentialtech.com> <001201c36d24$3c572460$0500a8c0@MOBILE01> <20030828161233.GB83759@perrin.nxad.com> <3F4E54FB.3020408@potentialtech.com> <20030828193123.GI83317@perrin.nxad.com> NNTP-Posting-Host: yertle.kcilink.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: lorax.kciLink.com 1062102024 29973 216.194.193.105 (28 Aug 2003 20:20:24 GMT) X-Complaints-To: daemon@kciLink.com NNTP-Posting-Date: Thu, 28 Aug 2003 20:20:24 +0000 (UTC) User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Portable Code, berkeley-unix) Cancel-Lock: sha1:Phhmg/93nDJbk+ygkeqOjhEeZQ8= X-Virus-Scanned: by amavisd-new at kciLink.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/443 X-Sequence-Number: 3259 >>>>> "SC" == Sean Chittenden writes: >> I need to step in and do 2 things: SC> Thanks for posting that. Let me know if you have any questions while SC> doing your testing. I've found that using 16K blocks on FreeBSD SC> results in about an 8% speedup in writes to the database, fwiw. Where/how does one set this? In postgresql.conf or on the file system or during compilation of postgres? I'm on FreeBSD 4.8 still. I've got a box right now on which I'm comparing the speed merits of hardware RAID10, RAID5, and RAID50 using a filesystem benchmark utility (bonnie++). If I have time I'm gonna try different striping block sizes. Right now I'm using 32k byte stripe size. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D. Khera Communications, Inc. Internet: khera@kciLink.com Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/ From pgsql-performance-owner@postgresql.org Thu Aug 28 18:27:24 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 4A88BD1B9AE for ; Thu, 28 Aug 2003 21:20:43 +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 06965-03 for ; Thu, 28 Aug 2003 18:20:34 -0300 (ADT) Received: from lorax.kciLink.com (lorax.kciLink.com [206.112.95.1]) by svr1.postgresql.org (Postfix) with ESMTP id E3B9FD1D297 for ; Thu, 28 Aug 2003 17:28:05 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by lorax.kciLink.com (Postfix) with ESMTP id EAAB83E5B for ; Thu, 28 Aug 2003 16:28:06 -0400 (EDT) Received: from lorax.kciLink.com ([127.0.0.1]) by localhost (lorax.kciLink.com [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 27094-01 for ; Thu, 28 Aug 2003 16:27:56 -0400 (EDT) Received: from lorax.kciLink.com (localhost [127.0.0.1]) by lorax.kciLink.com (Postfix) with ESMTP id 765F53E21 for ; Thu, 28 Aug 2003 16:27:56 -0400 (EDT) Received: (from news@localhost) by lorax.kciLink.com (8.12.8p1/8.12.8/Submit) id h7SKRu1t034084 for pgsql-performance@postgresql.org; Thu, 28 Aug 2003 16:27:56 -0400 (EDT) To: pgsql-performance@postgresql.org Path: not-for-mail From: Vivek Khera Newsgroups: ml.postgres.performance Subject: Re: The results of my PostgreSQL/filesystem performance tests Date: Thu, 28 Aug 2003 16:27:55 -0400 Organization: Khera Communications, Inc., Rockville, MD Lines: 20 Message-ID: References: <3F4C0DC4.8070105@potentialtech.com> <001201c36d24$3c572460$0500a8c0@MOBILE01> <20030828161233.GB83759@perrin.nxad.com> <3F4E54FB.3020408@potentialtech.com> <20030828193123.GI83317@perrin.nxad.com> NNTP-Posting-Host: yertle.kcilink.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: lorax.kciLink.com 1062102476 32928 216.194.193.105 (28 Aug 2003 20:27:56 GMT) X-Complaints-To: daemon@kciLink.com NNTP-Posting-Date: Thu, 28 Aug 2003 20:27:56 +0000 (UTC) User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Portable Code, berkeley-unix) Cancel-Lock: sha1:cQRS2pnAkDZvWuxPtHxEqt3Lr/g= X-Virus-Scanned: by amavisd-new at kciLink.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/444 X-Sequence-Number: 3260 >>>>> "SC" == Sean Chittenden writes: >> I need to step in and do 2 things: SC> Thanks for posting that. Let me know if you have any questions while SC> doing your testing. I've found that using 16K blocks on FreeBSD SC> results in about an 8% speedup in writes to the database, fwiw. ok.. ignore my prior request about how to set that... i missed you had included a patch. Any recommendations on newfs parameters for an overly large file system used solely for Postgres? Over 100Gb (with raid 10) or over 200Gb (with raid 5)? -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D. Khera Communications, Inc. Internet: khera@kciLink.com Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/ From pgsql-performance-owner@postgresql.org Thu Aug 28 18:55:57 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 9DB39D1B8AC for ; Thu, 28 Aug 2003 21:19: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 05282-10 for ; Thu, 28 Aug 2003 18:19:46 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 92A9AD1D2DD for ; Thu, 28 Aug 2003 17:35:16 -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 h7SKYkp5002691; Thu, 28 Aug 2003 14:34:46 -0600 (MDT) Date: Thu, 28 Aug 2003 14:33:41 -0600 (MDT) From: "scott.marlowe" To: Sean Chittenden Cc: Christopher Browne , Subject: Re: The results of my PostgreSQL/filesystem performance In-Reply-To: <20030828161233.GB83759@perrin.nxad.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner-ihs-com: Found to be clean X-MailScanner-SpamCheck-ihs-com: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/446 X-Sequence-Number: 3262 On Thu, 28 Aug 2003, Sean Chittenden wrote: > > What it still leaves quite open is just what happens when the OS has > > more than one disk drive or CPU to play with. It's not clear what > > happens in such cases, whether FreeBSD would catch up, or be "left > > further in the dust." The traditional "propaganda" has been that > > there are all sorts of reasons to expect PostgreSQL on FreeBSD to > > run a bit faster than on Linux; it is a bit unexpected for the > > opposite to seem true. > > Let me nip this in the butt before people run away with ideas that > aren't correct. When the tests were performed in FreeBSD 5.1 and > Linux, the hard drives were running UDMA. When running 4.8, for some > reason his drives settled in on PIO mode: > > ad0s1a: UDMA ICRC error writing fsbn 1458368 of 729184-729215 (ad0s1 bn 1458368; cn 241 tn 12 sn 44) retrying > ad0s1a: UDMA ICRC error writing fsbn 1458368 of 729184-729215 (ad0s1 bn 1458368; cn 241 tn 12 sn 44) retrying > ad0s1a: UDMA ICRC error writing fsbn 1458368 of 729184-729215 (ad0s1 bn 1458368; cn 241 tn 12 sn 44) retrying > ad0s1a: UDMA ICRC error writing fsbn 1458368 of 729184-729215 (ad0s1 bn 1458368; cn 241 tn 12 sn 44) falling back to PIO mode > > The benchmarks were hardly conclusive as UDMA runs vastly faster than > PIO. Until we hear back as to whether cables were jarred loose > between the tests or hearing if something else changed, I'd hardly > consider these conclusive tests given PIO/UDMA is apples to oranges in > terms of speed and I fully expect that FreeBSD 4.8 will perform at > least faster than 5.1 (5.x is still being unwound from Giant), but > should out perform Linux as well if industry experience iss any > indicator. Plus, in most "real" servers you're gonna be running SCSI, so it might be nice to see a test with a good SCSI controller (Symbios 875 is a nice choice) and a couple hard drives, one each for WAL and data. This would more closely resemble actual usage and there are likely to be fewer issues with things like UDMA versus PIO on SCSI. From pgsql-performance-owner@postgresql.org Thu Aug 28 19:10:10 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2B56BD1BA59 for ; Thu, 28 Aug 2003 21:18: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 05292-09 for ; Thu, 28 Aug 2003 18:18:17 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 0AB7CD1D30E for ; Thu, 28 Aug 2003 17:41:09 -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 h7SKeGp5003112; Thu, 28 Aug 2003 14:40:17 -0600 (MDT) Date: Thu, 28 Aug 2003 14:39:11 -0600 (MDT) From: "scott.marlowe" To: "Anders K. Pedersen" Cc: Subject: Re: Queries sometimes take 1000 times the normal time In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner-ihs-com: Found to be clean X-MailScanner-SpamCheck-ihs-com: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/448 X-Sequence-Number: 3264 Just to add to the clutch here, also check your bdflush settings (if you're on linux) or equivalent (if you're not.) Many times the swapping algo in linux can be quite bursty if you have it set to move too many pages at a time during cleanup / flush. From pgsql-general-owner@postgresql.org Thu Aug 28 18:15:08 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 09CCCD1D7FA for ; Thu, 28 Aug 2003 21:15:03 +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 05300-03 for ; Thu, 28 Aug 2003 18:14:33 -0300 (ADT) Received: from smtp013.mail.yahoo.com (smtp013.mail.yahoo.com [216.136.173.57]) by svr1.postgresql.org (Postfix) with SMTP id 6C888D1D923 for ; Thu, 28 Aug 2003 18:01:37 -0300 (ADT) Received: from pcp01341166pcs.wilog301.pa.comcast.net (HELO europa.janwieck.net) (janwieck@68.80.245.191 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 28 Aug 2003 21:01:37 -0000 Received: from Yahoo.com (ismtp.afilias.com [216.217.55.254]) (authenticated) by europa.janwieck.net (8.11.6/8.11.6) with ESMTP id h7SL1Kx05756; Thu, 28 Aug 2003 17:01:20 -0400 Message-ID: <3F4E6D52.90206@Yahoo.com> Date: Thu, 28 Aug 2003 17:00:02 -0400 From: Jan Wieck User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ron Johnson Cc: PgSQL General ML Subject: Re: Replication Ideas References: <200308270325.h7R3PfI24921@candle.pha.pa.us> <6358.1061955430@sss.pgh.pa.us> <1061971951.18060.357.camel@haggis> In-Reply-To: <1061971951.18060.357.camel@haggis> 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: 200308/1640 X-Sequence-Number: 48055 Ron Johnson wrote: > Notes: > a) this is, of course, not *sufficient* for multi-master > b) yes, you need a fast, low latency network for the DLM chatter. "Fast" is an understatement. The DLM you're talking about would (in our case) need to use Spread's AGREED_MESS or SAFE_MESS service type, meaning guarantee of total order. A transaction that needs any type of lock sends that request into the DLM group and then waits. The incoming stream of lock messages determines success or failure. With the overhead of these service types I don't think one single communication group for all database backends in the whole cluster guaranteeing total order will be that efficient. > > This is a tried and true method of synchronization. DEC Rdb/VMS > has been using it for 19 years as the underpinnings of it's cluster > technology, and Oracle licensed it from them (well, really Compaq) > for it's 9i RAC. Are you sure they're using it that way? Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com # From pgsql-performance-owner@postgresql.org Thu Aug 28 18:17: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 3B439D1D4D6 for ; Thu, 28 Aug 2003 21:17:10 +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 06212-01 for ; Thu, 28 Aug 2003 18:16:41 -0300 (ADT) Received: from yertle.kcilink.com (yertle.kcilink.com [216.194.193.105]) by svr1.postgresql.org (Postfix) with ESMTP id 36249D1B8AC for ; Thu, 28 Aug 2003 18:16:39 -0300 (ADT) Received: by yertle.kcilink.com (Postfix, from userid 100) id 22C1921792; Thu, 28 Aug 2003 17:16:41 -0400 (EDT) From: Vivek Khera To: pgsql-performance@postgresql.org Subject: opinion on RAID choice X-Mailer: VM 7.14 under 21.4 (patch 12) "Portable Code" XEmacs Lucid Message-Id: <20030828211641.22C1921792@yertle.kcilink.com> Date: Thu, 28 Aug 2003 17:16:41 -0400 (EDT) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/442 X-Sequence-Number: 3258 I just ran a handful of tests on a 14-disk array on a SCSI hardware RAID card. From some quickie benchmarks using the bonnie++ benchmark, it appears that the RAID5 across all 14 disks is a bit faster than RAID50 and noticeably faster than RAID10... Sample numbers for a 10Gb file (speed in Kbytes/second) RAID5 RAID50 RAID10 sequential write: 39728 37568 23533 read/write file: 13831 13289 11400 sequential read: 52184 51529 54222 Hardware is a Dell 2650 dual Xeon, 4GB Ram, PERC3/DC RAID card with 14 external U320 SCSI 15kRPM drives. Software is FreeBSD 4.8 with the default newfs settings. The RAID drives were configured with 32k stripe size. From informal tests it doesn't seem to make much difference in the bonnie++ benchmark to go with 64k stripe on the RAID10 (didn't test it with RAID5 or RAID50). They say use larger stripe size for sequential access, and lower for random access. My concern is speed. Any RAID config on this system has more disk space than I will need for a LOOONG time. My Postgres load is a heavy mix of select/update/insert. ie, it is a very actively updated and read database. The conventional wisdom has been to use RAID10, but with 14 disks, I'm kinda leaning toward RAID50 or perhaps just RAID5. Has anyone else done similar tests of different RAID levels? What were your conclusions? Raw output from bonnie++ available upon request. From pgsql-performance-owner@postgresql.org Thu Aug 28 18:28:50 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 66081D1B8BB for ; Thu, 28 Aug 2003 21:28:40 +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 06882-07 for ; Thu, 28 Aug 2003 18:28:31 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 62BB5D1B9FE for ; Thu, 28 Aug 2003 18:28:29 -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 h7SLRJp5006811; Thu, 28 Aug 2003 15:27:19 -0600 (MDT) Date: Thu, 28 Aug 2003 15:26:14 -0600 (MDT) From: "scott.marlowe" To: Vivek Khera Cc: Subject: Re: opinion on RAID choice In-Reply-To: <20030828211641.22C1921792@yertle.kcilink.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner-ihs-com: Found to be clean X-MailScanner-SpamCheck-ihs-com: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/445 X-Sequence-Number: 3261 On Thu, 28 Aug 2003, Vivek Khera wrote: > I just ran a handful of tests on a 14-disk array on a SCSI hardware > RAID card. SNIP > Has anyone else done similar tests of different RAID levels? What > were your conclusions? Yes I have. I had a 6 disk array plus 2 disks inside my machine (this was on a Sparc 20 with 4 narrow SCSI channels and the disks spread across them evenly, using RH6.2 and linux sw raid. My results were about the same as yours, RAID1+0 tended to beat RAID5 at reads, while RAID5 tended to win at writes. There's an old wive's tale that RAID5 has to touch every single disk in a stripe when writing, which simply isn't true. I believe that many old controllers (decades back, 286 land kinda stuff) might have done it this way, and so people kept thinking this was how RAID5 worked, and avoided it. My experience has been that once you get past 6 disks, RAID5 is faster than RAID1+0. From pgsql-performance-owner@postgresql.org Thu Aug 28 19:22: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 7B296D1B550 for ; Thu, 28 Aug 2003 21:49:49 +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 08220-09 for ; Thu, 28 Aug 2003 18:49:40 -0300 (ADT) Received: from perrin.nxad.com (internal.nxad.com [69.1.70.251]) by svr1.postgresql.org (Postfix) with ESMTP id C2D9ED1B8A9 for ; Thu, 28 Aug 2003 18:49:38 -0300 (ADT) Received: by perrin.nxad.com (Postfix, from userid 1001) id 8BC8D21058; Thu, 28 Aug 2003 14:49:40 -0700 (PDT) Date: Thu, 28 Aug 2003 14:49:40 -0700 From: Sean Chittenden To: Vivek Khera Cc: pgsql-performance@postgresql.org Subject: Re: The results of my PostgreSQL/filesystem performance tests Message-ID: <20030828214940.GQ83759@perrin.nxad.com> References: <3F4C0DC4.8070105@potentialtech.com> <001201c36d24$3c572460$0500a8c0@MOBILE01> <20030828161233.GB83759@perrin.nxad.com> <3F4E54FB.3020408@potentialtech.com> <20030828193123.GI83317@perrin.nxad.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/449 X-Sequence-Number: 3265 > >> I need to step in and do 2 things: > SC> Thanks for posting that. Let me know if you have any questions while > SC> doing your testing. I've found that using 16K blocks on FreeBSD > SC> results in about an 8% speedup in writes to the database, fwiw. > > ok.. ignore my prior request about how to set that... i missed you > had included a patch. > > Any recommendations on newfs parameters for an overly large file > system used solely for Postgres? Over 100Gb (with raid 10) or over > 200Gb (with raid 5)? Nope, you'll have to test and see. If you find something that works, however, let me know. -sc -- Sean Chittenden From pgsql-general-owner@postgresql.org Thu Aug 28 19:19:24 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 10A43D1B8BC for ; Thu, 28 Aug 2003 22:04: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 09218-07 for ; Thu, 28 Aug 2003 19:04:19 -0300 (ADT) Received: from lakemtao02.cox.net (lakemtao02.cox.net [68.1.17.243]) by svr1.postgresql.org (Postfix) with ESMTP id E0202D1B8BD for ; Thu, 28 Aug 2003 19:04:16 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao02.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030828220410.KGII11854.lakemtao02.cox.net@lhosts> for ; Thu, 28 Aug 2003 18:04:10 -0400 Subject: Re: Replication Ideas From: Ron Johnson To: PgSQL General ML In-Reply-To: <3F4E6D52.90206@Yahoo.com> References: <200308270325.h7R3PfI24921@candle.pha.pa.us> <6358.1061955430@sss.pgh.pa.us> <1061971951.18060.357.camel@haggis> <3F4E6D52.90206@Yahoo.com> Content-Type: text/plain Message-Id: <1062108258.29020.69.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 28 Aug 2003 17:04:19 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1653 X-Sequence-Number: 48068 On Thu, 2003-08-28 at 16:00, Jan Wieck wrote: > Ron Johnson wrote: > > > Notes: > > a) this is, of course, not *sufficient* for multi-master > > b) yes, you need a fast, low latency network for the DLM chatter. > > "Fast" is an understatement. The DLM you're talking about would (in our > case) need to use Spread's AGREED_MESS or SAFE_MESS service type, > meaning guarantee of total order. A transaction that needs any type of > lock sends that request into the DLM group and then waits. The incoming > stream of lock messages determines success or failure. With the overhead > of these service types I don't think one single communication group for > all database backends in the whole cluster guaranteeing total order will > be that efficient. I guess it's the differing protocols involved. DEC made clustering (including Rdb/VMS) work over an 80Mbps protocol, back in The Day, and HPaq says that it works fine now over fast ethernet. > > This is a tried and true method of synchronization. DEC Rdb/VMS > > has been using it for 19 years as the underpinnings of it's cluster > > technology, and Oracle licensed it from them (well, really Compaq) > > for it's 9i RAC. > > Are you sure they're using it that way? Not as sure as I am that the sun will rise in the east tomorrow, but, yes, I am highly confident that O modified DLM for use in 9i RAC. Note that O purchased Rdb/VMS from DEC back in 1994, along with the Engineers, so they have long knowledge of how it works in VMS. One of the reasons they bought Rdb was to merge the tech- nology into RDBMS. -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "they love our milk and honey, but preach about another way of living" Merle Haggard, "The Fighting Side Of Me" From pgsql-general-owner@postgresql.org Thu Aug 28 19:47:49 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3F6C6D1B8CF for ; Thu, 28 Aug 2003 22:47: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 17898-06 for ; Thu, 28 Aug 2003 19:47:17 -0300 (ADT) Received: from snoopy.oit.edu (snoopy.OIT.EDU [140.211.135.12]) by svr1.postgresql.org (Postfix) with ESMTP id 4EF56D1B8E7 for ; Thu, 28 Aug 2003 19:47:11 -0300 (ADT) Received: from fireserve.net (purvine-141-62.oit.edu [140.211.141.62]) by snoopy.oit.edu (8.12.9/8.12.9/OIT-4.0) with ESMTP id h7SMlCHf018390; Thu, 28 Aug 2003 15:47:12 -0700 Message-ID: <3F4E87A8.9010005@fireserve.net> Date: Thu, 28 Aug 2003 15:52:24 -0700 From: Dennis Gearon User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, ru, es-mx MIME-Version: 1.0 To: Ron Johnson Cc: PgSQL General ML Subject: Re: Replication Ideas References: <200308270325.h7R3PfI24921@candle.pha.pa.us> <6358.1061955430@sss.pgh.pa.us> <1061971951.18060.357.camel@haggis> <3F4E6D52.90206@Yahoo.com> <1062108258.29020.69.camel@haggis> In-Reply-To: <1062108258.29020.69.camel@haggis> 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: 200308/1657 X-Sequence-Number: 48072 Are these clusters physically together using dedicate LAN lines .... or are they synchronizing over the Interwait? Ron Johnson wrote: >On Thu, 2003-08-28 at 16:00, Jan Wieck wrote: > > >>Ron Johnson wrote: >> >> >> >>>Notes: >>>a) this is, of course, not *sufficient* for multi-master >>>b) yes, you need a fast, low latency network for the DLM chatter. >>> >>> >>"Fast" is an understatement. The DLM you're talking about would (in our >>case) need to use Spread's AGREED_MESS or SAFE_MESS service type, >>meaning guarantee of total order. A transaction that needs any type of >>lock sends that request into the DLM group and then waits. The incoming >>stream of lock messages determines success or failure. With the overhead >>of these service types I don't think one single communication group for >>all database backends in the whole cluster guaranteeing total order will >>be that efficient. >> >> > >I guess it's the differing protocols involved. DEC made clustering >(including Rdb/VMS) work over an 80Mbps protocol, back in The Day, >and HPaq says that it works fine now over fast ethernet. > > > >>>This is a tried and true method of synchronization. DEC Rdb/VMS >>>has been using it for 19 years as the underpinnings of it's cluster >>>technology, and Oracle licensed it from them (well, really Compaq) >>>for it's 9i RAC. >>> >>> >>Are you sure they're using it that way? >> >> > >Not as sure as I am that the sun will rise in the east tomorrow, >but, yes, I am highly confident that O modified DLM for use in >9i RAC. Note that O purchased Rdb/VMS from DEC back in 1994, along >with the Engineers, so they have long knowledge of how it works >in VMS. One of the reasons they bought Rdb was to merge the tech- >nology into RDBMS. > > > From pgsql-performance-owner@postgresql.org Thu Aug 28 21:11: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 3791BD1B8CC for ; Fri, 29 Aug 2003 00:11: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 26754-05 for ; Thu, 28 Aug 2003 21:10:36 -0300 (ADT) Received: from mail.speakeasy.net (mail7.speakeasy.net [216.254.0.207]) by svr1.postgresql.org (Postfix) with ESMTP id 04D82D1B8BC for ; Thu, 28 Aug 2003 21:10:31 -0300 (ADT) Received: (qmail 13033 invoked by uid 64014); 29 Aug 2003 00:10:34 -0000 Received: from kgeis@speakeasy.org by mail7.speakeasy.net with AmikaGuardian-Server-2.0.0 (Processed in 0.191544 secs); 29 Aug 2003 00:10:34 -0000 X-AmikaGuardian-Id: mail7.speakeasy.net106211583423613026 X-AmikaGuardian-Category: AN:Non-Junk Content : -2.0 X-AmikaGuardian-Category: AN:Non-Junk Clues : -2.0 X-AmikaGuardian-Category: AN:Picky Clues : 0.1 X-AmikaGuardian-Category: AN:Spam Structure : 0.1 X-AmikaGuardian-Category: AN:Junk Mail : -1.9 X-AmikaGuardian-Category: AN:Pastime : 0.05 X-AmikaGuardian-Category: AN:Joke : 0.05 X-AmikaGuardian-Category: AN:Obvious Clues : 0.1 X-AmikaGuardian-Category: AN:Spam : 0.1 X-AmikaGuardian-Category: AN:Spam Indicators : 0.1 X-AmikaGuardian-Action: Do Nothing() Received: from unknown (HELO speakeasy.org) (kgeis@[67.113.18.226]) (envelope-sender ) by mail7.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Aug 2003 00:10:33 -0000 Message-ID: <3F4E99F7.7080604@speakeasy.org> Date: Thu, 28 Aug 2003 17:10:31 -0700 From: Ken Geis 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: pgsql-performance@postgresql.org Subject: bad estimates / non-scanning aggregates 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: 200308/450 X-Sequence-Number: 3266 I'm surprised at the effort pgsql requires to run one of my queries. I don't know how to tune this query. Column | Type | Modifiers ------------+--------------+----------- the_id | integer | not null the_date | date | not null num1 | numeric(9,4) | num2 | numeric(9,4) | num3 | numeric(9,4) | num4 | numeric(9,4) | int1 | integer | Indexes: "the_table_pkey" primary key, btree (the_id, the_date) --------------------------------------- The query I want to run is select stock_id, min(price_date) from day_ends group by stock_id; --------------------------------------- Here's the plan that I get. GroupAggregate (cost=3711244.30..3838308.31 rows=6732 width=8) -> Sort (cost=3711244.30..3753593.36 rows=16939624 width=8) Sort Key: stock_id -> Seq Scan on day_ends (cost=0.00..361892.24 rows=16939624 width=8) If I set enable_seqscan = false, the plan changes to GroupAggregate (cost=0.00..67716299.91 rows=6732 width=8) -> Index Scan using day_ends_pkey on day_ends (cost=0.00..67631584.96 rows=16939624 width=8) --------------------------------------- Now... the first plan uses up tons of temporary space for sorting. The second one just runs and runs and runs. I've tried setting the statistics to 1000 with little effect. So the query can get everything it needs from the index, and a full scan of the index should be faster (the index file is less than half the size of the data file.) So why does the optimizer estimate so high? Also, to get the MIN for a given group, not all values of the index need to be seen. Must pgsql do a full scan because it treats all aggregates in the same way? Are MIN and MAX used often enough to justify special treatment, and could that be cleanly implemented? Perhaps the aggregate function can request the data in a certain order, be told that it is being passed data in a certain order, and return before seeing the entire set of data. Food for thought... Thanks, Ken Geis From pgsql-performance-owner@postgresql.org Thu Aug 28 21:50:29 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 4489FD1B8AE for ; Fri, 29 Aug 2003 00:50:28 +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 28252-08 for ; Thu, 28 Aug 2003 21:50:00 -0300 (ADT) Received: from harrier.cohaesio.com (harrier.cohaesio.com [212.97.128.50]) by svr1.postgresql.org (Postfix) with ESMTP id 49349D1B52C for ; Thu, 28 Aug 2003 21:49:57 -0300 (ADT) Received: by harrier.cohaesio.com (Postfix, from userid 88) id 2D3D086; Fri, 29 Aug 2003 02:49:45 +0200 (CEST) X-Original-To: news2mail@news.cohaesio.com From: "Anders K. Pedersen" Subject: Re: Queries sometimes take 1000 times the normal time Date: Fri, 29 Aug 2003 02:49:44 +0200 Organization: Cohaesio A/S Lines: 14 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: harrier.cohaesio.com 1062118184 13692 212.97.128.160 (29 Aug 2003 00:49:44 GMT) X-Complaints-To: newsmaster@news.cohaesio.com X-Accept-Language: da, en-us, en To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/451 X-Sequence-Number: 3267 scott.marlowe wrote: > Just to add to the clutch here, also check your bdflush settings (if > you're on linux) or equivalent (if you're not.) > > Many times the swapping algo in linux can be quite bursty if you have it > set to move too many pages at a time during cleanup / flush. According to vmstat it doesn't swap near the spikes, so I don't think this is the problem. I posted a vmstat sample in another reply, where you can see an example of what happens. Regards, Anders K. Pedersen From pgsql-performance-owner@postgresql.org Thu Aug 28 22:13:28 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 2BC65D1B8BB for ; Fri, 29 Aug 2003 01:08:43 +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 35910-09 for ; Thu, 28 Aug 2003 22:08:15 -0300 (ADT) Received: from mta11.adelphia.net (mta11.adelphia.net [68.168.78.205]) by svr1.postgresql.org (Postfix) with ESMTP id 7B456D1B8A8 for ; Thu, 28 Aug 2003 22:08:01 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta11.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030829010806.OKTK19795.mta11.adelphia.net@potentialtech.com>; Thu, 28 Aug 2003 21:08:06 -0400 Message-ID: <3F4EA775.9020501@potentialtech.com> Date: Thu, 28 Aug 2003 21:08:05 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: PgSQL Performance ML , freebsd-database@freebsd.org, freebsd-fs@freebsd.org, freebsd-performance@freebsd.org Subject: Taking another shot at the PostgreSQL/filesystem benchmarks 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: 200308/452 X-Sequence-Number: 3268 Alright. To anyone who didn't get the news the first time: The first set of benchmarks were terribly skewed because FreeBSD didn't properly work with the hardware I was using. Thanks to those who pointed the problem out to me. I have scrounged new hardware, and insured that FreeBSD is working properly with it. And I have rerun many of the tests (not all). Thanks again to all who responded with helpful tips and pointers. I'm hoping to work on these tests a little bit at a time, adding additional tests and their results, so feel free to stop back and check the page every so often. I don't intend to announce future updates on these lists unless there is something that seems considerably important found. If you've made a suggestion on additional tests to run, please rest assured that I got your email and have added the test to my list of things to try. I simply got more emails than I could respond to. I apologize to everyone who didn't get a personal response. http://www.potentialtech.com/wmoran/postgresql.php Again, feedback is welcome, but if it's of any magnitude similar to what I just got, I doubt I'll be able to respond to everyone. Please don't be offended. I'm rather surprised at how popular this information was. -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Thu Aug 28 22:20: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 41FC1D1B99C for ; Fri, 29 Aug 2003 01:19:38 +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 38378-08 for ; Thu, 28 Aug 2003 22:19:10 -0300 (ADT) Received: from mta5.adelphia.net (mta5.adelphia.net [68.168.78.187]) by svr1.postgresql.org (Postfix) with ESMTP id 0451FD1BA45 for ; Thu, 28 Aug 2003 22:19:02 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta5.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030829011907.RMTX7719.mta5.adelphia.net@potentialtech.com>; Thu, 28 Aug 2003 21:19:07 -0400 Message-ID: <3F4EAA09.4070602@potentialtech.com> Date: Thu, 28 Aug 2003 21:19:05 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: shridhar_daithankar@persistent.co.in Cc: pgsql-performance@postgresql.org Subject: Re: The results of my PostgreSQL/filesystem performance References: <3F4DF252.3395.332BF0F@localhost> In-Reply-To: <3F4DF252.3395.332BF0F@localhost> 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: 200308/453 X-Sequence-Number: 3269 Shridhar Daithankar wrote: > On 26 Aug 2003 at 21:47, Bill Moran wrote: > > >>Hey all. >> >>I said I was going to do it, and I finally did it. >> >>As with all performance tests/benchmarks, there are probably dozens or >>more reasons why these results aren't as accurate or wonderful as they >>should be. Take them for what they are and hopefully everyone can >>learn a few things from them. >> >>Intelligent feedback is welcome. >> >>http://www.potentialtech.com/wmoran/postgresql.php > > > Can we have these benchmarks and relevant information stored in a central > archive at techdocs(Say)? > > That would be better than searching mail archives.. I agree. There doesn't seem to be a place on techdocs for benchmarks at the time. Is there another part of the site that would be good for these to go? I'll keep them posted on my site until a better location is found. -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Thu Aug 28 22:37: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 A363FD1B8B3 for ; Fri, 29 Aug 2003 01:37:37 +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 45899-04 for ; Thu, 28 Aug 2003 22:37:09 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id 8D7D6D1B8E0 for ; Thu, 28 Aug 2003 22:37:04 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h7T1axLt034462; Fri, 29 Aug 2003 09:36:59 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <06e801c36dce$81a153b0$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "Ron Johnson" , "PgSQL Performance ML" References: <3F4C0DC4.8070105@potentialtech.com> <1062062608.25226.182.camel@haggis> Subject: Re: The results of my PostgreSQL/filesystem performance Date: Fri, 29 Aug 2003 09:40:18 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/454 X-Sequence-Number: 3270 > > As with all performance tests/benchmarks, there are probably dozens or > > more reasons why these results aren't as accurate or wonderful as they > > should be. Take them for what they are and hopefully everyone can > > learn a few things from them. > > > > Intelligent feedback is welcome. > > > > http://www.potentialtech.com/wmoran/postgresql.php > > I notice that the Linux FSs weren't tested with noatime. Any > reason? My friend, (a FreeBSD committer), was wondering what the results are if you turn off softupdates (to match Linux default installation) and use noatime. He also wonders how bug the default IO is? Chris From pgsql-performance-owner@postgresql.org Thu Aug 28 22:57: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 B7D3BD1B8B3 for ; Fri, 29 Aug 2003 01:57:03 +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 45640-10 for ; Thu, 28 Aug 2003 22:56:36 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id 8788DD1B8CC for ; Thu, 28 Aug 2003 22:56:31 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h7T1uULt034817; Fri, 29 Aug 2003 09:56:30 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <082e01c36dd1$3bf1f150$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "Sean Chittenden" , "Bill Moran" Cc: References: <3F4C0DC4.8070105@potentialtech.com> <001201c36d24$3c572460$0500a8c0@MOBILE01> <20030828161233.GB83759@perrin.nxad.com> <3F4E54FB.3020408@potentialtech.com> <20030828193123.GI83317@perrin.nxad.com> Subject: Re: The results of my PostgreSQL/filesystem performance tests Date: Fri, 29 Aug 2003 09:59:50 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/455 X-Sequence-Number: 3271 > I'm likely going to make this the default for PostgreSQL on FreeBSD > starting with 7.4 (just posted something to -hackers about this)f. If > you'd like to do this in your testing, just apply the following patch. > > Right now PostgreSQL defaults to 8K blocks, but FreeBSD uses 16K > blocks which means that currently, reading two blocks of data in PG is > two read calls to the OS, one reads 16K of data off disk and returns > the 1st page, the 2nd call pulls the 2nd block from the FS cache. In > making things 16K, it avoids the need for the 2nd system call which is > where the performance difference is coming from, afaikt. -sc Are you _sure_ this won't cause any atomicity problems? Can FreeBSD write 16k as an atomic unit? Chris From pgsql-performance-owner@postgresql.org Thu Aug 28 23:00:31 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 5F6FAD1B8BD for ; Fri, 29 Aug 2003 02:00:28 +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 46829-06 for ; Thu, 28 Aug 2003 23:00:21 -0300 (ADT) Received: from yertle.kcilink.com (yertle.kcilink.com [216.194.193.105]) by svr1.postgresql.org (Postfix) with ESMTP id 68F76D1B550 for ; Thu, 28 Aug 2003 23:00:17 -0300 (ADT) Received: by yertle.kcilink.com (Postfix, from userid 100) id A43382178A; Thu, 28 Aug 2003 22:00:21 -0400 (EDT) From: Vivek Khera MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16206.46005.102954.7768@yertle.int.kciLink.com> Date: Thu, 28 Aug 2003 22:00:21 -0400 To: Subject: Re: opinion on RAID choice In-Reply-To: References: <20030828211641.22C1921792@yertle.kcilink.com> X-Mailer: VM 7.14 under 21.4 (patch 12) "Portable Code" XEmacs Lucid X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/456 X-Sequence-Number: 3272 >>>>> "sm" == scott marlowe writes: sm> My experience has been that once you get past 6 disks, RAID5 is faster sm> than RAID1+0. Any opinion on stripe size for the RAID? From pgsql-performance-owner@postgresql.org Thu Aug 28 23:15:49 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 8BF4CD1B8B3 for ; Fri, 29 Aug 2003 02:15: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 62430-03 for ; Thu, 28 Aug 2003 23:15:20 -0300 (ADT) Received: from mta3.adelphia.net (mta3.adelphia.net [68.168.78.181]) by svr1.postgresql.org (Postfix) with ESMTP id 72AC3D1B97C for ; Thu, 28 Aug 2003 23:15:16 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta3.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030829021522.YIO6558.mta3.adelphia.net@potentialtech.com>; Thu, 28 Aug 2003 22:15:22 -0400 Message-ID: <3F4EB738.1060203@potentialtech.com> Date: Thu, 28 Aug 2003 22:15:20 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Christopher Kings-Lynne Cc: Ron Johnson , PgSQL Performance ML Subject: Re: The results of my PostgreSQL/filesystem performance References: <3F4C0DC4.8070105@potentialtech.com> <1062062608.25226.182.camel@haggis> <06e801c36dce$81a153b0$2800a8c0@mars> In-Reply-To: <06e801c36dce$81a153b0$2800a8c0@mars> 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: 200308/457 X-Sequence-Number: 3273 Christopher Kings-Lynne wrote: >>>As with all performance tests/benchmarks, there are probably dozens or >>>more reasons why these results aren't as accurate or wonderful as they >>>should be. Take them for what they are and hopefully everyone can >>>learn a few things from them. >>> >>>Intelligent feedback is welcome. >>> >>>http://www.potentialtech.com/wmoran/postgresql.php >> >>I notice that the Linux FSs weren't tested with noatime. Any >>reason? > > My friend, (a FreeBSD committer), was wondering what the results are if you > turn off softupdates (to match Linux default installation) and use noatime. Keep an eye on the page. The test results will be posted shortly after I finish them. Keep in mind, I'm more interested in figuring out what can be done to make Postgres _faster_, so tests along that line are going to have a higher priority than ones that specifically compare "apples to apples" or anything like that. > He also wonders how bug the default IO is? Huh? -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Thu Aug 28 23:51:16 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 C14D1D1B960 for ; Fri, 29 Aug 2003 02:51: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 69829-08 for ; Thu, 28 Aug 2003 23:50:43 -0300 (ADT) Received: from mail.speakeasy.net (mail15.speakeasy.net [216.254.0.215]) by svr1.postgresql.org (Postfix) with ESMTP id D2B60D1B8C6 for ; Thu, 28 Aug 2003 23:50:37 -0300 (ADT) Received: (qmail 25478 invoked by uid 64014); 29 Aug 2003 02:50:42 -0000 Received: from kgeis@speakeasy.org by mail15.speakeasy.net with AmikaGuardian-Server-2.0.0 (Processed in 0.214208 secs); 29 Aug 2003 02:50:42 -0000 X-AmikaGuardian-Id: mail15.speakeasy.net106212544223625473 X-AmikaGuardian-Category: AN:Urgency : 0.01 X-AmikaGuardian-Category: AN:Vectored : 1.7 X-AmikaGuardian-Category: AN:Spam Language : 0.01 X-AmikaGuardian-Category: AN:Forwarded Mail : 1.7 X-AmikaGuardian-Category: AN:Override : 1.7 X-AmikaGuardian-Category: AN:Junk Mail : 0.01 X-AmikaGuardian-Category: AN:Exception : 1.7 X-AmikaGuardian-Category: AN:Spam : 0.01 X-AmikaGuardian-Action: Do Nothing() Received: from unknown (HELO speakeasy.org) (kgeis@[67.113.18.226]) (envelope-sender ) by mail15.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Aug 2003 02:50:42 -0000 Message-ID: <3F4EBF7E.8020602@speakeasy.org> Date: Thu, 28 Aug 2003 19:50:38 -0700 From: Ken Geis 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: Bruno Wolff III Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates / non-scanning aggregates References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> In-Reply-To: <20030829025109.GD4373@wolff.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: 200308/459 X-Sequence-Number: 3275 Bruno Wolff III wrote: > On Thu, Aug 28, 2003 at 17:10:31 -0700, > Ken Geis wrote: > >>The query I want to run is >> >>select stock_id, min(price_date) from day_ends group by stock_id; > > The fast way to do this is: > > select distinct on (stock_id) stock_id, price_date > order by stock_id, price_date; Not according to the optimizer! Plus, this is not guaranteed to return the correct results. Unique (cost=3711244.30..3795942.42 rows=6366 width=8) -> Sort (cost=3711244.30..3753593.36 rows=16939624 width=8) Sort Key: stock_id, price_date -> Seq Scan on day_ends (cost=0.00..361892.24 rows=16939624 width=8) From pgsql-performance-owner@postgresql.org Thu Aug 28 23:45:40 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 95314D1B550 for ; Fri, 29 Aug 2003 02: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 68817-09 for ; Thu, 28 Aug 2003 23:45:11 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 22A9AD1B8E6 for ; Thu, 28 Aug 2003 23:45:07 -0300 (ADT) Received: (qmail 5007 invoked by uid 500); 29 Aug 2003 02:51:09 -0000 Date: Thu, 28 Aug 2003 21:51:09 -0500 From: Bruno Wolff III To: Ken Geis Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates / non-scanning aggregates Message-ID: <20030829025109.GD4373@wolff.to> Mail-Followup-To: Ken Geis , pgsql-performance@postgresql.org References: <3F4E99F7.7080604@speakeasy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4E99F7.7080604@speakeasy.org> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/458 X-Sequence-Number: 3274 On Thu, Aug 28, 2003 at 17:10:31 -0700, Ken Geis wrote: > The query I want to run is > > select stock_id, min(price_date) from day_ends group by stock_id; The fast way to do this is: select distinct on (stock_id) stock_id, price_date order by stock_id, price_date; > Also, to get the MIN for a given group, not all values of the index need > to be seen. Must pgsql do a full scan because it treats all aggregates > in the same way? Are MIN and MAX used often enough to justify special > treatment, and could that be cleanly implemented? Perhaps the aggregate > function can request the data in a certain order, be told that it is > being passed data in a certain order, and return before seeing the > entire set of data. Yes, max and min are not treated special so they don't benefit from indexes. This has been discussed repeatedly in the archives. From pgsql-performance-owner@postgresql.org Fri Aug 29 00:01:16 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 68C9CD1B9F4 for ; Fri, 29 Aug 2003 03:00: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 71196-06 for ; Fri, 29 Aug 2003 00:00:44 -0300 (ADT) Received: from mail.speakeasy.net (mail15.speakeasy.net [216.254.0.215]) by svr1.postgresql.org (Postfix) with ESMTP id 89CE3D1B9B2 for ; Fri, 29 Aug 2003 00:00:37 -0300 (ADT) Received: (qmail 9218 invoked by uid 64014); 29 Aug 2003 03:00:36 -0000 Received: from kgeis@speakeasy.org by mail15.speakeasy.net with AmikaGuardian-Server-2.0.0 (Processed in 0.290994 secs); 29 Aug 2003 03:00:36 -0000 X-AmikaGuardian-Id: mail15.speakeasy.net10621260362369157 X-AmikaGuardian-Category: AN:Urgency : 0.03 X-AmikaGuardian-Category: AN:Vectored : 1.7 X-AmikaGuardian-Category: AN:Spam Language : 0.03 X-AmikaGuardian-Category: AN:Forwarded Mail : 1.7 X-AmikaGuardian-Category: AN:Override : 1.7 X-AmikaGuardian-Category: AN:Junk Mail : 0.03 X-AmikaGuardian-Category: AN:Exception : 1.7 X-AmikaGuardian-Category: AN:Spam : 0.03 X-AmikaGuardian-Action: Do Nothing() Received: from unknown (HELO speakeasy.org) (kgeis@[67.113.18.226]) (envelope-sender ) by mail15.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Aug 2003 03:00:35 -0000 Message-ID: <3F4EC1D0.5010503@speakeasy.org> Date: Thu, 28 Aug 2003 20:00:32 -0700 From: Ken Geis 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: Bruno Wolff III Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates / non-scanning aggregates References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> In-Reply-To: <20030829030156.GF4373@wolff.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: 200308/461 X-Sequence-Number: 3277 Bruno Wolff III wrote: >>Not according to the optimizer! Plus, this is not guaranteed to return >>the correct results. > > For it to be fast you need an index on (stock_id, price_date) so that > you can use an index scan. I already said that such an index existed. In fact, it is the primary key of the table. And yes, I *am* analyzed! > The answers are guarenteed to be correct. See: > http://developer.postgresql.org/docs/postgres/sql-select.html#SQL-DISTINCT That's good to know. Thanks! Ken From pgsql-performance-owner@postgresql.org Thu Aug 28 23:56: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 4AE1CD1B550 for ; Fri, 29 Aug 2003 02:56: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 71477-04 for ; Thu, 28 Aug 2003 23:55:58 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 18C2BD1B8AD for ; Thu, 28 Aug 2003 23:55:54 -0300 (ADT) Received: (qmail 5140 invoked by uid 500); 29 Aug 2003 03:01:56 -0000 Date: Thu, 28 Aug 2003 22:01:56 -0500 From: Bruno Wolff III To: Ken Geis Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates / non-scanning aggregates Message-ID: <20030829030156.GF4373@wolff.to> Mail-Followup-To: Ken Geis , pgsql-performance@postgresql.org References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4EBF7E.8020602@speakeasy.org> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/460 X-Sequence-Number: 3276 On Thu, Aug 28, 2003 at 19:50:38 -0700, Ken Geis wrote: > Bruno Wolff III wrote: > >On Thu, Aug 28, 2003 at 17:10:31 -0700, > > Ken Geis wrote: > > > >>The query I want to run is > >> > >>select stock_id, min(price_date) from day_ends group by stock_id; > > > >The fast way to do this is: > > > >select distinct on (stock_id) stock_id, price_date > > order by stock_id, price_date; > > Not according to the optimizer! Plus, this is not guaranteed to return > the correct results. For it to be fast you need an index on (stock_id, price_date) so that you can use an index scan. The answers are guarenteed to be correct. See: http://developer.postgresql.org/docs/postgres/sql-select.html#SQL-DISTINCT From pgsql-general-owner@postgresql.org Fri Aug 29 00:20:55 2003 X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D7860D1B897 for ; Fri, 29 Aug 2003 03:20:43 +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 71299-10 for ; Fri, 29 Aug 2003 00:20:11 -0300 (ADT) Received: from lakemtao03.cox.net (lakemtao03.cox.net [68.1.17.242]) by svr1.postgresql.org (Postfix) with ESMTP id 61C49D1B8C6 for ; Fri, 29 Aug 2003 00:20:11 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao03.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030829032006.JJKO10977.lakemtao03.cox.net@lhosts> for ; Thu, 28 Aug 2003 23:20:06 -0400 Subject: Re: Replication Ideas From: Ron Johnson To: PgSQL General ML In-Reply-To: <3F4E87A8.9010005@fireserve.net> References: <200308270325.h7R3PfI24921@candle.pha.pa.us> <6358.1061955430@sss.pgh.pa.us> <1061971951.18060.357.camel@haggis> <3F4E6D52.90206@Yahoo.com> <1062108258.29020.69.camel@haggis> <3F4E87A8.9010005@fireserve.net> Content-Type: text/plain Message-Id: <1062127209.30745.84.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 28 Aug 2003 22:20:10 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/1679 X-Sequence-Number: 48094 On Thu, 2003-08-28 at 17:52, Dennis Gearon wrote: > Are these clusters physically together using dedicate LAN lines .... or > are they synchronizing over the Interwait? There have been multiple methods over the years. In order: 1. Cluster Interconnect (CI) : There's a big box, called the CI, that in the early days was really a stripped PDP-11 running an RTOS. Each VAX (and, later, Alpha) is connected to the CI via a special adapters and cables. Disks are connected to an "HSC" Storage Controllers which also plug into the CI. Basic- ally, it's a big, intelligent switch. Disk sectors pass along the wires from VAX and Alpha to disks and back. DLM messages pass along the wires from node to node. With mul- tiple CI adapters, and HSCs (they were dual-ported) you could set up otal dual-redundancy. Up to 96 nodes can be cluster- ed. It still works, but Memory Channel is preferred now. 2. LAVC - Local Area VAX Cluster : In this scheme, disks were directly attached to nodes, and data (disk and DLM) is trans- ferred back and forth across the 10Mbps Ethernet. It could travel over TCP/IP or DECnet. For obvious reasons, LAVC was a lot cheaper and slower than CI. 3. SCSI clusters : SCSI disks are wired to a dual-ported "HSZ" Storage Controller. Then, SCSI cards on each of 2 nodes could be wired into a port. The SCSI disks could also be wired to a 2nd HSZ, and a 2nd SCSI card in each node plugged into that HSZ, dual-redundancy is achieved. With modern versions of VMS, the SCSI drivers can choose which SCSI card it wanted to send data through, to increase performance. DLM messages are passed via TCP/IP. Only 2 nodes can be clustered. A related method uses fiber channel disks on "HSG" Storage Controllers. 4. Memory Channel : A higher speed interconnect. Don't know much about it. 128 nodes can be clustered. Note that since DLM awareness is built deep into VMS and all the RTLs, every program is cluster-aware, no matter what type of cluster method is used. > Ron Johnson wrote: > > >On Thu, 2003-08-28 at 16:00, Jan Wieck wrote: > > > > > >>Ron Johnson wrote: > >> > >> > >> > >>>Notes: > >>>a) this is, of course, not *sufficient* for multi-master > >>>b) yes, you need a fast, low latency network for the DLM chatter. > >>> > >>> > >>"Fast" is an understatement. The DLM you're talking about would (in our > >>case) need to use Spread's AGREED_MESS or SAFE_MESS service type, > >>meaning guarantee of total order. A transaction that needs any type of > >>lock sends that request into the DLM group and then waits. The incoming > >>stream of lock messages determines success or failure. With the overhead > >>of these service types I don't think one single communication group for > >>all database backends in the whole cluster guaranteeing total order will > >>be that efficient. > >> > >> > > > >I guess it's the differing protocols involved. DEC made clustering > >(including Rdb/VMS) work over an 80Mbps protocol, back in The Day, > >and HPaq says that it works fine now over fast ethernet. > > > > > > > >>>This is a tried and true method of synchronization. DEC Rdb/VMS > >>>has been using it for 19 years as the underpinnings of it's cluster > >>>technology, and Oracle licensed it from them (well, really Compaq) > >>>for it's 9i RAC. > >>> > >>> > >>Are you sure they're using it that way? > >> > >> > > > >Not as sure as I am that the sun will rise in the east tomorrow, > >but, yes, I am highly confident that O modified DLM for use in > >9i RAC. Note that O purchased Rdb/VMS from DEC back in 1994, along > >with the Engineers, so they have long knowledge of how it works > >in VMS. One of the reasons they bought Rdb was to merge the tech- > >nology into RDBMS. > > > > > > -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "Oh, great altar of passive entertainment, bestow upon me thy discordant images at such speed as to render linear thought impossible" Calvin, regarding TV From pgsql-performance-owner@postgresql.org Fri Aug 29 00:32:37 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 C1EEED1B897 for ; Fri, 29 Aug 2003 03:32:32 +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 76611-04 for ; Fri, 29 Aug 2003 00:32:22 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id A9A76D1B8CC for ; Fri, 29 Aug 2003 00:32:21 -0300 (ADT) Received: (qmail 5636 invoked by uid 500); 29 Aug 2003 03:38:18 -0000 Date: Thu, 28 Aug 2003 22:38:18 -0500 From: Bruno Wolff III To: Ken Geis Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates / non-scanning aggregates Message-ID: <20030829033818.GA5577@wolff.to> Mail-Followup-To: Ken Geis , pgsql-performance@postgresql.org References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4EC1D0.5010503@speakeasy.org> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/462 X-Sequence-Number: 3278 On Thu, Aug 28, 2003 at 20:00:32 -0700, Ken Geis wrote: > Bruno Wolff III wrote: > >>Not according to the optimizer! Plus, this is not guaranteed to return > >>the correct results. > > > >For it to be fast you need an index on (stock_id, price_date) so that > >you can use an index scan. > > I already said that such an index existed. In fact, it is the primary > key of the table. And yes, I *am* analyzed! Your original example didn't actually match that of the table you are showing examples from. In that example the second half of the primary key was the date not the end of the day price. If this is the case for the real table, then that is the reason the distinct on doesn't help. From pgsql-performance-owner@postgresql.org Fri Aug 29 00:40:49 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 6B2CFD1B8CC for ; Fri, 29 Aug 2003 03:40:46 +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 73647-08 for ; Fri, 29 Aug 2003 00:40:14 -0300 (ADT) Received: from al-aqsho.rspj.local (unknown [61.94.104.35]) by svr1.postgresql.org (Postfix) with ESMTP id 32EE6D1B8AE for ; Fri, 29 Aug 2003 00:40:12 -0300 (ADT) Received: from works220 (unknown [192.168.1.220]) by al-aqsho.rspj.local (Postfix) with ESMTP id 687AF1B58D for ; Fri, 29 Aug 2003 03:39:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" From: Eko Pranoto Reply-To: koprahome@telkom.net Organization: WEPEKA IT To: pgsql-performance@postgresql.org Subject: PostgreSQL HDD Grow capacity Date: Fri, 29 Aug 2003 10:44:40 +0700 User-Agent: KMail/1.4.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308291044.40700.kopra@wepeka-it.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/463 X-Sequence-Number: 3279 How To calcute PostgreSQL HDD grow capacity for every byte data, start from= =20 installation initialize. Regards, Eko Pranoto From pgsql-performance-owner@postgresql.org Fri Aug 29 00:46:37 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 6017DD1B8AB for ; Fri, 29 Aug 2003 03:46:34 +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 77874-04 for ; Fri, 29 Aug 2003 00:46:02 -0300 (ADT) Received: from mail.speakeasy.net (mail13.speakeasy.net [216.254.0.213]) by svr1.postgresql.org (Postfix) with ESMTP id 06613D1B8EA for ; Fri, 29 Aug 2003 00:46:02 -0300 (ADT) Received: (qmail 18314 invoked from network); 29 Aug 2003 03:46:00 -0000 Received: from unknown (HELO speakeasy.org) (kgeis@[66.93.130.165]) (envelope-sender ) by mail13.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Aug 2003 03:46:00 -0000 Message-ID: <3F4ECC78.7090502@speakeasy.org> Date: Thu, 28 Aug 2003 20:46:00 -0700 From: Ken Geis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruno Wolff III Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> In-Reply-To: <20030829033818.GA5577@wolff.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: 200308/464 X-Sequence-Number: 3280 Bruno Wolff III wrote: > On Thu, Aug 28, 2003 at 20:00:32 -0700, > Ken Geis wrote: > >>Bruno Wolff III wrote: >> >>>>Not according to the optimizer! Plus, this is not guaranteed to return >>>>the correct results. >>> >>>For it to be fast you need an index on (stock_id, price_date) so that >>>you can use an index scan. >> >>I already said that such an index existed. In fact, it is the primary >>key of the table. And yes, I *am* analyzed! > > > Your original example didn't actually match that of the table you are showing > examples from. In that example the second half of the primary key was the > date not the end of the day price. If this is the case for the real table, > then that is the reason the distinct on doesn't help. I had obfuscated the table in the example and forgot to do the same with the query. Serves me right for thinking I care about that. A big problem is that the values I am working with are *only* the primary key and the optimizer is choosing a table scan over an index scan. That is why I titled the email "bad estimates." The table has (stock_id, price_date) as the primary key, and a bunch of other columns. What I *really* want to do efficiently is select stock_id, min(price_date), max(price_date) from day_ends group by stock_id; It is not the table or the query that is wrong. It is either the db parameters or the optimizer itself. Ken From pgsql-performance-owner@postgresql.org Fri Aug 29 00:59:39 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 DB4E2D1B8BB for ; Fri, 29 Aug 2003 03:59:32 +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 77860-06 for ; Fri, 29 Aug 2003 00:59:22 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id A31E3D1B8BC for ; Fri, 29 Aug 2003 00:59:21 -0300 (ADT) Received: (qmail 5814 invoked by uid 500); 29 Aug 2003 04:05:19 -0000 Date: Thu, 28 Aug 2003 23:05:19 -0500 From: Bruno Wolff III To: Ken Geis Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates Message-ID: <20030829040519.GA5746@wolff.to> Mail-Followup-To: Ken Geis , pgsql-performance@postgresql.org References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4ECC78.7090502@speakeasy.org> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/465 X-Sequence-Number: 3281 On Thu, Aug 28, 2003 at 20:46:00 -0700, Ken Geis wrote: > > A big problem is that the values I am working with are *only* the > primary key and the optimizer is choosing a table scan over an index > scan. That is why I titled the email "bad estimates." The table has > (stock_id, price_date) as the primary key, and a bunch of other columns. > What I *really* want to do efficiently is > > select stock_id, min(price_date), max(price_date) > from day_ends > group by stock_id; > > It is not the table or the query that is wrong. It is either the db > parameters or the optimizer itself. If you want both the max and the min, then things are going to be a bit more work. You are either going to want to do two separate selects or join two selects or use subselects. If there aren't enough prices per stock, the sequential scan might be fastest since you only need to go through the table once and don't have to hit the index blocks. It is still odd that you didn't get a big speed up for just the min though. You example did have the stock id and the date as the primary key which would make sense since the stock id and stock price on a day wouldn't be guarenteed to be unique. Are you absolutely sure you have a combined key on the stock id and the stock price? From pgsql-performance-owner@postgresql.org Fri Aug 29 01:09:46 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 C4771D1B8E3 for ; Fri, 29 Aug 2003 04:09:41 +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 79349-04 for ; Fri, 29 Aug 2003 01:09:05 -0300 (ADT) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by svr1.postgresql.org (Postfix) with ESMTP id 5112ED1B8AE for ; Fri, 29 Aug 2003 01:09:01 -0300 (ADT) Received: (qmail 16324 invoked from network); 29 Aug 2003 04:09:00 -0000 Received: from unknown (HELO speakeasy.org) (kgeis@[66.93.130.165]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Aug 2003 04:09:00 -0000 Message-ID: <3F4ED1DC.50808@speakeasy.org> Date: Thu, 28 Aug 2003 21:09:00 -0700 From: Ken Geis Reply-To: kgeis@alum.calberkeley.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruno Wolff III Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> In-Reply-To: <20030829040519.GA5746@wolff.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: 200308/466 X-Sequence-Number: 3282 Bruno Wolff III wrote: > On Thu, Aug 28, 2003 at 20:46:00 -0700, > Ken Geis wrote: >>It is not the table or the query that is wrong. It is either the db >>parameters or the optimizer itself. ... > > It is still odd that you didn't get a big speed up for just the min though. > You example did have the stock id and the date as the primary key which > would make sense since the stock id and stock price on a day wouldn't > be guarenteed to be unique. Are you absolutely sure you have a combined > key on the stock id and the stock price? I am positive! I can send a log if you want, but I won't post it to the list. The arity on the data is roughly 1500 price_dates per stock_id. I was able to get the query to return in a reasonable amount of time (still ~3 minutes) by forcing a nested loop path using SQL functions instead of min and max. I'm going to run comparisons on 7.3.3 and 7.4-beta2. I'll also look into the optimizer source to try to figure out why it thinks scanning this index is so expensive. Ken From pgsql-performance-owner@postgresql.org Fri Aug 29 01:24:39 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 0C00DD1B8E5 for ; Fri, 29 Aug 2003 04:24:36 +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 77874-09 for ; Fri, 29 Aug 2003 01:24:25 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 8AD50D1B8AE for ; Fri, 29 Aug 2003 01:24:24 -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 h7T4Ngp5002332; Thu, 28 Aug 2003 22:23:42 -0600 (MDT) Date: Thu, 28 Aug 2003 22:22:35 -0600 (MDT) From: "scott.marlowe" To: Vivek Khera Cc: Subject: Re: opinion on RAID choice In-Reply-To: <16206.46005.102954.7768@yertle.int.kciLink.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner-ihs-com: Found to be clean X-MailScanner-SpamCheck-ihs-com: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/468 X-Sequence-Number: 3284 On Thu, 28 Aug 2003, Vivek Khera wrote: > >>>>> "sm" == scott marlowe writes: > > sm> My experience has been that once you get past 6 disks, RAID5 is faster > sm> than RAID1+0. > > Any opinion on stripe size for the RAID? That's more determined by what kind of data you're gonna be handling. If you want to do lots of little financial transactions, then 32k or less is good. If you're gonna store moderately large text fields and such, then going above 32k or 64k is usually a good idea. From pgsql-performance-owner@postgresql.org Fri Aug 29 01:19: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 3E139D1B8C6 for ; Fri, 29 Aug 2003 04:19: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 76610-10 for ; Fri, 29 Aug 2003 01:18:56 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 8FEEDD1B8AB for ; Fri, 29 Aug 2003 01:18:55 -0300 (ADT) Received: (qmail 5978 invoked by uid 500); 29 Aug 2003 04:24:53 -0000 Date: Thu, 28 Aug 2003 23:24:53 -0500 From: Bruno Wolff III To: kgeis@alum.calberkeley.org Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates Message-ID: <20030829042453.GA5931@wolff.to> Mail-Followup-To: kgeis@alum.calberkeley.org, pgsql-performance@postgresql.org References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4ED1DC.50808@speakeasy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4ED1DC.50808@speakeasy.org> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/467 X-Sequence-Number: 3283 On Thu, Aug 28, 2003 at 21:09:00 -0700, Ken Geis wrote: > Bruno Wolff III wrote: > > I am positive! I can send a log if you want, but I won't post it to the > list. Can you do a \d on the real table or is that too sensitive? It still doesn't make sense that you have a primary key that is a stock and its price. What happens when the stock has the same price on two different dates? And I doubt that you are looking for the minimum and maximum dates for which you have price data. So it is hard to believe that the index for your primary key is the one you need for your query. > The arity on the data is roughly 1500 price_dates per stock_id. Two index scans (one for min values and another for max values) should be better than one sequential scan under those conditions. I am calling it quits for tonight, but will check back tomorrow to see how things turned out. From pgsql-performance-owner@postgresql.org Fri Aug 29 03:50:51 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 CD38ED1B8B3 for ; Fri, 29 Aug 2003 06:50: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 92533-09 for ; Fri, 29 Aug 2003 03:50:16 -0300 (ADT) Received: from mail.cict.nl (vnd-7521.mxs.adsl.euronet.nl [62.234.149.33]) by svr1.postgresql.org (Postfix) with ESMTP id 230E1D1B897 for ; Fri, 29 Aug 2003 03:50:14 -0300 (ADT) Received: from APR ([192.168.150.182]) by mail.cict.nl (Merak 6.0.5) with SMTP id DUC73886 for ; Fri, 29 Aug 2003 08:50:12 +0200 Message-ID: <012f01c36dfa$0f4a8760$b696a8c0@APR> From: "Alexander Priem" To: Subject: Indexing question Date: Fri, 29 Aug 2003 08:52:06 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_012C_01C36E0A.D2C8A900" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.2 tagged_above=0.0 required=5.0 tests=HTML_30_40, HTML_FONT_BIG, HTML_FONT_COLOR_BLUE, HTML_FONT_FACE_ODD X-Spam-Level: * X-Archive-Number: 200308/469 X-Sequence-Number: 3285 This is a multi-part message in MIME format. ------=_NextPart_000_012C_01C36E0A.D2C8A900 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, I have some tables (which can get pretty large) in which I want to record '= current' data as well as 'historical' data. This table has fields 'deleted'= and 'deleteddate' (among other fields, of course). The field 'deleted' is = false be default. Every record that I want to delete gets the value true fo= r 'deleted' and 'deleteddate' is set to the date of deletion. Since these tables are used a lot by queries that only use 'current' data, = I have created a view with a where clause 'Where not deleted'. Also, I have= indexed field 'deleted'. I did this this because I read somewhere that fields that can contain NULL = values will NOT be indexed. Is this true? Or could I ditch the 'deleted' field and just set 'deleteddate' to NULL by = default and to a DATE in the case of a deleted record? I could then index t= he field 'deleteddate' and create a view with where clause 'Where deletedda= te is null'. Would this give the same performance as my current solution (with an indexe= d boolean field 'deleted') ? I cannot test this myself at the moment as I am still in a design phase and= do not have a real server available yet... Thanks in advance, Alexander Priem ------=_NextPart_000_012C_01C36E0A.D2C8A900 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi all,
 
I have some tables (which can get pretty l= arge) in=20 which I want to record 'current' data as well as 'historical' data. Th= is=20 table has fields 'deleted' and 'deleteddate' (among other fields, of course= ).=20 The field 'deleted' is false be default. Every record that I want to delete= gets=20 the value true for 'deleted' and 'deleteddate' is set to the date of=20 deletion.
 
Since these tables are used a lot by queri= es that=20 only use 'current' data, I have created a view with a where clause 'Where n= ot=20 deleted'. Also, I have indexed field 'deleted'.
 
I did this this because I read somewhere t= hat=20 fields that can contain NULL values will NOT be indexed.
 
Is this true?
 
Or could I ditch the 'deleted' field and j= ust set=20 'deleteddate' to NULL by default and to a DATE in the case of a deleted rec= ord?=20 I could then index the field 'deleteddate' and create a view with where cla= use=20 'Where deleteddate is null'.
 
Would this give the same performance as my= current=20 solution (with an indexed boolean field 'deleted') ?
 
I cannot test this myself at the moment as= I am=20 still in a design phase and do not have a real server available=20 yet...
 
Thanks in advance,

Alexander Priem
------=_NextPart_000_012C_01C36E0A.D2C8A900-- From pgsql-performance-owner@postgresql.org Fri Aug 29 04:01:52 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 C0172D1B8D2 for ; Fri, 29 Aug 2003 07:01:43 +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 97566-01 for ; Fri, 29 Aug 2003 04:01:12 -0300 (ADT) Received: from mail.speakeasy.net (mail7.speakeasy.net [216.254.0.207]) by svr1.postgresql.org (Postfix) with ESMTP id 0C128D1B8AD for ; Fri, 29 Aug 2003 04:01:10 -0300 (ADT) Received: (qmail 14693 invoked from network); 29 Aug 2003 07:01:10 -0000 Received: from unknown (HELO speakeasy.org) (kgeis@[66.93.130.165]) (envelope-sender ) by mail7.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Aug 2003 07:01:10 -0000 Message-ID: <3F4EFA35.90401@speakeasy.org> Date: Fri, 29 Aug 2003 00:01:09 -0700 From: Ken Geis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruno Wolff III Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4ED1DC.50808@speakeasy.org> <20030829042453.GA5931@wolff.to> In-Reply-To: <20030829042453.GA5931@wolff.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: 200308/470 X-Sequence-Number: 3286 Bruno Wolff III wrote: > Can you do a \d on the real table or is that too sensitive? It was silly of me to think of this as particularly sensitive. stocks=> \d day_ends Table "public.day_ends" Column | Type | Modifiers ------------+--------------+----------- stock_id | integer | not null price_date | date | not null open | numeric(9,4) | high | numeric(9,4) | low | numeric(9,4) | close | numeric(9,4) | volume | integer | Indexes: day_ends_pkey primary key btree (stock_id, price_date) Triggers: RI_ConstraintTrigger_16558399 > It still doesn't make sense that you have a primary key that > is a stock and its price. What happens when the stock has the > same price on two different dates? And I doubt that you are looking > for the minimum and maximum dates for which you have price data. > So it is hard to believe that the index for your primary key is the > one you need for your query. I can see the naming being confusing. I used "price_date" because, of course, "date" is not a legal name. "day_ends" is a horrible name for the table; "daily_bars" would probably be better. I *am* looking for the mininum and maximum dates for which I have price data. I'm running this query to build a chart so I can see visually where the majority of my data begins to use as the start of a window for analysis. When run on 7.3.3, forcing an index scan by setting enable_seqscan=false, the query took 55 minutes to run. The index is about 660M in size, and the table is 1G. As I mentioned before, with table scans enabled, it bombs, running out of temporary space. Hey Bruno, thanks for your attention here. I'm not a newbie, but I've never really had performance issues with pgsql before. And I've been running this database for a couple of years now, but I haven't run these queries against it. Ken From pgsql-performance-owner@postgresql.org Fri Aug 29 04:04: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 D4939D1B8E6 for ; Fri, 29 Aug 2003 07:04:12 +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 96039-07 for ; Fri, 29 Aug 2003 04:03:43 -0300 (ADT) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by svr1.postgresql.org (Postfix) with ESMTP id F2BC6D1B8CC for ; Fri, 29 Aug 2003 04:03:39 -0300 (ADT) Received: from klaster.net (core-1.citynet.pl [80.48.135.69]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 393772B3A4; Fri, 29 Aug 2003 09:03:28 +0200 (CEST) Message-ID: <3F4EFAB6.7030104@klaster.net> Date: Fri, 29 Aug 2003 09:03:18 +0200 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; pl-PL; rv:1.5a) Gecko/20030718 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Alexander Priem Cc: pgsql-performance@postgresql.org Subject: Re: Indexing question References: <012f01c36dfa$0f4a8760$b696a8c0@APR> In-Reply-To: <012f01c36dfa$0f4a8760$b696a8c0@APR> 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: 200308/472 X-Sequence-Number: 3288 > Hi all, > > I have some tables (which can get pretty large) in which I want to > record 'current' data as well as 'historical' data. This table has > fields 'deleted' and 'deleteddate' (among other fields, of course). The > field 'deleted' is false be default. Every record that I want to delete > gets the value true for 'deleted' and 'deleteddate' is set to the date > of deletion. > > Since these tables are used a lot by queries that only use 'current' > data, I have created a view with a where clause 'Where not deleted'. > Also, I have indexed field 'deleted'. I think the best choice for your case is using conditional indexes. It should be much better than indexing 'deleted' field. I don't know on which exactly fields you have to create this index - you have to check it by yourself - what do you have in "where" clause? Example: create index some_index on your_table(id_field) where not deleted; Regards, Tomasz Myrta From pgsql-performance-owner@postgresql.org Fri Aug 29 04:22: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 5BBDED1B8C6 for ; Fri, 29 Aug 2003 07:22:42 +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 98536-04 for ; Fri, 29 Aug 2003 04:22:33 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id B3D98D1B8BB for ; Fri, 29 Aug 2003 04:22:29 -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 h7T7MTek027656 for ; Fri, 29 Aug 2003 07:22:29 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7T754PK024600 for pgsql-performance@postgresql.org; Fri, 29 Aug 2003 07:05:04 GMT From: William Yu X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Hardware recommendations to scale to silly load Date: Fri, 29 Aug 2003 00:05:03 -0700 Organization: Hub.Org Networking Services Lines: 27 Message-ID: References: <1061953146.18108.291.camel@haggis> <3F4E5DA9.6396.5C8916@localhost> 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: <3F4E5DA9.6396.5C8916@localhost> To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/473 X-Sequence-Number: 3289 Shridhar Daithankar wrote: >> Be careful here, we've seen that with the P4 Xeon's that are >>hyper-threaded and a system that has very high disk I/O causes the >>system to be sluggish and slow. But after disabling the hyper-threading >>itself, our system flew.. > > Anybody has opteron working? Hows' the performance? Yes. I'm using an 2x 1.8GHz Opteron system w/ 8GB of RAM. Right now, I'm still using 32-bit Linux -- I'm letting others be the 64-bit guinea pigs. :) I probably will get a cheapie 1x Opteron machine first and test the 64-bit kernel/libraries thoroughly before rolling it out to production. As for performance, the scaling is magnificient -- even when just using PAE instead of 64-bit addressing. At low transaction counts, it's only ~75% faster than the 2x Athlon 1800+ MP it replaced. But once the transactions start coming in, the gap is as high as 5x. My w-a-g: since each CPU has an integrated memory controller, you avoid memory bus contention which is probably the major bottleneck as transaction load increases. (I've seen Opteron several vs Xeon comparisons where single-connection tests are par for both CPUs but heavy-load tests favor the Opteron by a wide margin.) I suspect the 4X comparisons would tilt even more towards AMD's favor. We should see a boost when we move to 64-bit Linux and hopefully another one when NUMA for Linux is production-stable. From pgsql-performance-owner@postgresql.org Fri Aug 29 04:03:12 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 607B7D1B8B3 for ; Fri, 29 Aug 2003 07:03: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 94917-07 for ; Fri, 29 Aug 2003 04:02:36 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id ABCD6D1B8CC for ; Fri, 29 Aug 2003 04:02:32 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h7T72LLt040433; Fri, 29 Aug 2003 15:02:21 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <0b5e01c36dfb$fbaca380$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "Alexander Priem" , References: <012f01c36dfa$0f4a8760$b696a8c0@APR> Subject: Re: Indexing question Date: Fri, 29 Aug 2003 15:05:52 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0B5B_01C36E3F.09C3FCA0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=BAYES_30, HTML_30_40, HTML_FONT_BIG, HTML_FONT_COLOR_BLUE, HTML_FONT_FACE_ODD, REFERENCES X-Spam-Level: X-Archive-Number: 200308/471 X-Sequence-Number: 3287 This is a multi-part message in MIME format. ------=_NextPart_000_0B5B_01C36E3F.09C3FCA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Remember to consider partial indexes: eg. CREATE INDEX ON table (col) WHERE deletedate IS NOT NULL Chris ----- Original Message -----=20 From: Alexander Priem=20 To: pgsql-performance@postgresql.org=20 Sent: Friday, August 29, 2003 2:52 PM Subject: [PERFORM] Indexing question Hi all, I have some tables (which can get pretty large) in which I want to record= 'current' data as well as 'historical' data. This table has fields 'delete= d' and 'deleteddate' (among other fields, of course). The field 'deleted' i= s false be default. Every record that I want to delete gets the value true = for 'deleted' and 'deleteddate' is set to the date of deletion. Since these tables are used a lot by queries that only use 'current' data= , I have created a view with a where clause 'Where not deleted'. Also, I ha= ve indexed field 'deleted'. I did this this because I read somewhere that fields that can contain NUL= L values will NOT be indexed. Is this true? Or could I ditch the 'deleted' field and just set 'deleteddate' to NULL b= y default and to a DATE in the case of a deleted record? I could then index= the field 'deleteddate' and create a view with where clause 'Where deleted= date is null'. Would this give the same performance as my current solution (with an inde= xed boolean field 'deleted') ? I cannot test this myself at the moment as I am still in a design phase a= nd do not have a real server available yet... Thanks in advance, Alexander Priem ------=_NextPart_000_0B5B_01C36E3F.09C3FCA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Remember to consider partial indexes:
 
eg. CREATE INDEX ON table (col) WHERE deletedate IS NOT= =20 NULL
 
Chris
----- Original Message -----
Fro= m:=20 Alexander Priem
To: pgsql-performance@postgr= esql.org=20
Sent: Friday, August 29, 2003 2:52= =20 PM
Subject: [PERFORM] Indexing=20 question

Hi all,
 
I have some tables (which can get pretty= large)=20 in which I want to record 'current' data as well as 'historical' dat= a.=20 This table has fields 'deleted' and 'deleteddate' (among other fields, of= =20 course). The field 'deleted' is false be default. Every record that I wan= t to=20 delete gets the value true for 'deleted' and 'deleteddate' is set to the = date=20 of deletion.
 
Since these tables are used a lot by que= ries that=20 only use 'current' data, I have created a view with a where clause 'Where= not=20 deleted'. Also, I have indexed field 'deleted'.
 
I did this this because I read somewhere= that=20 fields that can contain NULL values will NOT be indexed.
 
Is this true?
 
Or could I ditch the 'deleted' field and= just set=20 'deleteddate' to NULL by default and to a DATE in the case of a deleted= =20 record? I could then index the field 'deleteddate' and create a view with= =20 where clause 'Where deleteddate is null'.
 
Would this give the same performance as = my=20 current solution (with an indexed boolean field 'deleted') ?<= /DIV>
 
I cannot test this myself at the moment = as I am=20 still in a design phase and do not have a real server available=20 yet...
 
Thanks in advance,

Alexander Priem
------=_NextPart_000_0B5B_01C36E3F.09C3FCA0-- From pgsql-performance-owner@postgresql.org Fri Aug 29 04:27: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 EB378D1B8BB for ; Fri, 29 Aug 2003 07:27: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 98856-02 for ; Fri, 29 Aug 2003 04:26:41 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id CDA57D1B8B9 for ; Fri, 29 Aug 2003 04:26:37 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h7T7QZLt040836; Fri, 29 Aug 2003 15:26:35 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <0b9a01c36dff$5ec5df60$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "William Yu" , References: <1061953146.18108.291.camel@haggis> <3F4E5DA9.6396.5C8916@localhost> Subject: Re: Hardware recommendations to scale to silly load Date: Fri, 29 Aug 2003 15:30:06 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=REFERENCES X-Spam-Level: X-Archive-Number: 200308/474 X-Sequence-Number: 3290 > We should see a boost when we move to 64-bit Linux and hopefully another > one when NUMA for Linux is production-stable. Assuming SCO doesn't make them remove it :P Chris From pgsql-performance-owner@postgresql.org Fri Aug 29 04:47:52 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 EE363D1B8AB for ; Fri, 29 Aug 2003 07:47: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 97105-09 for ; Fri, 29 Aug 2003 04:47:38 -0300 (ADT) Received: from mail.cict.nl (vnd-7521.mxs.adsl.euronet.nl [62.234.149.33]) by svr1.postgresql.org (Postfix) with ESMTP id 32D49D1B8A4 for ; Fri, 29 Aug 2003 04:47:36 -0300 (ADT) Received: from APR ([192.168.150.182]) by mail.cict.nl (Merak 6.0.5) with SMTP id DUC73886; Fri, 29 Aug 2003 09:47:35 +0200 Message-ID: <015f01c36e02$134fe960$b696a8c0@APR> From: "Alexander Priem" To: "Tomasz Myrta" Cc: References: <012f01c36dfa$0f4a8760$b696a8c0@APR> <3F4EFAB6.7030104@klaster.net> Subject: Re: Indexing question Date: Fri, 29 Aug 2003 09:49:28 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/475 X-Sequence-Number: 3291 So if I understand correctly I could ditch the 'deleted' field entirely and use just the 'deleteddate' field. This 'deleteddate' field would be NULL by default. It would contain a date value if the record is considered 'deleted'. The index would be 'create index a on tablename(deleteddate) where deleteddate is null'. I could then access 'current' records with a view like 'create view x_view as select * from tablename where deleteddate is null'. Is that correct? This would be the best performing solution for this kind of thing, I think (theoretically at least)? Kind regards, Alexander Priem. ----- Original Message ----- From: "Tomasz Myrta" To: "Alexander Priem" Cc: Sent: Friday, August 29, 2003 9:03 AM Subject: Re: [PERFORM] Indexing question > > Hi all, > > > > I have some tables (which can get pretty large) in which I want to > > record 'current' data as well as 'historical' data. This table has > > fields 'deleted' and 'deleteddate' (among other fields, of course). The > > field 'deleted' is false be default. Every record that I want to delete > > gets the value true for 'deleted' and 'deleteddate' is set to the date > > of deletion. > > > > Since these tables are used a lot by queries that only use 'current' > > data, I have created a view with a where clause 'Where not deleted'. > > Also, I have indexed field 'deleted'. > > > I think the best choice for your case is using conditional indexes. It > should be much better than indexing 'deleted' field. I don't know on > which exactly fields you have to create this index - you have to check > it by yourself - what do you have in "where" clause? > > Example: > create index some_index on your_table(id_field) where not deleted; > > > Regards, > Tomasz Myrta > > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend From pgsql-performance-owner@postgresql.org Fri Aug 29 04:57:56 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 32503D1B8AC for ; Fri, 29 Aug 2003 07:57: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 01002-03 for ; Fri, 29 Aug 2003 04:57:45 -0300 (ADT) Received: from mail.speakeasy.net (mail7.speakeasy.net [216.254.0.207]) by svr1.postgresql.org (Postfix) with ESMTP id 7C917D1B8BB for ; Fri, 29 Aug 2003 04:57:42 -0300 (ADT) Received: (qmail 16522 invoked from network); 29 Aug 2003 07:57:43 -0000 Received: from unknown (HELO speakeasy.org) (kgeis@[66.93.130.165]) (envelope-sender ) by mail7.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Aug 2003 07:57:43 -0000 Message-ID: <3F4F0777.8090503@speakeasy.org> Date: Fri, 29 Aug 2003 00:57:43 -0700 From: Ken Geis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruno Wolff III Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4ED1DC.50808@speakeasy.org> <20030829042453.GA5931@wolff.to> In-Reply-To: <20030829042453.GA5931@wolff.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: 200308/476 X-Sequence-Number: 3292 Sorry, all, to wipe out the context, but it was getting a little long. Bruno Wolff III wrote: > I am calling it quits for tonight, but will check back tomorrow > to see how things turned out. I went through the code (7.4 beta2) that estimates the cost of an index scan path. What I need to be sure of is that when running a query in pgsql that uses only the columns that are in an index, the underlying table need not be accessed. I know that Oracle does this. The cost_index function is assuming that after finding an entry in the index it will be looking it up in the underlying table. That table is not well correlated to the index, so it is assuming (in the worst case) a random page lookup for each of 17 million records! In my case, if the underlying table is indeed not touched, the estimated cost is 1000 times the real cost. 63388.624000 to scan the index 67406506.915595 to scan the index and load a random page for each entry Ken From pgsql-performance-owner@postgresql.org Fri Aug 29 04:59:45 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 B0CB1D1B8B1 for ; Fri, 29 Aug 2003 07:59:42 +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 00480-04 for ; Fri, 29 Aug 2003 04:59:12 -0300 (ADT) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by svr1.postgresql.org (Postfix) with ESMTP id 3EB3BD1B9AB for ; Fri, 29 Aug 2003 04:59:10 -0300 (ADT) Received: from klaster.net (core-1.citynet.pl [80.48.135.69]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 5D5AD2B3A4; Fri, 29 Aug 2003 09:58:59 +0200 (CEST) Message-ID: <3F4F07CE.6090803@klaster.net> Date: Fri, 29 Aug 2003 09:59:10 +0200 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; pl-PL; rv:1.5a) Gecko/20030718 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Alexander Priem Cc: pgsql-performance@postgresql.org Subject: Re: Indexing question References: <012f01c36dfa$0f4a8760$b696a8c0@APR> <3F4EFAB6.7030104@klaster.net> <015f01c36e02$134fe960$b696a8c0@APR> In-Reply-To: <015f01c36e02$134fe960$b696a8c0@APR> 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: 200308/477 X-Sequence-Number: 3293 > So if I understand correctly I could ditch the 'deleted' field entirely and > use just the 'deleteddate' field. This 'deleteddate' field would be NULL by > default. It would contain a date value if the record is considered > 'deleted'. > > The index would be 'create index a on tablename(deleteddate) where > deleteddate is null'. > > I could then access 'current' records with a view like 'create view x_view > as select * from tablename where deleteddate is null'. > > Is that correct? This would be the best performing solution for this kind of > thing, I think (theoretically at least)? > > Kind regards, > Alexander Priem. Near, but not exactly. You don't need field deleted - it's true. Your example: create index a on tablename(deleteddate) where deleteddate is null we can translate to: create index a on tablename(NULL) where deleteddate is null which doesn't make too much sense. Check your queries. You probably have something like this: select * from tablename where not deleted and xxx Create your index to match xxx clause - if xxx is "some_id=13", then create your index as: create index on tablename(some_id) where deleteddate is null; Regards, Tomasz Myrta From pgsql-performance-owner@postgresql.org Fri Aug 29 05:10: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 31BA7D1D94C for ; Fri, 29 Aug 2003 08:10: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 99592-10 for ; Fri, 29 Aug 2003 05:10:08 -0300 (ADT) Received: from mail.speakeasy.net (mail15.speakeasy.net [216.254.0.215]) by svr1.postgresql.org (Postfix) with ESMTP id 8CBF0D1B9AE for ; Fri, 29 Aug 2003 05:10:05 -0300 (ADT) Received: (qmail 11115 invoked from network); 29 Aug 2003 08:10:06 -0000 Received: from unknown (HELO speakeasy.org) (kgeis@[66.93.130.165]) (envelope-sender ) by mail15.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Aug 2003 08:10:06 -0000 Message-ID: <3F4F0A5E.8030207@speakeasy.org> Date: Fri, 29 Aug 2003 01:10:06 -0700 From: Ken Geis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruno Wolff III Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4ED1DC.50808@speakeasy.org> <20030829042453.GA5931@wolff.to> <3F4F0777.8090503@speakeasy.org> In-Reply-To: <3F4F0777.8090503@speakeasy.org> 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: 200308/478 X-Sequence-Number: 3294 Ken Geis wrote: > I went through the code (7.4 beta2) that estimates the cost of an index > scan path. What I need to be sure of is that when running a query in > pgsql that uses only the columns that are in an index, the underlying > table need not be accessed. I know that Oracle does this. Thinking about it some more, it's obvious to me that a pgsql index scan must be accessing the underlying table even though all of the information needed is in the index itself. A linear scan of a 660M file should not take 55 minutes. I could confirm this with stats, but someone out there probably already knows the answer here. Ken From pgsql-performance-owner@postgresql.org Fri Aug 29 05:11: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 CE332D1DA60 for ; Fri, 29 Aug 2003 08:10:56 +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 98438-10 for ; Fri, 29 Aug 2003 05:10:48 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id 615CFD1DA5F for ; Fri, 29 Aug 2003 05:10:44 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h7T8AWLt041701; Fri, 29 Aug 2003 16:10:32 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <0be001c36e05$83034fb0$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "Alexander Priem" , "Tomasz Myrta" Cc: References: <012f01c36dfa$0f4a8760$b696a8c0@APR> <3F4EFAB6.7030104@klaster.net> <015f01c36e02$134fe960$b696a8c0@APR> Subject: Re: Indexing question Date: Fri, 29 Aug 2003 16:14:04 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.5 tagged_above=0.0 required=5.0 tests=QUOTED_EMAIL_TEXT, RCVD_IN_OSIRUSOFT_COM, REFERENCES X-Spam-Level: X-Archive-Number: 200308/479 X-Sequence-Number: 3295 > So if I understand correctly I could ditch the 'deleted' field entirely and > use just the 'deleteddate' field. This 'deleteddate' field would be NULL by > default. It would contain a date value if the record is considered > 'deleted'. > > The index would be 'create index a on tablename(deleteddate) where > deleteddate is null'. > > I could then access 'current' records with a view like 'create view x_view > as select * from tablename where deleteddate is null'. > > Is that correct? This would be the best performing solution for this kind of > thing, I think (theoretically at least)? Yes, I think it would be best. Definitely better than your current solution. Cheers, Chris From pgsql-performance-owner@postgresql.org Fri Aug 29 05:11:46 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 48833D1DA62 for ; Fri, 29 Aug 2003 08:11: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 98856-08 for ; Fri, 29 Aug 2003 05:11:35 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id 50D47D1DA4F for ; Fri, 29 Aug 2003 05:11:32 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h7T8BWLt041736; Fri, 29 Aug 2003 16:11:32 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <0bf301c36e05$a72f90b0$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "Ken Geis" , "Bruno Wolff III" Cc: References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4ED1DC.50808@speakeasy.org> <20030829042453.GA5931@wolff.to> <3F4F0777.8090503@speakeasy.org> <3F4F0A5E.8030207@speakeasy.org> Subject: Re: bad estimates Date: Fri, 29 Aug 2003 16:15:05 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/480 X-Sequence-Number: 3296 > > I went through the code (7.4 beta2) that estimates the cost of an index > > scan path. What I need to be sure of is that when running a query in > > pgsql that uses only the columns that are in an index, the underlying > > table need not be accessed. I know that Oracle does this. PostgreSQL absolutely does not do this. It is also not possible to do this due to MVCC. Chris From pgsql-performance-owner@postgresql.org Fri Aug 29 05:17:59 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 0C4FBD1B948 for ; Fri, 29 Aug 2003 08:17:57 +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 00122-08 for ; Fri, 29 Aug 2003 05:17:27 -0300 (ADT) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by svr1.postgresql.org (Postfix) with ESMTP id 84861D1B916 for ; Fri, 29 Aug 2003 05:17:24 -0300 (ADT) Received: (qmail 8190 invoked from network); 29 Aug 2003 08:17:25 -0000 Received: from unknown (HELO speakeasy.org) (kgeis@[66.93.130.165]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Aug 2003 08:17:25 -0000 Message-ID: <3F4F0C15.6040802@speakeasy.org> Date: Fri, 29 Aug 2003 01:17:25 -0700 From: Ken Geis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruno Wolff III Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4ED1DC.50808@speakeasy.org> <20030829042453.GA5931@wolff.to> <3F4EFA35.90401@speakeasy.org> In-Reply-To: <3F4EFA35.90401@speakeasy.org> 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: 200308/482 X-Sequence-Number: 3298 Ken Geis wrote: > When run on 7.3.3, forcing an index scan by setting > enable_seqscan=false, the query took 55 minutes to run. The index is > about 660M in size, and the table is 1G. As I mentioned before, with > table scans enabled, it bombs, running out of temporary space. Man, I should wait a while before I send mails, because I keep having more to say! Some good news here. Doing the same as above on 7.4beta2 took 29 minutes. Now, the 7.3.3 was on reiser and 7.4 on ext2, so take that as you will. 7.4's index selectivity estimate seems much better; 7.3.3's anticipated rows was ten times the actual; 7.4's is one half of the actual. Ken From pgsql-performance-owner@postgresql.org Fri Aug 29 05:16:41 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 0CC91D1B9AE for ; Fri, 29 Aug 2003 08:16:38 +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 03468-02 for ; Fri, 29 Aug 2003 05:16:29 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id EBCE1D1DA4C for ; Fri, 29 Aug 2003 05:16:25 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7T8LC0e011220 for ; Fri, 29 Aug 2003 13:51:12 +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 h7T8LChi011207 for ; Fri, 29 Aug 2003 13:51:12 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Fri, 29 Aug 2003 13:48:24 +0530 MIME-Version: 1.0 Subject: Re: Hardware recommendations to scale to silly load Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4F59A8.20966.434E2AD@localhost> In-reply-to: References: <3F4E5DA9.6396.5C8916@localhost> 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: 200308/481 X-Sequence-Number: 3297 On 29 Aug 2003 at 0:05, William Yu wrote: > Shridhar Daithankar wrote: > >> Be careful here, we've seen that with the P4 Xeon's that are > >>hyper-threaded and a system that has very high disk I/O causes the > >>system to be sluggish and slow. But after disabling the hyper-threading > >>itself, our system flew.. > > > > Anybody has opteron working? Hows' the performance? > > Yes. I'm using an 2x 1.8GHz Opteron system w/ 8GB of RAM. Right now, I'm > still using 32-bit Linux -- I'm letting others be the 64-bit guinea > pigs. :) I probably will get a cheapie 1x Opteron machine first and test > the 64-bit kernel/libraries thoroughly before rolling it out to production. Just a guess here but does a precompiled postgresql for x86 and a x86-64 optimized one makes difference? Opteron is one place on earth you can watch difference between 32/64 bit on same machine. Can be handy at times.. > > As for performance, the scaling is magnificient -- even when just using > PAE instead of 64-bit addressing. At low transaction counts, it's only > ~75% faster than the 2x Athlon 1800+ MP it replaced. But once the > transactions start coming in, the gap is as high as 5x. My w-a-g: since > each CPU has an integrated memory controller, you avoid memory bus > contention which is probably the major bottleneck as transaction load > increases. (I've seen Opteron several vs Xeon comparisons where > single-connection tests are par for both CPUs but heavy-load tests favor > the Opteron by a wide margin.) I suspect the 4X comparisons would tilt > even more towards AMD's favor. I am sure. But is 64 bit environment, Xeon is not the compitition. It's PA-RSC- 8700, ultraSparcs, Power series and if possible itanium. I would still expect AMD to compete comfortably given high clock speed. But chipset need to be competent as well.. I still remember the product I work on, a single CPU PA-RISC 8700 with single SCSI disc, edged out a quad CPU Xeon with SCSI RAID controller running windows in terms of scalability while running oracle. I am not sure if it was windows v/s HP-UX issue but at the end HP machine was lot better than windows machine. Windows machine shooted ahead for light load and drooeed dead equally fast with rise in load.. > We should see a boost when we move to 64-bit Linux and hopefully another > one when NUMA for Linux is production-stable. Getting a 2.6 running now is the answer to make it stable fast..:-) Of course if you have spare hardware.. Bye Shridhar -- briefcase, n: A trial where the jury gets together and forms a lynching party. From pgsql-performance-owner@postgresql.org Fri Aug 29 05:28:52 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 54270D1B574 for ; Fri, 29 Aug 2003 08:28:49 +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 03537-04 for ; Fri, 29 Aug 2003 05:28:40 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 9AB3ED1B8E0 for ; Fri, 29 Aug 2003 05:28:36 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7T8XNvM015171 for ; Fri, 29 Aug 2003 14:03:23 +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 h7T8XMhi015158 for ; Fri, 29 Aug 2003 14:03:22 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Fri, 29 Aug 2003 14:00:34 +0530 MIME-Version: 1.0 Subject: Re: Queries sometimes take 1000 times the normal time Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4F5C82.18176.44007A5@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: 200308/483 X-Sequence-Number: 3299 On 28 Aug 2003 at 20:16, Anders K. Pedersen wrote: > Shridhar Daithankar wrote: > > On 28 Aug 2003 at 1:07, Anders K. Pedersen wrote: > >>We're running a set of Half-Life based game servers that lookup user > >>privileges from a central PostgreSQL 7.3.4 database server (I recently > >>ported the MySQL code in Adminmod to PostgreSQL to be able to do this). > >> > >>The data needed by the game servers are combined from several different > >>tables, so we have some views set up to provide the data in the format > >>needed. > >> > >>Currently there's only a few users in the database for testing purposes, > >>and most of the time the user lookup's take 2-3 ms (I have syslog'ing of > >>queries and duration turned on), but several times per hour the duration > >>for one of the queries is 2-3 seconds (1000 times larger), while the > >>surrounding lookups take the usual 2-3 ms. > > > > > > Check vmstat during the same period if it is syncing at that point as Tom > > suggested. > > I've been running a vmstat 1 logging process for a while now, and the > sample below shows what happende around one of these spikes - at > 18:18:03 specifically (actually there were two 1 second long queries, > that finished at 18:18:03). > > Thu Aug 28 18:17:53 2003 0 0 0 40904 4568 22288 404352 0 0 > 12 0 181 362 2 1 97 > Thu Aug 28 18:17:54 2003 0 0 0 40904 4580 22260 404380 0 0 > 128 0 205 330 2 3 95 > Thu Aug 28 18:17:55 2003 0 0 2 40904 4576 22264 404380 0 0 > 0 284 224 127 0 1 99 > Thu Aug 28 18:17:56 2003 0 0 2 40904 5008 22268 404512 0 0 > 128 728 571 492 2 3 95 > Thu Aug 28 18:17:57 2003 0 0 1 40904 5000 22276 404512 0 0 > 0 120 201 181 1 0 99 > Thu Aug 28 18:17:58 2003 0 0 1 40904 4936 22284 404528 0 0 > 8 0 1147 2204 12 3 85 > Thu Aug 28 18:17:59 2003 0 0 0 40904 4784 22304 404660 0 0 > 148 0 2112 3420 2 3 95 > Thu Aug 28 18:18:00 2003 1 1 3 40904 4760 22324 404664 0 0 > 20 456 2374 3277 2 1 97 > Thu Aug 28 18:18:01 2003 0 2 10 40904 4436 22000 401456 0 0 > 144 540 510 457 11 6 83 > Thu Aug 28 18:18:02 2003 1 1 2 40904 8336 22032 401512 0 0 > 68 676 1830 2540 4 3 93 > Thu Aug 28 18:18:04 2003 1 0 1 40904 8160 22052 401664 0 0 > 140 220 2308 3253 2 3 95 > Thu Aug 28 18:18:05 2003 0 0 1 40904 7748 22064 402064 0 0 > 288 0 1941 2856 1 3 96 > Thu Aug 28 18:18:06 2003 0 0 3 40904 6704 22064 403100 0 0 > 496 992 2326 3510 0 5 95 > Thu Aug 28 18:18:07 2003 1 0 0 40904 6324 22088 402716 0 0 > 260 188 1984 2927 11 4 85 > Thu Aug 28 18:18:08 2003 0 0 0 40904 6920 22088 402828 0 0 > 72 0 419 1473 17 5 78 > Thu Aug 28 18:18:09 2003 0 0 0 40904 6784 22088 402964 0 0 > 128 0 235 476 2 1 97 > Thu Aug 28 18:18:10 2003 0 0 1 40904 6404 22088 402980 0 0 > 0 0 343 855 14 2 84 > Notice a pattern. In first few entries free memory is increasing coupled with IO. Few entries down the line it's decreasing again with IO. I would guess that something terminated and started.. However given how idle CPU is, I wonder would it matter. Besides changes in stats are pretty small to be any significant. I wouldn't worry about context switches or interrupts. They don't seem to be any dramatic.. I wonder what kernel you are using. While running pgbench on 2.4 and 2.6 couple of days back, I noticed several stalls with 2.4 where neither CPU or disk does anything but nothing moves forward, for 30 sec. or so. If possible try with 2.6 Check which scheduler you are using and which works best for you. http://marc.theaimsgroup.com/?l=linux-kernel&m=105743728122143&w=2 If you want a step by step how to install 2.6, I can give that too.. It's pretty simple.. > > Are you using pooled connections? If yes you could shorten life of a connection > > and force making a new connection every 10-15 minutes say. That would avoid IO > > avelanche at the end of the hour types. > > I'm not quite sure, what you mean by "pooled connections". Each game > server has one connection to the PostgreSQL server, which is opened, > when the server is first started, and then never closed (until the game > server terminates, but there's days between this happens). I would say let each server start a new connection every 15 minutes. As soon as new connection is established, close old one. See if that cures the problem. Apache uses similar methods albeit it measure by nubmer of requests served by each child. HTH Bye Shridhar -- It is necessary to have purpose. -- Alice #1, "I, Mudd", stardate 4513.3 From pgsql-performance-owner@postgresql.org Fri Aug 29 05:39:24 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id A422DD1B8AB for ; Fri, 29 Aug 2003 08:39:23 +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 01251-09 for ; Fri, 29 Aug 2003 05:39:14 -0300 (ADT) Received: from mail.cict.nl (vnd-7521.mxs.adsl.euronet.nl [62.234.149.33]) by svr1.postgresql.org (Postfix) with ESMTP id 00DC2D1B8B3 for ; Fri, 29 Aug 2003 05:39:12 -0300 (ADT) Received: from APR ([192.168.150.182]) by mail.cict.nl (Merak 6.0.5) with SMTP id DUC73886; Fri, 29 Aug 2003 10:39:11 +0200 Message-ID: <018c01c36e09$4893e980$b696a8c0@APR> From: "Alexander Priem" To: "Tomasz Myrta" Cc: References: <012f01c36dfa$0f4a8760$b696a8c0@APR> <3F4EFAB6.7030104@klaster.net> <015f01c36e02$134fe960$b696a8c0@APR> <3F4F07CE.6090803@klaster.net> Subject: Re: Indexing question Date: Fri, 29 Aug 2003 10:41:04 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/484 X-Sequence-Number: 3300 I think I understand what you mean :) Let's see if that's true : The entire table WAS like this: (just one example table, I have many more) create table orderadvice ( orad_id serial primary key, orad_name varchar(25) unique not null, orad_description varchar(50) default null, orad_value integer not null default 0, orad_value_quan integer references quantity (quan_id) not null default 0, orad_deleted boolean not null default false, orad_deleteddate date default null, orad_deletedby integer references systemuser (user_id) default null ) without oids; Indexes were like this: create index orad_deleted_index on orderadvice (orad_deleted); (orad_id and orad_name indexed implicitly in the create table statement) A view on this table: create view orderadvice_edit as select orad_id,orad_name,orad_description,orad_value,orad_value_quan from orderadvice where not orad_deleted; Most queries on this view would be like 'select * from orderadvice_edit where orad_id=100' or 'select * from orderadvice_edit order by orad_name'. How about the following script. Would it be better, given the type of queries that would take place on this table? create table orderadvice ( orad_id serial primary key, orad_name varchar(25) not null, orad_description varchar(50) default null, orad_value integer not null default 0, orad_value_quan integer references quantity (quan_id) not null default 0, orad_deleteddate date default null, orad_deletedby integer references systemuser (user_id) default null ) without oids; create index orad_id_index on orderadvice (orad_id) where orad_deleteddate is null; create index orad_name_index on orderadvice (orad_name) where orad_deleteddate is null; create view orderadvice_edit as select orad_id,orad_name,orad_description,orad_value,orad_value_quan from orderadvice where orad_deleteddate is null; Would queries like 'select * from orderadvice_edit where orad_id=100' or 'select * from orderadvice_edit order by orad_name' both use one of these two partial indexes, given enough records are present in the table? There would be a double index on the primary key this way, right? Thanks for your advice so far, Alexander Priem. ----- Original Message ----- From: "Tomasz Myrta" To: "Alexander Priem" Cc: Sent: Friday, August 29, 2003 9:59 AM Subject: Re: [PERFORM] Indexing question > > So if I understand correctly I could ditch the 'deleted' field entirely and > > use just the 'deleteddate' field. This 'deleteddate' field would be NULL by > > default. It would contain a date value if the record is considered > > 'deleted'. > > > > The index would be 'create index a on tablename(deleteddate) where > > deleteddate is null'. > > > > I could then access 'current' records with a view like 'create view x_view > > as select * from tablename where deleteddate is null'. > > > > Is that correct? This would be the best performing solution for this kind of > > thing, I think (theoretically at least)? > > > > Kind regards, > > Alexander Priem. > > Near, but not exactly. You don't need field deleted - it's true. > > Your example: > create index a on tablename(deleteddate) where deleteddate is null > we can translate to: > create index a on tablename(NULL) where deleteddate is null > which doesn't make too much sense. > > Check your queries. You probably have something like this: > select * from tablename where not deleted and xxx > > Create your index to match xxx clause - if xxx is "some_id=13", then > create your index as: > create index on tablename(some_id) where deleteddate is null; > > Regards, > Tomasz Myrta > From pgsql-performance-owner@postgresql.org Fri Aug 29 05:57:50 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 36B48D1B574 for ; Fri, 29 Aug 2003 08:57: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 06763-01 for ; Fri, 29 Aug 2003 05:57:39 -0300 (ADT) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by svr1.postgresql.org (Postfix) with ESMTP id 7C24BD1B8AE for ; Fri, 29 Aug 2003 05:57:36 -0300 (ADT) Received: from klaster.net (core-1.citynet.pl [80.48.135.69]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 508502B3A4; Fri, 29 Aug 2003 10:57:15 +0200 (CEST) Message-ID: <3F4F1575.8090600@klaster.net> Date: Fri, 29 Aug 2003 10:57:25 +0200 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; pl-PL; rv:1.5a) Gecko/20030718 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Alexander Priem Cc: pgsql-performance@postgresql.org Subject: Re: Indexing question References: <012f01c36dfa$0f4a8760$b696a8c0@APR> <3F4EFAB6.7030104@klaster.net> <015f01c36e02$134fe960$b696a8c0@APR> <3F4F07CE.6090803@klaster.net> <018c01c36e09$4893e980$b696a8c0@APR> In-Reply-To: <018c01c36e09$4893e980$b696a8c0@APR> 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: 200308/485 X-Sequence-Number: 3301 > create index orad_id_index on orderadvice (orad_id) where orad_deleteddate > is null; > create index orad_name_index on orderadvice (orad_name) where > orad_deleteddate is null; > > create view orderadvice_edit as select > orad_id,orad_name,orad_description,orad_value,orad_value_quan from > orderadvice where orad_deleteddate is null; > > Would queries like 'select * from orderadvice_edit where orad_id=100' or > 'select * from orderadvice_edit order by orad_name' both use one of these > two partial indexes, given enough records are present in the table? > > There would be a double index on the primary key this way, right? It looks much better now. I'm not sure about the second index. Probably it will be useless, because you sort ALL records with deleteddtata is null. Maybe the first index will be enough. I'm not sure what to do with doubled index on a primary key field. Regards, Tomasz Myrta From pgsql-performance-owner@postgresql.org Fri Aug 29 06:07:03 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 448B2D1B8E5 for ; Fri, 29 Aug 2003 09:07: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 05293-05 for ; Fri, 29 Aug 2003 06:06:32 -0300 (ADT) Received: from mail.cict.nl (vnd-7521.mxs.adsl.euronet.nl [62.234.149.33]) by svr1.postgresql.org (Postfix) with ESMTP id 70D23D1B8D2 for ; Fri, 29 Aug 2003 06:06:29 -0300 (ADT) Received: from APR ([192.168.150.182]) by mail.cict.nl (Merak 6.0.5) with SMTP id DUC73886; Fri, 29 Aug 2003 11:06:28 +0200 Message-ID: <01bf01c36e0d$18769280$b696a8c0@APR> From: "Alexander Priem" To: "Tomasz Myrta" Cc: References: <012f01c36dfa$0f4a8760$b696a8c0@APR> <3F4EFAB6.7030104@klaster.net> <015f01c36e02$134fe960$b696a8c0@APR> <3F4F07CE.6090803@klaster.net> <018c01c36e09$4893e980$b696a8c0@APR> <3F4F1575.8090600@klaster.net> Subject: Re: Indexing question Date: Fri, 29 Aug 2003 11:08:21 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/486 X-Sequence-Number: 3302 The first index is for sorting on orad_id, the second one for sorting on orad_name. The first one would be useful for queries like 'select * from orderadvice_edit where orad_id=100', the second one for queries like 'select * from orderadvice_edit order by orad_name'. Right? Does anyone know whether it is bad practise to have two indexes on the primary key of a table? (one 'primary key' index and one partial index) ----- Original Message ----- From: "Tomasz Myrta" To: "Alexander Priem" Cc: Sent: Friday, August 29, 2003 10:57 AM Subject: Re: [PERFORM] Indexing question > > create index orad_id_index on orderadvice (orad_id) where orad_deleteddate > > is null; > > create index orad_name_index on orderadvice (orad_name) where > > orad_deleteddate is null; > > > > create view orderadvice_edit as select > > orad_id,orad_name,orad_description,orad_value,orad_value_quan from > > orderadvice where orad_deleteddate is null; > > > > Would queries like 'select * from orderadvice_edit where orad_id=100' or > > 'select * from orderadvice_edit order by orad_name' both use one of these > > two partial indexes, given enough records are present in the table? > > > > There would be a double index on the primary key this way, right? > > It looks much better now. I'm not sure about the second index. Probably > it will be useless, because you sort ALL records with deleteddtata is > null. Maybe the first index will be enough. > > I'm not sure what to do with doubled index on a primary key field. > > Regards, > Tomasz Myrta > > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend From pgsql-performance-owner@postgresql.org Fri Aug 29 09:05: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 5E2B6D1B8AB for ; Fri, 29 Aug 2003 12:05:45 +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 17587-03 for ; Fri, 29 Aug 2003 09:05:37 -0300 (ADT) Received: from lakemtao04.cox.net (lakemtao04.cox.net [68.1.17.241]) by svr1.postgresql.org (Postfix) with ESMTP id 60B35D1B8A4 for ; Fri, 29 Aug 2003 09:05:34 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao04.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030829120537.OFLG419.lakemtao04.cox.net@lhosts> for ; Fri, 29 Aug 2003 08:05:37 -0400 Subject: Re: Hardware recommendations to scale to silly load From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <3F4F59A8.20966.434E2AD@localhost> References: <3F4E5DA9.6396.5C8916@localhost> <3F4F59A8.20966.434E2AD@localhost> Content-Type: text/plain Message-Id: <1062158736.669.5.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Fri, 29 Aug 2003 07:05:36 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/487 X-Sequence-Number: 3303 On Fri, 2003-08-29 at 03:18, Shridhar Daithankar wrote: > On 29 Aug 2003 at 0:05, William Yu wrote: > > > Shridhar Daithankar wrote: [snip] > > As for performance, the scaling is magnificient -- even when just using > > PAE instead of 64-bit addressing. At low transaction counts, it's only > > ~75% faster than the 2x Athlon 1800+ MP it replaced. But once the > > transactions start coming in, the gap is as high as 5x. My w-a-g: since > > each CPU has an integrated memory controller, you avoid memory bus > > contention which is probably the major bottleneck as transaction load > > increases. (I've seen Opteron several vs Xeon comparisons where > > single-connection tests are par for both CPUs but heavy-load tests favor > > the Opteron by a wide margin.) I suspect the 4X comparisons would tilt > > even more towards AMD's favor. > > I am sure. But is 64 bit environment, Xeon is not the compitition. It's PA-RSC- > 8700, ultraSparcs, Power series and if possible itanium. IMO, Opti will compete in *both* markets. -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "Adventure is a sign of incompetence" Stephanson, great polar explorer From pgsql-performance-owner@postgresql.org Fri Aug 29 09:50:25 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 2419DD1B8AB for ; Fri, 29 Aug 2003 12:50:24 +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 19680-05 for ; Fri, 29 Aug 2003 09:49:55 -0300 (ADT) Received: from ainea-ag.de (unknown [195.145.148.245]) by svr1.postgresql.org (Postfix) with SMTP id 17DE7D1B8BB for ; Fri, 29 Aug 2003 09:49:49 -0300 (ADT) Received: (qmail 4550 invoked from network); 29 Aug 2003 12:49:59 -0000 Received: from kanzler.ainea-ag.de (HELO allanon.ainea-ag.de) (@195.145.148.242) by grinch.ainea-ag.de with SMTP; 29 Aug 2003 12:49:59 -0000 Message-Id: <5.1.0.14.0.20030829144416.03be0248@195.145.148.245> X-Sender: fkreitner@195.145.148.245 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 29 Aug 2003 14:52:10 +0200 To: pgsql-performance@postgresql.org From: Fabian Kreitner Subject: Force table to be permanently in cache? In-Reply-To: <1061995033.15800.138.camel@gibraltar.mattclark.net> References: <3F4CBD8A.4050309@potentialtech.com> <1061948112.15800.53.camel@gibraltar.mattclark.net> <3F4C1364.6080602@potentialtech.com> <1061990263.15800.124.camel@gibraltar.mattclark.net> <3F4CBD8A.4050309@potentialtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/488 X-Sequence-Number: 3304 Hi everyone, I have a sql request which on first invocation completes in ~12sec but then drops to ~3sec on the following runs. The 3 seconds would be acceptable but how can I make sure that the data is cached and all times? Is it simply enough to set shared_buffers high enough to hold the entire database (and have enough ram installed of course)? The OS is linux in this case. Nested Loop (cost=0.00..11.44 rows=1 width=362) (actual time=247.83..12643.96 rows=14700 loops=1) -> Index Scan using suchec_testa on suchec (cost=0.00..6.02 rows=1 width=23) (actual time=69.91..902.68 rows=42223 loops=1) -> Index Scan using idx_dokument on dokument d (cost=0.00..5.41 rows=1 width=339) (actual time=0.26..0.26 rows=0 loops=42223) Total runtime: 12662.64 msec Nested Loop (cost=0.00..11.44 rows=1 width=362) (actual time=1.18..2829.79 rows=14700 loops=1) -> Index Scan using suchec_testa on suchec (cost=0.00..6.02 rows=1 width=23) (actual time=0.51..661.75 rows=42223 loops=1) -> Index Scan using idx_dokument on dokument d (cost=0.00..5.41 rows=1 width=339) (actual time=0.04..0.04 rows=0 loops=42223) Total runtime: 2846.63 msec From pgsql-performance-owner@postgresql.org Fri Aug 29 09:53: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 32608D1B897 for ; Fri, 29 Aug 2003 12:53:16 +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 20978-03 for ; Fri, 29 Aug 2003 09:52:47 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id D34BFD1B8EE for ; Fri, 29 Aug 2003 09:52:28 -0300 (ADT) Received: (qmail 5378 invoked from network); 29 Aug 2003 12:52:34 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 29 Aug 2003 12:52:34 -0000 Date: Fri, 29 Aug 2003 08:52:34 -0400 (EDT) From: Jeff To: Ken Geis Cc: Bruno Wolff III , "pgsql-performance@postgresql.org" Subject: Re: bad estimates In-Reply-To: <3F4F0C15.6040802@speakeasy.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/489 X-Sequence-Number: 3305 On Fri, 29 Aug 2003, Ken Geis wrote: > Some good news here. Doing the same as above on 7.4beta2 took 29 > minutes. Now, the 7.3.3 was on reiser and 7.4 on ext2, so take that as > you will. 7.4's index selectivity estimate seems much better; 7.3.3's > anticipated rows was ten times the actual; 7.4's is one half of the actual. > Min() & Max() unfortunatly suck on PG. It will be that way for a while perhaps at some point someone will make a "special" case and convince -HACKERS it is a Good Thing(tm) (Like select count(*) from table being 'cached' - a lot of people probably get bad first impressions because of that) Would it be possible ot rewrite your queries replacing min/max with a select stock_id from bigtable where blah = blorch order by stock_id (desc|asc) limit 1? because that would enable PG to use an index and magically "go fast". You may need a subselect.. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Fri Aug 29 10:55:33 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 3CF2BD1B8B1 for ; Fri, 29 Aug 2003 13:55:32 +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 24437-06 for ; Fri, 29 Aug 2003 10:55:04 -0300 (ADT) Received: from router.intranet.de (morpheus.vitrado.de [194.97.5.114]) by svr1.postgresql.org (Postfix) with ESMTP id 85D07D1B8AD for ; Fri, 29 Aug 2003 10:54:59 -0300 (ADT) Received: from 192.168.1.50 ([192.168.1.50]) by router.intranet.de (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h7TDsMY19092 for ; Fri, 29 Aug 2003 15:54:24 +0200 From: Oliver Siegmar Organization: Vitrado GmbH To: pgsql-performance@postgresql.org Subject: PL/pgSQL functions - text / varchar - havy performance issue?! Date: Fri, 29 Aug 2003 15:54:46 +0200 User-Agent: KMail/1.5.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308291554.46748.o.siegmar@vitrado.de> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/490 X-Sequence-Number: 3306 Hi, I'm using PostgreSQL 7.3.4 and noticed a havy performance issue when using the datatype text for PL/pgSQL functions instead of varchar. This is the table: CREATE TABLE user_login_table ( id serial, username varchar(100), PRIMARY ID (id), UNIQUE (username) ); This table contains ~ 500.000 records. The database runs on a P4 with 512 MB RAM. When using the following functions, I notice a havy speed difference: CREATE OR REPLACE FUNCTION get_foo_exists (varchar(100)) RETURNS bool AS ' BEGIN PERFORM username FROM user_login_table WHERE username = $1; RETURN FOUND; END; ' LANGUAGE 'plpgsql'; CREATE OR REPLACE FUNCTION get_foo_exists2 (text) RETURNS bool AS ' BEGIN PERFORM username FROM user_login_table WHERE username = $1; RETURN FOUND; END; ' LANGUAGE 'plpgsql'; The function 'get_foo_exists (varchar(100))' is extremly fast (can't estimate - < 0.5 seconds). The function 'get_foo_exists2 (text)' takes about 3 seconds for the same operation. Is that normal? Bye, Oliver From pgsql-performance-owner@postgresql.org Fri Aug 29 11:00:34 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 E27ADD1B8B1 for ; Fri, 29 Aug 2003 14:00: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 26389-03 for ; Fri, 29 Aug 2003 11:00:21 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id DEE02D1B8AC for ; Fri, 29 Aug 2003 11:00:15 -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 h7TE0EjX015993; Fri, 29 Aug 2003 10:00:14 -0400 (EDT) To: "Alexander Priem" Cc: "Tomasz Myrta" , pgsql-performance@postgresql.org Subject: Re: Indexing question In-reply-to: <01bf01c36e0d$18769280$b696a8c0@APR> References: <012f01c36dfa$0f4a8760$b696a8c0@APR> <3F4EFAB6.7030104@klaster.net> <015f01c36e02$134fe960$b696a8c0@APR> <3F4F07CE.6090803@klaster.net> <018c01c36e09$4893e980$b696a8c0@APR> <3F4F1575.8090600@klaster.net> <01bf01c36e0d$18769280$b696a8c0@APR> Comments: In-reply-to "Alexander Priem" message dated "Fri, 29 Aug 2003 11:08:21 +0200" Date: Fri, 29 Aug 2003 10:00:14 -0400 Message-ID: <15992.1062165614@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/491 X-Sequence-Number: 3307 "Alexander Priem" writes: > Does anyone know whether it is bad practise to have two indexes on the > primary key of a table? (one 'primary key' index and one partial index) It's a little unusual, but if you get enough performance boost from it to justify the maintenance cost of the extra index, then I can't see anything wrong with it. The "if" is worth checking though. I missed the start of this thread, but what percentage of your rows do you expect to have null deleteddate? Unless it's a pretty small percentage, I'm unconvinced that the extra indexes will be worth their cost. regards, tom lane From pgsql-performance-owner@postgresql.org Fri Aug 29 11:05: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 03FB1D1B8AC for ; Fri, 29 Aug 2003 14:05:16 +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 24437-08 for ; Fri, 29 Aug 2003 11:05:09 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 7A642D1B8E0 for ; Fri, 29 Aug 2003 11:05:04 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19sjsD-00035N-00 for ; Fri, 29 Aug 2003 10:05:09 -0400 Received: by dba2 (Postfix, from userid 1019) id C4002CF47; Fri, 29 Aug 2003 10:05:08 -0400 (EDT) Date: Fri, 29 Aug 2003 10:05:08 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: Hardware recommendations to scale to silly load Message-ID: <20030829140503.GA19388@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <1061953146.18108.291.camel@haggis> <3F4E5DA9.6396.5C8916@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/492 X-Sequence-Number: 3308 On Fri, Aug 29, 2003 at 12:05:03AM -0700, William Yu wrote: > We should see a boost when we move to 64-bit Linux and hopefully another > one when NUMA for Linux is production-stable. According to the people who've worked with SGIs, NUMA actually seems to make things worse. It has something to do with how the shared memory is handled. You'll want to dig through the -general or -hackers archives from somewhere between 9 and 14 months ago, IIRC. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Fri Aug 29 11:35: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 E6F1ED1B8AC for ; Fri, 29 Aug 2003 14:26:58 +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 25570-09 for ; Fri, 29 Aug 2003 11:26:30 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 51D0CD1B8B1 for ; Fri, 29 Aug 2003 11:26:26 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19skCt-0003Vl-00 for ; Fri, 29 Aug 2003 10:26:31 -0400 Received: by dba2 (Postfix, from userid 1019) id BD2FACF47; Fri, 29 Aug 2003 10:26:30 -0400 (EDT) Date: Fri, 29 Aug 2003 10:26:30 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: Force table to be permanently in cache? Message-ID: <20030829142630.GE19388@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <3F4CBD8A.4050309@potentialtech.com> <1061948112.15800.53.camel@gibraltar.mattclark.net> <3F4C1364.6080602@potentialtech.com> <1061990263.15800.124.camel@gibraltar.mattclark.net> <3F4CBD8A.4050309@potentialtech.com> <5.1.0.14.0.20030829144416.03be0248@195.145.148.245> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.1.0.14.0.20030829144416.03be0248@195.145.148.245> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/493 X-Sequence-Number: 3309 On Fri, Aug 29, 2003 at 02:52:10PM +0200, Fabian Kreitner wrote: > Hi everyone, > > I have a sql request which on first invocation completes in ~12sec but then > drops to ~3sec on the following runs. The 3 seconds would be acceptable but > how can I make sure that the data is cached and all times? Is it simply > enough to set shared_buffers high enough to hold the entire database (and > have enough ram installed of course)? The OS is linux in this case. If the table gets hit often enough, then it'll be in your filesystem cache anyway. See the many discussions of sizing shared_buffers in the archives of this list for thoughts on how big that should be. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Fri Aug 29 11:47:32 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 77757D1B8AC for ; Fri, 29 Aug 2003 14:47: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 27003-10 for ; Fri, 29 Aug 2003 11:46:59 -0300 (ADT) Received: from mta4.adelphia.net (mta4.adelphia.net [68.168.78.184]) by svr1.postgresql.org (Postfix) with ESMTP id 159BBD1B8A4 for ; Fri, 29 Aug 2003 11:46:40 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta4.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030829144645.BXAT10404.mta4.adelphia.net@potentialtech.com>; Fri, 29 Aug 2003 10:46:45 -0400 Message-ID: <3F4F6754.8050900@potentialtech.com> Date: Fri, 29 Aug 2003 10:46:44 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Oliver Siegmar Cc: pgsql-performance@postgresql.org Subject: Re: PL/pgSQL functions - text / varchar - havy performance References: <200308291554.46748.o.siegmar@vitrado.de> In-Reply-To: <200308291554.46748.o.siegmar@vitrado.de> 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: 200308/494 X-Sequence-Number: 3310 Oliver Siegmar wrote: > Hi, > > I'm using PostgreSQL 7.3.4 and noticed a havy performance issue when > using the datatype text for PL/pgSQL functions instead of varchar. > > This is the table: > > CREATE TABLE user_login_table ( > id serial, > username varchar(100), > PRIMARY ID (id), > UNIQUE (username) > ); > > This table contains ~ 500.000 records. The database runs on a P4 with > 512 MB RAM. When using the following functions, I notice a havy > speed difference: > > > CREATE OR REPLACE FUNCTION get_foo_exists (varchar(100)) > RETURNS bool > AS ' > BEGIN > PERFORM username > FROM user_login_table > WHERE username = $1; > > RETURN FOUND; > END; > ' > LANGUAGE 'plpgsql'; > > CREATE OR REPLACE FUNCTION get_foo_exists2 (text) > RETURNS bool > AS ' > BEGIN > PERFORM username > FROM user_login_table > WHERE username = $1; > > RETURN FOUND; > END; > ' > LANGUAGE 'plpgsql'; > > > > The function 'get_foo_exists (varchar(100))' is extremly fast > (can't estimate - < 0.5 seconds). The function 'get_foo_exists2 (text)' > takes about 3 seconds for the same operation. > Is that normal? I don't know if it's normal for it to be that slow, but I would expect it to be slower. Postgres has to convert the text to a varchar before it can actually do anything. It's possible (though I'm not sure) that it has to do the conversion with each record it looks at. Every language I know of hits performance issues when you have to convert between types. I wouldn't _think_ that it would be that much work converting between text and varchar, but I'm not familiar enough with the server code to know what's actually involved. What kind of performance do you get if you accept a text value and then manually convert it to a varchar? i.e. CREATE OR REPLACE FUNCTION get_foo_exists2 (text) RETURNS bool AS ' DECLARE tempvar VARCHAR(100); BEGIN tempvar := $1; PERFORM username FROM user_login_table WHERE username = tempvar; RETURN FOUND; END; ' LANGUAGE 'plpgsql'; -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Fri Aug 29 12:02: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 9ADA6D1B8AD for ; Fri, 29 Aug 2003 15:02:39 +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 31436-02 for ; Fri, 29 Aug 2003 12:02:28 -0300 (ADT) Received: from router.intranet.de (morpheus.vitrado.de [194.97.5.114]) by svr1.postgresql.org (Postfix) with ESMTP id D3112D1B8A4 for ; Fri, 29 Aug 2003 12:02:26 -0300 (ADT) Received: from 192.168.1.50 ([192.168.1.50]) by router.intranet.de (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h7TF1RY20572; Fri, 29 Aug 2003 17:01:28 +0200 From: Oliver Siegmar Organization: Vitrado GmbH To: Bill Moran Subject: Re: PL/pgSQL functions - text / varchar - havy performance issue?! Date: Fri, 29 Aug 2003 17:01:51 +0200 User-Agent: KMail/1.5.3 References: <200308291554.46748.o.siegmar@vitrado.de> <3F4F6754.8050900@potentialtech.com> In-Reply-To: <3F4F6754.8050900@potentialtech.com> Cc: pgsql-performance@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308291701.51853.o.siegmar@vitrado.de> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/496 X-Sequence-Number: 3312 Hi Bill, On Friday 29 August 2003 16:46, you wrote: > Postgres has to convert the text to a varchar before it can actually > do anything. It's possible (though I'm not sure) that it has to > do the conversion with each record it looks at. Nope. I tested you function with the temporary varchar variable...it is as slow as the 'text-only' varayity. > Every language I know of hits performance issues when you have to > convert between types. I wouldn't _think_ that it would be that > much work converting between text and varchar, but I'm not familiar > enough with the server code to know what's actually involved. I have absolutely no idea how pgsql handles text/varchar stuff in its server code. But ~ 3 seconds for that small function is ways to slow in any case. Bye, Oliver From pgsql-performance-owner@postgresql.org Fri Aug 29 12:02:31 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 D6F8DD1B8AD for ; Fri, 29 Aug 2003 15:02:28 +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 31432-04 for ; Fri, 29 Aug 2003 12:01:53 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id D1CA9D1B8B4 for ; Fri, 29 Aug 2003 12:01:52 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19skl6-00047E-00 for ; Fri, 29 Aug 2003 11:01:52 -0400 Received: by dba2 (Postfix, from userid 1019) id E0AB8D0C1; Fri, 29 Aug 2003 11:01:51 -0400 (EDT) Date: Fri, 29 Aug 2003 11:01:51 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: PL/pgSQL functions - text / varchar - havy performance Message-ID: <20030829150151.GI19388@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <200308291554.46748.o.siegmar@vitrado.de> <3F4F6754.8050900@potentialtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4F6754.8050900@potentialtech.com> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/495 X-Sequence-Number: 3311 On Fri, Aug 29, 2003 at 10:46:44AM -0400, Bill Moran wrote: > > Postgres has to convert the text to a varchar before it can actually > do anything. It's possible (though I'm not sure) that it has to > do the conversion with each record it looks at. It does? According to the docs, varchar is just syntactic sugar for text. In fact, text and varchar() are supposed to be exactly the same. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Fri Aug 29 12:03:23 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 F2AC1D1B8AD for ; Fri, 29 Aug 2003 15:03: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 31949-01 for ; Fri, 29 Aug 2003 12:02:45 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id 8B1BDD1B8B3 for ; Fri, 29 Aug 2003 12:02:44 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 18DE3D594; Fri, 29 Aug 2003 08:02:27 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 0694C5C03; Fri, 29 Aug 2003 08:02:27 -0700 (PDT) Date: Fri, 29 Aug 2003 08:02:26 -0700 (PDT) From: Stephan Szabo To: Ken Geis Cc: Bruno Wolff III , Subject: Re: bad estimates In-Reply-To: <3F4F0A5E.8030207@speakeasy.org> Message-ID: <20030829080036.V37443-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/497 X-Sequence-Number: 3313 On Fri, 29 Aug 2003, Ken Geis wrote: > Ken Geis wrote: > > I went through the code (7.4 beta2) that estimates the cost of an index > > scan path. What I need to be sure of is that when running a query in > > pgsql that uses only the columns that are in an index, the underlying > > table need not be accessed. I know that Oracle does this. > > Thinking about it some more, it's obvious to me that a pgsql index scan > must be accessing the underlying table even though all of the > information needed is in the index itself. A linear scan of a 660M file > should not take 55 minutes. I could confirm this with stats, but > someone out there probably already knows the answer here. Unfortunately not all the information needed is in the index. You can't tell from the index alone currently whether or not the row is visible to you. Adding said information would be possible but there are downsides to that as well (there are some past discussions on the topic, but I'm too lazy to look them up to give a link, check the archives ;) ). From pgsql-performance-owner@postgresql.org Fri Aug 29 12:12: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 224D3D1B8AD for ; Fri, 29 Aug 2003 15:12:45 +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 29385-08 for ; Fri, 29 Aug 2003 12:12:13 -0300 (ADT) Received: from mail.cict.nl (vnd-7521.mxs.adsl.euronet.nl [62.234.149.33]) by svr1.postgresql.org (Postfix) with ESMTP id 989EDD1B8A4 for ; Fri, 29 Aug 2003 12:12:12 -0300 (ADT) Received: from APR ([192.168.150.182]) by mail.cict.nl (Merak 6.0.5) with SMTP id DUC73886; Fri, 29 Aug 2003 17:12:00 +0200 Message-ID: <027701c36e40$2851aef0$b696a8c0@APR> From: "Alexander Priem" To: "Tom Lane" Cc: References: <012f01c36dfa$0f4a8760$b696a8c0@APR> <3F4EFAB6.7030104@klaster.net> <015f01c36e02$134fe960$b696a8c0@APR> <3F4F07CE.6090803@klaster.net> <018c01c36e09$4893e980$b696a8c0@APR> <3F4F1575.8090600@klaster.net> <01bf01c36e0d$18769280$b696a8c0@APR> <15992.1062165614@sss.pgh.pa.us> Subject: Re: Indexing question Date: Fri, 29 Aug 2003 17:13:52 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/498 X-Sequence-Number: 3314 Well, the intention is to hold every record that ever existed in the table. Therefore, records do not get deleted, but they get a date in the deleteddate field. This way, we can track what changes were made to the table(s). So if a record gets 'deleted', the field 'deleted' is set to today's date. If a record gets 'updated', a new record is made containing the new data, and the old record is marked as 'deleted'. So the percentage of 'deleted' records will grow with time, if you understand what I mean. ----- Original Message ----- From: "Tom Lane" To: "Alexander Priem" Cc: "Tomasz Myrta" ; Sent: Friday, August 29, 2003 4:00 PM Subject: Re: [PERFORM] Indexing question > "Alexander Priem" writes: > > Does anyone know whether it is bad practise to have two indexes on the > > primary key of a table? (one 'primary key' index and one partial index) > > It's a little unusual, but if you get enough performance boost from it > to justify the maintenance cost of the extra index, then I can't see > anything wrong with it. > > The "if" is worth checking though. I missed the start of this thread, > but what percentage of your rows do you expect to have null deleteddate? > Unless it's a pretty small percentage, I'm unconvinced that the extra > indexes will be worth their cost. > > regards, tom lane From pgsql-performance-owner@postgresql.org Fri Aug 29 12:35: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 88E24D1B574 for ; Fri, 29 Aug 2003 15:34:56 +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 33843-04 for ; Fri, 29 Aug 2003 12:34:45 -0300 (ADT) Received: from mta6.adelphia.net (mta6.adelphia.net [68.168.78.190]) by svr1.postgresql.org (Postfix) with ESMTP id 79DA9D1B8D2 for ; Fri, 29 Aug 2003 12:34:29 -0300 (ADT) Received: from potentialtech.com ([24.53.179.151]) by mta6.adelphia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030829153415.TCDL18217.mta6.adelphia.net@potentialtech.com>; Fri, 29 Aug 2003 11:34:15 -0400 Message-ID: <3F4F7275.5030203@potentialtech.com> Date: Fri, 29 Aug 2003 11:34:13 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Sullivan Cc: pgsql-performance@postgresql.org Subject: Re: PL/pgSQL functions - text / varchar - havy performance References: <200308291554.46748.o.siegmar@vitrado.de> <3F4F6754.8050900@potentialtech.com> <20030829150151.GI19388@libertyrms.info> In-Reply-To: <20030829150151.GI19388@libertyrms.info> 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: 200308/499 X-Sequence-Number: 3315 Andrew Sullivan wrote: > On Fri, Aug 29, 2003 at 10:46:44AM -0400, Bill Moran wrote: > >>Postgres has to convert the text to a varchar before it can actually >>do anything. It's possible (though I'm not sure) that it has to >>do the conversion with each record it looks at. > > It does? According to the docs, varchar is just syntactic sugar for > text. In fact, text and varchar() are supposed to be exactly the > same. Really? Well, if I'm wrong, I'm wrong. Wouldn't be the first time. Have any explanation as to why that function is so slow? -- Bill Moran Potential Technologies http://www.potentialtech.com From pgsql-performance-owner@postgresql.org Fri Aug 29 12:54: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 B124BD1B8A5 for ; Fri, 29 Aug 2003 15:54:39 +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 34807-05 for ; Fri, 29 Aug 2003 12:54:08 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 33AE6D1B8AD for ; Fri, 29 Aug 2003 12:54:07 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19slZa-00050U-00 for ; Fri, 29 Aug 2003 11:54:02 -0400 Received: by dba2 (Postfix, from userid 1019) id D2084D0C0; Fri, 29 Aug 2003 11:54:01 -0400 (EDT) Date: Fri, 29 Aug 2003 11:54:01 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: PL/pgSQL functions - text / varchar - havy performance Message-ID: <20030829155401.GM19388@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <200308291554.46748.o.siegmar@vitrado.de> <3F4F6754.8050900@potentialtech.com> <20030829150151.GI19388@libertyrms.info> <3F4F7275.5030203@potentialtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4F7275.5030203@potentialtech.com> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/500 X-Sequence-Number: 3316 On Fri, Aug 29, 2003 at 11:34:13AM -0400, Bill Moran wrote: > Have any explanation as to why that function is so slow? Sorry, no. It might have to do with the planning, though. I believe the funciton is planned the first time it is run. It may need to be marked as "STABLE" in order to use any indexes, and that could be part of the problem. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Fri Aug 29 13:07:15 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 BB27FD1B8BD for ; Fri, 29 Aug 2003 16:07:04 +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 34680-07 for ; Fri, 29 Aug 2003 13:06:34 -0300 (ADT) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by svr1.postgresql.org (Postfix) with ESMTP id 1BE0CD1B8E0 for ; Fri, 29 Aug 2003 13:06:33 -0300 (ADT) Received: (qmail 1736 invoked from network); 29 Aug 2003 16:06:32 -0000 Received: from unknown (HELO speakeasy.org) (kgeis@[66.93.130.165]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Aug 2003 16:06:32 -0000 Message-ID: <3F4F7A07.30404@speakeasy.org> Date: Fri, 29 Aug 2003 09:06:31 -0700 From: Ken Geis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruno Wolff III Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> In-Reply-To: <20030829040519.GA5746@wolff.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: 200308/501 X-Sequence-Number: 3317 Bruno Wolff III wrote: > If you want both the max and the min, then things are going to be a bit > more work. You are either going to want to do two separate selects > or join two selects or use subselects. If there aren't enough prices > per stock, the sequential scan might be fastest since you only need to > go through the table once and don't have to hit the index blocks. > > It is still odd that you didn't get a big speed up for just the min though. I found I'm suffering from an effect detailed in a previous thread titled Does "correlation" mislead the optimizer on large tables? Ken From pgsql-performance-owner@postgresql.org Fri Aug 29 13:18:51 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 B8B47D1B915 for ; Fri, 29 Aug 2003 16:18: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 35872-07 for ; Fri, 29 Aug 2003 13:18:37 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 7FF92D1B8CD for ; Fri, 29 Aug 2003 13:18:36 -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 h7TGIZjX028310; Fri, 29 Aug 2003 12:18:36 -0400 (EDT) To: Andrew Sullivan Cc: pgsql-performance@postgresql.org, Oliver Siegmar , Bill Moran Subject: Re: PL/pgSQL functions - text / varchar - havy performance In-reply-to: <20030829155401.GM19388@libertyrms.info> References: <200308291554.46748.o.siegmar@vitrado.de> <3F4F6754.8050900@potentialtech.com> <20030829150151.GI19388@libertyrms.info> <3F4F7275.5030203@potentialtech.com> <20030829155401.GM19388@libertyrms.info> Comments: In-reply-to Andrew Sullivan message dated "Fri, 29 Aug 2003 11:54:01 -0400" Date: Fri, 29 Aug 2003 12:18:35 -0400 Message-ID: <28309.1062173915@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/502 X-Sequence-Number: 3318 Andrew Sullivan writes: > On Fri, Aug 29, 2003 at 11:34:13AM -0400, Bill Moran wrote: >> Have any explanation as to why that function is so slow? > Sorry, no. It might have to do with the planning, though. Specifically, I'll bet he's getting an indexscan plan with one and not with the other. It's just ye olde cross-datatype-comparisons-aren't- indexable problem. "varchar = varchar" matches the index on the varchar column, but "text = text" is a different operator that doesn't match. Guess which one gets selected when the initial input is "varchar = text". 7.4 has fixed this particular problem by essentially eliminating the separate operators for varchar, but in prior releases the behavior Oliver describes is entirely to be expected. A workaround is to cast inside the function: ... where varcharcolumn = textarg::varchar; so that "=" gets interpreted as "varchar = varchar". regards, tom lane From pgsql-performance-owner@postgresql.org Fri Aug 29 13:27:34 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 1EC59D1B8B7 for ; Fri, 29 Aug 2003 16:27:33 +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 35901-09 for ; Fri, 29 Aug 2003 13:27:22 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 04619D1B8AC for ; Fri, 29 Aug 2003 13:27:18 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7TGW8gS021324 for ; Fri, 29 Aug 2003 22:02:08 +0530 Received: from daithan.intranet.pspl.co.in (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 h7TGW7hi021309 for ; Fri, 29 Aug 2003 22:02:07 +0530 From: Shridhar Daithankar To: pgsql-performance@postgresql.org Subject: 2.4 v/s 2.6 again. Date: Fri, 29 Aug 2003 21:59:14 +0530 User-Agent: KMail/1.5.2 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_a93T/ZnXOWqUH/q" Message-Id: <200308292159.14095.shridhar_daithankar@persistent.co.in> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/503 X-Sequence-Number: 3319 --Boundary-00=_a93T/ZnXOWqUH/q Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, I compared 2.6 with elevator=deadline. It did bring some improvement in performance. But still it does not beat 2.4. Attached are three files for details. I also ran a simple insert benchmark to insert a million record in a simple table with a small int and a varchar(30). Here are the results 2.6 deadline 1K/xact 299sec 10K/xact 277 sec 100K/xact 271 sec 2.6 AS 1K/xact 262sec 10K/xact Not done 100K/xact 257 sec 2.6 AS 1K/xact 252sec 10K/xact 243 sec 100K/xact 246 sec It seems that I noted a test result wrongly. I need to do it again. Overall 2.6 needs some real IO improvements. Of course it could do better on multiway machine. I guess there is no point bothering this with kernel hackers. They know this stuff already, right. Looking forward to next release of kernel and hope it improves things... Shridhar --Boundary-00=_a93T/ZnXOWqUH/q Content-Type: text/plain; charset="us-ascii"; name="pgbench.7.4CVSHEAD.2.6.0-test4" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pgbench.7.4CVSHEAD.2.6.0-test4" Vacumm full done after each run. pg_resetlog run between each server start Scaling factor: 10 Initialization time: real 1m42.282s user 0m1.787s sys 0m0.121s Kernel 2.6.0-test4 Effective cache size 38400 (300MB) checkpoint segments=6 1)Shared buffers 1000 pgbench -c5 -t100 test1 tps = 131.962542 (including connections establishing) tps = 134.418358 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 79.301493 (including connections establishing) tps = 79.393258 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 64.917044 (including connections establishing) tps = 65.438067 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 66.135615 (including connections establishing) tps = 66.193039 (excluding connections establishing) 2) Shared buffers 2000 pgbench -c5 -t100 test1 tps = 135.598994 (including connections establishing) tps = 138.296634 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 81.331678 (including connections establishing) tps = 81.425369 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 116.524476 (including connections establishing) tps = 118.388407 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 64.659894 (including connections establishing) tps = 64.719829 (excluding connections establishing) 3) Shared buffers 3000 pgbench -c5 -t100 test tps = 132.489569 (including connections establishing) tps = 135.177003 (excluding connections establishing) pgbench -c5 -t1000 test tps = 70.272855 (including connections establishing) tps = 70.343452 (excluding connections establishing) pgbench -c10 -t100 test tps = 121.624524 (including connections establishing) tps = 123.549086 (excluding connections establishing) pgbench -c10 -t1000 test tps = 64.124644 (including connections establishing) tps = 64.183736 (excluding connections establishing) 4) noatime enabled Shared buffers 3000 pgbench -c5 -t100 test tps = 90.850600 (including connections establishing) tps = 92.053686 (excluding connections establishing) pgbench -c5 -t1000 test tps = 92.209724 (including connections establishing) tps = 92.329682 (excluding connections establishing) pgbench -c10 -t100 test tps = 79.264231 (including connections establishing) tps = 80.145448 (excluding connections establishing) pgbench -c10 -t1000 test tps = 70.439082 (including connections establishing) tps = 70.506189 (excluding connections establishing) --Boundary-00=_a93T/ZnXOWqUH/q Content-Type: text/plain; charset="us-ascii"; name="pgbench.7.4CVSHEAD.2.6.0-test4.deadline" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pgbench.7.4CVSHEAD.2.6.0-test4.deadline" Vacumm full done after each run. pg_resetlog run between each server start Scaling factor: 10 Initialization time: real 1m44.512s user 0m1.765s sys 0m0.134s Kernel 2.6.0-test4 Effective cache size 38400 (300MB) checkpoint segments=6 1)Shared buffers 1000 pgbench -c5 -t100 test1 tps = 135.647884 (including connections establishing) tps = 138.318785 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 61.097461 (including connections establishing) tps = 61.144720 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 121.626566 (including connections establishing) tps = 123.517787 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 54.618036 (including connections establishing) tps = 54.654704 (excluding connections establishing) 2) Shared buffers 2000 pgbench -c5 -t100 test1 tps = 131.715307 (including connections establishing) tps = 134.220729 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 74.486274 (including connections establishing) tps = 74.559177 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 127.431602 (including connections establishing) tps = 129.461754 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 51.840810 (including connections establishing) tps = 51.875044 (excluding connections establishing) --Boundary-00=_a93T/ZnXOWqUH/q Content-Type: text/plain; charset="us-ascii"; name="pgbench.7.4CVSHEAD.24.20" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pgbench.7.4CVSHEAD.24.20" Vacumm full done after each run. pg_resetlog run between each server start Scaling factor: 10 Initialization time: real 1m32.551s user 0m1.710s sys 0m0.130s Kernel 2.4.20 Effective cache size 38400 (300MB) checkpoint segments=6 1)Shared buffers 1000 pgbench -c5 -t100 test1 tps = 145.504917 (including connections establishing) tps = 147.991299 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 70.785341 (including connections establishing) tps = 70.849065 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 147.605267 (including connections establishing) tps = 149.944123 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 55.646866 (including connections establishing) tps = 55.678399 (excluding connections establishing) 2) Shared buffers 2000 pgbench -c5 -t100 test1 tps = 140.115444 (including connections establishing) tps = 142.441377 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 77.015876 (including connections establishing) tps = 77.084474 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 128.512768 (including connections establishing) tps = 130.314689 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 55.003077 (including connections establishing) tps = 55.035001 (excluding connections establishing) 3) Shared buffers 3000 pgbench -c5 -t100 test1 tps = 153.142499 (including connections establishing) tps = 156.094637 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 81.391878 (including connections establishing) tps = 81.472845 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 120.420876 (including connections establishing) tps = 122.066975 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 56.766460 (including connections establishing) tps = 56.801117 (excluding connections establishing) 4) Shared buffers 3000, noatime pgbench -c5 -t100 test1 tps = 140.464589 (including connections establishing) tps = 143.152323 (excluding connections establishing) pgbench -c5 -t1000 test1 tps = 94.718161 (including connections establishing) tps = 94.826618 (excluding connections establishing) pgbench -c10 -t100 test1 tps = 131.925129 (including connections establishing) tps = 133.826403 (excluding connections establishing) pgbench -c10 -t1000 test1 tps = 65.374006 (including connections establishing) tps = 65.458626 (excluding connections establishing) --Boundary-00=_a93T/ZnXOWqUH/q-- From pgsql-performance-owner@postgresql.org Fri Aug 29 13:52:57 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 7967BD1B8FC for ; Fri, 29 Aug 2003 16:52: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 41360-02 for ; Fri, 29 Aug 2003 13:52:43 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 732EBD1B8D8 for ; Fri, 29 Aug 2003 13:52:42 -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 h7TGqZeo099002 for ; Fri, 29 Aug 2003 16:52:41 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7TGXxpS092681 for pgsql-performance@postgresql.org; Fri, 29 Aug 2003 16:33:59 GMT From: William Yu X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Hardware recommendations to scale to silly load Date: Fri, 29 Aug 2003 09:33:51 -0700 Organization: Hub.Org Networking Services Lines: 48 Message-ID: References: <3F4E5DA9.6396.5C8916@localhost> <3F4F59A8.20966.434E2AD@localhost> 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: <3F4F59A8.20966.434E2AD@localhost> To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/505 X-Sequence-Number: 3321 Shridhar Daithankar wrote: > Just a guess here but does a precompiled postgresql for x86 and a x86-64 > optimized one makes difference? > > Opteron is one place on earth you can watch difference between 32/64 > bit on same machine. Can be handy at times.. I don't know yet. I tried building a 64-bit kernel and my eyes glazed over trying to figure out how to create the cross-platform GCC compiler that's first needed to build the kernel. Then I read all the libraries & drivers also needed to be 64-bit compiled and at that point gave up the ghost. I'll wait until a 64-bit Redhat distro is available before I test the 64-bit capabilities. The preview SuSE 64-bit Linux used in most of the Opteron rollout tests has MySql precompiled as 64-bit and under that DB, 64-bit added an extra ~25% performance (compared to a 32-bit SuSE install). My guess is half of the performance comes from eliminating the PAE swapping. > I am sure. But is 64 bit environment, Xeon is not the compitition. It's PA-RSC- > 8700, ultraSparcs, Power series and if possible itanium. Well, just because the Opteron is 64-bit doesn't mean it's direct competition for the high-end RISC chips. Yes, if you're looking at the discrete CPU itself, it appears they could compete -- the SpecINT scores places the Opteron near the top of the list. But big companies also need the infrastructure, management tools and top-end scalability. If you just have to have the million dollar machines (128x Itanium2 servers or whatever), AMD is nowhere close to competing unless Beowulf clusters fit your needs. In terms of infrastructure, scalability, mindshare and pricing, Xeon is most certainly Opteron's main competition. We're talking <$10K servers versus $50K+ servers (assuming you actually want performance instead of having a single pokey UltraSparc CPU in a box). And yes, just because Opteron is a better performing server platform than Xeon doesn't mean a corporate fuddy-duddy still won't buy Xeon due to the $1B spent by Intel on marketting. >>We should see a boost when we move to 64-bit Linux and hopefully another >>one when NUMA for Linux is production-stable. > > Getting a 2.6 running now is the answer to make it stable fast..:-) Of course > if you have spare hardware.. My office is a pigsty of spare hardware lying around. :) We're like pigs rolling around in the mud. From pgsql-performance-owner@postgresql.org Fri Aug 29 13:37: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 5328BD1B8E0 for ; Fri, 29 Aug 2003 16:37:03 +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 38635-06 for ; Fri, 29 Aug 2003 13:36:31 -0300 (ADT) Received: from perrin.nxad.com (internal.nxad.com [69.1.70.251]) by svr1.postgresql.org (Postfix) with ESMTP id E0E0BD1B8CC for ; Fri, 29 Aug 2003 13:36:28 -0300 (ADT) Received: by perrin.nxad.com (Postfix, from userid 1001) id 5209020F01; Fri, 29 Aug 2003 09:36:13 -0700 (PDT) Date: Fri, 29 Aug 2003 09:36:13 -0700 From: Sean Chittenden To: Ken Geis Cc: Bruno Wolff III , pgsql-performance@postgresql.org Subject: Re: bad estimates Message-ID: <20030829163613.GA51475@perrin.nxad.com> References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4F7A07.30404@speakeasy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4F7A07.30404@speakeasy.org> X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/504 X-Sequence-Number: 3320 > >If you want both the max and the min, then things are going to be a > >bit more work. You are either going to want to do two separate > >selects or join two selects or use subselects. If there aren't > >enough prices per stock, the sequential scan might be fastest since > >you only need to go through the table once and don't have to hit > >the index blocks. > > > >It is still odd that you didn't get a big speed up for just the min though. > > I found I'm suffering from an effect detailed in a previous thread titled > > Does "correlation" mislead the optimizer on large tables? I don't know about large tables, but this is a big problem and something I'm going to spend some time validating later today. I think Manfred's patch is pretty good and certainly better than where we are but I haven't used it yet to see if it's the magic ticket for many of these index problems. -sc -- Sean Chittenden From pgsql-performance-owner@postgresql.org Fri Aug 29 14:00:43 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 0DA59D1B8CD for ; Fri, 29 Aug 2003 17:00:42 +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 38886-10 for ; Fri, 29 Aug 2003 14:00:10 -0300 (ADT) Received: from mail.speakeasy.net (mail7.speakeasy.net [216.254.0.207]) by svr1.postgresql.org (Postfix) with ESMTP id 5F0A6D1B8CF for ; Fri, 29 Aug 2003 14:00:09 -0300 (ADT) Received: (qmail 15274 invoked from network); 29 Aug 2003 16:57:00 -0000 Received: from unknown (HELO speakeasy.org) (kgeis@[66.93.130.165]) (envelope-sender ) by mail7.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Aug 2003 16:57:00 -0000 Message-ID: <3F4F85DB.2030402@speakeasy.org> Date: Fri, 29 Aug 2003 09:56:59 -0700 From: Ken Geis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sean Chittenden Cc: Bruno Wolff III , pgsql-performance@postgresql.org Subject: Re: bad estimates References: <3F4E99F7.7080604@speakeasy.org> <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4F7A07.30404@speakeasy.org> <20030829163613.GA51475@perrin.nxad.com> In-Reply-To: <20030829163613.GA51475@perrin.nxad.com> 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: 200308/507 X-Sequence-Number: 3323 Sean Chittenden wrote: >>I found I'm suffering from an effect detailed in a previous thread titled >> >> Does "correlation" mislead the optimizer on large tables? > > > I don't know about large tables, but this is a big problem and > something I'm going to spend some time validating later today. I > think Manfred's patch is pretty good and certainly better than where > we are but I haven't used it yet to see if it's the magic ticket for > many of these index problems. I had to dig through a lot of archives to find this. Is this the patch, from last October? http://members.aon.at/pivot/pg/16-correlation.diff If so, I'll try it out and report my results. Ken From pgsql-performance-owner@postgresql.org Fri Aug 29 13:59:26 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 70A38D1B914 for ; Fri, 29 Aug 2003 16:59:24 +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 40703-05 for ; Fri, 29 Aug 2003 13:58:54 -0300 (ADT) Received: from dp100.dp100.com (dsl093-082-153.wdc1.dsl.speakeasy.net [66.93.82.153]) by svr1.postgresql.org (Postfix) with ESMTP id A00B3D1B8CC for ; Fri, 29 Aug 2003 13:58:51 -0300 (ADT) Received: from i386.dp100.com (i386.dp100.com [10.0.0.1]) by dp100.dp100.com (Postfix) with ESMTP id 5F3C12064 for ; Fri, 29 Aug 2003 12:58:51 -0400 (EDT) Received: by i386.dp100.com (Postfix, from userid 501) id 07877491F; Fri, 29 Aug 2003 12:58:51 -0400 (EDT) Date: Fri, 29 Aug 2003 12:58:51 -0400 From: Richard Ellis To: pgsql-performance@postgresql.org Subject: Re: Indexing question Message-ID: <20030829165850.GA28458@i386.dp100.com> Mail-Followup-To: pgsql-performance@postgresql.org References: <012f01c36dfa$0f4a8760$b696a8c0@APR> <3F4EFAB6.7030104@klaster.net> <015f01c36e02$134fe960$b696a8c0@APR> <3F4F07CE.6090803@klaster.net> <018c01c36e09$4893e980$b696a8c0@APR> <3F4F1575.8090600@klaster.net> <01bf01c36e0d$18769280$b696a8c0@APR> <15992.1062165614@sss.pgh.pa.us> <027701c36e40$2851aef0$b696a8c0@APR> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <027701c36e40$2851aef0$b696a8c0@APR> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/506 X-Sequence-Number: 3322 On Fri, Aug 29, 2003 at 05:13:52PM +0200, Alexander Priem wrote: > Well, the intention is to hold every record that ever existed in the table. > Therefore, records do not get deleted, but they get a date in the > deleteddate field. This way, we can track what changes were made to the > table(s). > > So if a record gets 'deleted', the field 'deleted' is set to today's date. > If a record gets 'updated', a new record is made containing the new data, > and the old record is marked as 'deleted'. > > So the percentage of 'deleted' records will grow with time, if you > understand what I mean. Did you consider a two table implimentation. 1 table "live_table" containing the non-deleted records, a second table "deleted_table" containing the deleted records, along with the "deleted_date" field. Keep the two in sync column type/number wise, and use a before delete trigger function on "live_table" to actually insert a copy of the deleted row plus "deleted_date" into "deleted_table" before performing the delete on "live_table". You could also use a before update trigger to keep old copies of updated records in the same way. Then you would only incur the performance loss of scanning/etc. the deleted records when you actually need to pull up deleted plus live records. From pgsql-performance-owner@postgresql.org Fri Aug 29 14:04:04 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 9048ED1B8CD for ; Fri, 29 Aug 2003 17:04:03 +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 40119-07 for ; Fri, 29 Aug 2003 14:03:33 -0300 (ADT) Received: from perrin.nxad.com (internal.nxad.com [69.1.70.251]) by svr1.postgresql.org (Postfix) with ESMTP id EFE08D1B8D8 for ; Fri, 29 Aug 2003 14:03:31 -0300 (ADT) Received: by perrin.nxad.com (Postfix, from userid 1001) id CAFD321058; Fri, 29 Aug 2003 10:03:31 -0700 (PDT) Date: Fri, 29 Aug 2003 10:03:31 -0700 From: Sean Chittenden To: Ken Geis Cc: Bruno Wolff III , pgsql-performance@postgresql.org Subject: Re: bad estimates Message-ID: <20030829170331.GA51353@perrin.nxad.com> References: <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4F7A07.30404@speakeasy.org> <20030829163613.GA51475@perrin.nxad.com> <3F4F85DB.2030402@speakeasy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4F85DB.2030402@speakeasy.org> X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/508 X-Sequence-Number: 3324 > >>I found I'm suffering from an effect detailed in a previous thread titled > >> > >> Does "correlation" mislead the optimizer on large tables? > > > > > >I don't know about large tables, but this is a big problem and > >something I'm going to spend some time validating later today. I > >think Manfred's patch is pretty good and certainly better than where > >we are but I haven't used it yet to see if it's the magic ticket for > >many of these index problems. > > I had to dig through a lot of archives to find this. Is this the patch, > from last October? > > http://members.aon.at/pivot/pg/16-correlation.diff > > If so, I'll try it out and report my results. Same guy, but that patch is pretty out of date and has been replaced by some newer work that's much better. From: Manfred Koizar Cc: pgsql-hackers@postgresql.org Subject: Re: [HACKERS] Correlation in cost_index() Date: Wed, 20 Aug 2003 19:57:12 +0200 Message-ID: and From: Manfred Koizar To: pgsql-hackers@postgresql.org Subject: [HACKERS] Again on index correlation Date: Wed, 20 Aug 2003 21:21:14 +0200 Message-ID: -sc -- Sean Chittenden From pgsql-performance-owner@postgresql.org Fri Aug 29 14:20:10 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 4D88CD1B8D8 for ; Fri, 29 Aug 2003 17:20: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 41427-06 for ; Fri, 29 Aug 2003 14:19:51 -0300 (ADT) Received: from ll.mit.edu (LLMAIL.LL.MIT.EDU [129.55.12.40]) by svr1.postgresql.org (Postfix) with ESMTP id 1B630D1B8E0 for ; Fri, 29 Aug 2003 14:19:49 -0300 (ADT) Received: (from smtp@localhost) by ll.mit.edu (8.12.9/8.8.8) id h7THJhaX013834 for ; Fri, 29 Aug 2003 13:19:43 -0400 (EDT) Received: from sty.llan.ll.mit.edu( ), claiming to be "sty.llan" via SMTP by llpost, id smtpdAAAtwaa2A; Fri Aug 29 13:19:36 2003 Date: Fri, 29 Aug 2003 13:19:35 -0400 From: george young To: pgsql-performance@postgresql.org Subject: sourcecode for newly release eRServer? Message-Id: <20030829131935.474f78f2.gry@ll.mit.edu> Reply-To: gry@ll.mit.edu Organization: MIT Lincoln Laboratory X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.10; i686-pc-linux-gnu) 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: 200308/509 X-Sequence-Number: 3325 I was ecstatic to hear that postgresql.com is releasing the eRServer replication project to postgresql.org as open source! I'm anxious to get my hands on it -- actually I'm desperate: I'm under pressure to produce a warm-failover server for our lab. I REALLY would like to get hands on this code soon! Does anyone know how and when the actual release will happen? I would be glad to be an alpha tester and promise to contribute back bug-reports/patches. I'll take cvs or tar.gz or paper tape or stone tablets engraved in high Elvish... -- George -- I cannot think why the whole bed of the ocean is not one solid mass of oysters, so prolific they seem. Ah, I am wandering! Strange how the brain controls the brain! -- Sherlock Holmes in "The Dying Detective" From pgsql-performance-owner@postgresql.org Fri Aug 29 14:32: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 A735AD1B8CD for ; Fri, 29 Aug 2003 17:32:04 +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 43670-03 for ; Fri, 29 Aug 2003 14:31:33 -0300 (ADT) Received: from lakemtao03.cox.net (lakemtao03.cox.net [68.1.17.242]) by svr1.postgresql.org (Postfix) with ESMTP id 6F461D1B8B4 for ; Fri, 29 Aug 2003 14:31:32 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao03.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030829173133.QHUP10977.lakemtao03.cox.net@lhosts> for ; Fri, 29 Aug 2003 13:31:33 -0400 Subject: Re: Hardware recommendations to scale to silly load From: Ron Johnson To: PgSQL Performance ML In-Reply-To: References: <3F4E5DA9.6396.5C8916@localhost> <3F4F59A8.20966.434E2AD@localhost> Content-Type: text/plain Message-Id: <1062178287.668.86.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Fri, 29 Aug 2003 12:31:27 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/510 X-Sequence-Number: 3326 On Fri, 2003-08-29 at 11:33, William Yu wrote: > Shridhar Daithankar wrote: [snip] > > I am sure. But is 64 bit environment, Xeon is not the compitition. It's PA-RSC- > > 8700, ultraSparcs, Power series and if possible itanium. > > Well, just because the Opteron is 64-bit doesn't mean it's direct > competition for the high-end RISC chips. Yes, if you're looking at the > discrete CPU itself, it appears they could compete -- the SpecINT scores > places the Opteron near the top of the list. But big companies also need > the infrastructure, management tools and top-end scalability. If you > just have to have the million dollar machines (128x Itanium2 servers or > whatever), AMD is nowhere close to competing unless Beowulf clusters fit > your needs. With the proper motherboards and chipsets, it can definitely compete. What's so special about Itanic-2 that it can be engineered to be put in 128x boxes and run VMS and high-end Unix , but Opti can't? Nothing. If a company with enough engineering talent wants to do it, it can happen. -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "For me and windows it became a matter of easy to start with, and becoming increasingly difficult to be productive as time went on, and if something went wrong very difficult to fix, compared to linux's large over head setting up and learning the system with ease of use and the increase in productivity becoming larger the longer I use the system." Rohan Nicholls , The Netherlands From pgsql-performance-owner@postgresql.org Fri Aug 29 15:51:23 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 9570AD1B8B1 for ; Fri, 29 Aug 2003 18:51:19 +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 46628-06 for ; Fri, 29 Aug 2003 15:51:10 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 9CF12D1B574 for ; Fri, 29 Aug 2003 15:51:08 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19soKz-0007Tx-00 for ; Fri, 29 Aug 2003 14:51:09 -0400 Received: by dba2 (Postfix, from userid 1019) id C580ED0BD; Fri, 29 Aug 2003 14:51:09 -0400 (EDT) Date: Fri, 29 Aug 2003 14:51:09 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: sourcecode for newly release eRServer? Message-ID: <20030829185109.GD20165@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <20030829131935.474f78f2.gry@ll.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030829131935.474f78f2.gry@ll.mit.edu> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/511 X-Sequence-Number: 3327 On Fri, Aug 29, 2003 at 01:19:35PM -0400, george young wrote: > Does anyone know how and when the actual release will happen? See the erserver project on gborg. It's out. There's a list, too; any problems, send 'em there. A ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From pgsql-performance-owner@postgresql.org Fri Aug 29 18:00: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 ED95DD1B8A9 for ; Fri, 29 Aug 2003 21:00: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 58878-10 for ; Fri, 29 Aug 2003 17:59:51 -0300 (ADT) Received: from host2.hostseguro.com (unknown [200.198.188.133]) by svr1.postgresql.org (Postfix) with ESMTP id 863CED1B8EE for ; Fri, 29 Aug 2003 17:59:47 -0300 (ADT) Received: from cpanel by host2.hostseguro.com with local (Exim 4.20) id 19sqL1-0008EW-Np for pgsql-performance@postgresql.org; Fri, 29 Aug 2003 17:59:19 -0300 Received: from 200.180.189.138 ([200.180.189.138]) by sistemica.info (IMP) with HTTP for ; Fri, 29 Aug 2003 17:59:19 -0300 Message-ID: <1062190759.3f4fbea7aae8c@sistemica.info> Date: Fri, 29 Aug 2003 17:59:19 -0300 From: Rhaoni Chiu Pereira To: PostgreSQL Performance Subject: SQL performance problems MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-MOQ10621907597c83580e1a1a0b1ef30a4fe538606e93" User-Agent: Internet Messaging Program (IMP) 3.2.1 X-Originating-IP: 200.180.189.138 X-MailScanner-Information: Verificado pelo McAfee VirusScan / Scanned by McAfee VirusScan X-MailScanner: Nao infectado / Found to be clean X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host2.hostseguro.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [32001 32001] / [47 12] X-AntiAbuse: Sender Address Domain - sistemica.info X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/512 X-Sequence-Number: 3328 This message is in MIME format. ---MOQ10621907597c83580e1a1a0b1ef30a4fe538606e93 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Hi List, I still have performance problems with this sql: SELECT /*+ */ ftnfco00.estado_cliente , ftcofi00.grupo_faturamento , SUM( DECODE( ftcofi00.atual_fatura, '-', -(NVL(ftnfpr00.qtde_duzias,0)), '+', NVL(ftnfpr00.qtde_duzias,0), 0) ) , SUM( DECODE( ftcofi00.atual_fatura, '-', -(NVL(ftnfpr00.vlr_liquido,0)), '+', NVL(ftnfpr00.vlr_liquido,0), 0) ) , ftprod00.tipo_cadastro||ftprod00.codigo_produto , ftprod00.descricao_produto , DIVIDE( SUM( DECODE( ftcofi00.atual_fatura, '-', -(NVL(ftnfpr00.vlr_liquido,0)), '+', NVL(ftnfpr00.vlr_liquido,0), 0)*ftnfpr00.margem_comercial ), SUM( DECODE( ftcofi00.atual_fatura, '-', -(NVL(ftnfpr00.vlr_liquido,0)), '+', NVL(ftnfpr00.vlr_liquido,0), 0)) ) , SUM( DECODE( ftcofi00.nf_prodgratis, 'S', NVL(ftnfpr00.qtde_duzias,0), 0 ) ) , SUM( DECODE( ftcofi00.nf_prodgratis, 'S', NVL(ftnfpr00.vlr_liquido,0), 0 ) ) FROM ftprod00 , ftnfco00 , ftcgma00 , ftcgca00 , ftspro00 , ftclcr00 , gsames00 , ftcofi00 , ftrepr00 , gsesta00 , ftsupv00 , ftgrep00 , ftclgr00 , ftband00 , fttcli00 , ftredc00 , ftnfpr00 WHERE ftnfco00.emp = 909 AND ftnfpr00.fil IN ('101') AND ftnfco00.situacao_nf = 'N' AND TO_CHAR(ftnfco00.data_emissao,'YYYYMM') >= '200208' AND TO_CHAR(ftnfco00.data_emissao,'YYYYMM') <= '200303' AND ftcofi00.grupo_faturamento >= '01' AND (ftcofi00.atual_fatura IN ('+','-') OR ftcofi00.nf_prodgratis = 'S') AND ftcgma00.emp = ftprod00.emp AND ftcgma00.fil = ftprod00.fil AND ftcgma00.codigo = ftprod00.cla_marca AND ftcgca00.emp = ftprod00.emp AND ftcgca00.fil = ftprod00.fil AND ftcgca00.codigo = ftprod00.cla_categoria AND ftspro00.emp = ftprod00.emp AND ftspro00.fil = ftprod00.fil AND ftspro00.codigo = ftprod00.situacao AND ftclcr00.emp = ftnfco00.emp AND ftclcr00.fil = ftnfco00.empfil AND ftclcr00.tipo_cadastro = ftnfco00.tipo_cad_clicre AND ftclcr00.codigo = ftnfco00.cod_cliente AND gsames00.ano_mes = TO_CHAR(ftnfco00.data_emissao,'YYYYMM') AND ftcofi00.emp = ftnfco00.emp AND ftcofi00.fil = ftnfco00.empfil AND ftcofi00.codigo_fiscal = ftnfco00.cod_fiscal AND ftrepr00.emp = ftnfco00.emp AND ftrepr00.fil = ftnfco00.empfil AND ftrepr00.codigo_repr = ftnfco00.cod_repres AND gsesta00.estado_sigla = ftnfco00.estado_cliente AND ftsupv00.emp = ftrepr00.emp AND ftsupv00.fil = ftrepr00.fil AND ftsupv00.codigo_supervisor = ftrepr00.codigo_supervisor AND ftgrep00.emp = ftrepr00.emp AND ftgrep00.fil = ftrepr00.fil AND ftgrep00.codigo_grupo_rep = ftrepr00.codigo_grupo_rep AND ftclgr00.emp = ftclcr00.emp AND ftclgr00.fil = ftclcr00.fil AND ftclgr00.codigo = ftclcr00.codigo_grupo_cliente AND ftband00.emp = ftclcr00.emp AND ftband00.fil = ftclcr00.fil AND ftband00.codigo = ftclcr00.bandeira_cliente AND fttcli00.emp = ftclcr00.emp AND fttcli00.fil = ftclcr00.fil AND fttcli00.cod_tipocliente = ftclcr00.codigo_tipo_cliente AND ftredc00.emp = ftclcr00.emp AND ftredc00.fil = ftclcr00.fil AND ftredc00.tipo_contribuinte = ftclcr00.tipo_contribuinte AND ftredc00.codigo_rede = ftclcr00.codigo_rede AND gsesta00.estado_sigla = ftclcr00.emp_estado AND ftnfco00.emp = ftnfpr00.emp AND ftnfco00.fil = ftnfpr00.fil AND ftnfco00.nota_fiscal = ftnfpr00.nota_fiscal AND ftnfco00.serie = ftnfpr00.serie AND ftnfco00.data_emissao = ftnfpr00.data_emissao AND ftprod00.emp = ftnfpr00.emp AND ftprod00.fil = ftnfpr00.empfil AND ftprod00.tipo_cadastro = ftnfpr00.tipo_cad_promat AND ftprod00.codigo_produto= ftnfpr00.cod_produto GROUP BY ftnfco00.estado_cliente , ftcofi00.grupo_faturamento , ftprod00.tipo_cadastro||ftprod00.codigo_produto , ftprod00.descricao_produto I have created some oracle function in the database 'cuz I want the same alication to use both Oracle or PostgreSQL without changing any source. atached follow tha explain analyze for this query and my postgresql.conf. I still searching a way to make it faster. I've tried to change a lot of variables values like sort_mem, effective_cache_size, fsync, ... I change the machine box from a Pentium III 1Ghz with 256 RAM to a P4 1.7 with 512 RAM DDR. I don't know what else to do ! Atenciosamente, Rhaoni Chiu Pereira Sist�mica Computadores Visite-nos na Web: http://sistemica.info Fone/Fax : +55 51 3328 1122 ---MOQ10621907597c83580e1a1a0b1ef30a4fe538606e93 Content-Type: application/octet-stream; name="postgresql.conf" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="postgresql.conf" IwojIFBvc3RncmVTUUwgY29uZmlndXJhdGlvbiBmaWxlCiMgLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0KIwojIFRoaXMgZmlsZSBjb25zaXN0cyBv ZiBsaW5lcyBvZiB0aGUgZm9ybToKIwojICAgbmFtZSA9IHZhbHVlCiMKIyAo VGhlICc9JyBpcyBvcHRpb25hbC4pIFdoaXRlIHNwYWNlIG1heSBiZSB1c2Vk LiBDb21tZW50cyBhcmUgaW50cm9kdWNlZAojIHdpdGggJyMnIGFueXdoZXJl IG9uIGEgbGluZS4gVGhlIGNvbXBsZXRlIGxpc3Qgb2Ygb3B0aW9uIG5hbWVz IGFuZAojIGFsbG93ZWQgdmFsdWVzIGNhbiBiZSBmb3VuZCBpbiB0aGUgUG9z dGdyZVNRTCBkb2N1bWVudGF0aW9uLiBUaGUKIyBjb21tZW50ZWQtb3V0IHNl dHRpbmdzIHNob3duIGluIHRoaXMgZmlsZSByZXByZXNlbnQgdGhlIGRlZmF1 bHQgdmFsdWVzLgojCiMgQW55IG9wdGlvbiBjYW4gYWxzbyBiZSBnaXZlbiBh cyBhIGNvbW1hbmQgbGluZSBzd2l0Y2ggdG8gdGhlCiMgcG9zdG1hc3Rlciwg ZS5nLiAncG9zdG1hc3RlciAtYyBsb2dfY29ubmVjdGlvbnM9b24nLiBTb21l IG9wdGlvbnMKIyBjYW4gYmUgY2hhbmdlZCBhdCBydW4tdGltZSB3aXRoIHRo ZSAnU0VUJyBTUUwgY29tbWFuZC4KIwojIFRoaXMgZmlsZSBpcyByZWFkIG9u IHBvc3RtYXN0ZXIgc3RhcnR1cCBhbmQgd2hlbiB0aGUgcG9zdG1hc3Rlcgoj IHJlY2VpdmVzIGEgU0lHSFVQLiBJZiB5b3UgZWRpdCB0aGUgZmlsZSBvbiBh IHJ1bm5pbmcgc3lzdGVtLCB5b3UgaGF2ZSAKIyB0byBTSUdIVVAgdGhlIHBv c3RtYXN0ZXIgZm9yIHRoZSBjaGFuZ2VzIHRvIHRha2UgZWZmZWN0LCBvciB1 c2UgCiMgInBnX2N0bCByZWxvYWQiLgoKCiM9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT0KCgojCiMJQ29ubmVjdGlvbiBQYXJhbWV0ZXJzCiMKdGNwaXBf c29ja2V0ID0gdHJ1ZQojc3NsID0gZmFsc2UKCm1heF9jb25uZWN0aW9ucyA9 IDMyCiNzdXBlcnVzZXJfcmVzZXJ2ZWRfY29ubmVjdGlvbnMgPSAyCgpwb3J0 ID0gNTQzMiAKI2hvc3RuYW1lX2xvb2t1cCA9IGZhbHNlCiNzaG93X3NvdXJj ZV9wb3J0ID0gZmFsc2UKCiN1bml4X3NvY2tldF9kaXJlY3RvcnkgPSAnJwoj dW5peF9zb2NrZXRfZ3JvdXAgPSAnJwojdW5peF9zb2NrZXRfcGVybWlzc2lv bnMgPSAwNzc3CSMgb2N0YWwKCiN2aXJ0dWFsX2hvc3QgPSAnJwoKI2tyYl9z ZXJ2ZXJfa2V5ZmlsZSA9ICcnCgoKIwojCVNoYXJlZCBNZW1vcnkgU2l6ZQoj CnNoYXJlZF9idWZmZXJzID0gODAwMAkJIyBtaW4gbWF4X2Nvbm5lY3Rpb25z KjIgb3IgMTYsIDhLQiBlYWNoCiNtYXhfZnNtX3JlbGF0aW9ucyA9IDEwMDAJ IyBtaW4gMTAsIGZzbSBpcyBmcmVlIHNwYWNlIG1hcCwgfjQwIGJ5dGVzCiNt YXhfZnNtX3BhZ2VzID0gMTAwMDAJCSMgbWluIDEwMDAsIGZzbSBpcyBmcmVl IHNwYWNlIG1hcCwgfjYgYnl0ZXMKI21heF9sb2Nrc19wZXJfdHJhbnNhY3Rp b24gPSA2NAkjIG1pbiAxMAojd2FsX2J1ZmZlcnMgPSA4CQkjIG1pbiA0LCB0 eXBpY2FsbHkgOEtCIGVhY2gKCiMKIwlOb24tc2hhcmVkIE1lbW9yeSBTaXpl cwojCnNvcnRfbWVtID0gODAwMCAgCQkjIG1pbiA2NCwgc2l6ZSBpbiBLQgoj dmFjdXVtX21lbSA9IDgxOTIJCSMgbWluIDEwMjQsIHNpemUgaW4gS0IKCgoj CiMJV3JpdGUtYWhlYWQgbG9nIChXQUwpCiMKY2hlY2twb2ludF9zZWdtZW50 cyA9IDkgCSMgaW4gbG9nZmlsZSBzZWdtZW50cywgbWluIDEsIDE2TUIgZWFj aAojY2hlY2twb2ludF90aW1lb3V0ID0gMzAwCSMgcmFuZ2UgMzAtMzYwMCwg aW4gc2Vjb25kcwojCiNjb21taXRfZGVsYXkgPSAwCQkjIHJhbmdlIDAtMTAw MDAwLCBpbiBtaWNyb3NlY29uZHMKI2NvbW1pdF9zaWJsaW5ncyA9IDUJCSMg cmFuZ2UgMS0xMDAwCiMKI2ZzeW5jID0gZmFsc2UKI3dhbF9zeW5jX21ldGhv ZCA9IGZzeW5jCSMgdGhlIGRlZmF1bHQgdmFyaWVzIGFjcm9zcyBwbGF0Zm9y bXM6CiMJCQkJIyBmc3luYywgZmRhdGFzeW5jLCBvcGVuX3N5bmMsIG9yIG9w ZW5fZGF0YXN5bmMKI3dhbF9kZWJ1ZyA9IDAJCQkjIHJhbmdlIDAtMTYKCgoj CiMJT3B0aW1pemVyIFBhcmFtZXRlcnMKIwplbmFibGVfc2Vxc2NhbiA9IGZh bHNlCmVuYWJsZV9pbmRleHNjYW4gPSB0cnVlCmVuYWJsZV90aWRzY2FuID0g dHJ1ZQplbmFibGVfc29ydCA9IHRydWUKZW5hYmxlX25lc3Rsb29wID0gdHJ1 ZQplbmFibGVfbWVyZ2Vqb2luID0gdHJ1ZQplbmFibGVfaGFzaGpvaW4gPSB0 cnVlCgplZmZlY3RpdmVfY2FjaGVfc2l6ZSA9IDE2MDAwCSMgdHlwaWNhbGx5 IDhLQiBlYWNoCiNyYW5kb21fcGFnZV9jb3N0ID0gNAkJIyB1bml0cyBhcmUg b25lIHNlcXVlbnRpYWwgcGFnZSBmZXRjaCBjb3N0CiNjcHVfdHVwbGVfY29z dCA9IDAuMDEJCSMgKHNhbWUpCiNjcHVfaW5kZXhfdHVwbGVfY29zdCA9IDAu MDAxCSMgKHNhbWUpCiNjcHVfb3BlcmF0b3JfY29zdCA9IDAuMDAyNQkjIChz YW1lKQoKZGVmYXVsdF9zdGF0aXN0aWNzX3RhcmdldCA9IDc1MAkjIHJhbmdl IDEtMTAwMAoKIwojCUdFUU8gT3B0aW1pemVyIFBhcmFtZXRlcnMKIwojZ2Vx byA9IHRydWUKI2dlcW9fc2VsZWN0aW9uX2JpYXMgPSAyLjAJIyByYW5nZSAx LjUtMi4wCiNnZXFvX3RocmVzaG9sZCA9IDExCiNnZXFvX3Bvb2xfc2l6ZSA9 IDAJCSMgZGVmYXVsdCBiYXNlZCBvbiB0YWJsZXMgaW4gc3RhdGVtZW50LCAK CQkJCSMgcmFuZ2UgMTI4LTEwMjQKI2dlcW9fZWZmb3J0ID0gMQojZ2Vxb19n ZW5lcmF0aW9ucyA9IDAKI2dlcW9fcmFuZG9tX3NlZWQgPSAtMQkJIyBhdXRv LWNvbXB1dGUgc2VlZAoKCiMKIwlNZXNzYWdlIGRpc3BsYXkKIwojc2VydmVy X21pbl9tZXNzYWdlcyA9IG5vdGljZQkjIFZhbHVlcywgaW4gb3JkZXIgb2Yg ZGVjcmVhc2luZyBkZXRhaWw6CgkJCQkjICAgZGVidWc1LCBkZWJ1ZzQsIGRl YnVnMywgZGVidWcyLCBkZWJ1ZzEsCgkJCQkjICAgaW5mbywgbm90aWNlLCB3 YXJuaW5nLCBlcnJvciwgbG9nLCBmYXRhbCwKCQkJCSMgICBwYW5pYwojY2xp ZW50X21pbl9tZXNzYWdlcyA9IG5vdGljZQkjIFZhbHVlcywgaW4gb3JkZXIg b2YgZGVjcmVhc2luZyBkZXRhaWw6CgkJCQkjICAgZGVidWc1LCBkZWJ1ZzQs IGRlYnVnMywgZGVidWcyLCBkZWJ1ZzEsCgkJCQkjICAgbG9nLCBpbmZvLCBu b3RpY2UsIHdhcm5pbmcsIGVycm9yCiNzaWxlbnRfbW9kZSA9IGZhbHNlCgoj bG9nX2Nvbm5lY3Rpb25zID0gZmFsc2UKI2xvZ19waWQgPSBmYWxzZQojbG9n X3N0YXRlbWVudCA9IGZhbHNlCiNsb2dfZHVyYXRpb24gPSBmYWxzZQpsb2df dGltZXN0YW1wID0gdHJ1ZQoKI2xvZ19taW5fZXJyb3Jfc3RhdGVtZW50ID0g ZXJyb3IgIyBWYWx1ZXMgaW4gb3JkZXIgb2YgaW5jcmVhc2luZyBzZXZlcml0 eToKCQkJCSAjICAgZGVidWc1LCBkZWJ1ZzQsIGRlYnVnMywgZGVidWcyLCBk ZWJ1ZzEsCgkJCQkgIyAgIGluZm8sIG5vdGljZSwgd2FybmluZywgZXJyb3Is IHBhbmljKG9mZikKCiNkZWJ1Z19wcmludF9wYXJzZSA9IGZhbHNlCiNkZWJ1 Z19wcmludF9yZXdyaXR0ZW4gPSBmYWxzZQojZGVidWdfcHJpbnRfcGxhbiA9 IGZhbHNlCiNkZWJ1Z19wcmV0dHlfcHJpbnQgPSBmYWxzZQoKI2V4cGxhaW5f cHJldHR5X3ByaW50ID0gdHJ1ZQoKIyByZXF1aXJlcyBVU0VfQVNTRVJUX0NI RUNLSU5HCiNkZWJ1Z19hc3NlcnRpb25zID0gdHJ1ZQoKCiMKIwlTeXNsb2cK Iwojc3lzbG9nID0gMAkJCSMgcmFuZ2UgMC0yCiNzeXNsb2dfZmFjaWxpdHkg PSAnTE9DQUwwJwojc3lzbG9nX2lkZW50ID0gJ3Bvc3RncmVzJwoKCiMKIwlT dGF0aXN0aWNzCiMKI3Nob3dfcGFyc2VyX3N0YXRzID0gZmFsc2UKI3Nob3df cGxhbm5lcl9zdGF0cyA9IGZhbHNlCiNzaG93X2V4ZWN1dG9yX3N0YXRzID0g ZmFsc2UKI3Nob3dfc3RhdGVtZW50X3N0YXRzID0gZmFsc2UKCiMgcmVxdWly ZXMgQlRSRUVfQlVJTERfU1RBVFMKI3Nob3dfYnRyZWVfYnVpbGRfc3RhdHMg PSBmYWxzZQoKCiMKIwlBY2Nlc3Mgc3RhdGlzdGljcyBjb2xsZWN0aW9uCiMK I3N0YXRzX3N0YXJ0X2NvbGxlY3RvciA9IHRydWUKI3N0YXRzX3Jlc2V0X29u X3NlcnZlcl9zdGFydCA9IHRydWUKI3N0YXRzX2NvbW1hbmRfc3RyaW5nID0g ZmFsc2UKI3N0YXRzX3Jvd19sZXZlbCA9IGZhbHNlCiNzdGF0c19ibG9ja19s ZXZlbCA9IGZhbHNlCgoKIwojCUxvY2sgVHJhY2luZwojCiN0cmFjZV9ub3Rp ZnkgPSBmYWxzZQoKIyByZXF1aXJlcyBMT0NLX0RFQlVHCiN0cmFjZV9sb2Nr cyA9IGZhbHNlCiN0cmFjZV91c2VybG9ja3MgPSBmYWxzZQojdHJhY2VfbHds b2NrcyA9IGZhbHNlCiNkZWJ1Z19kZWFkbG9ja3MgPSBmYWxzZQojdHJhY2Vf bG9ja19vaWRtaW4gPSAxNjM4NAojdHJhY2VfbG9ja190YWJsZSA9IDAKCgoj CiMJTWlzYwojCiNhdXRvY29tbWl0ID0gdHJ1ZQojZHluYW1pY19saWJyYXJ5 X3BhdGggPSAnJGxpYmRpcicKc2VhcmNoX3BhdGggPSAndmVuZGFzJwojZGF0 ZXN0eWxlID0gJ2lzbywgdXMnCiN0aW1lem9uZSA9IHVua25vd24JCSMgYWN0 dWFsbHksIGRlZmF1bHRzIHRvIFRaIGVudmlyb25tZW50IHNldHRpbmcKI2F1 c3RyYWxpYW5fdGltZXpvbmVzID0gZmFsc2UKI2NsaWVudF9lbmNvZGluZyA9 IHNxbF9hc2NpaQkjIGFjdHVhbGx5LCBkZWZhdWx0cyB0byBkYXRhYmFzZSBl bmNvZGluZwojYXV0aGVudGljYXRpb25fdGltZW91dCA9IDYwCSMgMS02MDAs IGluIHNlY29uZHMKI2RlYWRsb2NrX3RpbWVvdXQgPSAxMDAwCSMgaW4gbWls bGlzZWNvbmRzCiNkZWZhdWx0X3RyYW5zYWN0aW9uX2lzb2xhdGlvbiA9ICdy ZWFkIGNvbW1pdHRlZCcKI21heF9leHByX2RlcHRoID0gMTAwMDAJCSMgbWlu IDEwCiNtYXhfZmlsZXNfcGVyX3Byb2Nlc3MgPSAxMDAwCSMgbWluIDI1CiNw YXNzd29yZF9lbmNyeXB0aW9uID0gdHJ1ZQojc3FsX2luaGVyaXRhbmNlID0g dHJ1ZQojdHJhbnNmb3JtX251bGxfZXF1YWxzID0gZmFsc2UKI3N0YXRlbWVu dF90aW1lb3V0ID0gMAkJIyAwIGlzIGRpc2FibGVkLCBpbiBtaWxsaXNlY29u ZHMKI2RiX3VzZXJfbmFtZXNwYWNlID0gZmFsc2UKIAoKCiMKIwlMb2NhbGUg c2V0dGluZ3MKIwojIChpbml0aWFsaXplZCBieSBpbml0ZGIgLS0gbWF5IGJl IGNoYW5nZWQpCkxDX01FU1NBR0VTID0gJ2VuX1VTLlVURi04JwpMQ19NT05F VEFSWSA9ICdlbl9VUy5VVEYtOCcKTENfTlVNRVJJQyA9ICdlbl9VUy5VVEYt OCcKTENfVElNRSA9ICdlbl9VUy5VVEYtOCcK ---MOQ10621907597c83580e1a1a0b1ef30a4fe538606e93 Content-Type: application/octet-stream; name="explain2.sql" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="explain2.sql" ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUVVFUlkgUExBTiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tCiBBZ2dyZWdhdGUgIChjb3N0PTEwMDAyNjMy OC45OC4uMTAwMDI2MzI5LjAxIHJvd3M9MSB3aWR0aD04MTgpIChhY3R1YWwg dGltZT0xMDYwOTIuNDguLjExMjIzOC44MCByb3dzPTM3NiBsb29wcz0xKQog ICAtPiAgR3JvdXAgIChjb3N0PTEwMDAyNjMyOC45OC4uMTAwMDI2MzI4Ljk5 IHJvd3M9MSB3aWR0aD04MTgpIChhY3R1YWwgdGltZT0xMDYwNTAuMDYuLjEw NjY2MS44MiByb3dzPTI0MjI2IGxvb3BzPTEpCiAgICAgICAgIC0+ICBTb3J0 ICAoY29zdD0xMDAwMjYzMjguOTguLjEwMDAyNjMyOC45OCByb3dzPTEgd2lk dGg9ODE4KSAoYWN0dWFsIHRpbWU9MTA2MDUwLjAzLi4xMDYwOTQuOTkgcm93 cz0yNDIyNiBsb29wcz0xKQogICAgICAgICAgICAgICBTb3J0IEtleTogZnRu ZmNvMDAuZXN0YWRvX2NsaWVudGUsIGZ0Y29maTAwLmdydXBvX2ZhdHVyYW1l bnRvLCAoKGZ0cHJvZDAwLnRpcG9fY2FkYXN0cm8pOjp0ZXh0IHx8IChmdHBy b2QwMC5jb2RpZ29fcHJvZHV0byk6OnRleHQpLCBmdHByb2QwMC5kZXNjcmlj YW9fcHJvZHV0bwogICAgICAgICAgICAgICAtPiAgTmVzdGVkIExvb3AgIChj b3N0PTEwMDAyNTczNS41MS4uMTAwMDI2MzI4Ljk3IHJvd3M9MSB3aWR0aD04 MTgpIChhY3R1YWwgdGltZT05NDk3OS43Mi4uMTA0MDMzLjc4IHJvd3M9MjQy MjYgbG9vcHM9MSkKICAgICAgICAgICAgICAgICAgICAgSm9pbiBGaWx0ZXI6 ICgoImlubmVyIi5maWwgPSAib3V0ZXIiLmZpbCkgQU5EICgiaW5uZXIiLmVt cCA9ICJvdXRlciIuZW1wKSkKICAgICAgICAgICAgICAgICAgICAgLT4gIE5l c3RlZCBMb29wICAoY29zdD0xMDAwMjU3MzUuNTEuLjEwMDAyNjMyNC40NSBy b3dzPTEgd2lkdGg9NzkxKSAoYWN0dWFsIHRpbWU9OTQ5NzEuMDAuLjEwMjQ2 OS4yNiByb3dzPTI0MjI2IGxvb3BzPTEpCiAgICAgICAgICAgICAgICAgICAg ICAgICAgIEpvaW4gRmlsdGVyOiAoKCJpbm5lciIuZW1wID0gIm91dGVyIi5l bXApIEFORCAoImlubmVyIi5maWwgPSAib3V0ZXIiLmVtcGZpbCkgQU5EICgi aW5uZXIiLmNvZGlnb19zdXBlcnZpc29yID0gIm91dGVyIi5jb2RpZ29fc3Vw ZXJ2aXNvcikpCiAgICAgICAgICAgICAgICAgICAgICAgICAgIC0+ICBOZXN0 ZWQgTG9vcCAgKGNvc3Q9MTAwMDI1NzM1LjUxLi4xMDAwMjYzMTkuNzYgcm93 cz0xIHdpZHRoPTc1OSkgKGFjdHVhbCB0aW1lPTk0OTYyLjM2Li45OTk5MS43 NCByb3dzPTI0MjI2IGxvb3BzPTEpCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIEpvaW4gRmlsdGVyOiAoImlubmVyIi5lc3RhZG9fc2lnbGEg PSAib3V0ZXIiLmVzdGFkb19jbGllbnRlKQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAtPiAgTmVzdGVkIExvb3AgIChjb3N0PTEwMDAyNTcz NS41MS4uMTAwMDI2MzE2LjE5IHJvd3M9MSB3aWR0aD03NTMpIChhY3R1YWwg dGltZT05NDk0Ni40My4uOTcxNTcuOTYgcm93cz0yNDIyNiBsb29wcz0xKQog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKb2luIEZp bHRlcjogKCgiaW5uZXIiLmZpbCA9ICJvdXRlciIuZmlsKSBBTkQgKCJpbm5l ciIuZW1wID0gIm91dGVyIi5lbXApIEFORCAoIm91dGVyIi5jb2RpZ28gPSAi aW5uZXIiLmNsYV9tYXJjYSkpCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIC0+ICBJbmRleCBTY2FuIHVzaW5nIGZ0Y2dtYTAwX3Br ZXkgb24gZnRjZ21hMDAgIChjb3N0PTAuMDAuLjQuNjggcm93cz0xIHdpZHRo PTMyKSAoYWN0dWFsIHRpbWU9NC4wMC4uNC4wMSByb3dzPTEgbG9vcHM9MSkK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLT4gIE1h dGVyaWFsaXplICAoY29zdD0xMDAwMjYzMTEuNTAuLjEwMDAyNjMxMS41MCBy b3dzPTEgd2lkdGg9NzIxKSAoYWN0dWFsIHRpbWU9OTQ5NDIuMjkuLjk1MTAz LjA2IHJvd3M9MjQyMjYgbG9vcHM9MSkKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLT4gIE5lc3RlZCBMb29wICAoY29z dD0xMDAwMjU3MzUuNTEuLjEwMDAyNjMxMS41MCByb3dzPTEgd2lkdGg9NzIx KSAoYWN0dWFsIHRpbWU9ODM1NzIuNDIuLjk0NjQ0LjUxIHJvd3M9MjQyMjYg bG9vcHM9MSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgSm9pbiBGaWx0ZXI6ICgoIm91dGVyIi5lbXAgPSAi aW5uZXIiLmVtcCkgQU5EICgib3V0ZXIiLmZpbCA9ICJpbm5lciIuZmlsKSBB TkQgKCJvdXRlciIuY29kaWdvID0gImlubmVyIi5jbGFfY2F0ZWdvcmlhKSkK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLT4gIE5lc3RlZCBMb29wICAoY29zdD0xMDAwMjU3MzUuNTEuLjEw MDAyNjMwNS43MyByb3dzPTEgd2lkdGg9NjMxKSAoYWN0dWFsIHRpbWU9ODM1 NjUuNDUuLjkxMzkyLjc0IHJvd3M9MjQyMjYgbG9vcHM9MSkKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgSm9pbiBGaWx0ZXI6ICgoImlubmVyIi5lbXAgPSAib3V0ZXIiLmVtcCkg QU5EICgib3V0ZXIiLmNvZGlnb19ncnVwb19yZXAgPSAiaW5uZXIiLmNvZGln b19ncnVwb19yZXApKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAgTmVzdGVkIExvb3AgIChj b3N0PTEwMDAyNTczNS41MS4uMTAwMDI2MzAwLjMwIHJvd3M9MSB3aWR0aD01 NzgpIChhY3R1YWwgdGltZT04MzU1OC4xMi4uODg4MTcuNTMgcm93cz0yNDIy NiBsb29wcz0xKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKb2luIEZpbHRlcjogKCgi aW5uZXIiLmVtcCA9ICJvdXRlciIuZW1wKSBBTkQgKCJpbm5lciIuZmlsID0g Im91dGVyIi5lbXBmaWwpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAgTmVzdGVk IExvb3AgIChjb3N0PTEwMDAyNTczNS41MS4uMTAwMDI2Mjk1Ljc5IHJvd3M9 MSB3aWR0aD01NDUpIChhY3R1YWwgdGltZT04MzU1MS44OC4uODY1OTcuMjEg cm93cz0yNDIyNiBsb29wcz0xKQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBK b2luIEZpbHRlcjogKCgiaW5uZXIiLmVtcCA9ICJvdXRlciIuZW1wKSBBTkQg KCJpbm5lciIuZmlsID0gIm91dGVyIi5lbXBmaWwpIEFORCAoImlubmVyIi5j b2RpZ28gPSAib3V0ZXIiLmJhbmRlaXJhX2NsaWVudGUpKQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAtPiAgTmVzdGVkIExvb3AgIChjb3N0PTEwMDAyNTcz NS41MS4uMTAwMDI2MjkxLjA5IHJvd3M9MSB3aWR0aD01MTMpIChhY3R1YWwg dGltZT04MzUzOS45Mi4uODQ5MTAuNjggcm93cz0yNDIyNiBsb29wcz0xKQog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKb2luIEZpbHRlcjogKCgi b3V0ZXIiLmVtcCA9ICJpbm5lciIuZW1wKSBBTkQgKCJvdXRlciIuZmlsID0g ImlubmVyIi5lbXBmaWwpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAtPiAgSW5kZXggU2NhbiB1c2luZyBmdGdyZXAwMF9wa2V5IG9uIGZ0Z3Jl cDAwICAoY29zdD0wLjAwLi40LjY4IHJvd3M9MSB3aWR0aD0zMikgKGFjdHVh bCB0aW1lPTYuOTAuLjYuOTEgcm93cz0xIGxvb3BzPTEpCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIC0+ICBNYXRlcmlhbGl6ZSAgKGNvc3Q9MTAw MDI2Mjg2LjQwLi4xMDAwMjYyODYuNDAgcm93cz0xIHdpZHRoPTQ4MSkgKGFj dHVhbCB0aW1lPTgzNTMyLjkzLi44MzY4NC42MCByb3dzPTI0MjI2IGxvb3Bz PTEpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0+ICBO ZXN0ZWQgTG9vcCAgKGNvc3Q9MTAwMDI1NzM1LjUxLi4xMDAwMjYyODYuNDAg cm93cz0xIHdpZHRoPTQ4MSkgKGFjdHVhbCB0aW1lPTI0ODcuMjEuLjgzMjgw LjUwIHJvd3M9MjQyMjYgbG9vcHM9MSkKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgSm9pbiBGaWx0ZXI6ICgoImlubmVyIi5h bm9fbWVzKTo6dGV4dCA9IHRvX2NoYXIoIm91dGVyIi5kYXRhX2VtaXNzYW8s ICdZWVlZTU0nOjp0ZXh0KSkKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgLT4gIE5lc3RlZCBMb29wICAoY29zdD0yNTczNS41 MS4uMjYyNzQuMTAgcm93cz0xIHdpZHRoPTQ3MSkgKGFjdHVhbCB0aW1lPTI0 ODUuNzYuLjgyNjYuMDQgcm93cz0yNDIyNiBsb29wcz0xKQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKb2luIEZp bHRlcjogKCgiaW5uZXIiLmVtcGZpbCA9ICJvdXRlciIuZmlsKSBBTkQgKCJp bm5lciIuZW1wID0gIm91dGVyIi5lbXApKQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAgTmVzdGVkIExvb3Ag IChjb3N0PTI1NzM1LjUxLi4yNjIxMy42NyByb3dzPTEwIHdpZHRoPTM1OSkg KGFjdHVhbCB0aW1lPTI0NDkuMDMuLjM2NTYuMDAgcm93cz03NzA1IGxvb3Bz PTEpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIEpvaW4gRmlsdGVyOiAoKCJpbm5lciIuZW1wID0gIm91 dGVyIi5lbXApIEFORCAoImlubmVyIi5maWwgPSAib3V0ZXIiLmVtcGZpbCkp CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC0+ICBOZXN0ZWQgTG9vcCAgKGNvc3Q9MjU3MzUuNTEuLjI2 MTU2LjMxIHJvd3M9MTAgd2lkdGg9MzE5KSAoYWN0dWFsIHRpbWU9MjQxMC4w Mi4uMjY2NC42OCByb3dzPTc3MDUgbG9vcHM9MSkKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Sm9pbiBGaWx0ZXI6ICgoIm91dGVyIi5lbXAgPSAiaW5uZXIiLmVtcCkgQU5E ICgib3V0ZXIiLmZpbCA9ICJpbm5lciIuZW1wZmlsKSBBTkQgKCJvdXRlciIu Y29kaWdvID0gImlubmVyIi5jb2RpZ29fZ3J1cG9fY2xpZW50ZSkpCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC0+ICBJbmRleCBTY2FuIHVzaW5nIGZ0Y2xncjAwX3BrZXkg b24gZnRjbGdyMDAgIChjb3N0PTAuMDAuLjQuNjggcm93cz0xIHdpZHRoPTMy KSAoYWN0dWFsIHRpbWU9OS4yMC4uOS4yMSByb3dzPTEgbG9vcHM9MSkKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLT4gIE1hdGVyaWFsaXplICAoY29zdD0yNjE1MS40Ni4u MjYxNTEuNDYgcm93cz0xMCB3aWR0aD0yODcpIChhY3R1YWwgdGltZT0yNDAw Ljc1Li4yNDE1LjgwIHJvd3M9NzcwNSBsb29wcz0xKQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAtPiAgTmVzdGVkIExvb3AgIChjb3N0PTI1NzM1LjUxLi4yNjE1 MS40NiByb3dzPTEwIHdpZHRoPTI4NykgKGFjdHVhbCB0aW1lPTEzNDkuODku LjIzNjkuMjQgcm93cz03NzA1IGxvb3BzPTEpCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIEpvaW4gRmlsdGVyOiAoKCJpbm5lciIuZW1wID0gIm91dGVy Ii5lbXApIEFORCAoImlubmVyIi5lbXBfZXN0YWRvID0gIm91dGVyIi5lc3Rh ZG9fY2xpZW50ZSkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0+ICBN ZXJnZSBKb2luICAoY29zdD0yNTczNS41MS4uMjU4OTIuNjUgcm93cz00NCB3 aWR0aD0xOTMpIChhY3R1YWwgdGltZT0xMzIyLjM2Li4xNDUyLjk0IHJvd3M9 NzcwNSBsb29wcz0xKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBNZXJnZSBDb25kOiAoKCJvdXRlciIuZW1wID0gImlubmVyIi5lbXApIEFO RCAoIm91dGVyIi5maWwgPSAiaW5uZXIiLmVtcGZpbCkgQU5EICgib3V0ZXIi LmNvZGlnb19maXNjYWwgPSAiaW5uZXIiLmNvZF9maXNjYWwpKQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAgSW5kZXggU2NhbiB1c2lu ZyBmdGNvZmkwMF9wa2V5IG9uIGZ0Y29maTAwICAoY29zdD0wLjAwLi4xNTIu NzMgcm93cz03MiB3aWR0aD01MikgKGFjdHVhbCB0aW1lPTIxLjYwLi4yNy40 NiByb3dzPTY0IGxvb3BzPTEpCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIEZpbHRlcjogKChncnVwb19mYXR1cmFtZW50byA+PSAn MDEnOjpjaGFyYWN0ZXIgdmFyeWluZykgQU5EICgoYXR1YWxfZmF0dXJhID0g JysnOjpjaGFyYWN0ZXIgdmFyeWluZykgT1IgKGF0dWFsX2ZhdHVyYSA9ICct Jzo6Y2hhcmFjdGVyIHZhcnlpbmcpIE9SIChuZl9wcm9kZ3JhdGlzID0gJ1Mn OjpjaGFyYWN0ZXIgdmFyeWluZykpKQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAtPiAgU29ydCAgKGNvc3Q9MjU3MzUuNTEuLjI1NzM2LjI1 IHJvd3M9Mjk0IHdpZHRoPTE0MSkgKGFjdHVhbCB0aW1lPTEyOTguMjIuLjEz MTAuNDQgcm93cz05NDUzIGxvb3BzPTEpCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFNvcnQgS2V5OiBmdG5mY28wMC5lbXAsIGZ0 bmZjbzAwLmVtcGZpbCwgZnRuZmNvMDAuY29kX2Zpc2NhbAogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAgTmVzdGVkIExvb3Ag IChjb3N0PTAuMDAuLjI1NzIzLjQ2IHJvd3M9Mjk0IHdpZHRoPTE0MSkgKGFj dHVhbCB0aW1lPTY1Mi42Mi4uMTA4NS4wOCByb3dzPTk0NTMgbG9vcHM9MSkK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Sm9pbiBGaWx0ZXI6ICgiaW5uZXIiLmVtcCA9ICJvdXRlciIuZW1wKQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAg SW5kZXggU2NhbiB1c2luZyBmdGNnY2EwMF9wa2V5IG9uIGZ0Y2djYTAwICAo Y29zdD0wLjAwLi40LjY4IHJvd3M9MSB3aWR0aD0zMikgKGFjdHVhbCB0aW1l PTIzLjc4Li4yMy43OSByb3dzPTEgbG9vcHM9MSkKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLT4gIEluZGV4IFNjYW4g dXNpbmcgZnRuZmNvMDIgb24gZnRuZmNvMDAgIChjb3N0PTAuMDAuLjI1NzE1 LjExIHJvd3M9Mjk0IHdpZHRoPTEwOSkgKGFjdHVhbCB0aW1lPTYyOC44MC4u OTczLjY5IHJvd3M9OTQ1MyBsb29wcz0xKQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWx0ZXI6ICgoZW1w ID0gOTA5OjpudW1lcmljKSBBTkQgKHNpdHVhY2FvX25mID0gJ04nOjpjaGFy YWN0ZXIgdmFyeWluZykgQU5EICh0b19jaGFyKGRhdGFfZW1pc3NhbywgJ1lZ WVlNTSc6OnRleHQpID49ICcyMDAyMDgnOjp0ZXh0KSBBTkQgKHRvX2NoYXIo ZGF0YV9lbWlzc2FvLCAnWVlZWU1NJzo6dGV4dCkgPD0gJzIwMDMwMyc6OnRl eHQpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAgSW5kZXggU2Nh biB1c2luZyBmdGNsY3IwMF9wa2V5IG9uIGZ0Y2xjcjAwICAoY29zdD0wLjAw Li41LjgzIHJvd3M9MSB3aWR0aD05NCkgKGFjdHVhbCB0aW1lPTAuMDkuLjAu MDkgcm93cz0xIGxvb3BzPTc3MDUpCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIEluZGV4IENvbmQ6ICgoZnRjbGNyMDAuZW1wID0gIm91dGVy Ii5lbXApIEFORCAoZnRjbGNyMDAuZmlsID0gIm91dGVyIi5lbXBmaWwpIEFO RCAoZnRjbGNyMDAudGlwb19jYWRhc3RybyA9ICJvdXRlciIudGlwb19jYWRf Y2xpY3JlKSBBTkQgKGZ0Y2xjcjAwLmNvZGlnbyA9ICJvdXRlciIuY29kX2Ns aWVudGUpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAtPiAgSW5kZXggU2NhbiB1c2luZyBmdHJlZGMw MF9wa2V5IG9uIGZ0cmVkYzAwICAoY29zdD0wLjAwLi41LjgzIHJvd3M9MSB3 aWR0aD00MCkgKGFjdHVhbCB0aW1lPTAuMDkuLjAuMDkgcm93cz0xIGxvb3Bz PTc3MDUpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIEluZGV4IENvbmQ6ICgoZnRyZWRjMDAu ZW1wID0gIm91dGVyIi5lbXApIEFORCAoZnRyZWRjMDAuZmlsID0gIm91dGVy Ii5maWwpIEFORCAoZnRyZWRjMDAudGlwb19jb250cmlidWludGUgPSAib3V0 ZXIiLnRpcG9fY29udHJpYnVpbnRlKSBBTkQgKGZ0cmVkYzAwLmNvZGlnb19y ZWRlID0gIm91dGVyIi5jb2RpZ29fcmVkZSkpCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0+ICBJbmRleCBTY2Fu IHVzaW5nIGZ0bmZwcjAwX3BrZXkgb24gZnRuZnByMDAgIChjb3N0PTAuMDAu LjUuOTUgcm93cz0xIHdpZHRoPTExMikgKGFjdHVhbCB0aW1lPTAuMjIuLjAu NDggcm93cz0zIGxvb3BzPTc3MDUpCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZGV4IENvbmQ6ICgo Im91dGVyIi5lbXAgPSBmdG5mcHIwMC5lbXApIEFORCAoIm91dGVyIi5maWwg PSBmdG5mcHIwMC5maWwpIEFORCAoZnRuZnByMDAuZmlsID0gMTAxOjpudW1l cmljKSBBTkQgKCJvdXRlciIubm90YV9maXNjYWwgPSBmdG5mcHIwMC5ub3Rh X2Zpc2NhbCkgQU5EICgib3V0ZXIiLnNlcmllID0gZnRuZnByMDAuc2VyaWUp IEFORCAoIm91dGVyIi5kYXRhX2VtaXNzYW8gPSBmdG5mcHIwMC5kYXRhX2Vt aXNzYW8pKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAtPiAgU2VxIFNjYW4gb24gZ3NhbWVzMDAgIChjb3N0PTEwMDAwMDAw MC4wMC4uMTAwMDAwMDA2LjcyIHJvd3M9MzcyIHdpZHRoPTEwKSAoYWN0dWFs IHRpbWU9MC4wMS4uMC44OCByb3dzPTM3MiBsb29wcz0yNDIyNikKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLT4gIEluZGV4IFNjYW4gdXNpbmcgZnRiYW5k MDBfcGtleSBvbiBmdGJhbmQwMCAgKGNvc3Q9MC4wMC4uNC42OCByb3dzPTEg d2lkdGg9MzIpIChhY3R1YWwgdGltZT0wLjAxLi4wLjAyIHJvd3M9MSBsb29w cz0yNDIyNikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLT4gIEluZGV4IFNjYW4gdXNp bmcgZnR0Y2xpMDBfcGtleSBvbiBmdHRjbGkwMCAgKGNvc3Q9MC4wMC4uNC41 MCByb3dzPTEgd2lkdGg9MzMpIChhY3R1YWwgdGltZT0wLjAzLi4wLjAzIHJv d3M9MSBsb29wcz0yNDIyNikKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5k ZXggQ29uZDogKChmdHRjbGkwMC5lbXAgPSAib3V0ZXIiLmVtcCkgQU5EIChm dHRjbGkwMC5maWwgPSAib3V0ZXIiLmZpbCkgQU5EIChmdHRjbGkwMC5jb2Rf dGlwb2NsaWVudGUgPSAib3V0ZXIiLmNvZGlnb190aXBvX2NsaWVudGUpKQog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAtPiAgSW5kZXggU2NhbiB1c2luZyBmdHJlcHIwMF9wa2V5 IG9uIGZ0cmVwcjAwICAoY29zdD0wLjAwLi41LjQxIHJvd3M9MSB3aWR0aD01 MykgKGFjdHVhbCB0aW1lPTAuMDQuLjAuMDQgcm93cz0xIGxvb3BzPTI0MjI2 KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBJbmRleCBDb25kOiAoKGZ0cmVwcjAwLmVt cCA9ICJvdXRlciIuZW1wKSBBTkQgKGZ0cmVwcjAwLmZpbCA9ICJvdXRlciIu ZW1wZmlsKSBBTkQgKGZ0cmVwcjAwLmNvZGlnb19yZXByID0gIm91dGVyIi5j b2RfcmVwcmVzKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLT4gIEluZGV4IFNjYW4gdXNpbmcgZnRwcm9k MDBfcGtleSBvbiBmdHByb2QwMCAgKGNvc3Q9MC4wMC4uNS43NCByb3dzPTEg d2lkdGg9OTApIChhY3R1YWwgdGltZT0wLjA2Li4wLjA2IHJvd3M9MSBsb29w cz0yNDIyNikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgSW5kZXggQ29uZDogKChmdHByb2QwMC5l bXAgPSAib3V0ZXIiLmVtcCkgQU5EIChmdHByb2QwMC5maWwgPSAib3V0ZXIi LmVtcGZpbCkgQU5EIChmdHByb2QwMC50aXBvX2NhZGFzdHJvID0gIm91dGVy Ii50aXBvX2NhZF9wcm9tYXQpIEFORCAoZnRwcm9kMDAuY29kaWdvX3Byb2R1 dG8gPSAib3V0ZXIiLmNvZF9wcm9kdXRvKSkKICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgLT4gIEluZGV4IFNjYW4gdXNpbmcgZ3Nlc3RhMDBf cGtleSBvbiBnc2VzdGEwMCAgKGNvc3Q9MC4wMC4uMy41NSByb3dzPTEgd2lk dGg9NikgKGFjdHVhbCB0aW1lPTAuMDMuLjAuMDMgcm93cz0xIGxvb3BzPTI0 MjI2KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJ bmRleCBDb25kOiAoZ3Nlc3RhMDAuZXN0YWRvX3NpZ2xhID0gIm91dGVyIi5l bXBfZXN0YWRvKQogICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAgSW5k ZXggU2NhbiB1c2luZyBmdHN1cHYwMF9wa2V5IG9uIGZ0c3VwdjAwICAoY29z dD0wLjAwLi40LjY4IHJvd3M9MSB3aWR0aD0zMikgKGFjdHVhbCB0aW1lPTAu MDEuLjAuMDIgcm93cz0xIGxvb3BzPTI0MjI2KQogICAgICAgICAgICAgICAg ICAgICAtPiAgSW5kZXggU2NhbiB1c2luZyBmdHNwcm8wMF9wa2V5IG9uIGZ0 c3BybzAwICAoY29zdD0wLjAwLi40LjUwIHJvd3M9MSB3aWR0aD0yNykgKGFj dHVhbCB0aW1lPTAuMDMuLjAuMDMgcm93cz0xIGxvb3BzPTI0MjI2KQogICAg ICAgICAgICAgICAgICAgICAgICAgICBJbmRleCBDb25kOiAoKGZ0c3BybzAw LmVtcCA9ICJvdXRlciIuZW1wKSBBTkQgKGZ0c3BybzAwLmZpbCA9ICJvdXRl ciIuZmlsKSBBTkQgKGZ0c3BybzAwLmNvZGlnbyA9ICJvdXRlciIuc2l0dWFj YW8pKQogVG90YWwgcnVudGltZTogMTEyMjg3LjEwIG1zZWMKKDY5IHJvd3Mp Cgo= ---MOQ10621907597c83580e1a1a0b1ef30a4fe538606e93-- From pgsql-performance-owner@postgresql.org Fri Aug 29 19:04:04 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 36474D1B8B7 for ; Fri, 29 Aug 2003 22:04: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 65832-10 for ; Fri, 29 Aug 2003 19:03:53 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 1EEC7D1B8A4 for ; Fri, 29 Aug 2003 19:03:47 -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 h7TM3njX027515; Fri, 29 Aug 2003 18:03:49 -0400 (EDT) To: Rhaoni Chiu Pereira Cc: PostgreSQL Performance Subject: Re: SQL performance problems In-reply-to: <1062190759.3f4fbea7aae8c@sistemica.info> References: <1062190759.3f4fbea7aae8c@sistemica.info> Comments: In-reply-to Rhaoni Chiu Pereira message dated "Fri, 29 Aug 2003 17:59:19 -0300" Date: Fri, 29 Aug 2003 18:03:48 -0400 Message-ID: <27514.1062194628@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/513 X-Sequence-Number: 3329 Rhaoni Chiu Pereira writes: > I still have performance problems with this sql: It seems odd that all the joins are being done as nestloops. Perhaps you shouldn't be forcing enable_seqscan off? regards, tom lane From pgsql-performance-owner@postgresql.org Fri Aug 29 21:40: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 BB591D1B8B7 for ; Sat, 30 Aug 2003 00:40:45 +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 76762-01 for ; Fri, 29 Aug 2003 21:40:18 -0300 (ADT) Received: from water.oasis.net.au (water.oasis.net.au [210.8.139.2]) by svr1.postgresql.org (Postfix) with ESMTP id AD4ABD1B8A4 for ; Fri, 29 Aug 2003 21:40:12 -0300 (ADT) Received: from oasis.net.au (localhost [127.0.0.1]) by water.oasis.net.au (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id LAA04651; Sat, 30 Aug 2003 11:07:43 +1000 X-Authentication-Warning: water.oasis.net.au: Host localhost [127.0.0.1] claimed to be oasis.net.au From: "Rudi Starcevic" To: "Alexander Priem" , Subject: Re: Indexing question Date: Sat, 30 Aug 2003 11:07:43 +1000 Message-Id: <20030830010743.M18111@oasis.net.au> In-Reply-To: <012f01c36dfa$0f4a8760$b696a8c0@APR> References: <012f01c36dfa$0f4a8760$b696a8c0@APR> X-Mailer: Open WebMail X-OriginatingIP: 203.221.163.92 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/514 X-Sequence-Number: 3330 Hi, > I have some tables (which can get pretty large) in which I want to > record 'current' data as well as 'historical' data. Another solution can be using a trigger and function to record every transaction to a 'logging' table. This way you'll have one 'current' table and one 'historical' table The 'historical' table will contain every transaction recorded from the current table. Regards Rudi. From pgsql-performance-owner@postgresql.org Fri Aug 29 23:33:24 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 452BDD1BA21 for ; Sat, 30 Aug 2003 02:33: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 82197-04 for ; Fri, 29 Aug 2003 23:33:03 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 83C0AD1B8EF for ; Fri, 29 Aug 2003 23:32:58 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7U2WcS11913; Fri, 29 Aug 2003 22:32:38 -0400 (EDT) From: Bruce Momjian Message-Id: <200308300232.h7U2WcS11913@candle.pha.pa.us> Subject: Re: The results of my PostgreSQL/filesystem performance tests In-Reply-To: <082e01c36dd1$3bf1f150$2800a8c0@mars> To: Christopher Kings-Lynne Date: Fri, 29 Aug 2003 22:32:38 -0400 (EDT) Cc: Sean Chittenden , Bill Moran , pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL106 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/515 X-Sequence-Number: 3331 Christopher Kings-Lynne wrote: > > I'm likely going to make this the default for PostgreSQL on FreeBSD > > starting with 7.4 (just posted something to -hackers about this)f. If > > you'd like to do this in your testing, just apply the following patch. > > > > Right now PostgreSQL defaults to 8K blocks, but FreeBSD uses 16K > > blocks which means that currently, reading two blocks of data in PG is > > two read calls to the OS, one reads 16K of data off disk and returns > > the 1st page, the 2nd call pulls the 2nd block from the FS cache. In > > making things 16K, it avoids the need for the 2nd system call which is > > where the performance difference is coming from, afaikt. -sc > > Are you _sure_ this won't cause any atomicity problems? Can FreeBSD write > 16k as an atomic unit? We pre-modified page images to WAL before modifying the page. The disks are only 512-byte blocks, so we don't rely on file system atomicity anymore anyway. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Fri Aug 29 23:35: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 EAF72D1B8EF for ; Sat, 30 Aug 2003 02:34: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 80948-07 for ; Fri, 29 Aug 2003 23:34:48 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 93818D1B8EE for ; Fri, 29 Aug 2003 23:34:43 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7U2YYf12104; Fri, 29 Aug 2003 22:34:34 -0400 (EDT) From: Bruce Momjian Message-Id: <200308300234.h7U2YYf12104@candle.pha.pa.us> Subject: Re: The results of my PostgreSQL/filesystem performance tests In-Reply-To: <001201c36d24$3c572460$0500a8c0@MOBILE01> To: Balazs Wellisch Date: Fri, 29 Aug 2003 22:34:34 -0400 (EDT) Cc: pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL106 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/516 X-Sequence-Number: 3332 Balazs Wellisch wrote: > > Bill, > > Very interesting results. I'd like to command you on your honesty. > Having started out with the intentions of proving that FreeBSD is faster > than Linux only to find that the opposite is true must not have been > rewarding for you. However, these unexpected results serve only to > reinforce the integrity of your tests. Looking at the results, ext2 is out because it isn't crash safe, and I have heard Reiser uses a lot more CPU to do its work. It does show ext3 as slow, which was expected. Interesting how JFS came out, and XFS would be interesting. And, of course, it is multiple backends that really shows PostgreSQL off, so it could radically affect the results. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Fri Aug 29 23:45:03 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 B7874D1B8EE for ; Sat, 30 Aug 2003 02:44:28 +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 83609-04 for ; Fri, 29 Aug 2003 23:44:20 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 23DF9D1B8BD for ; Fri, 29 Aug 2003 23:44:15 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7U2i4S12751; Fri, 29 Aug 2003 22:44:04 -0400 (EDT) From: Bruce Momjian Message-Id: <200308300244.h7U2i4S12751@candle.pha.pa.us> Subject: Re: Hardware recommendations to scale to silly load In-Reply-To: <1062058639.15800.247.camel@gibraltar.mattclark.net> To: matt Date: Fri, 29 Aug 2003 22:44:04 -0400 (EDT) Cc: Ron Johnson , PgSQL Performance ML X-Mailer: ELM [version 2.4ME+ PL106 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/517 X-Sequence-Number: 3333 matt wrote: > > Are you *sure* about that???? 3K updates/inserts per second xlates > > to 10,800,000 per hour. That, my friend, is a WHOLE HECK OF A LOT! > > Yup, I know! Just a data point, but on my Dual Xeon 2.4Gig machine with a 10k SCSI drive I can do 4k inserts/second if I turn fsync off. If you have a battery-backed controller, you should be able to do the same. (You will not need to turn fsync off --- fsync will just be fast because of the disk drive RAM). Am I missing something? -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Fri Aug 29 23:49: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 16D99D1B8FC for ; Sat, 30 Aug 2003 02:49:31 +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 85323-03 for ; Fri, 29 Aug 2003 23:49:04 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 5D902D1B897 for ; Fri, 29 Aug 2003 23:48:59 -0300 (ADT) Received: (qmail 30723 invoked by uid 500); 30 Aug 2003 02:55:03 -0000 Date: Fri, 29 Aug 2003 21:55:03 -0500 From: Bruno Wolff III To: Ken Geis Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates Message-ID: <20030830025503.GA30691@wolff.to> Mail-Followup-To: Ken Geis , pgsql-performance@postgresql.org References: <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4ED1DC.50808@speakeasy.org> <20030829042453.GA5931@wolff.to> <3F4F0777.8090503@speakeasy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F4F0777.8090503@speakeasy.org> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/518 X-Sequence-Number: 3334 I haven't come up with any great ideas for this one. It might be interesting to compare the explain analyze output from the distinct on query with and without seqscans enabled. From pgsql-performance-owner@postgresql.org Sat Aug 30 01:25:33 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 F1E05D1B8B1 for ; Sat, 30 Aug 2003 04:25: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 97409-02 for ; Sat, 30 Aug 2003 01:25:17 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 75035D1B8D2 for ; Sat, 30 Aug 2003 01:25:15 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7U4PFK23474; Sat, 30 Aug 2003 00:25:15 -0400 (EDT) From: Bruce Momjian Message-Id: <200308300425.h7U4PFK23474@candle.pha.pa.us> Subject: Re: Tests In-Reply-To: <001301c36d24$b6ab8490$0500a8c0@MOBILE01> To: Balazs Wellisch Date: Sat, 30 Aug 2003 00:25:15 -0400 (EDT) Cc: pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL106 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/519 X-Sequence-Number: 3335 What I thought was really interesting in this test was a dramatic difference for ext3 mounted "writeback" in the "h1" test, 1 minute vs. 9 minutes compared to the default "ordered" mount option. This was the "add new constraint" test. --------------------------------------------------------------------------- Balazs Wellisch wrote: > > Nicely done! > > Thanks, > > Balazs > > > -----Original Message----- > From: pgsql-performance-owner@postgresql.org > [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Tomka > Gergely > Sent: Wednesday, August 27, 2003 5:40 AM > To: pgsql-performance@postgresql.org > Subject: Re: [PERFORM] Tests > > http://mail.sth.sze.hu/~hsz/sql/ > > New, upgraded test results. As we see, the developers works hard, and > with > good results. Million thanks and congratulations. > > Sorry *BSD-lovers, if you send a new hard drive, our tester can do bsd > tests also. Life is hard. > > And last, but not least, thanks for the tests, Horv?th Szabolcs > > -- > Tomka Gergely > "S most - vajon barb?rok n?lk?l mi lesz vel?nk? > ?k m?giscsak megold?s voltak valahogy..." > > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Sat Aug 30 01:51:16 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 49EE2D1B897 for ; Sat, 30 Aug 2003 04:51: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 01827-01 for ; Sat, 30 Aug 2003 01:50:42 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id D58E7D1B550 for ; Sat, 30 Aug 2003 01:50:40 -0300 (ADT) Received: from houston.familyhealth.com.au (chriskl@localhost [127.0.0.1]) by houston.familyhealth.com.au (8.12.9/8.12.9) with ESMTP id h7U4oWLt060453; Sat, 30 Aug 2003 12:50:32 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Received: from localhost (chriskl@localhost) by houston.familyhealth.com.au (8.12.9/8.12.9/Submit) with ESMTP id h7U4oVZQ060450; Sat, 30 Aug 2003 12:50:32 +0800 (WST) X-Authentication-Warning: houston.familyhealth.com.au: chriskl owned process doing -bs Date: Sat, 30 Aug 2003 12:50:31 +0800 (WST) From: Christopher Kings-Lynne To: george young Cc: pgsql-performance@postgresql.org Subject: Re: sourcecode for newly release eRServer? In-Reply-To: <20030829131935.474f78f2.gry@ll.mit.edu> Message-ID: <20030830124955.I60043-100000@houston.familyhealth.com.au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/520 X-Sequence-Number: 3336 > Does anyone know how and when the actual release will happen? > I would be glad to be an alpha tester and promise to contribute > back bug-reports/patches. I'll take cvs or tar.gz or paper tape or > stone tablets engraved in high Elvish... I think someone should call him on that :P Chris From pgsql-performance-owner@postgresql.org Sat Aug 30 02:05:57 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 ABD95D1B8A4 for ; Sat, 30 Aug 2003 05:05:51 +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 95889-07 for ; Sat, 30 Aug 2003 02:05:21 -0300 (ADT) Received: from mail.speakeasy.net (mail13.speakeasy.net [216.254.0.213]) by svr1.postgresql.org (Postfix) with ESMTP id 2EF4DD1B550 for ; Sat, 30 Aug 2003 02:05:19 -0300 (ADT) Received: (qmail 22523 invoked from network); 30 Aug 2003 05:05:18 -0000 Received: from unknown (HELO speakeasy.org) (kgeis@[66.93.130.165]) (envelope-sender ) by mail13.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 30 Aug 2003 05:05:18 -0000 Message-ID: <3F50308E.6070100@speakeasy.org> Date: Fri, 29 Aug 2003 22:05:18 -0700 From: Ken Geis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruno Wolff III Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates References: <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4ED1DC.50808@speakeasy.org> <20030829042453.GA5931@wolff.to> <3F4F0777.8090503@speakeasy.org> <20030830025503.GA30691@wolff.to> In-Reply-To: <20030830025503.GA30691@wolff.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: 200308/521 X-Sequence-Number: 3337 Bruno Wolff III wrote: > I haven't come up with any great ideas for this one. It might be interesting > to compare the explain analyze output from the distinct on query with > and without seqscans enabled. Can't do that comparison. Remember, with seqscan it fails. (Oh, and that nested loops solution I thought was fast actually took 31 minutes versus 29 for index scan in 7.4b2.) I ran another query across the same data: select price_date, count(*) from day_ends group by price_date; It used a table scan and hashed aggregates, and it ran in 5.5 minutes. Considering that, pgsql should be able to do the query that I had been running in a little more time than that. So... From what I've learned, we want to convince the optimizer to use a table scan; that's a good thing. I want it to use hashed aggregates, but I can't convince it to (unless maybe I removed all of the statistics.) To use group aggregates, it first sorts the results of the table scan (all 17 million rows!) There ought to be some way to tell pgsql not to do sorts above a certain size. In this case, if I set enable_sort=false, it goes back to the index scan. If I then set enable_indexscan=false, it goes back to sorting. From pgsql-performance-owner@postgresql.org Sat Aug 30 02:21: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 A9682D1B52C for ; Sat, 30 Aug 2003 05:21:51 +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 01827-05 for ; Sat, 30 Aug 2003 02:21:21 -0300 (ADT) Received: from lakemtao03.cox.net (lakemtao03.cox.net [68.1.17.242]) by svr1.postgresql.org (Postfix) with ESMTP id C53E8D1B93F for ; Sat, 30 Aug 2003 02:21:17 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao03.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030830052118.XIFK10977.lakemtao03.cox.net@lhosts> for ; Sat, 30 Aug 2003 01:21:18 -0400 Subject: Re: Hardware recommendations to scale to silly load From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <200308300244.h7U2i4S12751@candle.pha.pa.us> References: <200308300244.h7U2i4S12751@candle.pha.pa.us> Content-Type: text/plain Message-Id: <1062220877.669.406.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sat, 30 Aug 2003 00:21:17 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/522 X-Sequence-Number: 3338 On Fri, 2003-08-29 at 21:44, Bruce Momjian wrote: > matt wrote: > > > Are you *sure* about that???? 3K updates/inserts per second xlates > > > to 10,800,000 per hour. That, my friend, is a WHOLE HECK OF A LOT! > > > > Yup, I know! > > Just a data point, but on my Dual Xeon 2.4Gig machine with a 10k SCSI > drive I can do 4k inserts/second if I turn fsync off. If you have a > battery-backed controller, you should be able to do the same. (You will > not need to turn fsync off --- fsync will just be fast because of the > disk drive RAM). > > Am I missing something? Is that FOR I BETWEEN 1 AND 4000 BEGIN INSERT COMMIT or BEGIN INSERT INSERT COMMIT; or COPY I get the impression that Matt will need to do 25,000 of these per hour: SELECT IF BEGIN INSERT or UPDATE COMMIT; He says his current h/w peaks at 1/10th that rate. My question is: is that current peak rate ("300 inserts/updates *or* 2500 selects") based upon 1 connection, or many connections? With 4 CPUs, and a 4 disk RAID10, I wouldn't be surprised if 4 con- current connections gives the optimum speed. -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA Great Inventors of our time: Al Gore -> Internet Sun Microsystems -> Clusters From pgsql-performance-owner@postgresql.org Sat Aug 30 10:45:51 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 372C4D1B981 for ; Sat, 30 Aug 2003 13:45:50 +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 34785-01 for ; Sat, 30 Aug 2003 10:45:40 -0300 (ADT) Received: from www.postgresql.com (unknown [64.117.225.209]) by svr1.postgresql.org (Postfix) with ESMTP id 3B355D1B8BA for ; Sat, 30 Aug 2003 10:45:39 -0300 (ADT) Received: from mail.speakeasy.net (mail13.speakeasy.net [216.254.0.213]) by www.postgresql.com (Postfix) with ESMTP id 03A24CF7A60 for ; Sat, 30 Aug 2003 04:39:14 -0300 (ADT) Received: (qmail 18070 invoked from network); 30 Aug 2003 07:38:14 -0000 Received: from unknown (HELO speakeasy.org) (kgeis@[66.93.130.165]) (envelope-sender ) by mail13.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 30 Aug 2003 07:38:14 -0000 Message-ID: <3F505465.6010504@speakeasy.org> Date: Sat, 30 Aug 2003 00:38:13 -0700 From: Ken Geis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruno Wolff III Cc: pgsql-performance@postgresql.org Subject: Re: bad estimates References: <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4ED1DC.50808@speakeasy.org> <20030829042453.GA5931@wolff.to> <3F4F0777.8090503@speakeasy.org> <20030830025503.GA30691@wolff.to> In-Reply-To: <20030830025503.GA30691@wolff.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: 200308/527 X-Sequence-Number: 3343 Bruno Wolff III wrote: > I haven't come up with any great ideas for this one. It might be interesting > to compare the explain analyze output from the distinct on query with > and without seqscans enabled. After digging through planner code, I found that bumping up the sort_mem will make the planner prefer a full table scan and hashed aggregation. The sort memory is where the hash table is stored. In the end, the query runs in 4.5 minutes, which is reasonable. I had planned to try Manfred's index correlation patch to see if it would give better estimates for an index scan. The index scan method took maybe 6.5x as long, but the estimate was that it would take 1400x as long. I think instead of trying out his patch I might actually work on my application! Ken From pgsql-performance-owner@postgresql.org Sat Aug 30 10:09: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 77A55D1B8B3 for ; Sat, 30 Aug 2003 13:09: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 12611-09 for ; Sat, 30 Aug 2003 10:08:55 -0300 (ADT) Received: from jefftrout.com (h00a0cc4084e5.ne.client2.attbi.com [24.128.241.68]) by svr1.postgresql.org (Postfix) with SMTP id 4F414D1B8B4 for ; Sat, 30 Aug 2003 10:08:49 -0300 (ADT) Received: (qmail 883 invoked from network); 30 Aug 2003 13:08:51 -0000 Received: from unknown (HELO torgo) (threshar@10.10.10.10) by 10.10.10.10 with SMTP; 30 Aug 2003 13:08:51 -0000 Date: Sat, 30 Aug 2003 09:08:51 -0400 (EDT) From: Jeff To: Richard Jones Cc: PgSQL Performance ML Subject: Re: Selecting random rows efficiently In-Reply-To: <200308301309.03412.rj@last.fm> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/524 X-Sequence-Number: 3340 On Sat, 30 Aug 2003, Richard Jones wrote: > Hi, > i have a table of around 3 million rows from which i regularly (twice a second > at the moment) need to select a random row from > > currently i'm doing "order by rand() limit 1" - but i suspect this is > responsible for the large load on my db server - i guess that PG is doing far > too much work just to pick one row. > If you have an int id (aka serial) column then it is simple - just pick a random number between 1 and currval('id_seq')... or offset rand() limit 1 perhaps? since you want random ther eis no need to bother with an order and that'll save a sort. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/ From pgsql-performance-owner@postgresql.org Sat Aug 30 09:15:40 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 4790FD1B8C4 for ; Sat, 30 Aug 2003 12:15:39 +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 12408-06 for ; Sat, 30 Aug 2003 09:15:08 -0300 (ADT) Received: from cmailm3.svr.pol.co.uk (cmailm3.svr.pol.co.uk [195.92.193.19]) by svr1.postgresql.org (Postfix) with ESMTP id CEABAD1B8C0 for ; Sat, 30 Aug 2003 09:15:01 -0300 (ADT) Received: from user-2040.bbd23tcl.dsl.pol.co.uk ([81.77.247.248] helo=rj) by cmailm3.svr.pol.co.uk with esmtp (Exim 4.14) id 19t4dA-0001R9-OD for pgsql-performance@postgresql.org; Sat, 30 Aug 2003 13:15:01 +0100 From: Richard Jones Reply-To: rj@last.fm Organization: Last.FM To: PgSQL Performance ML Subject: Selecting random rows efficiently Date: Sat, 30 Aug 2003 13:09:03 +0000 User-Agent: KMail/1.5.1 References: <200308300244.h7U2i4S12751@candle.pha.pa.us> <1062220877.669.406.camel@haggis> In-Reply-To: <1062220877.669.406.camel@haggis> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308301309.03412.rj@last.fm> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/523 X-Sequence-Number: 3339 Hi, i have a table of around 3 million rows from which i regularly (twice a second at the moment) need to select a random row from currently i'm doing "order by rand() limit 1" - but i suspect this is responsible for the large load on my db server - i guess that PG is doing far too much work just to pick one row. one way i can think of is to read in all the primary keys from my table, and select one of the keys at random then directly fetch that row. are there any other ways to do this? i need to keep the load down :) Thanks, Richard From pgsql-performance-owner@postgresql.org Sat Aug 30 10:36:20 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 CDDCBD1B8D0 for ; Sat, 30 Aug 2003 13:36: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 33237-04 for ; Sat, 30 Aug 2003 10:35:47 -0300 (ADT) Received: from pass.bivio.com (pass.bivio.com [216.87.82.238]) by svr1.postgresql.org (Postfix) with ESMTP id F2F7ED1B8B5 for ; Sat, 30 Aug 2003 10:35:41 -0300 (ADT) Received: from LIFT.bivio.com (lift.bivio.com [216.87.82.233]) by pass.bivio.com (8.9.3/8.9.3) with ESMTP id HAB24713 for ; Sat, 30 Aug 2003 07:35:36 -0600 From: Rob Nagler MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16208.41885.960000.12706@gargle.gargle.HOWL> Date: Sat, 30 Aug 2003 07:16:13 -0600 To: pgsql-performance@postgresql.org Subject: How to force Nested Loop plan? X-Mailer: VM 6.96 under Emacs 21.1.1 Organization: bivio Software Artisans, Inc. X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/526 X-Sequence-Number: 3342 I'm trying to understand how I can get the planner to always do the right thing with this query: EXPLAIN ANALYZE SELECT aa_t.min_date_time FROM aa_t , bb_t , cc_t WHERE bb_t.bb_id = aa_t.bb_id AND aa_t.realm_id = cc_t.realm_id AND aa_t.server_id = 21 ORDER BY aa_t.min_date_time desc LIMIT 1 OFFSET 674 ; There's a extreme elbow in the performance curve around the sum of LIMIT and OFFSET. The two plans follow. First for the query above: Limit (cost=21569.56..21601.56 rows=1 width=84) (actual time=59.60..59.69 rows=1 loops=1) -> Nested Loop (cost=0.00..110535.66 rows=3454 width=84) (actual time=0.19..59.20 rows=676 loops=1) -> Nested Loop (cost=0.00..93177.46 rows=3454 width=65) (actual time=0.14..44.41 rows=676 loops=1) -> Index Scan Backward using aa_t20 on aa_t (cost=0.00..76738.77 rows=3454 width=46) (actual time=0.10..31.30 rows=676 loops=1) Filter: (server_id = 21::numeric) -> Index Scan using cc_t1 on cc_t (cost=0.00..4.75 rows=1 width=19) (actual time=0.01..0.01 rows=1 loops=676) Index Cond: ("outer".realm_id = cc_t.realm_id) -> Index Scan using bb_t1 on bb_t (cost=0.00..5.01 rows=1 width=19) (actual time=0.02..0.02 rows=1 loops=676) Index Cond: (bb_t.bb_id = "outer".bb_id) Total runtime: 59.89 msec (10 rows) Setting OFFSET to 675 in the above query, results in this 100 times slower plan: Limit (cost=21614.48..21614.48 rows=1 width=84) (actual time=4762.39..4762.39 rows=1 loops=1) -> Sort (cost=21612.79..21621.42 rows=3454 width=84) (actual time=4761.45..4761.92 rows=677 loops=1) Sort Key: aa_t.min_date_time -> Merge Join (cost=21139.96..21409.80 rows=3454 width=84) (actual time=4399.80..4685.24 rows=41879 loops=1) Merge Cond: ("outer".bb_id = "inner".bb_id) -> Sort (cost=8079.83..8184.53 rows=41879 width=19) (actual time=936.99..967.37 rows=41879 loops=1) Sort Key: bb_t.bb_id -> Seq Scan on bb_t (cost=0.00..4864.79 rows=41879 width=19) (actual time=0.06..729.60 rows=41879 loops=1) -> Sort (cost=13060.13..13068.76 rows=3454 width=65) (actual time=3462.76..3493.97 rows=41879 loops=1) Sort Key: aa_t.bb_id -> Merge Join (cost=12794.42..12857.14 rows=3454 width=65) (actual time=2923.62..3202.78 rows=41879 loops=1) Merge Cond: ("outer".realm_id = "inner".realm_id) -> Sort (cost=12762.78..12771.41 rows=3454 width=46) (actual time=2920.78..2950.87 rows=41879 loops=1) Sort Key: aa_t.realm_id -> Index Scan using aa_t5 on aa_t (cost=0.00..12559.79 rows=3454 width=46) (actual time=0.18..2589.22 rows=41879 loops=1) Index Cond: (server_id = 21::numeric) -> Sort (cost=31.64..32.78 rows=455 width=19) (actual time=2.54..33.12 rows=42163 loops=1) Sort Key: cc_t.realm_id -> Seq Scan on cc_t (cost=0.00..11.55 rows=455 width=19) (actual time=0.04..0.86 rows=455 loops=1) Total runtime: 4792.84 msec (20 rows) Twiddling effective_cache_size and random_page_cost allows for a large LIMIT+OFFSET number but not enough. These tests are made with 400000 effective_cache_size and random_page_cost of 4. I can increase the LIMIT+OFFSET elbow to 1654 by changing the query thusly: < AND aa_t.server_id = 21 --- > AND aa_t.server_id IN (21, 0) The value 0 is an invalid server_id, so I know it won't be returned. However, I've got 41K rows that could be returned by this query and growing, and 1654 is obviously not enough. (aa is 690K rows, bb is 41K rows, and cc is 500 rows.) If I drop the ORDER BY, the query goes much faster, but the query is useless without the ORDER BY. I've figured out that the second plan is slow, because it is writing a huge result set to disk (+200MB). This doesn't make sense to me, since sort_mem is 32000. Is there a way to tell the optimizer to use Nested Loop plan always instead of the Merge/Join plan? Turning off enable_mergejoin is obviously not an option. Thanks, Rob From pgsql-performance-owner@postgresql.org Sat Aug 30 10:58: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 48F64D1B8AA for ; Sat, 30 Aug 2003 13:58:28 +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 33551-05 for ; Sat, 30 Aug 2003 10:57:57 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 41BACD1B8A9 for ; Sat, 30 Aug 2003 10:57:56 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id A72CB1025B; Sat, 30 Aug 2003 09:49:52 -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 7F1621025A; Sat, 30 Aug 2003 09:49:50 -0400 (EDT) Subject: Re: Hardware recommendations to scale to silly load From: Rod Taylor To: Ron Johnson Cc: PgSQL Performance ML In-Reply-To: <1062220877.669.406.camel@haggis> References: <200308300244.h7U2i4S12751@candle.pha.pa.us> <1062220877.669.406.camel@haggis> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-7QC8Y0Pdu/iRs8LzYh8l" Message-Id: <1062251891.83670.25.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sat, 30 Aug 2003 13:58:12 +0000 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/528 X-Sequence-Number: 3344 --=-7QC8Y0Pdu/iRs8LzYh8l Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > My question is: is that current peak rate ("300 inserts/updates=20 > *or* 2500 selects") based upon 1 connection, or many connections? > With 4 CPUs, and a 4 disk RAID10, I wouldn't be surprised if 4 con- > current connections gives the optimum speed. Optimum number of active workers is probably between 10 and 16. 4 doing math, 4 doing a dma transfer of data, and 4 to be available the instant one of the other 8 completes. On FreeBSD it seems to work that way when there is a mix of activity with the database. --=-7QC8Y0Pdu/iRs8LzYh8l 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/UK1z6DETLow6vwwRAviNAJwL4Ivu55vx4Ee9RAI1NAKClSJrfQCfTE84 Lxv6fxYSRD6H029Ffmpe66c= =Z7ne -----END PGP SIGNATURE----- --=-7QC8Y0Pdu/iRs8LzYh8l-- From pgsql-performance-owner@postgresql.org Sat Aug 30 11:02:10 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C8DD3D1B8CE for ; Sat, 30 Aug 2003 14:02: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 35235-01 for ; Sat, 30 Aug 2003 11:01:38 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 8A0F1D1B8AA for ; Sat, 30 Aug 2003 11:01:37 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id B54FA1025B; Sat, 30 Aug 2003 09:53:39 -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 99CB41024D; Sat, 30 Aug 2003 09:53:36 -0400 (EDT) Subject: Re: Selecting random rows efficiently From: Rod Taylor To: rj@last.fm Cc: PgSQL Performance ML In-Reply-To: <200308301425.51127.rj@last.fm> References: <200308301425.51127.rj@last.fm> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-c+Z2bsX6C995OKTLxuo6" Message-Id: <1062252117.83670.29.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sat, 30 Aug 2003 14:01:58 +0000 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/529 X-Sequence-Number: 3345 --=-c+Z2bsX6C995OKTLxuo6 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > i was hoping there was some trickery with sequences that would allow me t= o=20 > easily pick a random valid sequence number..? I would suggest renumbering the data. ALTER SEQUENCE ... RESTART WITH 1; UPDATE table SET pkey =3D DEFAULT; Of course, PostgreSQL may have trouble with that update due to evaluation of the unique constraint immediately -- so drop the primary key first, and add it back after. --=-c+Z2bsX6C995OKTLxuo6 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/UK5V6DETLow6vwwRAh9GAJsGVb68JRwuJLhhPzmmKi+HfUfsXwCfUpCu yIw1ezFFDNjlz5y0WYA1pKg= =8TSm -----END PGP SIGNATURE----- --=-c+Z2bsX6C995OKTLxuo6-- From pgsql-performance-owner@postgresql.org Sat Aug 30 11:04: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 8CFE1D1B8B5 for ; Sat, 30 Aug 2003 14:04:10 +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 33566-07 for ; Sat, 30 Aug 2003 11:04:01 -0300 (ADT) Received: from lakemtao04.cox.net (lakemtao04.cox.net [68.1.17.241]) by svr1.postgresql.org (Postfix) with ESMTP id 7E6F5D1B8AA for ; Sat, 30 Aug 2003 11:03:59 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao04.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030830140401.CDNM419.lakemtao04.cox.net@lhosts> for ; Sat, 30 Aug 2003 10:04:01 -0400 Subject: Re: Selecting random rows efficiently From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <200308301309.03412.rj@last.fm> References: <200308300244.h7U2i4S12751@candle.pha.pa.us> <1062220877.669.406.camel@haggis> <200308301309.03412.rj@last.fm> Content-Type: text/plain Message-Id: <1062252240.667.453.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sat, 30 Aug 2003 09:04:01 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/530 X-Sequence-Number: 3346 On Sat, 2003-08-30 at 08:09, Richard Jones wrote: > Hi, > i have a table of around 3 million rows from which i regularly (twice a second > at the moment) need to select a random row from > > currently i'm doing "order by rand() limit 1" - but i suspect this is > responsible for the large load on my db server - i guess that PG is doing far > too much work just to pick one row. What datatype is the selected by key? Also, where is rand() defined? Is that a UDF? Could it be that there is a type mismatch? > one way i can think of is to read in all the primary keys from my table, and > select one of the keys at random then directly fetch that row. > > are there any other ways to do this? i need to keep the load down :) > > Thanks, > Richard Are you really in Micronesia? -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "The greatest dangers to liberty lurk in insidious encroachment by men of zeal, well-meaning, but without understanding." Justice Louis Brandeis, dissenting, Olmstead v US (1928) From pgsql-performance-owner@postgresql.org Sat Aug 30 10:32: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 81C03D1B8C4 for ; Sat, 30 Aug 2003 13:32:04 +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 33601-01 for ; Sat, 30 Aug 2003 10:31:54 -0300 (ADT) Received: from cmailm4.svr.pol.co.uk (cmailm4.svr.pol.co.uk [195.92.193.211]) by svr1.postgresql.org (Postfix) with ESMTP id B4D22D1B8CE for ; Sat, 30 Aug 2003 10:31:48 -0300 (ADT) Received: from user-2040.bbd23tcl.dsl.pol.co.uk ([81.77.247.248] helo=rj) by cmailm4.svr.pol.co.uk with esmtp (Exim 4.14) id 19t5pU-0006Ab-WB for pgsql-performance@postgresql.org; Sat, 30 Aug 2003 14:31:49 +0100 From: Richard Jones Reply-To: rj@last.fm Organization: Last.FM To: PgSQL Performance ML Subject: Re: Selecting random rows efficiently Date: Sat, 30 Aug 2003 14:25:51 +0000 User-Agent: KMail/1.5.1 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308301425.51127.rj@last.fm> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/525 X-Sequence-Number: 3341 On Saturday 30 August 2003 1:08 pm, you wrote: > On Sat, 30 Aug 2003, Richard Jones wrote: > > Hi, > > i have a table of around 3 million rows from which i regularly (twice a > > second at the moment) need to select a random row from > > > > currently i'm doing "order by rand() limit 1" - but i suspect this is > > responsible for the large load on my db server - i guess that PG is doing > > far too much work just to pick one row. > > If you have an int id (aka serial) column then it is simple - just pick a > random number between 1 and currval('id_seq')... > > or offset rand() limit 1 perhaps? > > since you want random ther eis no need to bother with an order and that'll > save a sort. Yes, the pkey is a SERIAL but the problem is that the sequence is rather sparse for example, it goes something like 1 -> 5000 then 100000->100000 and then 2000000->upwards this is due to chunks being deleted etc.. if i pick a random number for the key it will not be a random enough distribution, because the sequence is sparse.. sometimes it will pick a key that doesnt exist. i'm currently reading all the keys into an array and selecting randoms from there - but this is no good long-term as i need to refresh the array of keys to take into account newly added rows to the table (daily) i was hoping there was some trickery with sequences that would allow me to easily pick a random valid sequence number..? Thanks, Rich. > > -- > Jeff Trout > http://www.jefftrout.com/ > http://www.stuarthamm.net/ > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster From pgsql-performance-owner@postgresql.org Sat Aug 30 11:36: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 E30E1D1B9DF for ; Sat, 30 Aug 2003 14:36: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 37301-05 for ; Sat, 30 Aug 2003 11:35:57 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id B9E54D1BA68 for ; Sat, 30 Aug 2003 11:35:55 -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 h7UEZqjX022272; Sat, 30 Aug 2003 10:35:52 -0400 (EDT) To: Ken Geis Cc: Bruno Wolff III , pgsql-performance@postgresql.org Subject: Re: bad estimates In-reply-to: <3F50308E.6070100@speakeasy.org> References: <20030829025109.GD4373@wolff.to> <3F4EBF7E.8020602@speakeasy.org> <20030829030156.GF4373@wolff.to> <3F4EC1D0.5010503@speakeasy.org> <20030829033818.GA5577@wolff.to> <3F4ECC78.7090502@speakeasy.org> <20030829040519.GA5746@wolff.to> <3F4ED1DC.50808@speakeasy.org> <20030829042453.GA5931@wolff.to> <3F4F0777.8090503@speakeasy.org> <20030830025503.GA30691@wolff.to> <3F50308E.6070100@speakeasy.org> Comments: In-reply-to Ken Geis message dated "Fri, 29 Aug 2003 22:05:18 -0700" Date: Sat, 30 Aug 2003 10:35:52 -0400 Message-ID: <22271.1062254152@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/531 X-Sequence-Number: 3347 Ken Geis writes: > From what I've learned, we want to convince the optimizer to use a > table scan; that's a good thing. I want it to use hashed aggregates, > but I can't convince it to (unless maybe I removed all of the > statistics.) You probably just need to increase sort_mem. Multiple aggregates take more RAM to process in a hashtable style ... regards, tom lane From pgsql-performance-owner@postgresql.org Sat Aug 30 11:47:56 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 542ABD1B8CB for ; Sat, 30 Aug 2003 14:47: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 37218-08 for ; Sat, 30 Aug 2003 11:47:46 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 714F2D1B8B2 for ; Sat, 30 Aug 2003 11:47:44 -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 h7UElgjX023401; Sat, 30 Aug 2003 10:47:42 -0400 (EDT) To: rj@last.fm Cc: PgSQL Performance ML Subject: Re: Selecting random rows efficiently In-reply-to: <200308301425.51127.rj@last.fm> References: <200308301425.51127.rj@last.fm> Comments: In-reply-to Richard Jones message dated "Sat, 30 Aug 2003 14:25:51 -0000" Date: Sat, 30 Aug 2003 10:47:42 -0400 Message-ID: <23400.1062254862@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/532 X-Sequence-Number: 3348 Richard Jones writes: >>> i have a table of around 3 million rows from which i regularly (twice a >>> second at the moment) need to select a random row from > i was hoping there was some trickery with sequences that would allow me to > easily pick a random valid sequence number..? There is no magic bullet here, but if you expect that requirement to persist then it is worth your trouble to expend effort on a real solution. A real solution in my mind would look like 1. Add a column "random_id float8 default random()". The idea here is that you assign a random ID to each row as it is created. 2. Add an index on the above column. 3. Your query now looks like SELECT * FROM table WHERE random_id >= random() ORDER BY random_id LIMIT 1; This gives you a plan on the order of Limit (cost=0.00..0.17 rows=1 width=8) -> Index Scan using fooi on foo (cost=0.00..57.00 rows=334 width=8) Filter: (random_id >= random()) which is fast and gives a genuinely random result row. At least up until you have enough rows that there start being duplicate random_ids, which AFAIK would be 2 billion rows with a decent random() implementation. If you're concerned about that, you could periodically re-randomize with UPDATE table SET random_id = random(); so that any rows that were "hidden" because they had a duplicate random_id have another shot at being choosable. But with only a few mil rows I don't think you need to worry. regards, tom lane From pgsql-performance-owner@postgresql.org Sat Aug 30 12:02:16 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 A5BEAD1B8A7 for ; Sat, 30 Aug 2003 15:02:15 +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 37496-07 for ; Sat, 30 Aug 2003 12:02:05 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id B2626D1B8C0 for ; Sat, 30 Aug 2003 12:02:04 -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 h7UF21jX024638; Sat, 30 Aug 2003 11:02:01 -0400 (EDT) To: Rob Nagler Cc: pgsql-performance@postgresql.org Subject: Re: How to force Nested Loop plan? In-reply-to: <16208.41885.960000.12706@gargle.gargle.HOWL> References: <16208.41885.960000.12706@gargle.gargle.HOWL> Comments: In-reply-to Rob Nagler message dated "Sat, 30 Aug 2003 07:16:13 -0600" Date: Sat, 30 Aug 2003 11:02:01 -0400 Message-ID: <24637.1062255721@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/533 X-Sequence-Number: 3349 Rob Nagler writes: > I'm trying to understand how I can get the planner to always do the > right thing with this query: > SELECT > aa_t.min_date_time > FROM > aa_t > , bb_t > , cc_t > WHERE bb_t.bb_id = aa_t.bb_id > AND aa_t.realm_id = cc_t.realm_id > AND aa_t.server_id = 21 > ORDER BY aa_t.min_date_time desc > LIMIT 1 > OFFSET 674 > -> Index Scan Backward using aa_t20 on aa_t (cost=0.00..76738.77 rows=3454 width=46) (actual time=0.10..31.30 rows=676 loops=1) > Filter: (server_id = 21::numeric) The reason the planner does not much like this plan is that it's estimating that quite a lot of rows will have to be hit in min_date_time order before it finds enough rows with server_id = 21. Thus the high cost estimate for the above step. I suspect that the reason you like this plan is that there's actually substantial correlation between server_id and min_date_time, such that the required rows are found quickly. Before trying to force the planner into what you consider an optimal plan, you had better ask yourself whether you can expect that correlation to hold up in the future. If not, your plan could become pessimal pretty quickly. I'd suggest creating a double-column index: create index aa_ti on aa_t(server_id, min_date_time); and altering the query to read ORDER BY aa_t.server_id DESC, aa_t.min_date_time DESC (you need this kluge to make sure the planner recognizes that the new index matches the ORDER BY request). Then you should get a plan with a much smaller cost coefficient for this step. regards, tom lane PS: does server_id really need to be NUMERIC? Why not integer, or at worst bigint? From pgsql-performance-owner@postgresql.org Sat Aug 30 12:14: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 A3F63D1B8CB for ; Sat, 30 Aug 2003 15:14: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 37422-10 for ; Sat, 30 Aug 2003 12:14:07 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id C03E2D1B8C4 for ; Sat, 30 Aug 2003 12:14:06 -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 h7UFE5jX025758; Sat, 30 Aug 2003 11:14:05 -0400 (EDT) To: rj@last.fm Cc: PgSQL Performance ML Subject: Re: Selecting random rows efficiently In-reply-to: <23400.1062254862@sss.pgh.pa.us> References: <200308301425.51127.rj@last.fm> <23400.1062254862@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sat, 30 Aug 2003 10:47:42 -0400" Date: Sat, 30 Aug 2003 11:14:04 -0400 Message-ID: <25757.1062256444@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/534 X-Sequence-Number: 3350 I said: > 3. Your query now looks like > SELECT * FROM table WHERE random_id >= random() > ORDER BY random_id LIMIT 1; Correction: the above won't give quite the right query because random() is marked as a volatile function. You can hide the random() call inside a user-defined function that you (misleadingly) mark stable, or you can just stick it into a sub-select: regression=# explain select * from foo WHERE random_id >= (select random()) regression-# ORDER BY random_id LIMIT 1; QUERY PLAN ------------------------------------------------------------------------- Limit (cost=0.01..0.15 rows=1 width=8) InitPlan -> Result (cost=0.00..0.01 rows=1 width=0) -> Index Scan using fooi on foo (cost=0.00..45.50 rows=334 width=8) Index Cond: (random_id >= $0) (5 rows) This technique is probably safer against future planner changes, however: regression=# create function oneshot_random() returns float8 as regression-# 'select random()' language sql stable; CREATE FUNCTION regression=# explain select * from foo WHERE random_id >= oneshot_random() regression-# ORDER BY random_id LIMIT 1; QUERY PLAN ------------------------------------------------------------------------- Limit (cost=0.00..0.14 rows=1 width=8) -> Index Scan using fooi on foo (cost=0.00..46.33 rows=334 width=8) Index Cond: (random_id >= oneshot_random()) (3 rows) The point here is that an indexscan boundary condition has to use stable or immutable functions. By marking oneshot_random() stable, you essentially say that it's okay to evaluate it only once per query, rather than once at each row. regards, tom lane From pgsql-performance-owner@postgresql.org Sat Aug 30 12:37:23 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 30FE0D1B8CB for ; Sat, 30 Aug 2003 15:37: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 40687-06 for ; Sat, 30 Aug 2003 12:36:51 -0300 (ADT) Received: from wight.ymogen.net (unknown [217.27.240.153]) by svr1.postgresql.org (Postfix) with SMTP id 02411D1B8B5 for ; Sat, 30 Aug 2003 12:36:41 -0300 (ADT) Received: (qmail 18513 invoked from network); 30 Aug 2003 15:36:11 -0000 Received: from host213-123-217-162.in-addr.btopenworld.com (HELO solent) (213.123.217.162) by wight.ymogen.net with SMTP; 30 Aug 2003 15:36:11 -0000 From: "Matt Clark" To: "Bruce Momjian" Cc: "Ron Johnson" , "PgSQL Performance ML" Subject: Re: Hardware recommendations to scale to silly load Date: Sat, 30 Aug 2003 16:36:20 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" 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: <200308300244.h7U2i4S12751@candle.pha.pa.us> Importance: Normal X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/536 X-Sequence-Number: 3352 > Just a data point, but on my Dual Xeon 2.4Gig machine with a 10k SCSI > drive I can do 4k inserts/second if I turn fsync off. If you have a > battery-backed controller, you should be able to do the same. (You will > not need to turn fsync off --- fsync will just be fast because of the > disk drive RAM). > > Am I missing something? I think Ron asked this, but I will too, is that 4k inserts in one transaction or 4k transactions each with one insert? fsync is very much faster (as are all random writes) with the write-back cache, but I'd hazard a guess that it's still not nearly as fast as turning fsync off altogether. I'll do a test perhaps... From pgsql-performance-owner@postgresql.org Sat Aug 30 12:37: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 C5F82D1B8D9 for ; Sat, 30 Aug 2003 15:37:12 +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 41294-04 for ; Sat, 30 Aug 2003 12:36:42 -0300 (ADT) Received: from wight.ymogen.net (unknown [217.27.240.153]) by svr1.postgresql.org (Postfix) with SMTP id F2BF2D1B8B4 for ; Sat, 30 Aug 2003 12:36:40 -0300 (ADT) Received: (qmail 18512 invoked from network); 30 Aug 2003 15:36:11 -0000 Received: from host213-123-217-162.in-addr.btopenworld.com (HELO solent) (213.123.217.162) by wight.ymogen.net with SMTP; 30 Aug 2003 15:36:11 -0000 From: "Matt Clark" To: "Ron Johnson" , "PgSQL Performance ML" Subject: Re: Hardware recommendations to scale to silly load Date: Sat, 30 Aug 2003 16:36:20 +0100 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: <1062220877.669.406.camel@haggis> Importance: Normal X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/535 X-Sequence-Number: 3351 > SELECT > IF > BEGIN > INSERT > or > UPDATE > COMMIT; > > He says his current h/w peaks at 1/10th that rate. > > My question is: is that current peak rate ("300 inserts/updates > *or* 2500 selects") based upon 1 connection, or many connections? > With 4 CPUs, and a 4 disk RAID10, I wouldn't be surprised if 4 con- > current connections gives the optimum speed. Well it's more like each user interaction looks like: SELECT SELECT SELECT SELECT SELECT SELECT INSERT SELECT SELECT SELECT SELECT INSERT SELECT SELECT SELECT UPDATE SELECT SELECT UPDATE SELECT And concurrency is very high, because it's a web app, and each httpd has one connection to PG, and there can be hundreds of active httpd processes. Some kind of connection pooling scheme might be in order when there are that many active clients. Any views? From pgsql-performance-owner@postgresql.org Sat Aug 30 12:50:26 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 2D88BD1B8C4 for ; Sat, 30 Aug 2003 15:50:26 +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 42667-05 for ; Sat, 30 Aug 2003 12:50:15 -0300 (ADT) Received: from pass.bivio.com (locker.bivio.com [216.87.82.238]) by svr1.postgresql.org (Postfix) with ESMTP id 61296D1B8D2 for ; Sat, 30 Aug 2003 12:50:11 -0300 (ADT) Received: from LIFT.bivio.com (lift.bivio.com [216.87.82.233]) by pass.bivio.com (8.9.3/8.9.3) with ESMTP id JAB24961; Sat, 30 Aug 2003 09:50:10 -0600 From: Rob Nagler MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16208.50934.351000.90704@gargle.gargle.HOWL> Date: Sat, 30 Aug 2003 09:47:02 -0600 To: pgsql-performance@postgresql.org Subject: Re: How to force Nested Loop plan? In-Reply-To: <24637.1062255721@sss.pgh.pa.us> References: <16208.41885.960000.12706@gargle.gargle.HOWL> <24637.1062255721@sss.pgh.pa.us> X-Mailer: VM 6.96 under Emacs 21.1.1 Organization: bivio Software Artisans, Inc. X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/537 X-Sequence-Number: 3353 Tom Lane writes: > The reason the planner does not much like this plan is that it's > estimating that quite a lot of rows will have to be hit in min_date_time > order before it finds enough rows with server_id = 21. Thus the high > cost estimate for the above step. Thanks for the speedy and useful reply! More questions follow. :) Very interesting. How does it know "quite a lot"? Is there something I can do to get the planner to analyze the data better? > I suspect that the reason you like this plan is that there's actually > substantial correlation between server_id and min_date_time, such that > the required rows are found quickly. Before trying to force the planner > into what you consider an optimal plan, you had better ask yourself > whether you can expect that correlation to hold up in the future. > If not, your plan could become pessimal pretty quickly. The correlation holds. min_date_time increases over time as records are inserted. server_id is uniformly distributed over time. There's no randomness. There is at least one 21 record for every value of min_date_time. 21 is a special server_id containing aggregate (denormalized) data for the other servers. I thought about putting it in a separate table, but this would complicate the code as the data is identical to the non-aggregated case. Do you have any suggestions for organizing the data/query now that you know this? > I'd suggest creating a double-column index: Thanks. I'll try this. I'm a very big fan of declarative programming. However, there's a danger in declarative programming when the interperter isn't smart enough. When I add this index, I will slow down inserts (about 20K/day) and increase data size (this is the second largest table in the database). Moreover, if the planner is improved, I've should fix my code, delete the index, etc. Is there a way of giving the planner direct hints as in Oracle? They can be ignored when the optimizer is improved, just as "register" is ignored by C compilers nowadays. Adding the extra index and ORDER BY is also not easy in our case. The query is dynamically generated. I can force the query ORDER BY to be whatever I want, but I would lose the ability to do interesting things, like the automatic generation of ORDER BY when someone clicks on a column header in the application. Indeed there are times when people want to sort on other columns in the query. I reduced the problem to the salient details for my post to this board. What if the ORDER BY was: ORDER BY aa_t.server_id DESC, cc_t.name ASC Would the planner do the right thing? > PS: does server_id really need to be NUMERIC? Why not integer, or at > worst bigint? It is a NUMERIC(18). It could be a bigint. What would be the change in performance of this query if we changed it to bigint? BTW, my customer is probably going to be switching to Oracle. This particular query has been one of the reasons. Maybe this change will help us stay with Postgres. Thanks, Rob From pgsql-performance-owner@postgresql.org Sat Aug 30 13:19: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 08A72D1B8A7 for ; Sat, 30 Aug 2003 16:19: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 44997-06 for ; Sat, 30 Aug 2003 13:18:29 -0300 (ADT) Received: from lakemtao02.cox.net (lakemtao02.cox.net [68.1.17.243]) by svr1.postgresql.org (Postfix) with ESMTP id CCCB5D1B8B2 for ; Sat, 30 Aug 2003 13:18:28 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao02.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030830161828.GMMG11854.lakemtao02.cox.net@lhosts> for ; Sat, 30 Aug 2003 12:18:28 -0400 Subject: Re: Selecting random rows efficiently From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <1062252117.83670.29.camel@jester> References: <200308301425.51127.rj@last.fm> <1062252117.83670.29.camel@jester> Content-Type: text/plain Message-Id: <1062260304.669.566.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sat, 30 Aug 2003 11:18:25 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/538 X-Sequence-Number: 3354 On Sat, 2003-08-30 at 09:01, Rod Taylor wrote: > > i was hoping there was some trickery with sequences that would allow me to > > easily pick a random valid sequence number..? > > I would suggest renumbering the data. > > ALTER SEQUENCE ... RESTART WITH 1; > UPDATE table SET pkey = DEFAULT; > > Of course, PostgreSQL may have trouble with that update due to > evaluation of the unique constraint immediately -- so drop the primary > key first, and add it back after. And if there are child tables, they'd all have to be updated, too. -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "Whatever may be the moral ambiguities of the so-called demoratic nations and however serious may be their failure to conform perfectly to their democratic ideals, it is sheer moral perversity to equate the inconsistencies of a democratic civilization with the brutalities which modern tyrannical states practice." Reinhold Nieburhr, ca. 1940 From pgsql-performance-owner@postgresql.org Sat Aug 30 13:20:20 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 1AC0ED1B8F5 for ; Sat, 30 Aug 2003 16:20:19 +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 45340-03 for ; Sat, 30 Aug 2003 13:19:48 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 7277FD1B8B4 for ; Sat, 30 Aug 2003 13:19:47 -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 h7UGJhjX002076; Sat, 30 Aug 2003 12:19:45 -0400 (EDT) To: Rob Nagler Cc: pgsql-performance@postgresql.org Subject: Re: How to force Nested Loop plan? In-reply-to: <16208.50934.351000.90704@gargle.gargle.HOWL> References: <16208.41885.960000.12706@gargle.gargle.HOWL> <24637.1062255721@sss.pgh.pa.us> <16208.50934.351000.90704@gargle.gargle.HOWL> Comments: In-reply-to Rob Nagler message dated "Sat, 30 Aug 2003 09:47:02 -0600" Date: Sat, 30 Aug 2003 12:19:42 -0400 Message-ID: <2074.1062260382@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/539 X-Sequence-Number: 3355 Rob Nagler writes: > Tom Lane writes: >> The reason the planner does not much like this plan is that it's >> estimating that quite a lot of rows will have to be hit in min_date_time >> order before it finds enough rows with server_id = 21. > Very interesting. How does it know "quite a lot"? It doesn't, because it has no cross-column-correlation stats. The default assumption is that there's no correlation. > server_id is uniformly distributed over time. There's > no randomness. There is at least one 21 record for every value of > min_date_time. That doesn't really tell me anything. What's the proportion of 21 records out of the total table? > 21 is a special server_id containing aggregate > (denormalized) data for the other servers. I thought about putting it > in a separate table, but this would complicate the code as the data is > identical to the non-aggregated case. Hm. If most of your queries are for id 21, an alternative approach is to create single-column partial indexes: create index fooi on foo (min_date_time) where server_id = 21; This reduces the cost of maintaining the index but also makes it useful *only* for id = 21 queries. On the plus side, you don't need to hack the ORDER BY clause to get your queries to use it. Your choice... > What if the ORDER BY was: > ORDER BY aa_t.server_id DESC, cc_t.name ASC > Would the planner do the right thing? What do you consider the right thing? cc_t.name doesn't seem connected to this table at all --- or did I miss something? > It is a NUMERIC(18). It could be a bigint. What would be the change > in performance of this query if we changed it to bigint? Hard to say. I can tell you that the raw comparison operator is a lot quicker for bigint than for numeric, but I don't have any hard numbers about what percentage of total CPU time is involved. You'd pretty much have to try it for yourself to see what the effect is in your queries. If you've been generically using NUMERIC(n) where you could be using integer or bigint, then I think you've probably paid a high price without knowing it. I don't know what Oracle's cost tradeoffs are for these datatypes, but I can tell you that Postgres's integer types are way faster (and more compact) than our NUMERIC. regards, tom lane From pgsql-performance-owner@postgresql.org Sat Aug 30 13:34: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 94AF2D1B8D3 for ; Sat, 30 Aug 2003 16:34:12 +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 46881-02 for ; Sat, 30 Aug 2003 13:33:42 -0300 (ADT) Received: from lakemtao02.cox.net (lakemtao02.cox.net [68.1.17.243]) by svr1.postgresql.org (Postfix) with ESMTP id 6DB4CD1B8C5 for ; Sat, 30 Aug 2003 13:33:41 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao02.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030830163341.GQUJ11854.lakemtao02.cox.net@lhosts> for ; Sat, 30 Aug 2003 12:33:41 -0400 Subject: Re: How to force Nested Loop plan? From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <16208.50934.351000.90704@gargle.gargle.HOWL> References: <16208.41885.960000.12706@gargle.gargle.HOWL> <24637.1062255721@sss.pgh.pa.us> <16208.50934.351000.90704@gargle.gargle.HOWL> Content-Type: text/plain Message-Id: <1062261220.669.576.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sat, 30 Aug 2003 11:33:40 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/540 X-Sequence-Number: 3356 On Sat, 2003-08-30 at 10:47, Rob Nagler wrote: > Tom Lane writes: [snip] > enough. When I add this index, I will slow down inserts (about > 20K/day) and increase data size (this is the second largest table in [snip] Since I gather that this is a web-site, can we presume that they are clumped into an 8 hour range? 20,000/8 = 2,500/hour, which is 41.67/minute. If you can't do .69 inserts/second, something is wrong, and it ain't hardware, and it ain't Postgresql... > > PS: does server_id really need to be NUMERIC? Why not integer, or at > > worst bigint? > > It is a NUMERIC(18). It could be a bigint. What would be the change > in performance of this query if we changed it to bigint? http://www.postgresql.org/docs/7.3/static/datatype.html#DATATYPE-INT http://www.postgresql.org/docs/7.3/static/datatype.html#DATATYPE-NUMERIC-DECIMAL Scalars are faster than arbitrary precision types. Small (32 bit) scalars are faster than bit (64 bit) scalars on x86 h/w. -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA "Adventure is a sign of incompetence" Stephanson, great polar explorer From pgsql-performance-owner@postgresql.org Sat Aug 30 13:48:19 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5F067D1B8C4 for ; Sat, 30 Aug 2003 16:48: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 48654-01 for ; Sat, 30 Aug 2003 13:48:08 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id C1C0AD1B8B4 for ; Sat, 30 Aug 2003 13:48:06 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h7UGlrQ13504; Sat, 30 Aug 2003 12:47:53 -0400 (EDT) From: Bruce Momjian Message-Id: <200308301647.h7UGlrQ13504@candle.pha.pa.us> Subject: Re: PostgreSQL HDD Grow capacity In-Reply-To: <200308291044.40700.kopra@wepeka-it.com> To: koprahome@telkom.net Date: Sat, 30 Aug 2003 12:47:53 -0400 (EDT) Cc: pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL106 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/541 X-Sequence-Number: 3357 Eko Pranoto wrote: > How To calcute PostgreSQL HDD grow capacity for every byte data, start from > installation initialize. First, see the FAQ item about calculating row size. Second, see the chapter in the administration manual talking about computing disk space. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 From pgsql-performance-owner@postgresql.org Sat Aug 30 14:43: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 40315D1B574 for ; Sat, 30 Aug 2003 17:43: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 48057-06 for ; Sat, 30 Aug 2003 14:43:24 -0300 (ADT) Received: from mta01-svc.ntlworld.com (mta01-svc.ntlworld.com [62.253.162.41]) by svr1.postgresql.org (Postfix) with ESMTP id 61E8ED1B8B5 for ; Sat, 30 Aug 2003 14:43:22 -0300 (ADT) Received: from russell ([81.99.189.14]) by mta01-svc.ntlworld.com (InterMail vM.4.01.03.37 201-229-121-137-20020806) with SMTP id <20030830174322.DXSD17074.mta01-svc.ntlworld.com@russell> for ; Sat, 30 Aug 2003 18:43:22 +0100 From: "Russell Garrett" To: "PgSQL Performance ML" Subject: Re: Selecting random rows efficiently Date: Sat, 30 Aug 2003 18:43:22 +0100 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.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <1062260304.669.566.camel@haggis> Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/542 X-Sequence-Number: 3358 Considering that we'd have to index the random field too, it'd be neater in the long term to re-number the primary key. Although, being a primary key, that's foreign-keyed from absolutely everywhere, so that'd probably take an amusingly long time. ...and no we're not from Micronesia, we're from ever so slightly less exotic London. Though Micronesia might be nice... Russ (also from last.fm but without the fancy address) pgsql-performance-owner@postgresql.org wrote: > On Sat, 2003-08-30 at 09:01, Rod Taylor wrote: >>> i was hoping there was some trickery with sequences that would >>> allow me to easily pick a random valid sequence number..? >> >> I would suggest renumbering the data. >> >> ALTER SEQUENCE ... RESTART WITH 1; >> UPDATE table SET pkey = DEFAULT; >> >> Of course, PostgreSQL may have trouble with that update due to >> evaluation of the unique constraint immediately -- so drop the >> primary key first, and add it back after. > > And if there are child tables, they'd all have to be updated, too. From pgsql-performance-owner@postgresql.org Sat Aug 30 17:42: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 47AD1D1B561 for ; Sat, 30 Aug 2003 20:42: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 62766-01 for ; Sat, 30 Aug 2003 17:42:38 -0300 (ADT) Received: from pass.bivio.com (pass.bivio.com [216.87.82.238]) by svr1.postgresql.org (Postfix) with ESMTP id 9FADED1B8A4 for ; Sat, 30 Aug 2003 17:42:32 -0300 (ADT) Received: from LIFT.bivio.com (lift.bivio.com [216.87.82.233]) by pass.bivio.com (8.9.3/8.9.3) with ESMTP id OAB25434; Sat, 30 Aug 2003 14:42:33 -0600 From: Rob Nagler MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16209.3105.94000.204936@gargle.gargle.HOWL> Date: Sat, 30 Aug 2003 14:42:09 -0600 To: pgsql-performance@postgresql.org Subject: Re: How to force Nested Loop plan? In-Reply-To: <2074.1062260382@sss.pgh.pa.us> References: <16208.41885.960000.12706@gargle.gargle.HOWL> <24637.1062255721@sss.pgh.pa.us> <16208.50934.351000.90704@gargle.gargle.HOWL> <2074.1062260382@sss.pgh.pa.us> X-Mailer: VM 6.96 under Emacs 21.1.1 Organization: bivio Software Artisans, Inc. X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/543 X-Sequence-Number: 3359 Tom Lane writes: > That doesn't really tell me anything. What's the proportion of 21 > records out of the total table? Currently we have about 15 servers so 6% of the data is uniformly distributed with the value 21. > create index fooi on foo (min_date_time) where server_id = 21; > > This reduces the cost of maintaining the index but also makes it useful > *only* for id = 21 queries. On the plus side, you don't need to hack > the ORDER BY clause to get your queries to use it. Your choice... I like that better, thanks. After testing I found the elbow was at 1610 records with this index, but this clause still yields better performance at 1654 records: AND aa_t.server_id IN (21, 0) This is independent of the existence of the new index. Interestingly, when I drop the aa_t5 index, the elbow goes up to 1729 with the IN (21, 0) query. You might ask: why do I have an index at all? That's from my Oracle experience. server_id is a foreign key into the server table. If you don't create an index on a foreign key, Oracle locks the entire foreign table when you modify the local table. With an index, it only locks a row in the foreign table. This causes a major bottleneck, but in this case the server table is static. Therefore, the index is superfluous, and since there are only 16 values, the index should be bitmap index (Oracle speak, sorry, don't know the PG term). Dropping the index probably won't change any of the other queries, I think. Without the aa_t5 index and after the elbow, the Index Scan is replaced with a Seq Scan, which is just about as fast, but still 50 times slower than before the elbow: Limit (cost=34071.30..34071.31 rows=1 width=84) (actual time=5111.14..5111.15 rows=1 loops=1) -> Sort (cost=34066.98..34075.61 rows=3454 width=84) (actual time=5108.74..5109.96 rows=1733 loops=1) Sort Key: aa_t.min_date_time -> Merge Join (cost=33801.26..33863.98 rows=3454 width=84) (actual time=4868.62..5020.58 rows=41879 loops=1) Merge Cond: ("outer".realm_id = "inner".realm_id) -> Sort (cost=31.64..32.78 rows=455 width=19) (actual time=3.06..3.38 rows=415 loops=1) Sort Key: cc_t.realm_id -> Seq Scan on cc_t (cost=0.00..11.55 rows=455 width=19) (actual time=0.05..0.99 rows=455 loops=1) -> Sort (cost=33769.63..33778.26 rows=3454 width=65) (actual time=4865.20..4895.28 rows=41879 loops=1) Sort Key: aa_t.realm_id -> Merge Join (cost=33296.79..33566.63 rows=3454 width=65) (actual time=4232.52..4541.24 rows=41879 loops=1) Merge Cond: ("outer".bb_id = "inner".bb_id) -> Sort (cost=25216.97..25225.60 rows=3454 width=46) (actual time=3213.53..3243.65 rows=41879 loops=1) Sort Key: aa_t.bb_id -> Seq Scan on aa_t (cost=0.00..25013.97 rows=3454 width=46) (actual time=20.07..2986.11 rows=41879 loops=1) Filter: (server_id = 21::numeric) -> Sort (cost=8079.83..8184.53 rows=41879 width=19) (actual time=1018.95..1049.37 rows=41879 loops=1) Sort Key: bb_t.bb_id -> Seq Scan on bb_t (cost=0.00..4864.79 rows=41879 width=19) (actual time=0.04..810.88 rows=41879 loops=1) Total runtime: 5141.22 msec What I'm not sure is why does it decide to switch modes so "early", i.e., at about 5% of the table size or less? It seems that an Index Scan would give better mileage than a Seq Scan for possibly up to 50% of the table in this case. I clearly don't understand the internals, but the elbow seems rather sharp to me. > > What if the ORDER BY was: > > ORDER BY aa_t.server_id DESC, cc_t.name ASC > > Would the planner do the right thing? > > What do you consider the right thing? > cc_t.name doesn't seem connected > to this table at all --- or did I miss something? Sorry, this is a red herring. Please ignore. > If you've been generically using NUMERIC(n) where you could be using > integer or bigint, then I think you've probably paid a high price > without knowing it. I don't know what Oracle's cost tradeoffs are for > these datatypes, but I can tell you that Postgres's integer types are > way faster (and more compact) than our NUMERIC. I'll try to figure out what the price is in our case. I think Oracle does a pretty good job on data compression for NUMERIC. I haven't dealt with a large Postgres database until this one, so I guess it's time to learn. :) We actually have been quite pleased with Postgres's performance without paying much attention to it before this. When we first set up Oracle, we got into all of its parameters pretty heavily. With Postgres, we just tried it and it worked. This is the first query where we ran out of ideas to try. BTW, everybody's help on this list is fantastic. Usually, I can find the answer to my question (and have been doing so for 3 years) on this list without asking. Thanks, Rob From pgsql-performance-owner@postgresql.org Sat Aug 30 18:28: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 2E66DD1B8AA for ; Sat, 30 Aug 2003 21:28:52 +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 65360-01 for ; Sat, 30 Aug 2003 18:28:22 -0300 (ADT) Received: from lakemtao01.cox.net (lakemtao01.cox.net [68.1.17.244]) by svr1.postgresql.org (Postfix) with ESMTP id 03D76D1B524 for ; Sat, 30 Aug 2003 18:28:20 -0300 (ADT) Received: from lhosts ([68.11.66.83]) by lakemtao01.cox.net (InterMail vM.5.01.06.04 201-253-122-130-104-20030726) with ESMTP id <20030830212822.RZMB5378.lakemtao01.cox.net@lhosts> for ; Sat, 30 Aug 2003 17:28:22 -0400 Subject: Re: How to force Nested Loop plan? From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <16209.3105.94000.204936@gargle.gargle.HOWL> References: <16208.41885.960000.12706@gargle.gargle.HOWL> <24637.1062255721@sss.pgh.pa.us> <16208.50934.351000.90704@gargle.gargle.HOWL> <2074.1062260382@sss.pgh.pa.us> <16209.3105.94000.204936@gargle.gargle.HOWL> Content-Type: text/plain Message-Id: <1062278901.669.597.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sat, 30 Aug 2003 16:28:22 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/544 X-Sequence-Number: 3360 On Sat, 2003-08-30 at 15:42, Rob Nagler wrote: [snip] > We actually have been quite pleased with Postgres's performance > without paying much attention to it before this. When we first set up > Oracle, we got into all of its parameters pretty heavily. With > Postgres, we just tried it and it worked. This is the first query > where we ran out of ideas to try. Dumb question: given your out-of-the-box satisfaction, could it be that postgresql.conf hasn't been tweaked? -- ----------------------------------------------------------------- Ron Johnson, Jr. ron.l.johnson@cox.net Jefferson, LA USA 484,246 sq mi are needed for 6 billion people to live, 4 persons per lot, in lots that are 60'x150'. That is ~ California, Texas and Missouri. Alternatively, France, Spain and The United Kingdom. From pgsql-performance-owner@postgresql.org Sat Aug 30 19:11: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 39E49D1B574 for ; Sat, 30 Aug 2003 22:11: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 66974-03 for ; Sat, 30 Aug 2003 19:10:44 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 14AC6D1B8A4 for ; Sat, 30 Aug 2003 19:10:42 -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 h7UMAgjX004041; Sat, 30 Aug 2003 18:10:42 -0400 (EDT) To: Rob Nagler Cc: pgsql-performance@postgresql.org Subject: Re: How to force Nested Loop plan? In-reply-to: <16209.3105.94000.204936@gargle.gargle.HOWL> References: <16208.41885.960000.12706@gargle.gargle.HOWL> <24637.1062255721@sss.pgh.pa.us> <16208.50934.351000.90704@gargle.gargle.HOWL> <2074.1062260382@sss.pgh.pa.us> <16209.3105.94000.204936@gargle.gargle.HOWL> Comments: In-reply-to Rob Nagler message dated "Sat, 30 Aug 2003 14:42:09 -0600" Date: Sat, 30 Aug 2003 18:10:41 -0400 Message-ID: <4040.1062281441@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/545 X-Sequence-Number: 3361 Rob Nagler writes: > What I'm not sure is why does it decide to switch modes so "early", > i.e., at about 5% of the table size or less? Given the default cost parameters and cost models, that's the correct place to switch. Since the estimate evidently doesn't match reality for your case, you might want to play with the parameters. Reducing random_page_cost would be the first thing I'd try. Some people think that increasing effective_cache_size is a good idea too, though I feel that that has only marginal impact on the planner's choices. Keep in mind though that you seem to be experimenting with a fully-cached database; you may find that the planner's beliefs more nearly approach reality when actual I/O has to occur. Another thing I'd be interested to know about is how closely the physical order of the table entries correlates with min_date_time. A high correlation reduces the actual cost of the indexscan (since visiting the rows in index order becomes less of a random-access proposition). We are aware that the planner doesn't model this effect very well at present ... regards, tom lane From pgsql-performance-owner@postgresql.org Sat Aug 30 21:09:59 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 32CEDD1B56B for ; Sun, 31 Aug 2003 00:09:56 +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 71365-06 for ; Sat, 30 Aug 2003 21:09:48 -0300 (ADT) Received: from pass.bivio.com (locker.bivio.com [216.87.82.238]) by svr1.postgresql.org (Postfix) with ESMTP id 47FAAD1B899 for ; Sat, 30 Aug 2003 21:09:36 -0300 (ADT) Received: from LIFT.bivio.com (lift.bivio.com [216.87.82.233]) by pass.bivio.com (8.9.3/8.9.3) with ESMTP id SAB25632 for ; Sat, 30 Aug 2003 18:09:39 -0600 From: Rob Nagler MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16209.14949.507000.384083@gargle.gargle.HOWL> Date: Sat, 30 Aug 2003 17:59:33 -0600 To: PgSQL Performance ML Subject: Re: How to force Nested Loop plan? In-Reply-To: <1062278901.669.597.camel@haggis> References: <16208.41885.960000.12706@gargle.gargle.HOWL> <24637.1062255721@sss.pgh.pa.us> <16208.50934.351000.90704@gargle.gargle.HOWL> <2074.1062260382@sss.pgh.pa.us> <16209.3105.94000.204936@gargle.gargle.HOWL> <1062278901.669.597.camel@haggis> X-Mailer: VM 6.96 under Emacs 21.1.1 Organization: bivio Software Artisans, Inc. X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/546 X-Sequence-Number: 3362 Ron Johnson writes: > Dumb question: given your out-of-the-box satisfaction, could it be > that postgresql.conf hasn't been tweaked? Here are the modified values: shared_buffers = 8000 wal_buffers = 80 sort_mem = 32000 effective_cache_size = 400000 random_page_cost = 4 autocommit = false timezone = UTC I had run a test with effective_cache_size to high value to see what would happen. Also adjusted random_page_cost: random_page_cost effective_cache_size elbow 4 40000 675 .5 40000 592 .1 40000 392 4 1000 30 My conclusion is that random_page_cost should be left alone and effective_cache_size higher is better. BTW, the hardware is 2 x 2.4ghz Xeon, 1.2GB, SCSI (linux software raid) with 10K disks. This is close to the production box. Although we are planning on adding more memory to production. Rob From pgsql-performance-owner@postgresql.org Sat Aug 30 21:23:46 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 7A0C0D1B561 for ; Sun, 31 Aug 2003 00:23:45 +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 73817-04 for ; Sat, 30 Aug 2003 21:23:38 -0300 (ADT) Received: from pass.bivio.com (locker.bivio.com [216.87.82.238]) by svr1.postgresql.org (Postfix) with ESMTP id 3F063D1B56B for ; Sat, 30 Aug 2003 21:23:34 -0300 (ADT) Received: from LIFT.bivio.com (lift.bivio.com [216.87.82.233]) by pass.bivio.com (8.9.3/8.9.3) with ESMTP id SAB25639; Sat, 30 Aug 2003 18:23:37 -0600 From: Rob Nagler MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16209.15488.141000.729032@gargle.gargle.HOWL> Date: Sat, 30 Aug 2003 18:08:32 -0600 To: pgsql-performance@postgresql.org Subject: Re: How to force Nested Loop plan? In-Reply-To: <4040.1062281441@sss.pgh.pa.us> References: <16208.41885.960000.12706@gargle.gargle.HOWL> <24637.1062255721@sss.pgh.pa.us> <16208.50934.351000.90704@gargle.gargle.HOWL> <2074.1062260382@sss.pgh.pa.us> <16209.3105.94000.204936@gargle.gargle.HOWL> <4040.1062281441@sss.pgh.pa.us> X-Mailer: VM 6.96 under Emacs 21.1.1 Organization: bivio Software Artisans, Inc. X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/547 X-Sequence-Number: 3363 Tom Lane writes: > Keep in mind though that you seem to be experimenting with a > fully-cached database; you may find that the planner's beliefs more > nearly approach reality when actual I/O has to occur. My hope is that the entire database should fit in memory. This may not be in the case right now with only 1GB, but it should be close. The pgsql/data/base/NNN directory is about 1.5GB on production. I'm pretty sure with constant vacuuming, we could keep that size down. A pgdump is about 60MB now, growing at about .5MB a day. > Another thing I'd be interested to know about is how closely the > physical order of the table entries correlates with min_date_time. Probably "pretty close". The primary key of aa_t is (bb_id, server_id), and bb_id is a sequence. aa_t is updated heavily on production, but these tests are on a fresh import so vacuuming and index order is not a factor. We do a reload every now and then to improve performance on production. min_date_time is highly correlated with bb_id, because both are increasing constantly. server_id is one of 16 values. > A high correlation reduces the actual cost of the indexscan (since > visiting the rows in index order becomes less of a random-access > proposition). We are aware that the planner doesn't model this effect > very well at present ... Oracle's optimizer is lacking here, too. The best optimizer I've seen was at Tandem, and even then hints were required. Are there plans for explicit hints to the planner? Thanks, Rob From pgsql-performance-owner@postgresql.org Sun Aug 31 19:16:58 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3042ED1B8C0 for ; Sun, 31 Aug 2003 22:16:57 +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 74042-06 for ; Sun, 31 Aug 2003 19:16:48 -0300 (ADT) Received: from mailer.acaso.net (209.Red-213-97-17.pooles.rima-tde.net [213.97.17.209]) by svr1.postgresql.org (Postfix) with ESMTP id 21B54D1B56B for ; Sun, 31 Aug 2003 19:16:44 -0300 (ADT) Received: from 6-allhosts (unknown [192.168.0.4]) by mailer.acaso.net (Postfix) with ESMTP id 33BD61014D; Mon, 1 Sep 2003 00:16:44 +0200 (CEST) Subject: Re: SQL performance problems From: Alberto Caso To: Rhaoni Chiu Pereira Cc: PostgreSQL Performance In-Reply-To: <1062190759.3f4fbea7aae8c@sistemica.info> References: <1062190759.3f4fbea7aae8c@sistemica.info> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-G8WSUG5iU/cnyxZPQWOJ" Organization: Adaptia Soluciones Integrales Message-Id: <1062368198.1052.34.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Mon, 01 Sep 2003 00:16:38 +0200 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/548 X-Sequence-Number: 3364 --=-G8WSUG5iU/cnyxZPQWOJ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Estimated and actual rows differ a lot. Did you a VACUUM ANALYZE so that the optimizer could update its statistics? Also it would be great if you could provide more information, as your PostgreSQL version, your table and indexes descriptions, etc. Have a look at:=20 http://techdocs.postgresql.org/guides/SlowQueryPostingGuidelines Please excuse me if you have already done it. I had a quick look at the list's archives and didn't found it in your prior posts. Regards, --=20 Alberto Caso Palomino Adaptia Soluciones Integrales http://www.adaptia.net alberto.caso@adaptia.net --=-G8WSUG5iU/cnyxZPQWOJ Content-Type: application/pgp-signature; name=signature.asc Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQA/UnPF/tUyzpgV/S0RAuDDAKDKxaIxIcMQuPbN8sK2oUjL+n5VbgCgzxsc 32d+0QS50it9fBRp84TOgGg= =PABT -----END PGP SIGNATURE----- --=-G8WSUG5iU/cnyxZPQWOJ-- From pgsql-performance-owner@postgresql.org Sun Aug 31 20:13:03 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 1647BD1B4E2 for ; Sun, 31 Aug 2003 23:13: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 74246-10 for ; Sun, 31 Aug 2003 20:12:53 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 0CC6CD1B8BA for ; Sun, 31 Aug 2003 20:12:50 -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 h7VNCojX029707; Sun, 31 Aug 2003 19:12:50 -0400 (EDT) To: Rob Nagler Cc: pgsql-performance@postgresql.org Subject: Re: How to force Nested Loop plan? In-reply-to: <16209.15488.141000.729032@gargle.gargle.HOWL> References: <16208.41885.960000.12706@gargle.gargle.HOWL> <24637.1062255721@sss.pgh.pa.us> <16208.50934.351000.90704@gargle.gargle.HOWL> <2074.1062260382@sss.pgh.pa.us> <16209.3105.94000.204936@gargle.gargle.HOWL> <4040.1062281441@sss.pgh.pa.us> <16209.15488.141000.729032@gargle.gargle.HOWL> Comments: In-reply-to Rob Nagler message dated "Sat, 30 Aug 2003 18:08:32 -0600" Date: Sun, 31 Aug 2003 19:12:50 -0400 Message-ID: <29706.1062371570@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/549 X-Sequence-Number: 3365 Rob Nagler writes: > Are there plans for explicit hints to the planner? Personally, I'm philosophically opposed to planner hints; see previous discussions in the archives. regards, tom lane