diff --git "a/pgsql-performance.200302" "b/pgsql-performance.200302" new file mode 100644--- /dev/null +++ "b/pgsql-performance.200302" @@ -0,0 +1,27311 @@ +From pgsql-performance-owner@postgresql.org Fri Jan 31 21:10:55 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id CE8CB4799B5 + for ; + Fri, 31 Jan 2003 21:10:54 -0500 (EST) +Received: from wolff.to (wolff.to [66.93.249.74]) + by postgresql.org (Postfix) with SMTP id 531FA479702 + for ; + Fri, 31 Jan 2003 19:49:33 -0500 (EST) +Received: (qmail 14693 invoked by uid 500); 1 Feb 2003 01:02:29 -0000 +Date: Fri, 31 Jan 2003 19:02:29 -0600 +From: Bruno Wolff III +To: Don Bowman +Cc: "'pgsql-performance@postgresql.org'" +Subject: Re: not using index for select min(...) +Message-ID: <20030201010229.GA14084@wolff.to> +Mail-Followup-To: Don Bowman , + "'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.3.25i +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200301/408 +X-Sequence-Number: 1055 + +On Fri, Jan 31, 2003 at 16:12:38 -0500, + Don Bowman wrote: +> I have a table which is very large (~65K rows). I have +> a column in it which is indexed, and I wish to use for +> a join. I'm finding that I'm using a sequential scan +> for this when selecting a MIN. +> +> I've boiled this down to something like this: +> +> => create table X( value int primary key ); +> => explain select min(value) from x; + +Use the following instead: +select value from x order by value limit 1; + +From pgsql-hackers-owner@postgresql.org Fri Jan 31 23:10:53 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 37EFC47613F; Fri, 31 Jan 2003 23:10:49 -0500 (EST) +Received: from perrin.int.nxad.com (internal.ext.nxad.com [66.250.180.251]) + by postgresql.org (Postfix) with ESMTP + id 93857475C15; Fri, 31 Jan 2003 23:10:37 -0500 (EST) +Received: by perrin.int.nxad.com (Postfix, from userid 1001) + id D5D8621058; Fri, 31 Jan 2003 20:09:54 -0800 (PST) +Date: Fri, 31 Jan 2003 20:09:54 -0800 +From: Sean Chittenden +To: Josh Berkus +Cc: Don Bowman , + "'pgsql-hackers@postgresql.org'" +Subject: Re: [PERFORM] not using index for select min(...) +Message-ID: <20030201040954.GK15936@perrin.int.nxad.com> +References: + <200301311531.12605.josh@agliodbs.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <200301311531.12605.josh@agliodbs.com> +User-Agent: Mutt/1.4i +X-PGP-Key: finger seanc@FreeBSD.org +X-PGP-Fingerprint: 6CEB 1B06 BFD3 70F6 95BE 7E4D 8E85 2E0A 5F5B 3ECB +X-Web-Homepage: http://sean.chittenden.org/ +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200301/1327 +X-Sequence-Number: 34937 + +> > I have a table which is very large (~65K rows). I have +> > a column in it which is indexed, and I wish to use for +> > a join. I'm finding that I'm using a sequential scan +> > for this when selecting a MIN. +> +> Due to Postgres' system of extensible aggregates (i.e. you can write +> your own aggregates), all aggregates will trigger a Seq Scan in a +> query. It's a known drawrback that nobody has yet found a good way +> around. + +I've spent some time in the past thinking about this, and here's the +best idea that I can come up with: + +Part one: setup an ALTER TABLE directive that allows for the +addition/removal of cached aggregates. Ex: + + ALTER TABLE tab1 ADD AGGREGATE CACHE ON count(*); + ALTER TABLE tab1 ADD AGGREGATE CACHE ON sum(col2); + ALTER TABLE tab1 ADD AGGREGATE CACHE ON sum(col2) WHERE col2 > 100; + ALTER TABLE tab1 ADD AGGREGATE CACHE ON sum(col2) WHERE col2 <= 100; + + +Which would translate into some kind of action on a pg_aggregate_cache +catalog: + +aggregate_cache_oid OID -- OID for the aggregate cache +aggregate_table_oid OID -- table OID +ins_aggfn_oid OID -- aggregate function id for inserts +upd_aggfn_oid OID -- aggregate function id for updates +del_aggfn_oid OID -- aggregate function id for deletes +cache_value INT -- the value of the cache +private_data INT[4] -- temporary data space for needed + -- data necessary to calculate cache_value + -- four is just a guesstimate for how much + -- space would be necessary to calculate + -- the most complex of aggregates +where_clause ??? -- I haven't the faintest idea how to + -- express some kind of conditional like this + + +Part two: setup a RULE or TRIGGER that runs on INSERT, UPDATE, or +DELETE. For the count(*) exercise, the ON UPDATE would be a no-op. +For ON INSERT, the count(*) rule would have to do something like: + +UPDATE pg_catalog.pg_aggregate_cache SET cached_value = (cached_value + 1) + WHERE aggregate_cache_oid = 1111111; + + +For the sum(col2) aggregate cache, the math is a little more complex, +but I think it's quite reasonable given that it obviates a full table +scan. For an insert: + +UPDATE pg_catalog.pg_aggregate_cache SET cached_value = + ((cached_value * private_data[0] + NEW.col2) / (private_data[0] + 1)) + WHERE aggregate_cache_oid = 1111112; + + +Now, there are some obvious problems: + +1) avg requires a floating point return value, therefore an INT may + not be an appropriate data type for cache_value or private_data. + +2) aggregate caching wouldn't speed up anything but full table + aggregates or regions of a column that are frequently needed. + +3) all of the existing aggregates would have to be updated to include + an insert, update, delete procedure (total of 60 aggregates, but + only 7 by name). + +4) the planner would have to be taught how to use/return values from + the cache. + +5) Each aggregate type makes use of the private_data column + differently. It's up to the cached aggregate function authors to + not jumble up their private data space. + +6) I don't know of a way to handle mixing of floating point numbers + and integers. That said, there's some margin of error that could + creep into the floating point calculations such as avg. + + +And some benefits: + +1) You only get caching for aggregates that you frequently use + (sum(col2), count(*), etc.). + +2) Aggregate function authors can write their own caching routines. + +3) For tens of millions of rows, it can be very time consuming to + sum() fifty million rows, but it's easy to amortize the cost of + updating the cache on insert, update, delete over the course of a + month. + +4) If an aggregate cache definition isn't setup, it should be easy for + the planner to fall back to a full table scan, as it currently is. + + +This definitely would be a performance boost and something that would +only be taken advantage of by DBAs that are intentionally performance +tuning their database, but for those that do, it could be a massive +win. Thoughts? -sc + +-- +Sean Chittenden + +From pgsql-hackers-owner@postgresql.org Fri Jan 31 23:40:33 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 9DB7A476654 + for ; + Fri, 31 Jan 2003 23:40:31 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 2EBAF4766D9 + for ; + Fri, 31 Jan 2003 23:35:51 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h114ZW5u004279; + Fri, 31 Jan 2003 23:35:32 -0500 (EST) +To: Sean Chittenden +Cc: Josh Berkus , Don Bowman , + "'pgsql-hackers@postgresql.org'" +Subject: Re: [PERFORM] not using index for select min(...) +In-reply-to: <20030201040954.GK15936@perrin.int.nxad.com> +References: + <200301311531.12605.josh@agliodbs.com> + <20030201040954.GK15936@perrin.int.nxad.com> +Comments: In-reply-to Sean Chittenden + message dated "Fri, 31 Jan 2003 20:09:54 -0800" +Date: Fri, 31 Jan 2003 23:35:32 -0500 +Message-ID: <4278.1044074132@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200301/1330 +X-Sequence-Number: 34940 + +Sean Chittenden writes: +> Now, there are some obvious problems: + +You missed the real reason why this will never happen: it completely +kills any prospect of concurrent updates. If transaction A has issued +an update on some row, and gone and modified the relevant aggregate +cache entries, what happens when transaction B wants to update another +row? It has to wait for A to commit or not, so it knows whether to +believe A's changes to the aggregate cache entries. + +For some aggregates you could imagine an 'undo' operator to allow +A's updates to be retroactively removed even after B has applied its +changes. But that doesn't work very well in general. And in any case, +you'd have to provide serialization interlocks on physical access to +each of the aggregate cache entries. That bottleneck applied to every +update would be likely to negate any possible benefit from using the +cached values. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Sat Feb 1 22:03:57 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id ED1B1475AA1 + for ; + Sat, 1 Feb 2003 22:03:55 -0500 (EST) +Received: from platonic.cynic.net (platonic.cynic.net [204.80.150.245]) + by postgresql.org (Postfix) with ESMTP id 555B3475A37 + for ; + Sat, 1 Feb 2003 22:03:55 -0500 (EST) +Received: from angelic.cynic.net (angelic-platonic.cvpn.cynic.net + [198.73.220.226]) by platonic.cynic.net (Postfix) with ESMTP + id 8A7CCC0C6; Sun, 2 Feb 2003 03:02:18 +0000 (UTC) +Received: from localhost (localhost [127.0.0.1]) + by angelic.cynic.net (Postfix) with ESMTP + id CDAA28736; Sat, 1 Feb 2003 14:07:00 +0900 (JST) +Date: Sat, 1 Feb 2003 14:07:00 +0900 (JST) +From: Curt Sampson +To: Curtis Faith +Cc: 'Josh Berkus' , + 'Noah Silverman' , + pgsql-performance@postgresql.org +Subject: Re: One large v. many small +In-Reply-To: <001401c2c935$8c759140$a200a8c0@curtislaptop> +Message-ID: +References: <001401c2c935$8c759140$a200a8c0@curtislaptop> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/2 +X-Sequence-Number: 1058 + +On Fri, 31 Jan 2003, Curtis Faith wrote: + +> Depending on the way the records are accessed and the cache size, +> the exact opposite could be true. The index pages will most likely +> rarely be in memory when you have 3000 different tables. Meaning +> that each search will require at least three or four index page +> retrievals plus the tuple page. + +Assuming you're using indexes at all. If you're tending to use table +scans, this doesn't matter. + + From Noah's description it seemed he was--he said that a particular data +item couldn't be the primary key, presumably because he couldn't index +it reasonably. But this just my guess, not a fact. + +> Combine a multi-part index (on both client and foo, which order +> would depend on the access required) that is clustered once a week +> or so using the admittedly non-optimal PostgreSQL CLUSTER command +> and I'll bet you can get equivalent or better performance... + +I would say that, just after a CLUSTER, you're likely to see better +performance because this would have the effect, on a FFS or similar +filesystem where you've got plenty of free space, of physically +clustering data that would not have been clustered in the case of a lot +of small tables that see a lot of appending evenly over all of them over +the course of time. + +So the tradeoff there is really, can you afford the time for the CLUSTER? +(In a system where you have a lot of maintenance time, probably. Though if +it's a huge table, this might need an entire weekend. In a system that needs +to be up 24/7, probably not, unless you have lots of spare I/O capacity.) +Just out of curiousity, how does CLUSTER deal with updates to the table while +the CLUSTER command is running? + +> I don't think there is any substitute for just trying it out. It +> shouldn't be that hard to create a bunch of SQL statements that +> concatenate the tables into one large one. + +I entirely agree! There are too many unknowns here to do more than +speculate on this list. + +But thanks for enlightening me on situations where one big table perform +better. + +cjs +-- +Curt Sampson +81 90 7737 2974 http://www.netbsd.org + Don't you know, in this new Dark Age, we're all light. --XTC + +From pgsql-hackers-owner@postgresql.org Sat Feb 1 00:15:35 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id C50CC4763E7 + for ; + Sat, 1 Feb 2003 00:15:33 -0500 (EST) +Received: from perrin.int.nxad.com (internal.ext.nxad.com [66.250.180.251]) + by postgresql.org (Postfix) with ESMTP id 3AF56476160 + for ; + Sat, 1 Feb 2003 00:10:13 -0500 (EST) +Received: by perrin.int.nxad.com (Postfix, from userid 1001) + id E1F1621058; Fri, 31 Jan 2003 21:09:35 -0800 (PST) +Date: Fri, 31 Jan 2003 21:09:35 -0800 +From: Sean Chittenden +To: Tom Lane +Cc: Josh Berkus , Don Bowman , + "'pgsql-hackers@postgresql.org'" +Subject: Re: [PERFORM] not using index for select min(...) +Message-ID: <20030201050935.GM15936@perrin.int.nxad.com> +References: + <200301311531.12605.josh@agliodbs.com> + <20030201040954.GK15936@perrin.int.nxad.com> + <4278.1044074132@sss.pgh.pa.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <4278.1044074132@sss.pgh.pa.us> +User-Agent: Mutt/1.4i +X-PGP-Key: finger seanc@FreeBSD.org +X-PGP-Fingerprint: 6CEB 1B06 BFD3 70F6 95BE 7E4D 8E85 2E0A 5F5B 3ECB +X-Web-Homepage: http://sean.chittenden.org/ +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/2 +X-Sequence-Number: 34944 + +> > Now, there are some obvious problems: +> +> You missed the real reason why this will never happen: it completely +> kills any prospect of concurrent updates. If transaction A has +> issued an update on some row, and gone and modified the relevant +> aggregate cache entries, what happens when transaction B wants to +> update another row? It has to wait for A to commit or not, so it +> knows whether to believe A's changes to the aggregate cache entries. + +I never claimed it was perfect, :) but it'd be is no worse than a +table lock. For the types of applications that this would be of +biggest use to, there would likely be more reads than writes and it +wouldn't be as bad as one could imagine. A few examples: + +# No contension +Transaction A begins +Transaction A updates tab1 +Transaction B begins +Transaction B updates tab1 +Transaction B commits +Transaction A commits + +# contension +Transaction A begins +Transaction A updates tab1 +Transaction B begins +Transaction B updates tab1 +Transaction A commits +Transaction B commits + +This is just about the only case that I can see where there would be +contension. In this case, transaction B would have to re-run its +trigger serially. In the worse case scenario: + +Transaction A begins +Transaction A updates tab1 +Transaction B begins +Transaction B updates tab1 +Transaction A commits +Transaction B selects +Transaction B updates tab1 again +Transaction B commits + +In my journals or books I haven't found any examples of a transaction +based cache that'd work any better than this. It ain't perfect, but, +AFAICT, it's as good as it's going to get. The only thing that I +could think of that would add some efficiency in this case would be to +have transaction B read trough the committed changes from a log file. +After a threshold, it could be more efficient than having transaction +B re-run its queries. + +Like I said, it ain't perfect, but what would be a better solution? +::shrug:: Even OODB's with stats agents have this problem (though +their overhead for doing this kind of work is much much lower). -sc + +-- +Sean Chittenden + +From pgsql-hackers-owner@postgresql.org Sat Feb 1 11:43:33 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0FE17475A09 + for ; + Sat, 1 Feb 2003 11:43:33 -0500 (EST) +Received: from filer (12-235-198-106.client.attbi.com [12.235.198.106]) + by postgresql.org (Postfix) with ESMTP id 627314758DC + for ; + Sat, 1 Feb 2003 11:43:32 -0500 (EST) +Received: from localhost (localhost [127.0.0.1]) (uid 1000) + by filer with local; Sat, 01 Feb 2003 08:43:37 -0800 +Date: Sat, 1 Feb 2003 08:43:37 -0800 +From: Kevin Brown +To: "'pgsql-hackers@postgresql.org'" +Subject: Re: [PERFORM] not using index for select min(...) +Message-ID: <20030201164336.GP12957@filer> +Mail-Followup-To: Kevin Brown , + "'pgsql-hackers@postgresql.org'" +References: + <200301311531.12605.josh@agliodbs.com> + <20030201040954.GK15936@perrin.int.nxad.com> + <4278.1044074132@sss.pgh.pa.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +In-Reply-To: <4278.1044074132@sss.pgh.pa.us> +User-Agent: Mutt/1.4i +Organization: Frobozzco International +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/26 +X-Sequence-Number: 34968 + +Tom Lane wrote: +> Sean Chittenden writes: +> > Now, there are some obvious problems: +> +> You missed the real reason why this will never happen: it completely +> kills any prospect of concurrent updates. If transaction A has issued +> an update on some row, and gone and modified the relevant aggregate +> cache entries, what happens when transaction B wants to update another +> row? It has to wait for A to commit or not, so it knows whether to +> believe A's changes to the aggregate cache entries. +> +> For some aggregates you could imagine an 'undo' operator to allow +> A's updates to be retroactively removed even after B has applied its +> changes. But that doesn't work very well in general. And in any case, +> you'd have to provide serialization interlocks on physical access to +> each of the aggregate cache entries. That bottleneck applied to every +> update would be likely to negate any possible benefit from using the +> cached values. + +Hmm...any chance, then, of giving aggregate functions a means of +asking which table(s) and column(s) the original query referred to so +that it could do proper optimization on its own? For instance, for a +"SELECT min(x) FROM mytable" query, the min() function would be told +upon asking that it's operating on column x of mytable, whereas it +would be told "undefined" for the column if the query were "SELECT +min(x+y) FROM mytable". In the former case, it would be able to do a +"SELECT x FROM mytable ORDER BY x LIMIT 1" on its own, whereas in the +latter it would have no choice but to fetch the data to do its +calculation via the normal means. + +But that may be more trouble than it's worth, if aggregate functions +aren't responsible for retrieving the values they're supposed to base +their computations on, or if it's not possible to get the system to +refrain from prefetching data for the aggregate function until the +function asks for it. + +-- +Kevin Brown kevin@sysexperts.com + +From pgsql-hackers-owner@postgresql.org Sat Feb 1 12:05:40 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0F9AB475E4A + for ; + Sat, 1 Feb 2003 12:05:40 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 1C2C44760F8 + for ; + Sat, 1 Feb 2003 12:03:27 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h11H3W5u007648; + Sat, 1 Feb 2003 12:03:32 -0500 (EST) +To: Kevin Brown +Cc: "'pgsql-hackers@postgresql.org'" +Subject: Re: [PERFORM] not using index for select min(...) +In-reply-to: <20030201164336.GP12957@filer> +References: + <200301311531.12605.josh@agliodbs.com> + <20030201040954.GK15936@perrin.int.nxad.com> + <4278.1044074132@sss.pgh.pa.us> <20030201164336.GP12957@filer> +Comments: In-reply-to Kevin Brown + message dated "Sat, 01 Feb 2003 08:43:37 -0800" +Date: Sat, 01 Feb 2003 12:03:32 -0500 +Message-ID: <7647.1044119012@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/29 +X-Sequence-Number: 34971 + +Kevin Brown writes: +> Hmm...any chance, then, of giving aggregate functions a means of +> asking which table(s) and column(s) the original query referred to so +> that it could do proper optimization on its own? + +You can't usefully do that without altering the aggregate paradigm. +It won't help for min() to intuit the answer quickly if the query +plan is going to insist on feeding every row to it anyway. + +> For instance, for a +> "SELECT min(x) FROM mytable" query, the min() function would be told +> upon asking that it's operating on column x of mytable, whereas it +> would be told "undefined" for the column if the query were "SELECT +> min(x+y) FROM mytable". In the former case, it would be able to do a +> "SELECT x FROM mytable ORDER BY x LIMIT 1" on its own, + +Don't forget that it would also need to be aware of whether there were +any WHERE clauses, joins, GROUP BY, perhaps other things I'm not +thinking of. + +In the end, the only reasonable way to handle this kind of thing is +to teach the query planner about it. Considering the small number +of cases that are usefully optimizable (basically only MIN and MAX +on a single table without any WHERE or GROUP clauses), and the ready +availability of a SQL-level workaround, it strikes me as a very +low-priority TODO item. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Sat Feb 1 14:42:54 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A5DBF475425 + for ; + Sat, 1 Feb 2003 14:42:53 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 11F33474E53 + for ; + Sat, 1 Feb 2003 14:42:53 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2816540 for pgsql-performance@postgresql.org; + Sat, 01 Feb 2003 11:42:47 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: pgsql-performance@postgresql.org +Subject: Re: not using index for select min(...) +Date: Sat, 1 Feb 2003 11:41:42 -0800 +User-Agent: KMail/1.4.3 +References: + <200301311531.12605.josh@agliodbs.com> + <20030201040954.GK15936@perrin.int.nxad.com> +In-Reply-To: <20030201040954.GK15936@perrin.int.nxad.com> +MIME-Version: 1.0 +Message-Id: <200302011141.42245.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/1 +X-Sequence-Number: 1057 + +Sean, + +> I've spent some time in the past thinking about this, and here's the +> best idea that I can come up with: +> +> Part one: setup an ALTER TABLE directive that allows for the +> addition/removal of cached aggregates. Ex: + +Actually, Joe Conway and I may be working on something like this for a clie= +nt.=20=20 +Joe's idea is to use a hacked version of the statistics collector to cache= +=20 +selected aggregate values in memory. These aggregates would be=20 +non-persistent, but the main concern for us is having aggregate values that= +=20 +are instantly accessable, and that don't increase the cost of INSERTS and= +=20 +UPDATES more than 10%. + +This is to satisfy the needs of a particular client, though, so it may neve= +r=20 +make it into the general PostgreSQL source. We'll post it somewhere if it= +=20 +works, though. + +We already implemented caching aggregates to tables, with is trivially easy= + to=20 +do with triggers. The problem with this approach is the=20 +UPDATE/INSERT/DELETE overhead; even with an SPI-optimized C trigger, it's= +=20 +costing us up to 40% additional time when under heavy write activity ...=20 +which is exactly when we can't afford delays. + +For a database which has a low level of UPDATE activity, though, you can=20 +already implement cached aggregates as tables without inventing any new=20 +Postgres extensions. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-hackers-owner@postgresql.org Sat Feb 1 15:29:47 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id D7A79476226 + for ; + Sat, 1 Feb 2003 15:29:46 -0500 (EST) +Received: from sabre.velocet.net (sabre.velocet.net [216.138.209.205]) + by postgresql.org (Postfix) with ESMTP id CFA13475E3E + for ; + Sat, 1 Feb 2003 15:21:33 -0500 (EST) +Received: from stark.dyndns.tv (H162.C233.tor.velocet.net [216.138.233.162]) + by sabre.velocet.net (Postfix) with ESMTP + id 325DE138152; Sat, 1 Feb 2003 15:21:28 -0500 (EST) +Received: from localhost ([127.0.0.1] helo=stark.dyndns.tv ident=foobar) + by stark.dyndns.tv with smtp (Exim 3.36 #1 (Debian)) + id 18f48k-0003Nc-00; Sat, 01 Feb 2003 15:21:26 -0500 +To: Tom Lane +Cc: Kevin Brown , + "'pgsql-hackers@postgresql.org'" +Subject: Re: [PERFORM] not using index for select min(...) +References: + <200301311531.12605.josh@agliodbs.com> + <20030201040954.GK15936@perrin.int.nxad.com> + <4278.1044074132@sss.pgh.pa.us> <20030201164336.GP12957@filer> + <7647.1044119012@sss.pgh.pa.us> +In-Reply-To: <7647.1044119012@sss.pgh.pa.us> +From: Greg Stark +Organization: The Emacs Conspiracy; member since 1992 +Date: 01 Feb 2003 15:21:24 -0500 +Message-ID: <87el6rsqez.fsf@stark.dyndns.tv> +Lines: 36 +User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/42 +X-Sequence-Number: 34984 + +Tom Lane writes: + +> Kevin Brown writes: +> > Hmm...any chance, then, of giving aggregate functions a means of +> > asking which table(s) and column(s) the original query referred to so +> > that it could do proper optimization on its own? +> +> You can't usefully do that without altering the aggregate paradigm. +> It won't help for min() to intuit the answer quickly if the query +> plan is going to insist on feeding every row to it anyway. + +That just means you need some way for aggregates to declare which records they +need. The only values that seem like they would be useful would be "first +record" "last record" and "all records". Possibly something like "all-nonnull +records" for things like count(), but that might be harder. + +> Don't forget that it would also need to be aware of whether there were +> any WHERE clauses, joins, GROUP BY, perhaps other things I'm not +> thinking of. +> +> In the end, the only reasonable way to handle this kind of thing is +> to teach the query planner about it. Considering the small number +> of cases that are usefully optimizable (basically only MIN and MAX +> on a single table without any WHERE or GROUP clauses), and the ready +> availability of a SQL-level workaround, it strikes me as a very +> low-priority TODO item. + +All true, but I wouldn't be so quick to dismiss it as low-priority. In my +experience I've seen the idiom "select min(foo) from bar" more times than I +can count. The frequency with which this question occurs here probably is +indicative of how much people expect it to work. And it's probably used by a +lot of multi-database applications and in a lot of auto-matically generated +code where it would be hard to hack in special purpose workarounds. + +-- +greg + + +From pgsql-hackers-owner@postgresql.org Sat Feb 1 21:29:00 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id CC195475425 + for ; + Sat, 1 Feb 2003 21:28:57 -0500 (EST) +Received: from wolff.to (wolff.to [66.93.249.74]) + by postgresql.org (Postfix) with SMTP id 1AB4F474E53 + for ; + Sat, 1 Feb 2003 21:28:57 -0500 (EST) +Received: (qmail 3374 invoked by uid 500); 2 Feb 2003 02:41:56 -0000 +Date: Sat, 1 Feb 2003 20:41:56 -0600 +From: Bruno Wolff III +To: Greg Stark +Cc: Tom Lane , Kevin Brown , + "'pgsql-hackers@postgresql.org'" +Subject: Re: [PERFORM] not using index for select min(...) +Message-ID: <20030202024156.GA3353@wolff.to> +Mail-Followup-To: Greg Stark , + Tom Lane , Kevin Brown , + "'pgsql-hackers@postgresql.org'" +References: + <200301311531.12605.josh@agliodbs.com> + <20030201040954.GK15936@perrin.int.nxad.com> + <4278.1044074132@sss.pgh.pa.us> <20030201164336.GP12957@filer> + <7647.1044119012@sss.pgh.pa.us> <87el6rsqez.fsf@stark.dyndns.tv> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <87el6rsqez.fsf@stark.dyndns.tv> +User-Agent: Mutt/1.3.25i +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/47 +X-Sequence-Number: 34989 + +On Sat, Feb 01, 2003 at 15:21:24 -0500, + Greg Stark wrote: +> Tom Lane writes: +> +> That just means you need some way for aggregates to declare which records they +> need. The only values that seem like they would be useful would be "first +> record" "last record" and "all records". Possibly something like "all-nonnull +> records" for things like count(), but that might be harder. + +I don't see how this is going to be all that useful for aggregates in general. +min and max are special and it is unlikely that you are going to get much +speed up for general aggregate functions. For the case where you really +only need to scan a part of the data (say skipping nulls when nearly all +of the entries are null), a DBA can add an appropiate partial index and +where clause. This will probably happen infrequently enough that adding +special checks for this aren't going to pay off. + +For min and max, it seems to me that putting special code to detect these +functions and replace them with equivalent subselects in the case where +an index exists (since a sort is worse than a linear scan) is a possible +long term solution to make porting easier. + +In the short term education is the answer. At least the documentation of the +min and max functions and the FAQ, and the section with performance tips +should recommend the alternative form if there is an appropiate index. + +From pgsql-performance-owner@postgresql.org Sun Feb 2 05:41:56 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B328F47671D + for ; + Sun, 2 Feb 2003 05:41:54 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP id 19CD04765CC + for ; + Sun, 2 Feb 2003 05:16:26 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h12AG0e19235; + Sun, 2 Feb 2003 05:16:00 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302021016.h12AG0e19235@candle.pha.pa.us> +Subject: Re: One large v. many small +In-Reply-To: +To: Curt Sampson +Date: Sun, 2 Feb 2003 05:16:00 -0500 (EST) +Cc: Curtis Faith , + "'Josh Berkus'" , + "'Noah Silverman'" , 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 AMaViS new-20020517 +X-Archive-Number: 200302/3 +X-Sequence-Number: 1059 + +Curt Sampson wrote: +> So the tradeoff there is really, can you afford the time for the CLUSTER? +> (In a system where you have a lot of maintenance time, probably. Though if +> it's a huge table, this might need an entire weekend. In a system that needs +> to be up 24/7, probably not, unless you have lots of spare I/O capacity.) +> Just out of curiousity, how does CLUSTER deal with updates to the table while +> the CLUSTER command is running? + +CLUSTER locks the table, so no updates can happen during a cluster. + +-- + 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 Feb 2 06:00:46 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id EC67A47659F + for ; + Sun, 2 Feb 2003 06:00:44 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP id C791E47660F + for ; + Sun, 2 Feb 2003 05:40:56 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h12Adah03315; + Sun, 2 Feb 2003 05:39:36 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302021039.h12Adah03315@candle.pha.pa.us> +Subject: Re: Postgres 7.3.1 poor insert/update/search performance +In-Reply-To: +To: Curt Sampson +Date: Sun, 2 Feb 2003 05:39:36 -0500 (EST) +Cc: Neil Conway , 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 AMaViS new-20020517 +X-Archive-Number: 200302/4 +X-Sequence-Number: 1060 + +Curt Sampson wrote: +> > > Some systems, like Solaris, allow you to turn off the +> > > disk cache, so the problem may not be one you face.) +> > +> > I think it would be interesting to investigate disabling the OS' cache +> > for all relation I/O (i.e. heap files, index files). That way we could +> > both improve performance (by moving all the caching into PostgreSQL's +> > domain, where there is more room for optimization)... +> +> I'm not so sure that there is that all much more room for optimization. +> But take a look at what Solaris and FFS do now, and consider how much +> work it would be to rewrite it, and then see if you even want to do that +> before adding stuff to improve performance. + +We need free-behind for large sequential scans, like Solaris has. Do we +have LRU-2 or LRU-K now? + +> > If so, is it portable? +> +> O_DIRECT is not all that portable, I don't think. Certainly not as +> portable as mmap. + +As I remember, DIRECT doesn't return until the data hits the disk +(because there is no OS cache), so if you want to write a page so you +can reused the buffer, DIRECT would be quite slow. + +-- + 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 Feb 2 12:01:41 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 1FEB4475425 + for ; + Sun, 2 Feb 2003 12:01:41 -0500 (EST) +Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) + by postgresql.org (Postfix) with ESMTP id A33CB4753A1 + for ; + Sun, 2 Feb 2003 12:01:40 -0500 (EST) +Received: from DU154.N225.ResNet.QueensU.CA (DU154.N225.ResNet.QueensU.CA + [130.15.225.154]) by bob.samurai.com (Postfix) with ESMTP + id C73051F77; Sun, 2 Feb 2003 12:01:44 -0500 (EST) +Subject: Re: Postgres 7.3.1 poor insert/update/search performance +From: Neil Conway +To: Bruce Momjian +Cc: Curt Sampson , Andrew Sullivan , + pgsql-performance@postgresql.org +In-Reply-To: <200302021039.h12Adah03315@candle.pha.pa.us> +References: <200302021039.h12Adah03315@candle.pha.pa.us> +Content-Type: text/plain +Organization: +Message-Id: <1044205301.760.103.camel@tokyo> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.1 +Date: 02 Feb 2003 12:01:41 -0500 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/5 +X-Sequence-Number: 1061 + +On Sun, 2003-02-02 at 05:39, Bruce Momjian wrote: +> We need free-behind for large sequential scans, like Solaris has. Do we +> have LRU-2 or LRU-K now? + +No. + +> As I remember, DIRECT doesn't return until the data hits the disk +> (because there is no OS cache), so if you want to write a page so you +> can reused the buffer, DIRECT would be quite slow. + +Why? If there is a finite amount of memory for doing buffering, the data +needs to be written to disk at *some* point, anyway. And if we didn't +use the OS cache, the size of the PostgreSQL shared buffer would be much +larger (I'd think 80% or more of the physical RAM in a typical high-end +machine, for dedicated PostgreSQL usage). + +One possible problem would be the fact that it might mean that writing +out dirty pages would become part of some key code paths in PostgreSQL +(rather than assuming that the OS can write out dirty pages in the +background, as it chooses to). But there are lots of ways to work around +this, notably by using a daemon to periodically write out some of the +pages in the background. + +Cheers, + +Neil +-- +Neil Conway || PGP Key ID: DB3C29FC + + + + +From pgsql-performance-owner@postgresql.org Sun Feb 2 12:16:22 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B1D50475957 + for ; + Sun, 2 Feb 2003 12:16:21 -0500 (EST) +Received: from platonic.cynic.net (platonic.cynic.net [204.80.150.245]) + by postgresql.org (Postfix) with ESMTP id 14A92476074 + for ; + Sun, 2 Feb 2003 12:15:42 -0500 (EST) +Received: from angelic.cynic.net (angelic-platonic.cvpn.cynic.net + [198.73.220.226]) by platonic.cynic.net (Postfix) with ESMTP + id B151FBF4C; Sun, 2 Feb 2003 17:15:39 +0000 (UTC) +Received: from localhost (localhost [127.0.0.1]) + by angelic.cynic.net (Postfix) with ESMTP + id 606F08744; Mon, 3 Feb 2003 02:14:51 +0900 (JST) +Date: Mon, 3 Feb 2003 02:14:51 +0900 (JST) +From: Curt Sampson +To: Neil Conway +Cc: Bruce Momjian , + Andrew Sullivan , pgsql-performance@postgresql.org +Subject: Re: Postgres 7.3.1 poor insert/update/search performance +In-Reply-To: <1044205301.760.103.camel@tokyo> +Message-ID: +References: <200302021039.h12Adah03315@candle.pha.pa.us> + <1044205301.760.103.camel@tokyo> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/6 +X-Sequence-Number: 1062 + +On Mon, 2 Feb 2003, Neil Conway wrote: + +> > As I remember, DIRECT doesn't return until the data hits the disk +> > (because there is no OS cache), so if you want to write a page so you +> > can reused the buffer, DIRECT would be quite slow. +> ... +> One possible problem would be the fact that it might mean that writing +> out dirty pages would become part of some key code paths in PostgreSQL +> (rather than assuming that the OS can write out dirty pages in the +> background, as it chooses to). But there are lots of ways to work around +> this, notably by using a daemon to periodically write out some of the +> pages in the background. + +If you're doing blocking direct I/O, you really have to have and use +what I guess I'd call "scatter-scatter I/O": you need to chose a large +number of blocks scattered over various positions in all your open +files, and be able to request a write for all of them at once. + +If you write one by one, with each write going to disk before your +request returns, you're going to be forcing the physical order of the +writes with no knowledge of where the blocks physically reside on the +disk, and you stand a snowball's chance in you-know-where of getting +a write ordering that will maximize your disk throughput. + +This is why systems that use direct I/O, for the most part, use a raw +partition and their own "filesystem" as well; you need to know the +physical layout of the blocks to create efficient write strategies. + +(MS SQL Server on Windows NT is a notable exception to this. They do, +however, make you pre-create the data file in advance, and they suggest +doing it on an empty partition, which at the very least would get you +long stretches of the file in contiguous order. They may also be using +tricks to make sure the file gets created in contiguous order, or they +may be able to get information from the OS about the physical block +numbers corresponding to logical block numbers in the file.) + +cjs +-- +Curt Sampson +81 90 7737 2974 http://www.netbsd.org + Don't you know, in this new Dark Age, we're all light. --XTC + +From pgsql-performance-owner@postgresql.org Sun Feb 2 13:09:32 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 8BF1147592C + for ; + Sun, 2 Feb 2003 13:09:31 -0500 (EST) +Received: from ms-smtp-03.texas.rr.com (ms-smtp-03.texas.rr.com + [24.93.36.231]) + by postgresql.org (Postfix) with ESMTP id 00004475925 + for ; + Sun, 2 Feb 2003 13:09:30 -0500 (EST) +Received: from spaceship.com (cs24243214-140.austin.rr.com [24.243.214.140]) + by ms-smtp-03.texas.rr.com (8.12.5/8.12.2) with ESMTP id h12I5MEi029994 + for ; + Sun, 2 Feb 2003 13:05:23 -0500 (EST) +Message-ID: <3E3D5ED9.3050608@spaceship.com> +Date: Sun, 02 Feb 2003 12:09:29 -0600 +From: alien +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance +Subject: Re: 1 char in the world +References: <3E37733D.90205@spaceship.com> <26667.1043855787@sss.pgh.pa.us> +In-Reply-To: <26667.1043855787@sss.pgh.pa.us> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/7 +X-Sequence-Number: 1063 + +Tom Lane wrote: +> I don't believe those numbers for a moment. All else being equal, +> comparing a "char" field to a literal should be exactly the same speed +> as comparing a bool field to a literal (and if you'd just said "where bool", +> the bool field would be faster). Both ought to be markedly faster than +> text. +> +> Look for errors in your test procedure. One thing I'd particularly +> wonder about is whether the query plans are the same. In the absence of +> any VACUUM ANALYZE data, I'd fully expect the planner to pick a +> different plan for a bool field than text/char --- because even without +> ANALYZE data, it knows that a bool column has only two possible values. + +Well, the previous test was done on REAL data. Everything was indexed +and vacuum analyzed as it should be. + +However, I generated some test data under "controlled" circumstances and +did get different results. Bear in mind, though, that the data is no +longer "real", and doesn't represent the system I am concerned about. + +[Someone requested some tests with int4/int8, too, so I included them, +as well. However, I would never use 4 or 8 bytes to store one bit. +Since a byte is platform-atomic, however, I will use a whole byte for a +single bit, as bit packing is too expensive.] + +create table booltest ( + boo boolean, + cha "char", + txt text, + in4 int4, + in8 int8 +); + +Insert lots of data here, but stay consistent between fields. [If you +insert a TRUE into a boolean, put a 'Y' into a text or "char" field and +a 1 into an int type.] So, I basically had 2 different insert +statements (one for true and one for false), and I used a random number +generator to get a good distribution of them. + +create index booidx on booltest(boo); +create index chaidx on booltest(cha); +create index txtidx on booltest(txt); +create index in4idx on booltest(in4); +create index in8idx on booltest(in8); + +vacuum full verbose analyze booltest; +INFO: --Relation public.booltest-- +INFO: Pages 6897: Changed 0, reaped 0, Empty 0, New 0; Tup 1000000: Vac +0, Keep/VTL 0/0, UnUsed 0, MinLen 52, MaxLen 52; Re-using: Free/Avail. +Space 362284/362284; EndEmpty/Avail. Pages 0/6897. + CPU 0.53s/0.41u sec elapsed 18.69 sec. +INFO: Index booidx: Pages 2193; Tuples 1000000. + CPU 0.24s/0.11u sec elapsed 3.33 sec. +INFO: Index chaidx: Pages 2193; Tuples 1000000. + CPU 0.23s/0.19u sec elapsed 4.01 sec. +INFO: Index txtidx: Pages 2745; Tuples 1000000. + CPU 0.51s/0.14u sec elapsed 4.07 sec. +INFO: Index in4idx: Pages 2193; Tuples 1000000. + CPU 0.20s/0.17u sec elapsed 3.51 sec. +INFO: Index in8idx: Pages 2745; Tuples 1000000. + CPU 0.26s/0.04u sec elapsed 1.92 sec. +INFO: Rel booltest: Pages: 6897 --> 6897; Tuple(s) moved: 0. + CPU 0.00s/0.00u sec elapsed 0.00 sec. +INFO: --Relation pg_toast.pg_toast_4327226-- +INFO: Pages 0: Changed 0, reaped 0, Empty 0, New 0; Tup 0: Vac 0, +Keep/VTL 0/0, UnUsed 0, MinLen 0, MaxLen 0; Re-using: Free/Avail. Space +0/0; EndEmpty/Avail. Pages 0/0. + CPU 0.00s/0.00u sec elapsed 0.00 sec. +INFO: Index pg_toast_4327226_index: Pages 1; Tuples 0. + CPU 0.00s/0.00u sec elapsed 0.02 sec. +INFO: Analyzing public.booltest +VACUUM + + +Count our test set: +select count(*) from booltest; [ALL] output:1000000 +select count(*) from booltest where boo; [TRUES] output:498649 + +TESTS ..... + +1) INT8=1 +explain analyze select count(*) from booltest where in8 = '1'; +Aggregate (cost=1342272.26..1342272.26 rows=1 width=0) (actual +time=3434.37..3434.37 rows=1 loops=1) +-> Index Scan using in8idx on booltest (cost=0.00..1340996.42 +rows=510333 width=0) (actual time=6.96..2704.45 rows=498649 loops=1) +Index Cond: (in8 = 1::bigint) +Total runtime: 3434.50 msec + +2) INT4=1 +explain analyze select count(*) from booltest where in4 = 1; +Aggregate (cost=1341990.26..1341990.26 rows=1 width=0) (actual +time=3219.24..3219.24 rows=1 loops=1) +-> Index Scan using in4idx on booltest (cost=0.00..1340714.42 +rows=510333 width=0) (actual time=12.92..2548.20 rows=498649 loops=1) +Index Cond: (in4 = 1) +Total runtime: 3219.35 msec + +3) TEXT='Y' +explain analyze select count(*) from booltest where txt = 'Y'; +Aggregate (cost=1342272.26..1342272.26 rows=1 width=0) (actual +time=4820.06..4820.06 rows=1 loops=1) +-> Index Scan using txtidx on booltest (cost=0.00..1340996.42 +rows=510333 width=0) (actual time=15.83..4042.07 rows=498649 loops=1) +Index Cond: (txt = 'Y'::text) +Total runtime: 4820.18 msec + +4) BOOLEAN=true +explain analyze select count(*) from booltest where boo = true; +Aggregate (cost=1341990.26..1341990.26 rows=1 width=0) (actual +time=3437.30..3437.30 rows=1 loops=1) +-> Index Scan using booidx on booltest (cost=0.00..1340714.42 +rows=510333 width=0) (actual time=28.16..2751.38 rows=498649 loops=1) +Index Cond: (boo = true) +Total runtime: 3437.42 msec + +5) BOOLEAN [implied = true] +explain analyze select count(*) from booltest where boo; +Aggregate (cost=100018172.83..100018172.83 rows=1 width=0) (actual +time=2775.40..2775.40 rows=1 loops=1) +-> Seq Scan on booltest (cost=100000000.00..100016897.00 rows=510333 +width=0) (actual time=0.10..2138.11 rows=498649 loops=1) +Filter: boo +Total runtime: 2775.50 msec + +6) "char"='Y' +explain analyze select count(*) from booltest where cha = 'Y'; +Aggregate (cost=1341990.26..1341990.26 rows=1 width=0) (actual +time=3379.71..3379.71 rows=1 loops=1) +-> Index Scan using chaidx on booltest (cost=0.00..1340714.42 +rows=510333 width=0) (actual time=32.77..2695.77 rows=498649 loops=1) +Index Cond: (cha = 'Y'::"char") +Total runtime: 3379.82 msec + + +Average ms over 42 attempts per test, some one-after-the-other, others +mixed with other queries, was: + +1) INT8=1 3229.76 +2) INT4=1 3194.45 +3) TEXT='Y' 4799.23 +4) BOOLEAN=true 3283.30 +5) BOOLEAN 2801.83 +6) "char"='Y' 3290.15 + +The straight boolean test was the fastest at 2.8 secs, and the TEXT was +the slowest at 4.8 secs. Everything else settled in the same pot at +3.25 secs. + +I wasn't too impressed with any of these times, actually, but I'm +bearing in mind that we are talking about an aggregate, which I have +learned much about in the last few days from the mailing list, and which +I expect to be slow in PG. + +Since straight-BOOLEAN [not adding "= true" to the condition] is about +15% faster than "char", I will stick with BOOLEAN. + +My immediate future plans also include recoding my system to never use +aggregates in "live" queries. I will be tracking statistics in real +time in statistics tables instead of hitting the database with an +aggregate. It is much cheaper to add a few milliseconds per insert than +to slow my whole system down for several seconds during an aggregate query. + +In fact, if you have a sizable table, and especially if you are running +an OLTP server, unless you are manually investigating something in the +table, I recommend never using aggregates. Your SQL queries should be +aggregate-free for large tables, if possible. + +Thanks! + +-- +Matt Mello + + +From pgsql-performance-owner@postgresql.org Sun Feb 2 14:32:45 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 61AED47592C + for ; + Sun, 2 Feb 2003 14:32:44 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id C5020475925 + for ; + Sun, 2 Feb 2003 14:32:43 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2820267; Sun, 02 Feb 2003 11:32:44 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: Curt Sampson , Neil Conway +Subject: Re: Postgres 7.3.1 poor insert/update/search performance +Date: Sun, 2 Feb 2003 11:31:30 -0800 +User-Agent: KMail/1.4.3 +Cc: Bruce Momjian , + Andrew Sullivan , pgsql-performance@postgresql.org +References: <200302021039.h12Adah03315@candle.pha.pa.us> + <1044205301.760.103.camel@tokyo> + +In-Reply-To: +MIME-Version: 1.0 +Message-Id: <200302021131.30209.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/8 +X-Sequence-Number: 1064 + +Curt, + +> (MS SQL Server on Windows NT is a notable exception to this. They do, +> however, make you pre-create the data file in advance, and they suggest +> doing it on an empty partition, which at the very least would get you +> long stretches of the file in contiguous order. They may also be using +> tricks to make sure the file gets created in contiguous order, or they +> may be able to get information from the OS about the physical block +> numbers corresponding to logical block numbers in the file.) + +MSSQL is, in fact, doing some kind of direct-block-addressing. If you=20 +attempt to move a partition on the disk containing MSSQL databases, SQL=20 +Server will crash on restart and be unrecoverable ... even if the other fil= +es=20 +on that disk are fine. Nor can you back up MSSQL by using disk imaging,=20 +unless you can recover to an identical model disk/array. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Sun Feb 2 19:41:09 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id D8C7C4758DC + for ; + Sun, 2 Feb 2003 19:41:08 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP id 2BF764753A1 + for ; + Sun, 2 Feb 2003 19:41:07 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h130f0P03763; + Sun, 2 Feb 2003 19:41:00 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302030041.h130f0P03763@candle.pha.pa.us> +Subject: Re: Postgres 7.3.1 poor insert/update/search performance +In-Reply-To: <1044205301.760.103.camel@tokyo> +To: Neil Conway +Date: Sun, 2 Feb 2003 19:41:00 -0500 (EST) +Cc: Curt Sampson , 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 AMaViS new-20020517 +X-Archive-Number: 200302/9 +X-Sequence-Number: 1065 + +Neil Conway wrote: +> On Sun, 2003-02-02 at 05:39, Bruce Momjian wrote: +> > We need free-behind for large sequential scans, like Solaris has. Do we +> > have LRU-2 or LRU-K now? +> +> No. +> +> > As I remember, DIRECT doesn't return until the data hits the disk +> > (because there is no OS cache), so if you want to write a page so you +> > can reused the buffer, DIRECT would be quite slow. +> +> Why? If there is a finite amount of memory for doing buffering, the data +> needs to be written to disk at *some* point, anyway. And if we didn't +> use the OS cache, the size of the PostgreSQL shared buffer would be much +> larger (I'd think 80% or more of the physical RAM in a typical high-end +> machine, for dedicated PostgreSQL usage). +> +> One possible problem would be the fact that it might mean that writing +> out dirty pages would become part of some key code paths in PostgreSQL +> (rather than assuming that the OS can write out dirty pages in the +> background, as it chooses to). But there are lots of ways to work around +> this, notably by using a daemon to periodically write out some of the +> pages in the background. + +Right. This is what we _don't_ want to do. If we need a buffer, we +need it now. We can't wait for some other process to write the buffer +directly to disk, nor do we want to group the writes somehow. + +And the other person mentioning we have to group writes again causes the +same issues --- we are bypassing the kernel buffers which know more than +we do. I can see advantage of preventing double buffering _quickly_ +being overtaken by the extra overhead of direct i/o. + +-- + 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 Feb 4 07:15:40 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 7CF96474E42 + for ; + Tue, 4 Feb 2003 07:15:38 -0500 (EST) +Received: from smtp.web.de (smtp03.web.de [217.72.192.158]) + by postgresql.org (Postfix) with ESMTP id E1BF1474E53 + for ; + Tue, 4 Feb 2003 07:15:37 -0500 (EST) +Received: from p50818a9b.dip0.t-ipconnect.de ([80.129.138.155] helo=web.de) + by smtp.web.de with asmtp (WEB.DE(Exim) 4.93 #1) id 18g1zH-0005l0-00 + for pgsql-performance@postgresql.org; Tue, 04 Feb 2003 13:15:40 +0100 +Message-ID: <3E3FAEF2.5080302@web.de> +Date: Tue, 04 Feb 2003 13:15:46 +0100 +From: Andreas Pflug +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: SELECT DISTINCT is picky about constants +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/10 +X-Sequence-Number: 1066 + +The query + SELECT DISTINCT keycol, 'constant' FROM myTable +or + SELECT DISTINCT keycol, NULL FROM myTable + +will result in an error message (7.3.1) + +Unable to identify an ordering operator '<' for type "unknown" +Use explicit ordering operator or modify query + +If I use 'constant'::varchar or NULL::varchar everything's fine. +Unfortunately, this SELECT DISTINCT will appear quite often in my app. + +I'd rather like PostgreSQL to use implicit type casting for such +constants. The final type chosen doesn't matter anyway and life would be +easier. + + + + +From pgsql-performance-owner@postgresql.org Tue Feb 4 09:53:55 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E2C084761A3 + for ; + Tue, 4 Feb 2003 09:53:53 -0500 (EST) +Received: from jester.inquent.com (unknown [216.208.117.7]) + by postgresql.org (Postfix) with ESMTP id 677E1476446 + for ; + Tue, 4 Feb 2003 09:28:47 -0500 (EST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by jester.inquent.com (8.12.6/8.12.6) with ESMTP id h14ETDtm080319; + Tue, 4 Feb 2003 09:29:13 -0500 (EST) (envelope-from rbt@rbt.ca) +Subject: Re: SELECT DISTINCT is picky about constants +From: Rod Taylor +To: Andreas Pflug +Cc: Postgresql Performance +In-Reply-To: <3E3FAEF2.5080302@web.de> +References: <3E3FAEF2.5080302@web.de> +Content-Type: multipart/signed; micalg=pgp-sha1; + protocol="application/pgp-signature"; + boundary="=-yo6G1kLGsKXTV7F96m7t" +Organization: +Message-Id: <1044368952.80167.6.camel@jester> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.1 +Date: 04 Feb 2003 09:29:13 -0500 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/11 +X-Sequence-Number: 1067 + +--=-yo6G1kLGsKXTV7F96m7t +Content-Type: text/plain +Content-Transfer-Encoding: quoted-printable + +On Tue, 2003-02-04 at 07:15, Andreas Pflug wrote: +> The query +> SELECT DISTINCT keycol, 'constant' FROM myTable +> or +> SELECT DISTINCT keycol, NULL FROM myTable +>=20 +> will result in an error message (7.3.1) +>=20 +> Unable to identify an ordering operator '<' for type "unknown" +> Use explicit ordering operator or modify query +>=20 +> If I use 'constant'::varchar or NULL::varchar everything's fine.=20 +> Unfortunately, this SELECT DISTINCT will appear quite often in my app. +>=20 +> I'd rather like PostgreSQL to use implicit type casting for such=20 +> constants. The final type chosen doesn't matter anyway and life would be= +=20 +> easier. + +How about: + +SELECT keycol, NULL FROM (SELECT DISTINCT keycol FROM myTable) AS tab; + +Might even be quicker as you won't have to do any comparisons against +the constant. + +--=20 +Rod Taylor + +PGP Key: http://www.rbt.ca/rbtpub.asc + +--=-yo6G1kLGsKXTV7F96m7t +Content-Type: application/pgp-signature; name=signature.asc +Content-Description: This is a digitally signed message part + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.2.1 (FreeBSD) + +iD8DBQA+P8446DETLow6vwwRAlZEAJ4l08Uoo8XeIL5Ub1FDwmgWiu+hNwCdEO1h +ejcMssrNS7jLWaaNSFfowVk= +=p9BA +-----END PGP SIGNATURE----- + +--=-yo6G1kLGsKXTV7F96m7t-- + + +From pgsql-performance-owner@postgresql.org Tue Feb 4 10:16:01 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id C8315475D0F + for ; + Tue, 4 Feb 2003 10:16:00 -0500 (EST) +Received: from etna.obsidian.co.za (etna.obsidian.co.za [196.36.119.67]) + by postgresql.org (Postfix) with ESMTP id C1982475E88 + for ; + Tue, 4 Feb 2003 10:02:28 -0500 (EST) +Received: (from uucp@localhost) + by etna.obsidian.co.za (8.11.6/8.11.6) with UUCP id h14F2Vk02587 + for pgsql-performance@postgresql.org; Tue, 4 Feb 2003 17:02:31 +0200 +Received: from tarcil.itvs.co.za (IDENT:jeandre@tarcil [172.16.1.14]) + by flash.itvs.co.za (8.9.3/8.9.3) with ESMTP id RAA16871 + for ; Tue, 4 Feb 2003 17:18:32 +0200 +Date: Tue, 4 Feb 2003 16:48:53 +0200 (SAST) +From: +X-Sender: jeandre@localhost.localdomain +To: pgsql-performance@postgresql.org +Subject: subscribe +Message-ID: +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/12 +X-Sequence-Number: 1068 + +subscribe + + +From pgsql-performance-owner@postgresql.org Tue Feb 4 10:16:28 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id D9EE1475FC5 + for ; + Tue, 4 Feb 2003 10:16:25 -0500 (EST) +Received: from smtp.web.de (smtp03.web.de [217.72.192.158]) + by postgresql.org (Postfix) with ESMTP id CE45E475F53 + for ; + Tue, 4 Feb 2003 10:11:11 -0500 (EST) +Received: from p50818a9b.dip0.t-ipconnect.de ([80.129.138.155] helo=web.de) + by smtp.web.de with asmtp (WEB.DE(Exim) 4.93 #1) id 18g4jD-0000ZU-00 + for pgsql-performance@postgresql.org; Tue, 04 Feb 2003 16:11:15 +0100 +Message-ID: <3E3FD81A.3010307@web.de> +Date: Tue, 04 Feb 2003 16:11:22 +0100 +From: Andreas Pflug +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: EXPLAIN not helpful for DELETE +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/13 +X-Sequence-Number: 1069 + +While executing a lot of INSERTs and DELETEs, I had some performance +problems which seemed to result from missing foreign key indexes. +Unfortunately, if doing an EXPLAIN DELETE myTab .... I'm getting only +the first stage of query plan, i.e. "seq scan on myTab". The database +accesses behind the scene to check foreign key constraints don't show +up, so there's no hint that an index might be missing. + +Since I got some highly referenced tables, deleting might be a lengthy +process if any single row leads to a full table scan on dozens of other +big tables (example: deleting 4000 rows, duration 500 seconds -> 8rows/sec) + +But this doesn't seem to be the whole truth. Actually, in the case +stated above, all referencing tables (about 80) are empty. I performed +this on a rather small database, imagine what happens if the table has +1.000.000 rows and referencing tables are filled too! + + +From pgsql-performance-owner@postgresql.org Wed Feb 5 05:51:33 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id D02EA475AEC + for ; + Wed, 5 Feb 2003 05:51:32 -0500 (EST) +Received: from ds9.quadratec-software.com (ds9.quadratec-software.com + [62.23.102.82]) by postgresql.org (Postfix) with ESMTP id 802C0475ADE + for ; + Wed, 5 Feb 2003 05:51:19 -0500 (EST) +Received: from spade.orsay.quadratec.fr (smtpserver [172.16.14.14]) + by ds9.quadratec-software.com (8.11.3/8.11.3) with ESMTP id + h15ApAI05182 + for ; Wed, 5 Feb 2003 11:51:11 +0100 +Received: from hotshine (hotshine.orsay.quadratec.fr [172.16.200.100]) + by spade.orsay.quadratec.fr (Switch-2.1.0/Switch-2.1.0) with SMTP id + h15Ap8T14720 for ; + Wed, 5 Feb 2003 11:51:09 +0100 (CET) +From: "philip johnson" +To: +Subject: how to configure my new server +Date: Wed, 5 Feb 2003 11:54:44 +0100 +Message-ID: +MIME-Version: 1.0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: 7bit +X-Priority: 1 (Highest) +X-MSMail-Priority: High +X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 +Importance: High +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/14 +X-Sequence-Number: 1070 + +I've a new configuration for our web server + +Processor Processeur Intel Xeon 2.0 Ghz / 512 Ko de cache L2 +Memoiry 1 Go DDR SDRAM +Disk1 18Go Ultra 3 (Ultra 160) SCSI 15 Ktpm +Disk2 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +Disk3 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +Disk4 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +Disk5 36Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm + +I will install a Mandrake 8.2 + +It's an application server that runs things other than just postgresql. +It also runs: apache + Php , bigbrother, log analyser. + + +At the moment, on my old server, there's postgresql 7.2.3 + my database takes 469M and there are approximatively +5 millions query per day + + +what values should I use for + +linux values: +kernel.shmmni = 4096 +kernel.shmall = 32000000 +kernel.shmmax = 256000000 + +postgresql values: +shared_buffers +max_fsm_relations +max_fsm_pages +wal_buffers +wal_files +sort_mem +vacuum_mem + + +any other advices are welcome + +thanks in advance + + + +--------------------- +Philip johnson +01 64 86 83 00 +http://www.atempo.com + +From pgsql-performance-owner@postgresql.org Wed Feb 5 11:16:29 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B55704758E1 + for ; + Wed, 5 Feb 2003 11:16:28 -0500 (EST) +Received: from hal.istation.com (hal.istation.com [65.120.151.132]) + by postgresql.org (Postfix) with ESMTP id 291084758DC + for ; + Wed, 5 Feb 2003 11:16:28 -0500 (EST) +Received: from sauron (sauron.istation.com [65.120.151.174]) (authenticated) + by hal.istation.com (8.11.6/8.11.6) with ESMTP id h15GGVE09026 + for ; Wed, 5 Feb 2003 10:16:31 -0600 +Reply-To: +From: "Keith Bottner" +To: +Subject: Postgres and SAN performance? +Date: Wed, 5 Feb 2003 10:16:28 -0600 +Organization: istation.com +Message-ID: <000001c2cd31$f0e58360$ae977841@istation.com> +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.3416 +Importance: Normal +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/15 +X-Sequence-Number: 1071 + +I am interested in hearing from anyone that has used Postgres with the +db files existing on a SAN, fibre channel or iSCSI. I would be +interested in what hardware you used and what the performance ended up +like. + +Thanking you in advance, + +Keith Bottner +kbottner@istation.com + +"Vegetarian - that's an old Indian word meaning 'lousy hunter.'" - Andy +Rooney + + +From pgsql-performance-owner@postgresql.org Wed Feb 5 12:59:41 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 01573474E42 + for ; + Wed, 5 Feb 2003 12:59:41 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 059674758DC + for ; + Wed, 5 Feb 2003 12:59:39 -0500 (EST) +Received: from [66.219.92.2] (HELO chocolate-mousse) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2825955; Wed, 05 Feb 2003 09:59:38 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Reply-To: josh@agliodbs.com +Organization: Aglio Database Solutions +To: , +Subject: Re: Postgres and SAN performance? +Date: Wed, 5 Feb 2003 10:01:07 -0800 +X-Mailer: KMail [version 1.4] +References: <000001c2cd31$f0e58360$ae977841@istation.com> +In-Reply-To: <000001c2cd31$f0e58360$ae977841@istation.com> +MIME-Version: 1.0 +Content-Transfer-Encoding: quoted-printable +Message-Id: <200302051001.07489.josh@agliodbs.com> +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/16 +X-Sequence-Number: 1072 + +Keith, + +> I am interested in hearing from anyone that has used Postgres with the +> db files existing on a SAN, fibre channel or iSCSI. I would be +> interested in what hardware you used and what the performance ended up +> like. + +I suggest that you contact Zapatec directly: www.zapatec.com. + +--=20 +-Josh Berkus + Aglio Database Solutions + San Francisco + + +From pgsql-performance-owner@postgresql.org Thu Feb 6 11:22:11 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0D71E474E4F + for ; + Thu, 6 Feb 2003 11:22:10 -0500 (EST) +Received: from ds9.quadratec-software.com (ds9.quadratec-software.com + [62.23.102.82]) by postgresql.org (Postfix) with ESMTP id E72D5475458 + for ; + Thu, 6 Feb 2003 11:22:07 -0500 (EST) +Received: from spade.orsay.quadratec.fr (deltaq.quadratec-software.com + [62.23.102.66]) + by ds9.quadratec-software.com (8.11.3/8.11.3) with ESMTP id + h16GM1I18969 + for ; Thu, 6 Feb 2003 17:22:02 +0100 +Received: from hotshine (hotshine.orsay.quadratec.fr [172.16.200.100]) + by spade.orsay.quadratec.fr (Switch-2.1.0/Switch-2.1.0) with SMTP id + h16GM0T10595; Thu, 6 Feb 2003 17:22:00 +0100 (CET) +From: "philip johnson" +To: "philip johnson" , + +Subject: Re: how to configure my new server +Date: Thu, 6 Feb 2003 17:25:38 +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: +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 +Importance: Normal +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/17 +X-Sequence-Number: 1073 + +pgsql-performance-owner@postgresql.org wrote: +> Objet : [PERFORM] how to configure my new server +> Importance : Haute +> +> +> I've a new configuration for our web server +> +> Processor Processeur Intel Xeon 2.0 Ghz / 512 Ko de cache L2 +> Memoiry 1 Go DDR SDRAM +> Disk1 18Go Ultra 3 (Ultra 160) SCSI 15 Ktpm +> Disk2 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +> Disk3 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +> Disk4 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +> Disk5 36Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +> +> I will install a Mandrake 8.2 +> +> It's an application server that runs things other than just +> postgresql. It also runs: apache + Php , bigbrother, log analyser. +> +> +> At the moment, on my old server, there's postgresql 7.2.3 +> my database takes 469M and there are approximatively +> 5 millions query per day +> +> +> what values should I use for +> +> linux values: +> kernel.shmmni = 4096 +> kernel.shmall = 32000000 +> kernel.shmmax = 256000000 +> +> postgresql values: +> shared_buffers +> max_fsm_relations +> max_fsm_pages +> wal_buffers +> wal_files +> sort_mem +> vacuum_mem +> +> +> any other advices are welcome +> +> thanks in advance +> +> +> +> --------------------- +> Philip johnson +> 01 64 86 83 00 +> http://www.atempo.com +> +> ---------------------------(end of +> broadcast)--------------------------- TIP 4: Don't 'kill -9' the +> postmaster + +Someone is able to help me ? + +From pgsql-performance-owner@postgresql.org Thu Feb 6 12:05:12 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 486F147595A + for ; + Thu, 6 Feb 2003 12:05:12 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 926204758E6 + for ; + Thu, 6 Feb 2003 12:04:40 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2827544; Thu, 06 Feb 2003 09:04:39 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: "philip johnson" , + +Subject: Re: how to configure my new server +Date: Thu, 6 Feb 2003 09:04:11 -0800 +User-Agent: KMail/1.4.3 +References: +In-Reply-To: +MIME-Version: 1.0 +Message-Id: <200302060904.11652.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/18 +X-Sequence-Number: 1074 + +Phillip, + +First, a disclaimer: my advice is without warranty whatsoever. You want a= +=20 +warranty, you gotta pay me. + +> I've a new configuration for our web server +> +> Processor Processeur Intel Xeon 2.0 Ghz / 512 Ko de cache L2 +> Memoiry 1 Go DDR SDRAM +> Disk1 18Go Ultra 3 (Ultra 160) SCSI 15 Ktpm +> Disk2 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +> Disk3 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +> Disk4 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +> Disk5 36Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm + +No RAID, though? + +Think carefully about which disks you put things on. Ideally, the OS, the= +=20 +web files, the database files, the database log, and the swap partition wil= +l=20 +all be on seperate disks. With a large database you may even think about= +=20 +shifting individual tables or indexes to seperate disks. + +> linux values: +> kernel.shmmni =3D 4096 +> kernel.shmall =3D 32000000 +> kernel.shmmax =3D 256000000 + +These are probably too high, but I'm ready to speak authoritatively on that. + +> postgresql values: +> shared_buffers +> max_fsm_relations +> max_fsm_pages +> wal_buffers +> wal_files +> sort_mem +> vacuum_mem + +Please visit the archives for this list. Setting those values is a topic = +of=20 +discussion for 50% of the threads, and there is yet no firm agreement on go= +od=20 +vs. bad values. + +Also, you need to ask youself more questions before you start setting value= +s: + +1. How many queries does my database handle per second or minute? +2. How big/complex are those queries? +3. What is the ratio of database read activity vs. database writing activit= +y? +4. What large tables in my database get queried simultaneously/together? +5. Are my database writes bundled into transactions, or seperate? +etc. + +Simply knowing the size of the database files isn't enough. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Thu Feb 6 13:14:41 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 5C628475DDB + for ; + Thu, 6 Feb 2003 13:14:39 -0500 (EST) +Received: from ds9.quadratec-software.com (ds9.quadratec-software.com + [62.23.102.82]) by postgresql.org (Postfix) with ESMTP id 1D7CB475E24 + for ; + Thu, 6 Feb 2003 13:10:00 -0500 (EST) +Received: from spade.orsay.quadratec.fr (smtpserver [172.16.14.14]) + by ds9.quadratec-software.com (8.11.3/8.11.3) with ESMTP id + h16I9kI21344; Thu, 6 Feb 2003 19:09:47 +0100 +Received: from hotshine (hotshine.orsay.quadratec.fr [172.16.200.100]) + by spade.orsay.quadratec.fr (Switch-2.1.0/Switch-2.1.0) with SMTP id + h16I9dT25410; Thu, 6 Feb 2003 19:09:46 +0100 (CET) +From: "philip johnson" +To: "Josh Berkus" , + +Subject: Re: how to configure my new server +Date: Thu, 6 Feb 2003 19:13:17 +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: <200302060904.11652.josh@agliodbs.com> +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 +Importance: Normal +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/19 +X-Sequence-Number: 1075 + +pgsql-performance-owner@postgresql.org wrote: +> Phillip, +> +> First, a disclaimer: my advice is without warranty whatsoever. You +> want a warranty, you gotta pay me. +> +>> I've a new configuration for our web server +>> +>> Processor Processeur Intel Xeon 2.0 Ghz / 512 Ko de cache L2 +>> Memoiry 1 Go DDR SDRAM Disk1 18Go Ultra 3 (Ultra 160) SCSI 15 Ktpm +>> Disk2 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +>> Disk3 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +>> Disk4 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +>> Disk5 36Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +> +> No RAID, though? + +Yes no Raid, but will could change soon + +> +> Think carefully about which disks you put things on. Ideally, the +> OS, the web files, the database files, the database log, and the swap +> partition will all be on seperate disks. With a large database you +> may even think about shifting individual tables or indexes to +> seperate disks. + +how can I put indexes on a seperate disk ? + +> +>> linux values: +>> kernel.shmmni = 4096 +>> kernel.shmall = 32000000 +>> kernel.shmmax = 256000000 +> +> These are probably too high, but I'm ready to speak authoritatively +> on that. +I took a look a the performance archive, and it's not possible to find +real info on how to set these 3 values. + +> +>> postgresql values: +>> shared_buffers +>> max_fsm_relations +>> max_fsm_pages +>> wal_buffers +>> wal_files +>> sort_mem +>> vacuum_mem +> +> Please visit the archives for this list. Setting those values is a +> topic of discussion for 50% of the threads, and there is yet no firm +> agreement on good vs. bad values. +> + +I'm surprised that there's no spreadsheet to calculate those values. +There are many threads, but it seems that no one is able to find a rule +to define values. + + +> Also, you need to ask youself more questions before you start setting +> values: +> +> 1. How many queries does my database handle per second or minute? +can't say now + +> 2. How big/complex are those queries? +Not really complex and big as you can see + +SELECT qu_request.request_id, qu_request.type, qu_request_doc.ki_status, +qu_request_doc.ki_subject, qu_request_doc.ki_description, +qu_request_doc.ki_category, qu_request_doc.rn_description_us, +qu_request_doc.rn_status_us, quad_config_nati.nati_version_extended +FROM qu_request left join quad_config_nati on qu_request.quad_server_nati = +quad_config_nati.nati_version +left join qu_request_doc on qu_request.request_id = +qu_request_doc.request_id +WHERE qu_request.request_id = '130239' + + +select sv_inquiry.inquiry_id, sv_inquiry.quad_account_inquiry_id +,to_char(sv_inquiry.change_dt, 'YYYY-MM-DD HH24:MI') as change_dt , +to_char(sv_inquiry.closed_dt, 'YYYY-MM-DD HH24:MI') as closed_dt +,sv_inquiry.state, sv_inquiry.priority, sv_inquiry.type, +account_contact.dear as contact , account_contact2.dear as contact2, +sv_inquiry.action, sv_inquiry.activity , +substr(sv_inq_txt.inquiry_txt, 1, 120) as inquiry_txt from sv_inquiry left +join sv_inq_txt on sv_inquiry.inquiry_id = sv_inq_txt.inquiry_id +left join account_contact on sv_inquiry.account_contact_id = +account_contact.account_contact_id left join account_contact +account_contact2 +on sv_inquiry.account_contact_id2 = account_contact2.account_contact_id +where sv_inquiry.account_id=3441833 and +sv_inquiry.state not in ('Closed', 'Classified') ORDER BY +sv_inquiry.inquiry_id DESC + + +> 3. What is the ratio of database read activity vs. database writing +> activity? +There are more insert/update than read, because I'm doing table +synchronization +from an SQL Server database. Every 5 minutes I'm looking for change in SQL +Server +Database. +I've made some stats, and I found that without user acces, and only with the +replications +I get 2 millions query per day + +> 4. What large tables in my database get queried simultaneously/together? +why this questions ? + +> 5. Are my database writes bundled into transactions, or seperate? +bundle in transactions + +> etc. +> +> Simply knowing the size of the database files isn't enough. + +is it better like this ? + + +From pgsql-performance-owner@postgresql.org Thu Feb 6 17:33:36 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 394DC475FC4 + for ; + Thu, 6 Feb 2003 17:33:35 -0500 (EST) +Received: from smtp.web.de (smtp01.web.de [217.72.192.180]) + by postgresql.org (Postfix) with ESMTP id 9AF66476000 + for ; + Thu, 6 Feb 2003 16:43:21 -0500 (EST) +Received: from p508189c6.dip0.t-ipconnect.de ([80.129.137.198] helo=web.de) + by smtp.web.de with asmtp (WEB.DE(Exim) 4.95 #31) id 18gtnm-0000fL-00 + for pgsql-performance@postgresql.org; Thu, 06 Feb 2003 22:43:22 +0100 +Message-ID: <3E42D6FB.9000605@web.de> +Date: Thu, 06 Feb 2003 22:43:23 +0100 +From: Andreas Pflug +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: how to configure my new server +References: +In-Reply-To: +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/20 +X-Sequence-Number: 1076 + +I do not agree with the advice to dedicate one disc to every table. + +Imagine 10 disks, 10 tables, and 10 users accessing the same table. This +would mean 1 disk really busy and 9 idling all the way. If you use a +RAID array, the random access is hopefully split to all disks, giving a +much better performance. There are suggestions about direct disk access +(using O_DIRECT file flags), versus using the OS' caching mechanisms. +This is quite the same, in hardware. Today's hardware is designed to +make the best of it, give it a chance! + +PostgreSQL's transaction logs are probably being written sequentially. +This situation is different because the access pattern is predictable, +dedicated disks might be useful since head movement is reduced to near +zero, but if there's no high write volume it's wasted performance. + +If your system is so small that web and database are running on the same +machine, you can consider page access being quite like table access, so +I'd put it on the same big array. Your favorite *.html or *.php will be +cached either. + +Swap space may be on a dedicated disk, but it's better for a server if +swap is never used. Put enough RAM into that machine! Swapping is quite +a desaster on a server. So you could put swap just where you like it: if +your server is sane, it's never accessed under load. + +Same about OS files: is there really heavy traffic on them? + +There's a white paper at www.microsoft.com about tuning MSSQL 7.0. If +read carefully, some advice will be applicable to PostgreSQL too. + +So as my general rule, valid for >99 % of users: use as much disks as +possible in one big RAID array. Let the hardware do the data scattering, +you'll be better off. For a production system, you will need disk +redundancy either (my experience says one failed disk per year for 20 in +use). Until your system is really heavily loaded, and you're using >10 +disks, don't think about dedicated disks. If you want extra performance +for no cost, you can put the most accessed partition on the outer +cylinders of the disk array (probably corresponding to the outer +cylinders of the disk) since throughput is highest there. + +Regards, + +Andreas + + + + + + + + + +From pgsql-performance-owner@postgresql.org Thu Feb 6 18:11:00 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id C061A475F00 + for ; + Thu, 6 Feb 2003 18:10:57 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 36F25475F09 + for ; + Thu, 6 Feb 2003 17:56:40 -0500 (EST) +Received: from [216.135.165.74] (account ) + by davinci.ethosmedia.com (CommuniGate Pro WebUser 4.0.2) + with HTTP id 2828247; Thu, 06 Feb 2003 14:56:41 -0800 +From: "Josh Berkus" +Subject: Re: how to configure my new server +To: Andreas Pflug , + pgsql-performance@postgresql.org +X-Mailer: CommuniGate Pro Web Mailer v.4.0.2 +Date: Thu, 06 Feb 2003 14:56:41 -0800 +Message-ID: +In-Reply-To: <3E42D6FB.9000605@web.de> +MIME-Version: 1.0 +Content-Type: text/plain; charset="ISO-8859-1" +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/21 +X-Sequence-Number: 1077 + +Andreas, + +> I do not agree with the advice to dedicate one disc to every table. + +Nobody gave any such advice. What are you talking about? + +-Josh + +From pgsql-performance-owner@postgresql.org Thu Feb 6 18:19:04 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E7D01475F80 + for ; + Thu, 6 Feb 2003 18:19:01 -0500 (EST) +Received: from l2.socialecology.com (unknown [4.42.179.131]) + by postgresql.org (Postfix) with ESMTP id E2AF9475FC8 + for ; + Thu, 6 Feb 2003 18:14:10 -0500 (EST) +Received: from 4.42.179.151 (broccoli.socialecology.com [4.42.179.151]) + by l2.socialecology.com (Postfix) with SMTP id 7A0983A3AFC + for ; + Thu, 6 Feb 2003 14:33:38 -0800 (PST) +X-Mailer: UserLand Frontier 9.1b1 (Macintosh OS) (mailServer v1.1..142) +Mime-Version: 1.0 +Message-Id: <137343446.1167578047@[4.42.179.151]> +X-authenticated-sender: erics +In-reply-to: <3E42D6FB.9000605@web.de> +Date: Thu, 06 Feb 2003 15:14:09 -0800 +To: pgsql-performance@postgresql.org +From: eric soroos +Subject: Re: how to configure my new server +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/22 +X-Sequence-Number: 1078 + +On Thu, 06 Feb 2003 22:43:23 +0100 in message <3E42D6FB.9000605@web.de>, Andreas Pflug wrote: +> I do not agree with the advice to dedicate one disc to every table. +> +> Imagine 10 disks, 10 tables, and 10 users accessing the same table. This +> would mean 1 disk really busy and 9 idling all the way. If you use a +> RAID array, the random access is hopefully split to all disks, giving a +> much better performance. There are suggestions about direct disk access +> (using O_DIRECT file flags), versus using the OS' caching mechanisms. +> This is quite the same, in hardware. Today's hardware is designed to +> make the best of it, give it a chance! + +Unfortunately, today's hardware still has rotational latency. You aren't goign to get much more than 300 seeks per sec on the best single drive. Putting them together in a way that requires half to all of them to seek for a given read or write is a performance killer. The only way around this is high end raid cards with backup batteries and ram. + +I've been doing some tests using pgbench (which aren't written up yet) on the topic of low budget performance. So far, using linux 2.4.20 md software raid where applicable, I've seen against a baseline of one ide disk: + +running on a rocketraid card (kernel thinks it's scsi) is faster than onboard controllers +mirrored is negligably slower +striped is much slower +splitting WAL and Data on two drives gives a 40+% speed boost +having data in ram cache is good for ~ 100% speed boost. Essentially, disk activity goes from evenly split reading and writing to all writing + +The only pg settings that show any correlation with pgbench performance are the # of WAL logs, generally corresponding to the interval between flushing wal logs to the data store. Buffers don't change much over a 64-8192 range, Sort mem doesn't change much. (Note that that may be due to the query types in this benchmark. My app certainly needs the sortmem) + +As a somewhat on topic thought, it would be really neat to have a pci card that was one slot for ram, one for compact flash, a memory/ide controller and battery. Fill the ram and cf with identical sized units, and use it as a disk for WAL. if the power goes off, dump the ram to cf. Should be able to do thousands of writes per sec, effectivley moving the bottleneck somewhere else. It's probably $20 worth of chips for the board, but it would probably sell for thousands. + +eric + + + + +From pgsql-performance-owner@postgresql.org Thu Feb 6 20:01:22 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B7898476484 + for ; + Thu, 6 Feb 2003 20:01:20 -0500 (EST) +Received: from martin.sysdetect.com (martin.sysdetect.com [65.209.102.1]) + by postgresql.org (Postfix) with ESMTP id 7FF20476B8E + for ; + Thu, 6 Feb 2003 19:07:36 -0500 (EST) +Received: (from mail@localhost) + by martin.sysdetect.com (8.11.3/8.11.3) id h1707dO26383; + Fri, 7 Feb 2003 00:07:39 GMT +Received: from winwood.sysdetect.com(172.16.1.1) + via SMTP by mail.sysdetect.com, id smtpdXD6858; Fri Feb 7 00:07:30 2003 +Received: from winwood.sysdetect.com (seth@localhost) + by winwood.sysdetect.com (8.11.6/8.11.6) with ESMTP id h1707Us06536; + Thu, 6 Feb 2003 19:07:30 -0500 +Message-Id: <200302070007.h1707Us06536@winwood.sysdetect.com> +To: eric soroos +Cc: pgsql-performance@postgresql.org +Subject: Re: how to configure my new server +In-reply-to: <137343446.1167578047@[4.42.179.151]> +References: <3E42D6FB.9000605@web.de> <137343446.1167578047@[4.42.179.151]> +Comments: In reply to a message from "eric soroos " + dated "Thu, 06 Feb 2003 15:14:09 -0800." +Date: Thu, 06 Feb 2003 19:07:30 -0500 +From: Seth Robertson +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/23 +X-Sequence-Number: 1079 + + +In message <137343446.1167578047@[4.42.179.151]>, eric soroos writes: + + As a somewhat on topic thought, it would be really neat to have a + pci card that was one slot for ram, one for compact flash, a + memory/ide controller and battery. Fill the ram and cf with + identical sized units, and use it as a disk for WAL. if the power + goes off, dump the ram to cf. Should be able to do thousands of + writes per sec, effectivley moving the bottleneck somewhere else. + It's probably $20 worth of chips for the board, but it would + probably sell for thousands. + +How is this not provided by one of the many solid state disks? + +http://www.storagesearch.com/ssd.html + +I have never puchased one of these due to cost ($1 per MB or more) but +I always assumed this was a direct fit. The solid state disk people +claim so as well on their marketing literature. One of the drives +claims 700MB/s bandwidth. + + -Seth Robertson + seth@sysd.com + +From pgsql-performance-owner@postgresql.org Thu Feb 6 20:17:00 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 7C2A5475AE4 + for ; + Thu, 6 Feb 2003 20:16:59 -0500 (EST) +Received: from martin.sysdetect.com (martin.sysdetect.com [65.209.102.1]) + by postgresql.org (Postfix) with ESMTP id DCD904770F0 + for ; + Thu, 6 Feb 2003 19:23:46 -0500 (EST) +Received: (from mail@localhost) + by martin.sysdetect.com (8.11.3/8.11.3) id h170NnP19738; + Fri, 7 Feb 2003 00:23:49 GMT +Received: from winwood.sysdetect.com(172.16.1.1) + via SMTP by mail.sysdetect.com, id smtpdg12555; Fri Feb 7 00:23:41 2003 +Received: from winwood.sysdetect.com (seth@localhost) + by winwood.sysdetect.com (8.11.6/8.11.6) with ESMTP id h170Nfn06721; + Thu, 6 Feb 2003 19:23:41 -0500 +Message-Id: <200302070023.h170Nfn06721@winwood.sysdetect.com> +To: eric soroos +Cc: pgsql-performance@postgresql.org +Subject: Re: how to configure my new server +In-reply-to: <137343446.1167578047@[4.42.179.151]> +References: <3E42D6FB.9000605@web.de> <137343446.1167578047@[4.42.179.151]> +Comments: In reply to a message from "eric soroos " + dated "Thu, 06 Feb 2003 15:14:09 -0800." +From: Seth Robertson +Date: Thu, 06 Feb 2003 19:23:41 -0500 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/24 +X-Sequence-Number: 1080 + + +In message <137343446.1167578047@[4.42.179.151]>, eric soroos writes: + + As a somewhat on topic thought, it would be really neat to have a + pci card that was one slot for ram, one for compact flash, a + memory/ide controller and battery. Fill the ram and cf with + identical sized units, and use it as a disk for WAL. if the power + goes off, dump the ram to cf. Should be able to do thousands of + writes per sec, effectivley moving the bottleneck somewhere else. + It's probably $20 worth of chips for the board, but it would + probably sell for thousands. + +How is this not provided by one of the many solid state disks? + +http://www.storagesearch.com/ssd.html + +I have never puchased one of these due to cost ($1 per MB or more) but +I always assumed this was a direct fit. The solid state disk people +claim so as well on their marketing literature. One of the drives +claims 700MB/s bandwidth. + + -Seth Robertson + pgsql-performance@sysd.com + +From pgsql-performance-owner@postgresql.org Thu Feb 6 20:27:10 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 1EB4F47651B + for ; + Thu, 6 Feb 2003 20:27:08 -0500 (EST) +Received: from l2.socialecology.com (unknown [4.42.179.131]) + by postgresql.org (Postfix) with ESMTP id 5D681477452 + for ; + Thu, 6 Feb 2003 19:33:45 -0500 (EST) +Received: from 4.42.179.151 (broccoli.socialecology.com [4.42.179.151]) + by l2.socialecology.com (Postfix) with SMTP + id 9CD893A3C93; Thu, 6 Feb 2003 15:53:14 -0800 (PST) +X-Mailer: UserLand Frontier 9.1b1 (Macintosh OS) (mailServer v1.1..142) +Mime-Version: 1.0 +Message-Id: <137629994.1167573271@[4.42.179.151]> +X-authenticated-sender: erics +In-reply-to: <200302070007.h1707Us06536@winwood.sysdetect.com> +Date: Thu, 06 Feb 2003 16:33:45 -0800 +To: Seth Robertson +Cc: pgsql-performance@postgresql.org +From: eric soroos +Subject: Re: how to configure my new server +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/25 +X-Sequence-Number: 1081 + +On Thu, 06 Feb 2003 19:07:30 -0500 in message <200302070007.h1707Us06536@winwood.sysdetect.com>, Seth Robertson wrote: +> +> In message <137343446.1167578047@[4.42.179.151]>, eric soroos writes: +> +> As a somewhat on topic thought, it would be really neat to have a +> pci card that was one slot for ram, one for compact flash, a +> memory/ide controller and battery. Fill the ram and cf with +> identical sized units, and use it as a disk for WAL. if the power +> goes off, dump the ram to cf. Should be able to do thousands of +> writes per sec, effectivley moving the bottleneck somewhere else. +> It's probably $20 worth of chips for the board, but it would +> probably sell for thousands. +> +> How is this not provided by one of the many solid state disks? + +$20 worth of chips. The selling for thousands is what is provided by SSDs. A pci interface. + +> http://www.storagesearch.com/ssd.html + +Solid state disks are sold by companies targeting the military and don't have prices on the website. That scares me. + +The pci board would need about the same circuitry as a north+southbridge on an everyday motherboard, current chip cost is in the tens of dollars. Assuming that the demand is low, call it $100 or so for a completed board. support pc-100 (much faster than a pci bus) and cf type 2 (3? allow microdrives) and you've got something like 512mb of storage for $300. Which is almost exactly my WAL size. Compared to a raid card + 2 ide drives, price is a wash and performance is limited by the pci bus. + +There's one board like this w/o the flash, but it's something like $500-1000 depending on ultimate capacity, without ram. + +> I have never puchased one of these due to cost ($1 per MB or more) but +> I always assumed this was a direct fit. The solid state disk people +> claim so as well on their marketing literature. One of the drives +> claims 700MB/s bandwidth. + +I was seeing prices start in the low thousands and go up from there. Out of my budget I'm afraid. I'm in the process of spending ~ $500 on a drive system. The desire is to switch from raid card + 4 ide drives to my wish card + a raid card + 2 drives. (note that I'm talking in mirrored drives). I'm guessing that I could move the bottleneck to either the processor or pci bus if these cards existed. + +eric + + + + +From pgsql-performance-owner@postgresql.org Thu Feb 6 20:39:08 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id CB04C476069 + for ; + Thu, 6 Feb 2003 20:39:07 -0500 (EST) +Received: from platonic.cynic.net (platonic.cynic.net [204.80.150.245]) + by postgresql.org (Postfix) with ESMTP id 4135D47621F + for ; + Thu, 6 Feb 2003 20:17:43 -0500 (EST) +Received: from angelic.cynic.net (angelic-platonic.cvpn.cynic.net + [198.73.220.226]) by platonic.cynic.net (Postfix) with ESMTP + id 6E159BFF8; Fri, 7 Feb 2003 01:17:45 +0000 (UTC) +Received: from localhost (localhost [127.0.0.1]) + by angelic.cynic.net (Postfix) with ESMTP + id 1BC238744; Fri, 7 Feb 2003 10:17:44 +0900 (JST) +Date: Fri, 7 Feb 2003 10:17:43 +0900 (JST) +From: Curt Sampson +To: eric soroos +Cc: pgsql-performance@postgresql.org +Subject: Re: how to configure my new server +In-Reply-To: <137343446.1167578047@[4.42.179.151]> +Message-ID: +References: <137343446.1167578047@[4.42.179.151]> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/26 +X-Sequence-Number: 1082 + +On Thu, 6 Feb 2003, eric soroos wrote: + +> running on a rocketraid card (kernel thinks it's scsi) is faster than +> onboard controllers + +How many transactions per second can you get on a single RAID or stripe +system using this card? + +I found that the write performance for large writes on an Escalade 7850 +was great, but I couldn't coax more than about 120 writes per second +out of the thing in any configuration (even writing to separate disks +in JBOD mode), which made it very disappointing for database use. (The +individual disks on the controller, modern IBM 60 GB IDEs, could do +about 90 writes per second.) + +cjs +-- +Curt Sampson +81 90 7737 2974 http://www.netbsd.org + Don't you know, in this new Dark Age, we're all light. --XTC + +From pgsql-performance-owner@postgresql.org Thu Feb 6 22:07:24 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 88C39475AD4 + for ; + Thu, 6 Feb 2003 22:07:22 -0500 (EST) +Received: from l2.socialecology.com (unknown [4.42.179.131]) + by postgresql.org (Postfix) with ESMTP id 88CB047595A + for ; + Thu, 6 Feb 2003 22:07:17 -0500 (EST) +Received: from 4.42.179.151 (broccoli.socialecology.com [4.42.179.151]) + by l2.socialecology.com (Postfix) with SMTP + id B2FC33A5004; Thu, 6 Feb 2003 18:26:48 -0800 (PST) +X-Mailer: UserLand Frontier 9.1b1 (Macintosh OS) (mailServer v1.1..142) +Mime-Version: 1.0 +Message-Id: <138182794.1167564058@[4.42.179.151]> +X-authenticated-sender: erics +In-reply-to: +Date: Thu, 06 Feb 2003 19:07:18 -0800 +To: Curt Sampson +Cc: pgsql-performance@postgresql.org +From: eric soroos +Subject: Re: how to configure my new server +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/27 +X-Sequence-Number: 1083 + +On Fri, 7 Feb 2003 10:17:43 +0900 (JST) in message , Curt Sampson wrote: +> On Thu, 6 Feb 2003, eric soroos wrote: +> +> > running on a rocketraid card (kernel thinks it's scsi) is faster than +> > onboard controllers +> +> How many transactions per second can you get on a single RAID or stripe +> system using this card? + +My current test setup is using a rocketraid 404 card, + 2 WD Caviar 80G SE (8 meg cache), and a 2 yr old 7200 rpm ide ibm on the mb controller channel as the os/log drive. The rocketraid is a 4 channel card, I'm going to fill the other two channels with mirror drives. I'm _not_ using hw mirroring, since I want the flexibility of sw mirroring for now. (I don't think their driver supports breaking and reestablishing the mirror with live drive usage) + +This is on a single p3-733, 640 mb ram. Processor is apparently never redlined normally running at 50-75% as reported by vmstat. + +> I found that the write performance for large writes on an Escalade 7850 +> was great, but I couldn't coax more than about 120 writes per second +> out of the thing in any configuration (even writing to separate disks +> in JBOD mode), which made it very disappointing for database use. (The +> individual disks on the controller, modern IBM 60 GB IDEs, could do +> about 90 writes per second.) + +Using a data/wal split, I see peaks around 135 t/s (500 transactions, 10 concurrent clients). Sustained (25000 transactions) that goes down to the 80 range due to the moving of data from the WAL to the data directories. these numbers are all with the kernel's data caches full of about 1/2 gig of data, I'm seeing 300 blks/s read and 3000 write + +Peaks for striped are @ 80, peaks for single are ~ 100, peaks for mirror are around 100. I'm curious if hw mirroring would help, as I am about a 4 disk raid 5. But I'm not likely to have the proper drives for that in time to do the testing, and I like the ablity to break the mirror for a backup. For comparison, that same system was doing 20-50 without the extra 512 stick of ram and on the internal single drive. + +eric + + + + +From pgsql-performance-owner@postgresql.org Thu Feb 6 22:23:30 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id CE207474E5C + for ; + Thu, 6 Feb 2003 22:23:29 -0500 (EST) +Received: from smtp.web.de (smtp03.web.de [217.72.192.158]) + by postgresql.org (Postfix) with ESMTP id 22A3E474E4F + for ; + Thu, 6 Feb 2003 22:23:29 -0500 (EST) +Received: from p50818974.dip0.t-ipconnect.de ([80.129.137.116] helo=web.de) + by smtp.web.de with asmtp (WEB.DE(Exim) 4.93 #1) id 18gz6y-00044U-00 + for pgsql-performance@postgresql.org; Fri, 07 Feb 2003 04:23:32 +0100 +Message-ID: <3E4326B6.5030100@web.de> +Date: Fri, 07 Feb 2003 04:23:34 +0100 +From: Andreas Pflug +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: how to configure my new server +References: +In-Reply-To: +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/28 +X-Sequence-Number: 1084 + +Hello @ all, + +Josh wrote: +>> With a large database you may even think about +>> shifting individual tables or indexes to seperate disks. + +OK, I admit it was a bit provoking. It was my intention to stir things up a little bit ;-) IMHO, thinking about locating data on dedicated files is a waste of time on small servers. Let the hardware do the job for you! It is "good enough". + + +Eric wrote: +>>Unfortunately, today's hardware still has rotational latency. You aren't goign to get much +>> more than 300 seeks per sec on the best single drive. Putting them together in a way that +>> requires half to all of them to seek for a given read or write is a performance killer. +>> The only way around this is high end raid cards with backup batteries and ram. + +You're right, 300 seeks is best you can expect from a state-of-the-art HD. But the average disk request will certainly not be performed over several disks. Usual block size for RAID is 32kb or 64kb, while most requests will be only some kb (assuming you're not doing full table scans all the time). Thus, the usual request will require only one disk to be accessed on read. This way, a 10-disk array will be capable of up to 3000 requests/second (if the controller allows this). + +Actually, I don't trust software RAID. If I'm talking about RAID, I mean mature RAID solutions, using SCSI or similar professional equipment. More RAM, ideally with backup power, is desirable. For small servers, a RAID controller < 1000 $ usually will do. IDE RAID, uhm eh... I never did like it, and I doubt that IDE RAID controller are doing a good job optimizing for this kind of traffic. IMHO, they are meant for workstation, leave them there. And remember, if we talk about access time, typical latency for a SCSI disk is half of fast IDE disks, giving double speed for typical DB access patterns. You may use IDE if speed means MB/s, but for us it's seeks/s. + +I don't think solid state disks are a way out (unless you don't know where to bury your money :-). Maybe the gurus can tell more about PostgreSQL's caching, but for my opinion if enough RAM is available after some time all of the DB should be in cache eliminating the need to access the disks for read access. For writing, which is typically less than 10 % of total load, an optimizing caching disk controller should be sufficient. + +Andreas + + + +From pgsql-performance-owner@postgresql.org Thu Feb 6 23:34:32 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B6FBC474E4F + for ; + Thu, 6 Feb 2003 23:34:31 -0500 (EST) +Received: from platonic.cynic.net (platonic.cynic.net [204.80.150.245]) + by postgresql.org (Postfix) with ESMTP id 02F75474E44 + for ; + Thu, 6 Feb 2003 23:34:31 -0500 (EST) +Received: from angelic.cynic.net (angelic-platonic.cvpn.cynic.net + [198.73.220.226]) by platonic.cynic.net (Postfix) with ESMTP + id 8F249BFF8; Fri, 7 Feb 2003 04:34:34 +0000 (UTC) +Received: from localhost (localhost [127.0.0.1]) + by angelic.cynic.net (Postfix) with ESMTP + id BF22A8736; Fri, 7 Feb 2003 13:34:32 +0900 (JST) +Date: Fri, 7 Feb 2003 13:34:32 +0900 (JST) +From: Curt Sampson +To: eric soroos +Cc: pgsql-performance@postgresql.org +Subject: Re: how to configure my new server +In-Reply-To: <138182794.1167564058@[4.42.179.151]> +Message-ID: +References: <138182794.1167564058@[4.42.179.151]> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/29 +X-Sequence-Number: 1085 + +On Thu, 6 Feb 2003, eric soroos wrote: + +> > I found that the write performance for large writes on an Escalade +> > 7850 was great, but I couldn't coax more than about 120 writes +> > per second out of the thing in any configuration (even writing to +> > separate disks in JBOD mode), which made it very disappointing for +> > database use. (The individual disks on the controller, modern IBM 60 +> > GB IDEs, could do about 90 writes per second.) +> ... +> Peaks for striped are @ 80, peaks for single are ~ 100, peaks for +> mirror are around 100. I'm curious if hw mirroring would help, as I am +> about a 4 disk raid 5. But I'm not likely to have the proper drives +> for that in time to do the testing, and I like the ablity to break the +> mirror for a backup. For comparison, that same system was doing 20-50 +> without the extra 512 stick of ram and on the internal single drive. + +Hm. That's still very low (about the same as a single modern IDE drive). +I'm looking for an IDE RAID controller that would get me up into the +300-500 reads/writes per second range, for 8K blocks. This should not +be a problem when doing striping across eight disks that are each +individually capable of about 90 random 8K reads/writes per second. +(Depending on the size of the data area you're testing on, of course.) + +See http://randread.sourceforge.net for some tools to help measure this. + +cjs +-- +Curt Sampson +81 90 7737 2974 http://www.netbsd.org + Don't you know, in this new Dark Age, we're all light. --XTC + +From pgsql-performance-owner@postgresql.org Fri Feb 7 03:33:51 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 5B6EF475956 + for ; + Fri, 7 Feb 2003 03:33:50 -0500 (EST) +Received: from etna.obsidian.co.za (etna.obsidian.co.za [196.36.119.67]) + by postgresql.org (Postfix) with ESMTP id 9B84047590C + for ; + Fri, 7 Feb 2003 03:33:47 -0500 (EST) +Received: (from uucp@localhost) + by etna.obsidian.co.za (8.11.6/8.11.6) with UUCP id h178Xla23640 + for pgsql-performance@postgresql.org; Fri, 7 Feb 2003 10:33:47 +0200 +Received: from tarcil.itvs.co.za + (IDENT:LEgyp/TCbo99cztxoZpEVn8sWfaSQKr8@tarcil [172.16.1.14]) + by flash.itvs.co.za (8.9.3/8.9.3) with ESMTP id KAA29577 + for ; Fri, 7 Feb 2003 10:41:52 +0200 +Date: Fri, 7 Feb 2003 10:11:46 +0200 (SAST) +From: jeandre@itvs.co.za +X-X-Sender: jeandre@localhost.localdomain +To: pgsql-performance@postgresql.org +Subject: Performance +Message-ID: +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/30 +X-Sequence-Number: 1086 + +I come from a Sybase background and have just started working with +Postgre. Are there any books or tutorials that cover general performance +issues for beginners? I don't just want to start creating databases and +tables or writing mad queries without really understanding what is happening +in the background. I know quite a few tips and tricks for Sybase but I don't +think that much of it is relevant on Postgres. I would like to know how +the query optimizer works, i.e. does the order of tables in the from +clause make a difference in speed and how does indexing work on Postgres? +Any help pointing me in the right direction would be appreciated. + +Many Thanks +Jeandre + + +From pgsql-performance-owner@postgresql.org Fri Feb 7 03:46:07 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 571D1475DBD + for ; + Fri, 7 Feb 2003 03:46:06 -0500 (EST) +Received: from www.pspl.co.in (www.pspl.co.in [202.54.11.65]) + by postgresql.org (Postfix) with ESMTP id DD95B47615F + for ; + Fri, 7 Feb 2003 03:40:26 -0500 (EST) +Received: (from root@localhost) + by www.pspl.co.in (8.11.6/8.11.6) id h178eQf26106 + for ; Fri, 7 Feb 2003 14:10:26 +0530 +Received: from daithan.itnranet.pspl.co.in (daithan.intranet.pspl.co.in + [192.168.7.161]) + by www.pspl.co.in (8.11.6/8.11.0) with ESMTP id h178eQ526101 + for ; Fri, 7 Feb 2003 14:10:26 +0530 +Content-Type: text/plain; + charset="iso-8859-1" +From: Shridhar Daithankar +To: pgsql-performance@postgresql.org +Subject: Re: Performance +Date: Fri, 7 Feb 2003 14:10:51 +0530 +User-Agent: KMail/1.4.3 +References: +In-Reply-To: +MIME-Version: 1.0 +Message-Id: <200302071410.51302.shridhar_daithankar@persistent.co.in> +X-MIME-Autoconverted: from quoted-printable to 8bit by www.pspl.co.in id + h178eQ526101 +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/31 +X-Sequence-Number: 1087 + +On Friday 07 February 2003 01:41 pm, you wrote: +> I come from a Sybase background and have just started working with +> Postgre. Are there any books or tutorials that cover general performance +> issues for beginners? I don't just want to start creating databases and +> tables or writing mad queries without really understanding what is +> happening in the background. I know quite a few tips and tricks for Sybase +> but I don't think that much of it is relevant on Postgres. I would like to +> know how the query optimizer works, i.e. does the order of tables in the +> from clause make a difference in speed and how does indexing work on +> Postgres? Any help pointing me in the right direction would be appreciate= +d. + +Religously go thr. admin guide. and then a quick look thr. all SQL commands= +.=20 +May take a day or two but believe me, it is worth that. + + Shridhar + +From pgsql-performance-owner@postgresql.org Fri Feb 7 05:22:09 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B0CC5475A97 + for ; + Fri, 7 Feb 2003 05:22:07 -0500 (EST) +Received: from mailsweeper.vhm-ibb.de (unknown [194.173.175.204]) + by postgresql.org (Postfix) with SMTP id DCF61475C26 + for ; + Fri, 7 Feb 2003 05:21:33 -0500 (EST) +Received: from 194.173.175.21 by mailsweeper.vhm-ibb.de (InterScan E-Mail + VirusWall NT); Fri, 07 Feb 2003 11:21:35 +0100 +Received: from vhm.de ([192.168.50.60]) by spartakus.vhm.de + (Post.Office MTA v3.5.3 release 223 ID# 127-61375U6500L550S0V35) + with ESMTP id de for ; + Fri, 7 Feb 2003 11:21:33 +0100 +Message-ID: <3E4389E7.80109@vhm.de> +Date: Fri, 07 Feb 2003 11:26:47 +0100 +From: Christian Toepp +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; + rv:1.2.1) Gecko/20021226 Debian/1.2.1-9 +X-Accept-Language: de +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: postgres on solaris 8 +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/32 +X-Sequence-Number: 1088 + +hi, i have to set up a postgres database on a +sun enterprise 10000 machine running on solaris 8. +has anyone hints for tuning the database for me? + +regards +-Chris +-- +If Bill Gates had a penny for every time Windows crashed... +..oh wait, he does. + + +From pgsql-performance-owner@postgresql.org Fri Feb 7 05:59:31 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 91B094758E6 + for ; + Fri, 7 Feb 2003 05:59:28 -0500 (EST) +Received: from mail013.syd.optusnet.com.au (mail013.syd.optusnet.com.au + [210.49.20.171]) + by postgresql.org (Postfix) with ESMTP id 0959547595A + for ; + Fri, 7 Feb 2003 05:59:17 -0500 (EST) +Received: from postgresql.org (adlax3-218.dialup.optusnet.com.au + [198.142.82.218]) + by mail013.syd.optusnet.com.au (8.11.1/8.11.1) with ESMTP id + h17Ax0N19853; Fri, 7 Feb 2003 21:59:04 +1100 +Message-ID: <3E439184.9020302@postgresql.org> +Date: Fri, 07 Feb 2003 21:29:16 +1030 +From: Justin Clift +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; + rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Christian Toepp +Cc: pgsql-performance@postgresql.org +Subject: Re: postgres on solaris 8 +References: <3E4389E7.80109@vhm.de> +In-Reply-To: <3E4389E7.80109@vhm.de> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/33 +X-Sequence-Number: 1089 + +Christian Toepp wrote: +> hi, i have to set up a postgres database on a +> sun enterprise 10000 machine running on solaris 8. +> has anyone hints for tuning the database for me? + +Hi Chris, + +Sure. + +We need some info first: + + + How much memory is in the E10k? + + What's the disk/array configuration of the E10k? + + How many CPU's? (just out of curiosity) + + Will the E10k be doing anything other than PostgreSQL? + + Which version of PostgreSQL? (please say 7.3.2) + + What is the expected workload of the E10k? + +Sorry for the not-entirely-easy questions, it's just that this will give +us a good understanding of your configuration and what to recommend. + +Regards and best wishes, + +Justin Clift + + +> regards +> -Chris + + +-- +"My grandfather once told me that there are two kinds of people: those +who work and those who take the credit. He told me to try to be in the +first group; there was less competition there." +- Indira Gandhi + + +From pgsql-performance-owner@postgresql.org Fri Feb 7 09:55:30 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 8D574475A1E + for ; + Fri, 7 Feb 2003 09:55:29 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id C373C4759AF + for ; + Fri, 7 Feb 2003 09:55:28 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h17EtF5u026719; + Fri, 7 Feb 2003 09:55:15 -0500 (EST) +To: jeandre@itvs.co.za +Cc: pgsql-performance@postgresql.org +Subject: Re: Performance +In-reply-to: +References: +Comments: In-reply-to jeandre@itvs.co.za + message dated "Fri, 07 Feb 2003 10:11:46 +0200" +Date: Fri, 07 Feb 2003 09:55:14 -0500 +Message-ID: <26718.1044629714@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/34 +X-Sequence-Number: 1090 + +jeandre@itvs.co.za writes: +> ... does the order of tables in the from +> clause make a difference in speed + +No, it does not; except perhaps in corner cases where two tables have +exactly the same statistics, so that the planner has no basis for +choosing one over the other. (This scenario could happen if you've +never ANALYZEd either, for example.) + +> and how does indexing work on Postgres? + +Uh, it indexes. What's your question exactly? + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Fri Feb 7 10:10:20 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 4819E475AD4 + for ; + Fri, 7 Feb 2003 10:10:18 -0500 (EST) +Received: from etna.obsidian.co.za (etna.obsidian.co.za [196.36.119.67]) + by postgresql.org (Postfix) with ESMTP id 10D5B475AF8 + for ; + Fri, 7 Feb 2003 10:10:15 -0500 (EST) +Received: (from uucp@localhost) + by etna.obsidian.co.za (8.11.6/8.11.6) with UUCP id h17FACS27292; + Fri, 7 Feb 2003 17:10:12 +0200 +Received: from tarcil.itvs.co.za + (IDENT:pfh5fNNs6d5bYskczhW1sbpikBda3HZZ@tarcil [172.16.1.14]) + by flash.itvs.co.za (8.9.3/8.9.3) with ESMTP id RAA31682; + Fri, 7 Feb 2003 17:35:05 +0200 +Date: Fri, 7 Feb 2003 17:04:52 +0200 (SAST) +From: jeandre@itvs.co.za +X-X-Sender: jeandre@localhost.localdomain +To: Tom Lane +Cc: pgsql-performance@postgresql.org +Subject: Re: Performance +In-Reply-To: <26718.1044629714@sss.pgh.pa.us> +Message-ID: +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/35 +X-Sequence-Number: 1091 + +On Fri, 7 Feb 2003, Tom Lane wrote: + +> Uh, it indexes. What's your question exactly? + +In the documentation I saw something about different index types. In +Sybase you create an index and that is it. How do you choose what type of +index to create on a column in Postgres? + + +From pgsql-performance-owner@postgresql.org Fri Feb 7 10:14:05 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0E007474E4F + for ; + Fri, 7 Feb 2003 10:14:05 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 51084474E42 + for ; + Fri, 7 Feb 2003 10:14:04 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h17FDw5u026910; + Fri, 7 Feb 2003 10:13:58 -0500 (EST) +To: jeandre@itvs.co.za +Cc: pgsql-performance@postgresql.org +Subject: Re: Performance +In-reply-to: +References: +Comments: In-reply-to jeandre@itvs.co.za + message dated "Fri, 07 Feb 2003 17:04:52 +0200" +Date: Fri, 07 Feb 2003 10:13:58 -0500 +Message-ID: <26909.1044630838@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/36 +X-Sequence-Number: 1092 + +jeandre@itvs.co.za writes: +> In the documentation I saw something about different index types. In +> Sybase you create an index and that is it. How do you choose what type of +> index to create on a column in Postgres? + +There's an optional clause in the CREATE INDEX command --- I think +"USING access_method", but check the man page. + +In practice, 99.44% of indexes are the default btree type, so you +usually don't need to think about it. I'd only use a non-btree index +if I needed to index non-scalar data (arrays, geometric types, etc); +the GIST and RTREE index types are designed for those. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Fri Feb 7 10:47:08 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id CF339474E5C + for ; + Fri, 7 Feb 2003 10:47:07 -0500 (EST) +Received: from etna.obsidian.co.za (etna.obsidian.co.za [196.36.119.67]) + by postgresql.org (Postfix) with ESMTP id EF2EE474E4F + for ; + Fri, 7 Feb 2003 10:47:05 -0500 (EST) +Received: (from uucp@localhost) + by etna.obsidian.co.za (8.11.6/8.11.6) with UUCP id h17FktZ28810; + Fri, 7 Feb 2003 17:46:55 +0200 +Received: from tarcil.itvs.co.za + (IDENT:KOR8zE53r9V8zRjdZUi7KGtpR+yMdQvo@tarcil [172.16.1.14]) + by flash.itvs.co.za (8.9.3/8.9.3) with ESMTP id SAA31854; + Fri, 7 Feb 2003 18:08:39 +0200 +Date: Fri, 7 Feb 2003 17:38:26 +0200 (SAST) +From: jeandre@itvs.co.za +X-X-Sender: jeandre@localhost.localdomain +To: Tom Lane +Cc: pgsql-performance@postgresql.org +Subject: Re: Performance +In-Reply-To: <26909.1044630838@sss.pgh.pa.us> +Message-ID: +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/37 +X-Sequence-Number: 1093 + + +On Fri, 7 Feb 2003, Tom Lane wrote: + +> In practice, 99.44% of indexes are the default btree type, so you +> usually don't need to think about it. + +Thanks for clearing that up, and everyone else that has responded. With +the help I am getting from you guys I should have a good clue of using the +database to it's utmost optimum very soon. + +regards +Jeandre + + +From pgsql-performance-owner@postgresql.org Fri Feb 7 11:22:03 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 6314F474E5C + for ; + Fri, 7 Feb 2003 11:22:02 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id B7CB8474E4F + for ; + Fri, 7 Feb 2003 11:22:01 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h17GKnC1024941; + Fri, 7 Feb 2003 09:20:50 -0700 (MST) +Date: Fri, 7 Feb 2003 09:13:17 -0700 (MST) +From: "scott.marlowe" +To: Andreas Pflug +Cc: +Subject: Re: how to configure my new server +In-Reply-To: <3E4326B6.5030100@web.de> +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 AMaViS new-20020517 +X-Archive-Number: 200302/38 +X-Sequence-Number: 1094 + +On Fri, 7 Feb 2003, Andreas Pflug wrote: + +> Actually, I don't trust software RAID. If I'm talking about RAID, I +> mean mature RAID solutions, using SCSI or similar professional +> equipment. + +Funny you should mention that. A buddy running a "professional" level +card had it mark two out of three drives in a RAID 5 bad and wouldn't let +him reinsert the drives no matter what. Had to revert to backups. + +I'll take Linux's built in kernel raid any day over most pro cards. I've +been using it in production for about 3 years and it is very mature and +stable, and lets you do what you want to do (which can be good if your +smart, but very bad if you do something dumb... :-) + +I've had good and bad experiences with pro grade RAID boxes and +controllers, but I've honestly had nothing but good from linux's kernel +level raid. Some early 2.0 stuff had some squirreliness that meant I had +to actually reboot for some changes to take affect. Since the 2.2 kernel +came out the md driver has been rock solid. I've not played with the +volume manager yet, but I hear equally nice things about it. + +Keep in mind that a "hardware raid card" is nothing more than software +raid burnt into ROM and stuffed on a dedicated card, there's no magic +pixie dust that decrees doing such makes it a better or more reliable +solution. + + +From pgsql-performance-owner@postgresql.org Fri Feb 7 11:46:59 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A93C2475458 + for ; + Fri, 7 Feb 2003 11:46:58 -0500 (EST) +Received: from mail.speakeasy.net (mail17.speakeasy.net [216.254.0.217]) + by postgresql.org (Postfix) with ESMTP id 04388474E5C + for ; + Fri, 7 Feb 2003 11:46:58 -0500 (EST) +Received: (qmail 1858 invoked from network); 7 Feb 2003 16:47:06 -0000 +Received: from unknown (HELO pdarley) (kinesis@[64.81.9.230]) + (envelope-sender ) + by mail17.speakeasy.net (qmail-ldap-1.03) with SMTP + for ; 7 Feb 2003 16:47:06 -0000 +From: "Peter Darley" +To: "scott.marlowe" , + "Andreas Pflug" +Cc: +Subject: Re: how to configure my new server +Date: Fri, 7 Feb 2003 08:47:01 -0800 +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.1106 +Importance: Normal +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/39 +X-Sequence-Number: 1095 + +Folks, + I'm going to be setting up a Linux software RAID this weekend, and in my +research I cam across the following document: +http://www.hpl.hp.com/techreports/2002/HPL-2002-352.html + It says that Linux software RAID is slower than XP Software RAID on the +same hardware. If this is the case, wouldn't it follow that hardware RAID +has a really good chance of beating Linux software RAID? Or does the +problem that affects the software raid affect all Linux disk IO? I'm not +really knowledgeable enough to tell. +Thanks, +Peter Darley + +-----Original Message----- +From: pgsql-performance-owner@postgresql.org +[mailto:pgsql-performance-owner@postgresql.org]On Behalf Of +scott.marlowe +Sent: Friday, February 07, 2003 8:13 AM +To: Andreas Pflug +Cc: pgsql-performance@postgresql.org +Subject: Re: [PERFORM] how to configure my new server + + +On Fri, 7 Feb 2003, Andreas Pflug wrote: + +> Actually, I don't trust software RAID. If I'm talking about RAID, I +> mean mature RAID solutions, using SCSI or similar professional +> equipment. + +Funny you should mention that. A buddy running a "professional" level +card had it mark two out of three drives in a RAID 5 bad and wouldn't let +him reinsert the drives no matter what. Had to revert to backups. + +I'll take Linux's built in kernel raid any day over most pro cards. I've +been using it in production for about 3 years and it is very mature and +stable, and lets you do what you want to do (which can be good if your +smart, but very bad if you do something dumb... :-) + +I've had good and bad experiences with pro grade RAID boxes and +controllers, but I've honestly had nothing but good from linux's kernel +level raid. Some early 2.0 stuff had some squirreliness that meant I had +to actually reboot for some changes to take affect. Since the 2.2 kernel +came out the md driver has been rock solid. I've not played with the +volume manager yet, but I hear equally nice things about it. + +Keep in mind that a "hardware raid card" is nothing more than software +raid burnt into ROM and stuffed on a dedicated card, there's no magic +pixie dust that decrees doing such makes it a better or more reliable +solution. + + +---------------------------(end of broadcast)--------------------------- +TIP 5: Have you checked our extensive FAQ? + +http://www.postgresql.org/users-lounge/docs/faq.html + + +From pgsql-performance-owner@postgresql.org Fri Feb 7 12:17:46 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id DB835474E61 + for ; + Fri, 7 Feb 2003 12:17:43 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 41DBE4758C9 + for ; + Fri, 7 Feb 2003 12:17:33 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2829171; Fri, 07 Feb 2003 09:17:03 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: Andreas Pflug , + pgsql-performance@postgresql.org +Subject: Re: how to configure my new server +Date: Fri, 7 Feb 2003 09:16:27 -0800 +User-Agent: KMail/1.4.3 +References: <3E4326B6.5030100@web.de> +In-Reply-To: <3E4326B6.5030100@web.de> +MIME-Version: 1.0 +Message-Id: <200302070916.27541.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/40 +X-Sequence-Number: 1096 + +Andreas, + +> Josh wrote: +> >> With a large database you may even think about +> >> shifting individual tables or indexes to seperate disks. +> +> OK, I admit it was a bit provoking. It was my intention to stir things up= + a +> little bit ;-) IMHO, thinking about locating data on dedicated files is a +> waste of time on small servers. Let the hardware do the job for you! It is +> "good enough". + +Aha, by "large databases" I mean "several million records". In the odd ca= +se=20 +where you have a database which has one or two tables which are larger than= +=20 +the rest of the database combined, you can get a performance boost by putti= +ng=20 +those tables, and/or their indexes, on a seperate spindle. + +Frankly, for small servers, a pair of mirrored IDE drives is adequate. And= +,=20 +of course, if you have a RAID 1+0 controller, that's better than trying to= +=20 +directly allocate different files to different disks ... except the WAL log. + +> I don't think solid state disks are a way out (unless you don't know where +> to bury your money :-). Maybe the gurus can tell more about PostgreSQL's +> caching, but for my opinion if enough RAM is available after some time all +> of the DB should be in cache eliminating the need to access the disks for +> read access. For writing, which is typically less than 10 % of total load, +> an optimizing caching disk controller should be sufficient. + +Depends on the database. I've worked on DBs where writes were 40% of all= +=20 +queries ... and 90% of the system resource load. For those databases,=20 +moving the WAL log to a RAMdisk might mean a big boost. + +Also, I'm currently working to figure out a solution for some 1U machines= +=20 +which don't have any *room* for an extra drive for WAL. A PCI ramdisk woul= +d=20 +be just perfect ... + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Fri Feb 7 12:21:23 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0FD54474E5C + for ; + Fri, 7 Feb 2003 12:21:23 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 5DE85474E42 + for ; + Fri, 7 Feb 2003 12:21:12 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2829177; Fri, 07 Feb 2003 09:20:42 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: jeandre@itvs.co.za +Subject: Re: Performance +Date: Fri, 7 Feb 2003 09:20:07 -0800 +User-Agent: KMail/1.4.3 +Cc: pgsql-performance@postgresql.org +References: +In-Reply-To: +MIME-Version: 1.0 +Message-Id: <200302070920.07250.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/41 +X-Sequence-Number: 1097 + +Jean, + +Also check out the many performance-related articles at: + +http://techdocs.postgresql.org + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Fri Feb 7 12:42:16 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 05345475A37 + for ; + Fri, 7 Feb 2003 12:42:12 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id 7AADC475957 + for ; + Fri, 7 Feb 2003 12:42:10 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h17HfLC1000518; + Fri, 7 Feb 2003 10:41:22 -0700 (MST) +Date: Fri, 7 Feb 2003 10:33:48 -0700 (MST) +From: "scott.marlowe" +To: Peter Darley +Cc: Andreas Pflug , + +Subject: Re: how to configure my new server +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 AMaViS new-20020517 +X-Archive-Number: 200302/42 +X-Sequence-Number: 1098 + +I've always had very good performance with Linux's kernel raid, though +I've never compared it to Windows, just to hardware raid cards running in +linux. + +I can get aggregate reads of about 48 Megs a second on a pair of 10k 18 +gig UW scsi drives in RAID1 config. I'm not saying there's no room for +improvement, but for what I use it for, it gives very good performance. + +Some hardware cards will certainly be faster than the linux kernel +raid software, but it's not a given that any hardware card WILL be faster. +I'm quite certain that you could outrun most older cards using 33 MHz I960 +for checksum calculations with a dual 2.4Ghz machine doing software. + +The only way to be sure is to test it. + + On Fri, 7 Feb 2003, Peter Darley wrote: + +> Folks, +> I'm going to be setting up a Linux software RAID this weekend, and in my +> research I cam across the following document: +> http://www.hpl.hp.com/techreports/2002/HPL-2002-352.html +> It says that Linux software RAID is slower than XP Software RAID on the +> same hardware. If this is the case, wouldn't it follow that hardware RAID +> has a really good chance of beating Linux software RAID? Or does the +> problem that affects the software raid affect all Linux disk IO? I'm not +> really knowledgeable enough to tell. +> Thanks, +> Peter Darley +> +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org +> [mailto:pgsql-performance-owner@postgresql.org]On Behalf Of +> scott.marlowe +> Sent: Friday, February 07, 2003 8:13 AM +> To: Andreas Pflug +> Cc: pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] how to configure my new server +> +> +> On Fri, 7 Feb 2003, Andreas Pflug wrote: +> +> > Actually, I don't trust software RAID. If I'm talking about RAID, I +> > mean mature RAID solutions, using SCSI or similar professional +> > equipment. +> +> Funny you should mention that. A buddy running a "professional" level +> card had it mark two out of three drives in a RAID 5 bad and wouldn't let +> him reinsert the drives no matter what. Had to revert to backups. +> +> I'll take Linux's built in kernel raid any day over most pro cards. I've +> been using it in production for about 3 years and it is very mature and +> stable, and lets you do what you want to do (which can be good if your +> smart, but very bad if you do something dumb... :-) +> +> I've had good and bad experiences with pro grade RAID boxes and +> controllers, but I've honestly had nothing but good from linux's kernel +> level raid. Some early 2.0 stuff had some squirreliness that meant I had +> to actually reboot for some changes to take affect. Since the 2.2 kernel +> came out the md driver has been rock solid. I've not played with the +> volume manager yet, but I hear equally nice things about it. +> +> Keep in mind that a "hardware raid card" is nothing more than software +> raid burnt into ROM and stuffed on a dedicated card, there's no magic +> pixie dust that decrees doing such makes it a better or more reliable +> solution. +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 5: Have you checked our extensive FAQ? +> +> http://www.postgresql.org/users-lounge/docs/faq.html +> +> + + +From pgsql-performance-owner@postgresql.org Fri Feb 7 13:07:00 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 864514764A1 + for ; + Fri, 7 Feb 2003 13:06:59 -0500 (EST) +Received: from l2.socialecology.com (unknown [4.42.179.131]) + by postgresql.org (Postfix) with ESMTP id 457B44758DC + for ; + Fri, 7 Feb 2003 13:06:17 -0500 (EST) +Received: from 4.42.179.151 (broccoli.socialecology.com [4.42.179.151]) + by l2.socialecology.com (Postfix) with SMTP + id 3233C3A9B2D; Fri, 7 Feb 2003 09:25:47 -0800 (PST) +X-Mailer: UserLand Frontier 9.1b1 (Macintosh OS) (mailServer v1.1..142) +Mime-Version: 1.0 +Message-Id: <141418696.1167510126@[4.42.179.151]> +X-authenticated-sender: erics +In-reply-to: +Date: Fri, 07 Feb 2003 10:06:10 -0800 +To: Curt Sampson +Cc: pgsql-performance@postgresql.org +From: eric soroos +Subject: Re: how to configure my new server +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/43 +X-Sequence-Number: 1099 + + +> > Peaks for striped are @ 80, peaks for single are ~ 100, peaks for +> > mirror are around 100. I'm curious if hw mirroring would help, as I am +> > about a 4 disk raid 5. But I'm not likely to have the proper drives +> > for that in time to do the testing, and I like the ablity to break the +> > mirror for a backup. For comparison, that same system was doing 20-50 +> > without the extra 512 stick of ram and on the internal single drive. + +Upon some further poking around, I have determined that there were procedural errors that make the data inconsistent. I believe that half of the ram cache may not have been in the state that I thought it was in for all of the tests. + +> Hm. That's still very low (about the same as a single modern IDE drive). +> I'm looking for an IDE RAID controller that would get me up into the +> 300-500 reads/writes per second range, for 8K blocks. This should not +> be a problem when doing striping across eight disks that are each +> individually capable of about 90 random 8K reads/writes per second. +> (Depending on the size of the data area you're testing on, of course.) + +Running some further tests, I'm seeing software striping in the 125 tps peak/100 sustained range, which is about what I'm getting from the split WAL/Data mode right now. I'm still seeing about 10% reads, so there's probably some more to be gained with additional system ram. + +eric + + + + +From pgsql-performance-owner@postgresql.org Fri Feb 7 13:42:50 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E2B414758C9 + for ; + Fri, 7 Feb 2003 13:42:48 -0500 (EST) +Received: from smtp.web.de (smtp02.web.de [217.72.192.151]) + by postgresql.org (Postfix) with ESMTP id 5E922475458 + for ; + Fri, 7 Feb 2003 13:42:48 -0500 (EST) +Received: from p508186ec.dip0.t-ipconnect.de ([80.129.134.236] helo=web.de) + by smtp.web.de with asmtp (WEB.DE(Exim) 4.93 #1) id 18hDSZ-0000Bu-00 + for pgsql-performance@postgresql.org; Fri, 07 Feb 2003 19:42:47 +0100 +Message-ID: <3E43FE28.7030203@web.de> +Date: Fri, 07 Feb 2003 19:42:48 +0100 +From: Andreas Pflug +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: how to configure my new server +References: +In-Reply-To: +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/44 +X-Sequence-Number: 1100 + +scott.marlowe wrote: + +>I can get aggregate reads of about 48 Megs a second on a pair of 10k 18 +>gig UW scsi drives in RAID1 config. I'm not saying there's no room for +>improvement, but for what I use it for, it gives very good performance. +> +> +> +Scott, + +as most people talking about performance you mean throughput, but this +is not the most important parameter for databases. Reading the comments +of other users with software and IDE RAID, it seems to me that indeed +these solutions are only good at this discipline. + +Another suggestion: +You're right, a hardware RAID controller is nothing but a stripped down +system that does noting more than a software RAID would do either. But +this tends to be the discussion that Intels plays for years now. There +were times when Intel said "don't need an intelligent graphics +controller, just use a fast processor". Well, development went another +direction, and it's good this way. Same with specialized controllers. +They will take burden from the central processing unit, which can +concentrate on the complicated things, not just getting some block from +disk. Look at most Intel based servers. Often, CPU Speed is less than +workstations CPUs, RAM technology one step behind. But they have +sophisticated infrastructure for coprocessing. This is the way to speed +things up, not pumping up the CPU. + +If you got two of three HDs bad in a RAID5 array, you're lost. That's +the case for all RAID5 solutions, because the redundancy is just one +disk. Better solutions will allow for spare disks that jump in as soon +as one fails, hopefully it rebuilds before the next fails. + + +Regards, + +Andreas + + + + + +From pgsql-performance-owner@postgresql.org Fri Feb 7 16:13:32 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E5476474E4F + for ; + Fri, 7 Feb 2003 16:13:31 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id 26190474E42 + for ; + Fri, 7 Feb 2003 16:13:31 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h17L9RC1014012; + Fri, 7 Feb 2003 14:10:03 -0700 (MST) +Date: Fri, 7 Feb 2003 14:01:38 -0700 (MST) +From: "scott.marlowe" +To: Andreas Pflug +Cc: +Subject: Re: how to configure my new server +In-Reply-To: <3E43FE28.7030203@web.de> +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 AMaViS new-20020517 +X-Archive-Number: 200302/45 +X-Sequence-Number: 1101 + +On Fri, 7 Feb 2003, Andreas Pflug wrote: + +> scott.marlowe wrote: +> +> >I can get aggregate reads of about 48 Megs a second on a pair of 10k 18 +> >gig UW scsi drives in RAID1 config. I'm not saying there's no room for +> >improvement, but for what I use it for, it gives very good performance. +> > +> > +> > +> Scott, +> +> as most people talking about performance you mean throughput, but this +> is not the most important parameter for databases. Reading the comments +> of other users with software and IDE RAID, it seems to me that indeed +> these solutions are only good at this discipline. + +Well, I have run bonnie across it and several other options as well, and +the RAID cards I've test (Mega RAID 428 kinda stuff, i.e. 2 or 3 years +old) were no better than Linux at any of the tests. In some cases much +slower. + +> Another suggestion: +> You're right, a hardware RAID controller is nothing but a stripped down +> system that does noting more than a software RAID would do either. But +> this tends to be the discussion that Intels plays for years now. There +> were times when Intel said "don't need an intelligent graphics +> controller, just use a fast processor". Well, development went another +> direction, and it's good this way. Same with specialized controllers. +> They will take burden from the central processing unit, which can +> concentrate on the complicated things, not just getting some block from +> disk. Look at most Intel based servers. Often, CPU Speed is less than +> workstations CPUs, RAM technology one step behind. But they have +> sophisticated infrastructure for coprocessing. This is the way to speed +> things up, not pumping up the CPU. + +Hey, I was an Amiga owner, I'm all in favor of moving off the CPU that you +can. But, that's only a win if you're on a machine that will be +CPU/interrupt bound. If the machine sits at 99% idle with most of the +waiting being I/O, and it has 4 CPUs anyway, then you may or may not gain +from moving the work onto another card. while SSL et. al. encryption is +CPU intensive, but generally the XOring needed to be done for RAID +checksums is very simple to do quickly on modern architectures, so +there's no great gain the that department. I'd imagine the big gain +would come from on board battery backed up write through / or behind +cache memory. + +I think the fastest solutions have always been the big outboard boxes with +the RAID built in, and the PCI cards tend to be also rans in comparison. + +But the one point I'm sure we'll agree on in this is that until you test +it with your workload, you won't really know which is better, if either. + +> If you got two of three HDs bad in a RAID5 array, you're lost. That's +> the case for all RAID5 solutions, because the redundancy is just one +> disk. Better solutions will allow for spare disks that jump in as soon +> as one fails, hopefully it rebuilds before the next fails. + +The problem was that all three drives were good. He moved the server, +cable came half off, the card marked the drives as bad, and wouldn't +accept them back until it had formatted them. This wasn't the first time +I'd seen this kind of problem with RAID controllers either, as it had +happened to me in testing one a few years earlier. Which is one of the +many life experiences that makes me like backups so much. + + +From pgsql-performance-owner@postgresql.org Fri Feb 7 18:21:45 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 7357447595A + for ; + Fri, 7 Feb 2003 18:21:44 -0500 (EST) +Received: from smtp.web.de (smtp03.web.de [217.72.192.158]) + by postgresql.org (Postfix) with ESMTP id E3CBA475957 + for ; + Fri, 7 Feb 2003 18:21:43 -0500 (EST) +Received: from p50818850.dip0.t-ipconnect.de ([80.129.136.80] helo=web.de) + by smtp.web.de with asmtp (WEB.DE(Exim) 4.93 #1) id 18hHoX-0008KA-00 + for pgsql-performance@postgresql.org; Sat, 08 Feb 2003 00:21:45 +0100 +Message-ID: <3E443F8B.4030301@web.de> +Date: Sat, 08 Feb 2003 00:21:47 +0100 +From: Andreas Pflug +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: how to configure my new server +References: +In-Reply-To: +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/46 +X-Sequence-Number: 1102 + +scott.marlowe wrote: + +>The problem was that all three drives were good. He moved the server, +>cable came half off, the card marked the drives as bad, and wouldn't +>accept them back until it had formatted them. This wasn't the first time +>I'd seen this kind of problem with RAID controllers either, as it had +>happened to me in testing one a few years earlier. Which is one of the +>many life experiences that makes me like backups so much. +> +> +> +Ok, had this kind of problems too. Everytime you stop and start a +server, rest a second and say a little prayer :-) 80 % of HDs I've seen +dying didn't start again after a regular maintenance power down. Or a +controller finds some disk to be faulty for some nonreproduceable +reason, until you kick the disk out of the array and rebuild it. Bad +surprise, if TWO disks are considered bad. Stop and start again, and say +a real GOOD prayer, then get out the backup tape... + +I had this especially with Adaptec controllers. I had to learn they +cannot build reliable RAID, and they don't know what maintenance of +products is either (three generations of AAA controllers in two years, +all being incompatible, only partial supported for new OS. I'm cured!) +Some years ago they bought PMD, which is a lot better. + +Andreas + + +From pgsql-performance-owner@postgresql.org Mon Feb 10 06:15:03 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 1EBA3475461 + for ; + Mon, 10 Feb 2003 06:15:02 -0500 (EST) +Received: from ds9.quadratec-software.com (ds9.quadratec-software.com + [62.23.102.82]) by postgresql.org (Postfix) with ESMTP id 53F70474E44 + for ; + Mon, 10 Feb 2003 06:15:00 -0500 (EST) +Received: from spade.orsay.quadratec.fr (deltaq.quadratec-software.com + [62.23.102.66]) + by ds9.quadratec-software.com (8.11.3/8.11.3) with ESMTP id + h1ABEpI13103 + for ; Mon, 10 Feb 2003 12:14:52 +0100 +Received: from hotshine (hotshine.orsay.quadratec.fr [172.16.200.100]) + by spade.orsay.quadratec.fr (Switch-2.1.0/Switch-2.1.0) with SMTP id + h1ABEoT13143 for ; + Mon, 10 Feb 2003 12:14:50 +0100 (CET) +From: "philip johnson" +To: +Subject: Re: how to configure my new server +Date: Mon, 10 Feb 2003 12:18:35 +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: +Importance: Normal +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/47 +X-Sequence-Number: 1103 + +pgsql-performance-owner@postgresql.org wrote: +> Objet : Re: [PERFORM] how to configure my new server +> +> +> pgsql-performance-owner@postgresql.org wrote: +>> Phillip, +>> +>> First, a disclaimer: my advice is without warranty whatsoever. You +>> want a warranty, you gotta pay me. +>> +>>> I've a new configuration for our web server +>>> +>>> Processor Processeur Intel Xeon 2.0 Ghz / 512 Ko de cache L2 +>>> Memoiry 1 Go DDR SDRAM Disk1 18Go Ultra 3 (Ultra 160) SCSI 15 Ktpm +>>> Disk2 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +>>> Disk3 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +>>> Disk4 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +>>> Disk5 36Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +>> +>> No RAID, though? +> +> Yes no Raid, but will could change soon +> +>> +>> Think carefully about which disks you put things on. Ideally, the +>> OS, the web files, the database files, the database log, and the swap +>> partition will all be on seperate disks. With a large database you +>> may even think about shifting individual tables or indexes to +>> seperate disks. +> +> how can I put indexes on a seperate disk ? +> +>> +>>> linux values: +>>> kernel.shmmni = 4096 +>>> kernel.shmall = 32000000 +>>> kernel.shmmax = 256000000 +>> +>> These are probably too high, but I'm ready to speak authoritatively +>> on that. +> I took a look a the performance archive, and it's not possible to find +> real info on how to set these 3 values. +> +>> +>>> postgresql values: +>>> shared_buffers +>>> max_fsm_relations +>>> max_fsm_pages +>>> wal_buffers +>>> wal_files +>>> sort_mem +>>> vacuum_mem +>> +>> Please visit the archives for this list. Setting those values is a +>> topic of discussion for 50% of the threads, and there is yet no firm +>> agreement on good vs. bad values. +>> +> +> I'm surprised that there's no spreadsheet to calculate those values. +> There are many threads, but it seems that no one is able to find a +> rule to define values. +> +> +>> Also, you need to ask youself more questions before you start +>> setting values: +>> +>> 1. How many queries does my database handle per second or minute? +>> can't say now +> +>> 2. How big/complex are those queries? +> Not really complex and big as you can see +> +> SELECT qu_request.request_id, qu_request.type, +> qu_request_doc.ki_status, qu_request_doc.ki_subject, +> qu_request_doc.ki_description, qu_request_doc.ki_category, +> qu_request_doc.rn_description_us, qu_request_doc.rn_status_us, +> quad_config_nati.nati_version_extended FROM qu_request left join +> quad_config_nati on qu_request.quad_server_nati = +> quad_config_nati.nati_version left join qu_request_doc on +> qu_request.request_id = qu_request_doc.request_id +> WHERE qu_request.request_id = '130239' +> +> +> select sv_inquiry.inquiry_id, sv_inquiry.quad_account_inquiry_id +> ,to_char(sv_inquiry.change_dt, 'YYYY-MM-DD HH24:MI') as change_dt , +> to_char(sv_inquiry.closed_dt, 'YYYY-MM-DD HH24:MI') as closed_dt +> ,sv_inquiry.state, sv_inquiry.priority, sv_inquiry.type, +> account_contact.dear as contact , account_contact2.dear as contact2, +> sv_inquiry.action, sv_inquiry.activity , +> substr(sv_inq_txt.inquiry_txt, 1, 120) as inquiry_txt from sv_inquiry +> left join sv_inq_txt on sv_inquiry.inquiry_id = sv_inq_txt.inquiry_id +> left join account_contact on sv_inquiry.account_contact_id = +> account_contact.account_contact_id left join account_contact +> account_contact2 +> on sv_inquiry.account_contact_id2 = +> account_contact2.account_contact_id where +> sv_inquiry.account_id=3441833 and sv_inquiry.state not in ('Closed', +> 'Classified') ORDER BY sv_inquiry.inquiry_id DESC +> +> +>> 3. What is the ratio of database read activity vs. database writing +>> activity? +> There are more insert/update than read, because I'm doing table +> synchronization +> from an SQL Server database. Every 5 minutes I'm looking for change +> in SQL Server +> Database. +> I've made some stats, and I found that without user acces, and only +> with the replications +> I get 2 millions query per day +> +>> 4. What large tables in my database get queried +>> simultaneously/together? why this questions ? +> +>> 5. Are my database writes bundled into transactions, or seperate? +>> bundle in transactions +> +>> etc. +>> +>> Simply knowing the size of the database files isn't enough. +> +> is it better like this ? +> +> +> ---------------------------(end of +> broadcast)--------------------------- TIP 5: Have you checked our +> extensive FAQ? +> +> http://www.postgresql.org/users-lounge/docs/faq.html + +someone could come back to first request ? + +From pgsql-performance-owner@postgresql.org Mon Feb 10 12:36:16 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id AD3954758DC + for ; + Mon, 10 Feb 2003 12:36:15 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 7747E4758BD + for ; + Mon, 10 Feb 2003 12:36:14 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2832316; Mon, 10 Feb 2003 09:36:14 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: "philip johnson" , + +Subject: Re: how to configure my new server +Date: Mon, 10 Feb 2003 09:35:14 -0800 +User-Agent: KMail/1.4.3 +References: +In-Reply-To: +MIME-Version: 1.0 +Message-Id: <200302100935.14455.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/48 +X-Sequence-Number: 1104 + +Philip, + +> +> someone could come back to first request ? +> + +Insistent, aren't you? ;-) + +> > Yes no Raid, but will could change soon + +Adding RAID 1+0 could simplify your job enormously. It would prevent you= +=20 +from having to figure out what to put on each disk. If it were my machine,= +=20 +and I knew that the database was more important than the other services, I'= +d=20 +build it like this: + +Array 1: Disk 1: 18Go Ultra 3 (Ultra 160) SCSI 15 Ktpm + Disk2 : 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm + +Contains: Linux, Apache, Swap + +Array 2:=20 + Di:sk3 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm + Disk4 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm + +Contains: PostgreSQL and databases + + Disk5 36Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm + +Contains: Postgresql log, backup partition. + +Alternately: +Put all of the above on one *smart* RAID5 controller, with on-controller=20 +memory and battery. Might give you better performance considering your di= +sk=20 +setup. + +> > how can I put indexes on a seperate disk ? + +Move the index object (use the oid2name package in /contrib to find the ind= +ex)=20 +to a different location, and symlink it back to its original location. Ma= +ke=20 +sure that you REINDEX at maintainence time, and don't drop and re-create th= +e=20 +index, as that will have the effect of moving it back to the original=20 +location. + +> >>> linux values: +> >>> kernel.shmmni =3D 4096 +> >>> kernel.shmall =3D 32000000 +> >>> kernel.shmmax =3D 256000000 +> > I took a look a the performance archive, and it's not possible to find +> > real info on how to set these 3 values. + +Yeah. Personally, I just raise them until I stop getting error messages fr= +om=20 +Postgres. Perhaps someone on the list could speak to the danger of settin= +g=20 +any of these values too high? + +> > I'm surprised that there's no spreadsheet to calculate those values. +> > There are many threads, but it seems that no one is able to find a +> > rule to define values. + +That's correct. There is no rule, because there are too many variables, an= +d=20 +the value of many of those variables is a matter of opinion. As an=20 +*abbreviated* list: +1) Your processors and RAM; 2) Your drive setup and speed; 3) the frequenc= +y=20 +of data reads; 4) the frequency of data writes; 5) the average complexity= +=20 +of queries; 6) use of database procedures (functions) for DML; 7) your= +=20 +maintainence plan (e.g. how often can you run VACUUM FULL?); 8) the expect= +ed=20 +data population of tables (how many rows, how many tables); 9) your abilit= +y=20 +to program for indexed vs. non-indexed queries; 10) do you do mass data=20 +loads? ; 11) is the server being used for any other hihg-memory/networked= +=20 +applications? ; 12) the expected number of concurrent users; 13) use of lar= +ge=20 +objects and/or large text fields; etc. + +As a result, a set of values that work really well for me might crash your= +=20 +database. It's an interactive process. Justin Clift started a project t= +o=20 +create an automated interactive postgresql.conf tuner, one that would=20 +repeatedly test the speed of different queries against your database,=20 +overnight while you sleep. However, he didn't get very far and I haven't= +=20 +had time to help. + +> >> 1. How many queries does my database handle per second or minute? +> >> can't say now + +This has a big influence on your desired sort_mem and shared_buffer setting= +s.=20=20=20 +Make some estimates. + +> >> +> >> 2. How big/complex are those queries? +> > +> > Not really complex and big as you can see + +OK, so nothing that would require you to really jack up your sort or shared= +=20 +memory beyond levels suggested by other factors. However, you don't say ho= +w=20 +many rows these queries usually return, which has a substantial effect on= +=20 +desired sort_mem. + +A good, if time-consuming, technique for setting sort_mem is to move it up = +and=20 +down (from, say 512 to 4096) seeing at what level your biggest meanest=20 +queries slow down noticably ... and then set it to one level just above tha= +t. + +> > There are more insert/update than read, because I'm doing table +> > synchronization +> > from an SQL Server database. Every 5 minutes I'm looking for change +> > in SQL Server +> > Database. +> > I've made some stats, and I found that without user acces, and only +> > with the replications +> > I get 2 millions query per day + +In that case, making sure that your WAL files (the pg_xlog directory) is=20 +located on a seperate drive which *does nothing else* during normal operati= +on=20 +is your paramount concern for performance. You'll also need to carefully= +=20 +prune your indexes down to only the ones you really need to avoid slowing= +=20 +your inserts and updates. + +> >> 4. What large tables in my database get queried +> >> simultaneously/together? why this questions ? + +If you're not using RAID, it would affect whether you should even consider= +=20 +moving a particular table or index to a seperate drive. If you have two= +=20 +tables, each of which is 3 million records, and they are quried joined=20 +together in 50% of data reads, then one of those tables is a good candidate= +=20 +for moving to another drive. + +Good luck! + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Mon Feb 10 12:59:08 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 788D2475DB3 + for ; + Mon, 10 Feb 2003 12:59:00 -0500 (EST) +Received: from ds9.quadratec-software.com (ds9.quadratec-software.com + [62.23.102.82]) by postgresql.org (Postfix) with ESMTP id 15BA047590C + for ; + Mon, 10 Feb 2003 12:58:33 -0500 (EST) +Received: from spade.orsay.quadratec.fr (deltaq.quadratec-software.com + [62.23.102.66]) + by ds9.quadratec-software.com (8.11.3/8.11.3) with ESMTP id + h1AHwbI17356; Mon, 10 Feb 2003 18:58:38 +0100 +Received: from hotshine (hotshine.orsay.quadratec.fr [172.16.200.100]) + by spade.orsay.quadratec.fr (Switch-2.1.0/Switch-2.1.0) with SMTP id + h1AHwbT01225; Mon, 10 Feb 2003 18:58:37 +0100 (CET) +From: "philip johnson" +To: "Josh Berkus" , + +Subject: Re: how to configure my new server +Date: Mon, 10 Feb 2003 19:02:21 +0100 +Message-ID: +MIME-Version: 1.0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: 7bit +X-Priority: 1 (Highest) +X-MSMail-Priority: High +X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) +In-Reply-To: <200302100935.14455.josh@agliodbs.com> +Importance: High +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/49 +X-Sequence-Number: 1105 + +pgsql-performance-owner@postgresql.org wrote: +> Philip, +> +>> +>> someone could come back to first request ? +>> +> +> Insistent, aren't you? ;-) +> +>>> Yes no Raid, but will could change soon +> +> Adding RAID 1+0 could simplify your job enormously. It would +> prevent you from having to figure out what to put on each disk. If +> it were my machine, and I knew that the database was more important +> than the other services, I'd build it like this: +> +> Array 1: Disk 1: 18Go Ultra 3 (Ultra 160) SCSI 15 Ktpm +> Disk2 : 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 +> Ktpm +> +> Contains: Linux, Apache, Swap +> +> Array 2: +> Di:sk3 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +> Disk4 18Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +> +> Contains: PostgreSQL and databases +> +> Disk5 36Go Hot Plug Ultra 3 (Ultra 160) SCSI 15 Ktpm +> +> Contains: Postgresql log, backup partition. +> +> Alternately: +> Put all of the above on one *smart* RAID5 controller, with +> on-controller memory and battery. Might give you better performance +> considering your disk setup. +> +>>> how can I put indexes on a seperate disk ? +> +> Move the index object (use the oid2name package in /contrib to find +> the index) to a different location, and symlink it back to its +> original location. Make sure that you REINDEX at maintainence time, +> and don't drop and re-create the index, as that will have the effect +> of moving it back to the original location. +> +>>>>> linux values: +>>>>> kernel.shmmni = 4096 +>>>>> kernel.shmall = 32000000 +>>>>> kernel.shmmax = 256000000 +>>> I took a look a the performance archive, and it's not possible to +>>> find real info on how to set these 3 values. +> +> Yeah. Personally, I just raise them until I stop getting error +> messages from Postgres. Perhaps someone on the list could speak to +> the danger of setting any of these values too high? +> +>>> I'm surprised that there's no spreadsheet to calculate those values. +>>> There are many threads, but it seems that no one is able to find a +>>> rule to define values. +> +> That's correct. There is no rule, because there are too many +> variables, and the value of many of those variables is a matter of +> opinion. As an +> *abbreviated* list: +> 1) Your processors and RAM; 2) Your drive setup and speed; 3) the +> frequency of data reads; 4) the frequency of data writes; 5) the +> average complexity of queries; 6) use of database procedures +> (functions) for DML; 7) your maintainence plan (e.g. how often can +> you run VACUUM FULL?); 8) the expected data population of tables +> (how many rows, how many tables); 9) your ability to program for +> indexed vs. non-indexed queries; 10) do you do mass data loads? ; +> 11) is the server being used for any other hihg-memory/networked +> applications? ; 12) the expected number of concurrent users; 13) use +> of large objects and/or large text fields; etc. +> +> As a result, a set of values that work really well for me might crash +> your database. It's an interactive process. Justin Clift started +> a project to create an automated interactive postgresql.conf tuner, +> one that would repeatedly test the speed of different queries against +> your database, overnight while you sleep. However, he didn't get +> very far and I haven't had time to help. +> +>>>> 1. How many queries does my database handle per second or minute? +>>>> can't say now +> +> This has a big influence on your desired sort_mem and shared_buffer +> settings. Make some estimates. +> +>>>> +>>>> 2. How big/complex are those queries? +>>> +>>> Not really complex and big as you can see +> +> OK, so nothing that would require you to really jack up your sort or +> shared memory beyond levels suggested by other factors. However, you +> don't say how many rows these queries usually return, which has a +> substantial effect on desired sort_mem. +> +> A good, if time-consuming, technique for setting sort_mem is to move +> it up and down (from, say 512 to 4096) seeing at what level your +> biggest meanest queries slow down noticably ... and then set it to +> one level just above that. +> +>>> There are more insert/update than read, because I'm doing table +>>> synchronization from an SQL Server database. Every 5 minutes I'm +>>> looking for change in SQL Server Database. +>>> I've made some stats, and I found that without user acces, and only +>>> with the replications I get 2 millions query per day +> +> In that case, making sure that your WAL files (the pg_xlog directory) +> is located on a seperate drive which *does nothing else* during +> normal operation is your paramount concern for performance. You'll +> also need to carefully prune your indexes down to only the ones you +> really need to avoid slowing your inserts and updates. +> +>>>> 4. What large tables in my database get queried +>>>> simultaneously/together? why this questions ? +> +> If you're not using RAID, it would affect whether you should even +> consider moving a particular table or index to a seperate drive. If +> you have two tables, each of which is 3 million records, and they are +> quried joined together in 50% of data reads, then one of those tables +> is a good candidate for moving to another drive. +> +> Good luck! + +thanks very much + +From pgsql-performance-owner@postgresql.org Tue Feb 11 07:27:43 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id CD00C4759BD + for ; + Tue, 11 Feb 2003 07:27:41 -0500 (EST) +Received: from etna.obsidian.co.za (etna.obsidian.co.za [196.36.119.67]) + by postgresql.org (Postfix) with ESMTP id 2CB91475956 + for ; + Tue, 11 Feb 2003 07:27:38 -0500 (EST) +Received: (from uucp@localhost) + by etna.obsidian.co.za (8.11.6/8.11.6) with UUCP id h1BCReT31568 + for pgsql-performance@postgresql.org; Tue, 11 Feb 2003 14:27:40 +0200 +Received: from tarcil.itvs.co.za + (IDENT:8CnzHtZPStUYZ1j8qSbzaoNXZS72OJiB@tarcil [172.16.1.14]) + by flash.itvs.co.za (8.9.3/8.9.3) with ESMTP id NAA26749 + for ; Tue, 11 Feb 2003 13:41:53 +0200 +Date: Tue, 11 Feb 2003 13:10:12 +0200 (SAST) +From: jeandre@itvs.co.za +X-X-Sender: jeandre@localhost.localdomain +To: pgsql-performance@postgresql.org +Message-ID: +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/50 +X-Sequence-Number: 1106 + +When defining data types, which is better text, varchar or char? I heard +that on Postgres text is better, but I know on Sybase char is more efficient. +Can someone please tell me whether this statement is true and if so why? + +Many Thanks +Jeandre + + +From pgsql-performance-owner@postgresql.org Tue Feb 11 08:29:25 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0D16D474E5C + for ; + Tue, 11 Feb 2003 08:29:25 -0500 (EST) +Received: from mail.libertyrms.com (unknown [209.167.124.227]) + by postgresql.org (Postfix) with ESMTP id 53A0F474E53 + for ; + Tue, 11 Feb 2003 08:29:24 -0500 (EST) +Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 + (Debian)) + id 18iaTX-0004Ia-00 + for ; Tue, 11 Feb 2003 08:29:27 -0500 +Date: Tue, 11 Feb 2003 08:29:27 -0500 +From: Andrew Sullivan +To: pgsql-performance@postgresql.org +Subject: Re: +Message-ID: <20030211082927.C15541@mail.libertyrms.com> +Mail-Followup-To: Andrew Sullivan , + pgsql-performance@postgresql.org +References: +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.2.5i +In-Reply-To: ; + from jeandre@itvs.co.za on Tue, Feb 11, 2003 at 01:10:12PM +0200 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/51 +X-Sequence-Number: 1107 + +On Tue, Feb 11, 2003 at 01:10:12PM +0200, jeandre@itvs.co.za wrote: +> When defining data types, which is better text, varchar or char? I heard +> that on Postgres text is better, but I know on Sybase char is more efficient. +> Can someone please tell me whether this statement is true and if so why? + +Avoid char(n) unless you absolutely know you have a constant-length +field. Even then, you may get surprises. + +For practical purposes, text is probably your best bet. For +compatibility, there is varchar(), which is the same thing as text. +If you need to limit the size, use varchar(n). Be aware that it is +slightly slower, so don't use it unless your model demands it. + +A + +-- +---- +Andrew Sullivan 204-4141 Yonge Street +Liberty RMS Toronto, Ontario Canada + M2P 2A8 + +1 416 646 3304 x110 + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 10:43:28 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id B666D475D0F; Tue, 11 Feb 2003 10:43:25 -0500 (EST) +Received: from cuthbert.rcsinc.local (unknown [205.217.85.84]) + by postgresql.org (Postfix) with ESMTP + id 98ECA475B8A; Tue, 11 Feb 2003 10:43:12 -0500 (EST) +Subject: Re: [HACKERS] PostgreSQL Benchmarks +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Date: Tue, 11 Feb 2003 10:44:07 -0500 +X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 +content-class: urn:content-classes:message +Message-ID: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [pgsql-advocacy] [HACKERS] PostgreSQL Benchmarks +Thread-Index: AcLR283MK3cKk9fhQfy3WpVpsHmX7gABybNQ +From: "Merlin Moncure" +To: "Greg Copeland" +Cc: "PostgresSQL Hackers Mailing List" , + +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/6 +X-Sequence-Number: 764 + +I've tested all the win32 versions of postgres I can get my hands on +(cygwin and not), and my general feeling is that they have problems with +insert performance with fsync() turned on, probably the fault of the os. +Select performance is not so much affected. + +This is easily solved with transactions and other such things. Also +Postgres benefits from pl just like oracle. + +May I make a suggestion that maybe it is time to start thinking about +tuning the default config file, IMHO its just a little bit too +conservative, and its hurting you in benchmarks being run by idiots, but +its still bad publicity. Any real database admin would know his test +are synthetic and not meaningful without having to look at the #s. + +This is irritating me so much that I am going to put together a +benchmark of my own, a real world one, on (publicly available) real +world data. Mysql is a real dog in a lot of situations. The FCC +publishes a database of wireless transmitters that has tables with 10 +million records in it. I'll pump that into pg, run some benchmarks, +real world queries, and we'll see who the faster database *really* is. +This is just a publicity issue, that's all. Its still annoying though. + +I'll even run an open challenge to database admin to beat query +performance of postgres in such datasets, complex multi table joins, +etc. I'll even throw out the whole table locking issue and analyze +single user performance. + +Merlin=20 + + + +_____________ +How much of the performance difference is from the RDBMS, from the +middleware, and from the quality of implementation in the middleware. + +While I'm not surprised that the the cygwin version of PostgreSQL is +slow, those results don't tell me anything about the quality of the +middleware interface between PHP and PostgreSQL. Does anyone know if we +can rule out some of the performance loss by pinning it to bad +middleware implementation for PostgreSQL? + + +Regards, + +--=20 +Greg Copeland +Copeland Computer Consulting + + + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 11:20:12 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 4E6C8474E5C; Tue, 11 Feb 2003 11:20:11 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP + id 77B87474E53; Tue, 11 Feb 2003 11:20:10 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1BGKF5u026005; + Tue, 11 Feb 2003 11:20:15 -0500 (EST) +To: "Merlin Moncure" +Cc: "PostgresSQL Hackers Mailing List" , + pgsql-advocacy@postgresql.org +Subject: Changing the default configuration (was Re: [HACKERS] PostgreSQL + Benchmarks) +In-reply-to: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> +Comments: In-reply-to "Merlin Moncure" + message dated "Tue, 11 Feb 2003 10:44:07 -0500" +Date: Tue, 11 Feb 2003 11:20:14 -0500 +Message-ID: <26004.1044980414@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/7 +X-Sequence-Number: 765 + +"Merlin Moncure" writes: +> May I make a suggestion that maybe it is time to start thinking about +> tuning the default config file, IMHO its just a little bit too +> conservative, + +It's a lot too conservative. I've been thinking for awhile that we +should adjust the defaults. + +The original motivation for setting shared_buffers = 64 was so that +Postgres would start out-of-the-box on machines where SHMMAX is 1 meg +(64 buffers = 1/2 meg, leaving 1/2 meg for our other shared data +structures). At one time SHMMAX=1M was a pretty common stock kernel +setting. But our other data structures blew past the 1/2 meg mark +some time ago; at default settings the shmem request is now close to +1.5 meg. So people with SHMMAX=1M have already got to twiddle their +postgresql.conf settings, or preferably learn how to increase SHMMAX. +That means there is *no* defensible reason anymore for defaulting to +64 buffers. + +We could retarget to try to stay under SHMMAX=4M, which I think is +the next boundary that's significant in terms of real-world platforms +(isn't that the default SHMMAX on some BSDen?). That would allow us +350 or so shared_buffers, which is better, but still not really a +serious choice for production work. + +What I would really like to do is set the default shared_buffers to +1000. That would be 8 meg worth of shared buffer space. Coupled with +more-realistic settings for FSM size, we'd probably be talking a shared +memory request approaching 16 meg. This is not enough RAM to bother +any modern machine from a performance standpoint, but there are probably +quite a few platforms out there that would need an increase in their +stock SHMMAX kernel setting before they'd take it. + +So what this comes down to is making it harder for people to get +Postgres running for the first time, versus making it more likely that +they'll see decent performance when they do get it running. + +It's worth noting that increasing SHMMAX is not nearly as painful as +it was back when these decisions were taken. Most people have moved +to platforms where it doesn't even take a kernel rebuild, and we've +acquired documentation that tells how to do it on all(?) our supported +platforms. So I think it might be okay to expect people to do it. + +The alternative approach is to leave the settings where they are, and +to try to put more emphasis in the documentation on the fact that the +factory-default settings produce a toy configuration that you *must* +adjust upward for decent performance. But we've not had a lot of +success spreading that word, I think. With SHMMMAX too small, you +do at least get a pretty specific error message telling you so. + +Comments? + + regards, tom lane + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 11:42:57 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id E5582474E5C; Tue, 11 Feb 2003 11:42:55 -0500 (EST) +Received: from CopelandConsulting.Net (dsl-24293-ld.customer.centurytel.net + [209.142.135.135]) by postgresql.org (Postfix) with ESMTP + id AED26474E53; Tue, 11 Feb 2003 11:42:54 -0500 (EST) +Received: from [192.168.1.2] (mouse.copelandconsulting.net [192.168.1.2]) + by CopelandConsulting.Net (8.10.1/8.10.1) with ESMTP id h1BGgn702486; + Tue, 11 Feb 2003 10:42:49 -0600 (CST) +X-Trade-Id: +To: Tom Lane +Cc: Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +In-Reply-To: <26004.1044980414@sss.pgh.pa.us> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> +Content-Type: text/plain +Organization: Copeland Computer Consulting +Message-Id: <1044981773.25889.165.camel@mouse.copelandconsulting.net> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.0 +Date: 11 Feb 2003 10:42:54 -0600 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/8 +X-Sequence-Number: 766 + +On Tue, 2003-02-11 at 10:20, Tom Lane wrote: +> "Merlin Moncure" writes: +> > May I make a suggestion that maybe it is time to start thinking about +> > tuning the default config file, IMHO its just a little bit too +> > conservative, +> +> It's a lot too conservative. I've been thinking for awhile that we +> should adjust the defaults. +> +> The original motivation for setting shared_buffers = 64 was so that +> Postgres would start out-of-the-box on machines where SHMMAX is 1 meg +> (64 buffers = 1/2 meg, leaving 1/2 meg for our other shared data +> structures). At one time SHMMAX=1M was a pretty common stock kernel +> setting. But our other data structures blew past the 1/2 meg mark +> some time ago; at default settings the shmem request is now close to +> 1.5 meg. So people with SHMMAX=1M have already got to twiddle their +> postgresql.conf settings, or preferably learn how to increase SHMMAX. +> That means there is *no* defensible reason anymore for defaulting to +> 64 buffers. +> +> We could retarget to try to stay under SHMMAX=4M, which I think is +> the next boundary that's significant in terms of real-world platforms +> (isn't that the default SHMMAX on some BSDen?). That would allow us +> 350 or so shared_buffers, which is better, but still not really a +> serious choice for production work. +> +> What I would really like to do is set the default shared_buffers to +> 1000. That would be 8 meg worth of shared buffer space. Coupled with +> more-realistic settings for FSM size, we'd probably be talking a shared +> memory request approaching 16 meg. This is not enough RAM to bother +> any modern machine from a performance standpoint, but there are probably +> quite a few platforms out there that would need an increase in their +> stock SHMMAX kernel setting before they'd take it. +> +> So what this comes down to is making it harder for people to get +> Postgres running for the first time, versus making it more likely that +> they'll see decent performance when they do get it running. +> +> It's worth noting that increasing SHMMAX is not nearly as painful as +> it was back when these decisions were taken. Most people have moved +> to platforms where it doesn't even take a kernel rebuild, and we've +> acquired documentation that tells how to do it on all(?) our supported +> platforms. So I think it might be okay to expect people to do it. +> +> The alternative approach is to leave the settings where they are, and +> to try to put more emphasis in the documentation on the fact that the +> factory-default settings produce a toy configuration that you *must* +> adjust upward for decent performance. But we've not had a lot of +> success spreading that word, I think. With SHMMMAX too small, you +> do at least get a pretty specific error message telling you so. +> +> Comments? + +I'd personally rather have people stumble trying to get PostgreSQL +running, up front, rather than allowing the lowest common denominator +more easily run PostgreSQL only to be disappointed with it and move on. + +After it's all said and done, I would rather someone simply say, "it's +beyond my skill set", and attempt to get help or walk away. That seems +better than them being able to run it and say, "it's a dog", spreading +word-of-mouth as such after they left PostgreSQL behind. Worse yet, +those that do walk away and claim it performs horribly are probably +doing more harm to the PostgreSQL community than expecting someone to be +able to install software ever can. + +Nutshell: + "Easy to install but is horribly slow." + + or + + "Took a couple of minutes to configure and it rocks!" + + + +Seems fairly cut-n-dry to me. ;) + + +Regards, + +-- +Greg Copeland +Copeland Computer Consulting + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 11:44:41 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 2A17D4759BD; Tue, 11 Feb 2003 11:44:40 -0500 (EST) +Received: from henry.newn.cam.ac.uk (henry.newn.cam.ac.uk [131.111.204.130]) + by postgresql.org (Postfix) with ESMTP + id 33C3A475925; Tue, 11 Feb 2003 11:44:39 -0500 (EST) +Received: from [131.111.204.180] (helo=quartz.newn.cam.ac.uk) + by henry.newn.cam.ac.uk with esmtp (Exim 3.13 #1) + id 18idWN-0003A0-00; Tue, 11 Feb 2003 16:44:35 +0000 +Received: from prlw1 by quartz.newn.cam.ac.uk with local (Exim 4.10) + id 18idWM-0006QS-00; Tue, 11 Feb 2003 16:44:34 +0000 +Date: Tue, 11 Feb 2003 16:44:34 +0000 +From: Patrick Welche +To: Tom Lane +Cc: Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: Changing the default configuration (was Re: [HACKERS] PostgreSQL + Benchmarks) +Message-ID: <20030211164434.B15688@quartz.newn.cam.ac.uk> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <26004.1044980414@sss.pgh.pa.us> +User-Agent: Mutt/1.3.19i +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/9 +X-Sequence-Number: 767 + +On Tue, Feb 11, 2003 at 11:20:14AM -0500, Tom Lane wrote: +... +> We could retarget to try to stay under SHMMAX=4M, which I think is +> the next boundary that's significant in terms of real-world platforms +> (isn't that the default SHMMAX on some BSDen?). +... + +Assuming 1 page = 4k, and number of pages is correct in GENERIC kernel configs, +SHMMAX=4M for NetBSD (8M for i386, x86_64) + +Cheers, + +Patrick + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:03:18 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id E039B475925; Tue, 11 Feb 2003 12:03:16 -0500 (EST) +Received: from chimta03.algx.net (mta8.algx.net [67.92.168.237]) + by postgresql.org (Postfix) with ESMTP + id 6E970475843; Tue, 11 Feb 2003 12:03:16 -0500 (EST) +Received: from JHS ([67.92.23.74]) + by chimmx03.algx.net (iPlanet Messaging Server 5.2 HotFix 1.10 (built + Jan 23 2003)) with SMTP id <0HA500124M1DLW@chimmx03.algx.net>; Tue, + 11 Feb 2003 11:03:13 -0600 (CST) +Date: Tue, 11 Feb 2003 12:03:13 -0500 +From: Jason Hihn +Subject: Re: Changing the default configuration (was Re: +In-reply-to: <1044981773.25889.165.camel@mouse.copelandconsulting.net> +Cc: PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Message-id: +MIME-version: 1.0 +X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 +X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) +Content-type: text/plain; charset=iso-8859-1 +Content-transfer-encoding: 7BIT +Importance: Normal +X-Priority: 3 (Normal) +X-MSMail-priority: Normal +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/10 +X-Sequence-Number: 768 + +>Nutshell: +> "Easy to install but is horribly slow." +> +> or +> +> "Took a couple of minutes to configure and it rocks!" + +Since when is it easy to install on win32? +The easiest way I know of is through Cygwin, then you have to worry about +installing the IPC service (an getting the right version too!) I've +installed versions 6.1 to 7.1, but I almost gave up on the windows install. +At least in 6.x you had very comprehensive installation guide with a TOC. + +Versus the competition which are you going to choose if you're a wanna-be +DBA? The one with all he hoops to jump through, or the one that comes with a +setup.exe? + +Now I actually am in support of making it more aggressive, but it should +wait until we too have a setup.exe for the native windows port. (Changing it +on *n*x platforms is of little benefit because most benchmarks seem to run +it on w32 anyway :-( ) + +Just my $.02. I reserve the right to be wrong. +-J + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:08:25 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 9434D474E5C; Tue, 11 Feb 2003 12:08:24 -0500 (EST) +Received: from grunt23.ihug.com.au (grunt23.ihug.com.au [203.109.249.143]) + by postgresql.org (Postfix) with ESMTP + id C1BC4474E53; Tue, 11 Feb 2003 12:08:23 -0500 (EST) +Received: from p43-tnt2.mel.ihug.com.au (postgresql.org) [203.173.164.43] + by grunt23.ihug.com.au with esmtp (Exim 3.35 #1 (Debian)) + id 18idtQ-000740-00; Wed, 12 Feb 2003 04:08:25 +1100 +Message-ID: <3E492E06.2030702@postgresql.org> +Date: Wed, 12 Feb 2003 04:08:22 +1100 +From: Justin Clift +User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Tom Lane +Cc: Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: Changing the default configuration (was Re: +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> +In-Reply-To: <26004.1044980414@sss.pgh.pa.us> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/12 +X-Sequence-Number: 770 + +Tom Lane wrote: + +> What I would really like to do is set the default shared_buffers to +> 1000. That would be 8 meg worth of shared buffer space. Coupled with +> more-realistic settings for FSM size, we'd probably be talking a shared +> memory request approaching 16 meg. This is not enough RAM to bother +> any modern machine from a performance standpoint, but there are probably +> quite a few platforms out there that would need an increase in their +> stock SHMMAX kernel setting before they'd take it. + + +Totally agree with this. We really, really, really, really need to get +the default to a point where we have _decent_ default performance. + +> The alternative approach is to leave the settings where they are, and +> to try to put more emphasis in the documentation on the fact that the +> factory-default settings produce a toy configuration that you *must* +> adjust upward for decent performance. But we've not had a lot of +> success spreading that word, I think. With SHMMMAX too small, you +> do at least get a pretty specific error message telling you so. +> +> Comments? + +Yep. + +Here's an *unfortunately very common* scenario, that again +unfortunately, a _seemingly large_ amount of people fall for. + +a) Someone decides to "benchmark" database XYZ vs PostgreSQL vs other +databases + +b) Said benchmarking person knows very little about PostgreSQL, so they +install the RPM's, packages, or whatever, and "it works". Then they run +whatever benchmark they've downloaded, or designed, or whatever + +c) PostgreSQL, being practically unconfigured, runs at the pace of a +slow, mostly-disabled snail. + +d) Said benchmarking person gets better performance from the other +databases (also set to their default settings) and thinks "PostgreSQL +has lots of features, and it's free, but it's Too Slow". + +Yes, this kind of testing shouldn't even _pretend_ to have any real +world credibility. + +e) Said benchmarking person tells everyone they know, _and_ everyone +they meet about their results. Some of them even create nice looking or +profesional looking web pages about it. + +f) People who know even _less_ than the benchmarking person hear about +the test, or read the result, and don't know any better than to believe +it at face value. So, they install whatever system was recommended. + +g) Over time, the benchmarking person gets the hang of their chosen +database more and writes further articles about it, and doesn't +generally look any further afield than it for say... a couple of years. + By this time, they've already influenced a couple of thousand people +in the non-optimal direction. + +h) Arrgh. With better defaults, our next release would _appear_ to be a +lot faster to quite a few people, just because they have no idea about +tuning. + +So, as sad as this scenario is, better defaults will probably encourage +a lot more newbies to get involved, and that'll eventually translate +into a lot more experienced users, and a few more coders to assist. ;-) + +Personally I'd be a bunch happier if we set the buffers so high that we +definitely have decent performance, and the people that want to run +PostgreSQL are forced to make the choice of either: + + 1) Adjust their system settings to allow PostgreSQL to run properly, or + + 2) Manually adjust the PostgreSQL settings to run memory-constrained + +This way, PostgreSQL either runs decently, or they are _aware_ that +they're limiting it. That should cut down on the false benchmarks +(hopefully). + +:-) + +Regards and best wishes, + +Justin Clift + +> regards, tom lane + + +-- +"My grandfather once told me that there are two kinds of people: those +who work and those who take the credit. He told me to try to be in the +first group; there was less competition there." + - Indira Gandhi + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:10:50 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 18A9B474E5C; Tue, 11 Feb 2003 12:10:49 -0500 (EST) +Received: from polaris.pinpointresearch.com (66-7-238-176.cust.telepacific.net + [66.7.238.176]) by postgresql.org (Postfix) with ESMTP + id 59E3E474E53; Tue, 11 Feb 2003 12:10:48 -0500 (EST) +Received: from there (66-7-238-179.cust.telepacific.net [66.7.238.179]) + by polaris.pinpointresearch.com (Postfix) with SMTP + id 579E1103F6; Tue, 11 Feb 2003 09:10:48 -0800 (PST) +Content-Type: text/plain; + charset="iso-8859-1" +From: Steve Crawford +Organization: Pinpoint Research +To: Tom Lane , + "Merlin Moncure" +Subject: Re: Changing the default configuration (was Re: [HACKERS] PostgreSQL + Benchmarks) +Date: Tue, 11 Feb 2003 09:10:48 -0800 +X-Mailer: KMail [version 1.3.1] +Cc: "PostgresSQL Hackers Mailing List" , + pgsql-advocacy@postgresql.org +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> +In-Reply-To: <26004.1044980414@sss.pgh.pa.us> +MIME-Version: 1.0 +Message-Id: <20030211171048.579E1103F6@polaris.pinpointresearch.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/13 +X-Sequence-Number: 771 + +A quick-'n'-dirty first step would be more comments in postgresql.conf. Mos= +t=20 +of the lines are commented out which would imply "use the default" but the= +=20 +default is not shown. (I realize this has the difficulty of defaults that= +=20 +change depending upon how PostgreSQL was configured/compiled but perhaps=20 +postgresql.conf could be built by the make process based on the configurati= +on=20 +options.) + +If postgresql.conf were commented with recommendations it would probably be= +=20 +all I need though perhaps a recommendation to edit that file should be=20 +displayed at the conclusion of "make install". + +Cheers, +Steve + + +On Tuesday 11 February 2003 8:20 am, Tom Lane wrote: +> "Merlin Moncure" writes: +> > May I make a suggestion that maybe it is time to start thinking about +> > tuning the default config file, IMHO its just a little bit too +> > conservative, +> +> It's a lot too conservative. I've been thinking for awhile that we +> should adjust the defaults. +> +> The original motivation for setting shared_buffers =3D 64 was so that +> Postgres would start out-of-the-box on machines where SHMMAX is 1 meg +> (64 buffers =3D 1/2 meg, leaving 1/2 meg for our other shared data +> structures). At one time SHMMAX=3D1M was a pretty common stock kernel +> setting. But our other data structures blew past the 1/2 meg mark +> some time ago; at default settings the shmem request is now close to +> 1.5 meg. So people with SHMMAX=3D1M have already got to twiddle their +> postgresql.conf settings, or preferably learn how to increase SHMMAX. +> That means there is *no* defensible reason anymore for defaulting to +> 64 buffers. +> +> We could retarget to try to stay under SHMMAX=3D4M, which I think is +> the next boundary that's significant in terms of real-world platforms +> (isn't that the default SHMMAX on some BSDen?). That would allow us +> 350 or so shared_buffers, which is better, but still not really a +> serious choice for production work. +> +> What I would really like to do is set the default shared_buffers to +> 1000. That would be 8 meg worth of shared buffer space. Coupled with +> more-realistic settings for FSM size, we'd probably be talking a shared +> memory request approaching 16 meg. This is not enough RAM to bother +> any modern machine from a performance standpoint, but there are probably +> quite a few platforms out there that would need an increase in their +> stock SHMMAX kernel setting before they'd take it. +> +> So what this comes down to is making it harder for people to get +> Postgres running for the first time, versus making it more likely that +> they'll see decent performance when they do get it running. +> +> It's worth noting that increasing SHMMAX is not nearly as painful as +> it was back when these decisions were taken. Most people have moved +> to platforms where it doesn't even take a kernel rebuild, and we've +> acquired documentation that tells how to do it on all(?) our supported +> platforms. So I think it might be okay to expect people to do it. +> +> The alternative approach is to leave the settings where they are, and +> to try to put more emphasis in the documentation on the fact that the +> factory-default settings produce a toy configuration that you *must* +> adjust upward for decent performance. But we've not had a lot of +> success spreading that word, I think. With SHMMMAX too small, you +> do at least get a pretty specific error message telling you so. +> +> Comments? +> +> regards, tom lane +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:06:03 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id DA325475A45; Tue, 11 Feb 2003 12:06:02 -0500 (EST) +Received: from snoopy.mohawksoft.com (h0030f1382639.ne.client2.attbi.com + [24.60.194.163]) by postgresql.org (Postfix) with ESMTP + id E65D5475843; Tue, 11 Feb 2003 12:06:01 -0500 (EST) +Received: from mohawksoft.com (snoopy.mohawksoft.com [127.0.0.1]) + by snoopy.mohawksoft.com (8.11.6/8.11.6) with ESMTP id h1BHC4a30725; + Tue, 11 Feb 2003 12:12:05 -0500 +Message-ID: <3E492EE4.1080502@mohawksoft.com> +Date: Tue, 11 Feb 2003 12:12:04 -0500 +From: mlw +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; + rv:1.0.1) Gecko/20020823 Netscape/7.0 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Tom Lane +Cc: Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: Changing the default configuration (was Re: +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> +Content-Type: multipart/alternative; + boundary="------------010600010708020705080102" +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/11 +X-Sequence-Number: 769 + +--------------010600010708020705080102 +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit + + + +Tom Lane wrote: + +>"Merlin Moncure" writes: +> +> +>>May I make a suggestion that maybe it is time to start thinking about +>>tuning the default config file, IMHO its just a little bit too +>>conservative, +>> +>> +> +>It's a lot too conservative. I've been thinking for awhile that we +>should adjust the defaults. +> +> +> +One of the things I did on my Windows install was to have a number of +default configuration files, postgresql.conf.small, +postgresql.conf.medium, postgresql.conf.large. + +Rather than choose one, in the "initdb" script, ask for or determine the +mount of shared memory, memory, etc. + +Another pet peeve I have is forcing the configuration files to be in the +database directory. We had this argument in 7.1 days, and I submitted a +patch that allowed a configuration file to be specified as a command +line parameter. One of the things that Oracle does better is separating +the "configuration" from the data. + +It is an easy patch to allow PostgreSQL to use a separate configuration +directory, and specify the data directory within the configuration file +(The way any logical application works), and, NO, symlinks are not a +solution, they are a kludge. + +--------------010600010708020705080102 +Content-Type: text/html; charset=us-ascii +Content-Transfer-Encoding: 7bit + + + + + + + +
+
+Tom Lane wrote:
+
+
"Merlin Moncure" <merlin.moncure@rcsonline.com> writes:
+  
+
+
May I make a suggestion that maybe it is time to start thinking about
+tuning the default config file, IMHO its just a little bit too
+conservative,
+    
+
+

+It's a lot too conservative.  I've been thinking for awhile that we
+should adjust the defaults.
+
+  
+
+One of the things I did on my Windows install was to have a number of default +configuration files, postgresql.conf.small, postgresql.conf.medium, postgresql.conf.large.
+
+Rather than choose one, in the "initdb" script, ask for or determine the +mount of shared memory, memory, etc.
+
+Another pet peeve I have is forcing the configuration files to be in the +database directory. We had this argument in 7.1 days, and I submitted a patch +that allowed a configuration file to be specified as a command line parameter. +One of the things that Oracle does better is separating the "configuration" +from the data.
+
+It is an easy patch to allow PostgreSQL to use a separate configuration directory, +and specify the data directory within the configuration file (The way any +logical application works), and, NO, symlinks are not a solution, they are +a kludge.
+ + + +--------------010600010708020705080102-- + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:18:07 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 5828F475CB4; Tue, 11 Feb 2003 12:18:06 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP + id A9D87475C9E; Tue, 11 Feb 2003 12:18:05 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1BHIA5u026501; + Tue, 11 Feb 2003 12:18:10 -0500 (EST) +To: Justin Clift +Cc: Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: Changing the default configuration (was Re: [HACKERS] PostgreSQL + Benchmarks) +In-reply-to: <3E492E06.2030702@postgresql.org> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> <3E492E06.2030702@postgresql.org> +Comments: In-reply-to Justin Clift + message dated "Wed, 12 Feb 2003 04:08:22 +1100" +Date: Tue, 11 Feb 2003 12:18:10 -0500 +Message-ID: <26500.1044983890@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/15 +X-Sequence-Number: 773 + +Justin Clift writes: +> Personally I'd be a bunch happier if we set the buffers so high that we +> definitely have decent performance, and the people that want to run +> PostgreSQL are forced to make the choice of either: +> 1) Adjust their system settings to allow PostgreSQL to run properly, or +> 2) Manually adjust the PostgreSQL settings to run memory-constrained +> This way, PostgreSQL either runs decently, or they are _aware_ that +> they're limiting it. + +Yeah, that is the subtext here. If you can't increase SHMMAX then you +can always trim the postgresql.conf parameters --- but theoretically, +at least, you should then have a clue that you're running a +badly-configured setup ... + + regards, tom lane + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:19:49 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 5ECD6475B8A; Tue, 11 Feb 2003 12:19:47 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP + id 47588475ADE; Tue, 11 Feb 2003 12:19:45 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2834295; Tue, 11 Feb 2003 09:19:56 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: Justin Clift , + Tom Lane +Subject: Re: Changing the default configuration (was Re: +Date: Tue, 11 Feb 2003 09:18:48 -0800 +User-Agent: KMail/1.4.3 +Cc: Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> <3E492E06.2030702@postgresql.org> +In-Reply-To: <3E492E06.2030702@postgresql.org> +MIME-Version: 1.0 +Message-Id: <200302110918.48614.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/16 +X-Sequence-Number: 774 + +Tom, Justin, + +> > What I would really like to do is set the default shared_buffers to +> > 1000. That would be 8 meg worth of shared buffer space. Coupled with +> > more-realistic settings for FSM size, we'd probably be talking a shared +> > memory request approaching 16 meg. This is not enough RAM to bother +> > any modern machine from a performance standpoint, but there are probably +> > quite a few platforms out there that would need an increase in their +> > stock SHMMAX kernel setting before they'd take it. + +What if we supplied several sample .conf files, and let the user choose whi= +ch=20 +to copy into the database directory? We could have a "high read=20 +performance" profile, and a "transaction database" profile, and a=20 +"workstation" profile, and a "low impact" profile. We could even supply a= +=20 +Perl script that would adjust SHMMAX and SHMMALL on platforms where this ca= +n=20 +be done from the command line. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:20:50 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id CACA3475A45; Tue, 11 Feb 2003 12:20:48 -0500 (EST) +Received: from jester.inquent.com (unknown [216.208.117.7]) + by postgresql.org (Postfix) with ESMTP + id B1577475925; Tue, 11 Feb 2003 12:20:47 -0500 (EST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by jester.inquent.com (8.12.6/8.12.6) with ESMTP id h1BHLDpK079405; + Tue, 11 Feb 2003 12:21:14 -0500 (EST) (envelope-from rbt@rbt.ca) +Subject: Re: Changing the default configuration (was Re: +From: Rod Taylor +To: Steve Crawford +Cc: Tom Lane , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + Postgresql Advocacy +In-Reply-To: <20030211171048.579E1103F6@polaris.pinpointresearch.com> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> + <20030211171048.579E1103F6@polaris.pinpointresearch.com> +Content-Type: multipart/signed; micalg=pgp-sha1; + protocol="application/pgp-signature"; + boundary="=-BRzfigf5Z4v7YLyGn2+M" +Organization: +Message-Id: <1044984072.79087.6.camel@jester> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.1 +Date: 11 Feb 2003 12:21:13 -0500 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/17 +X-Sequence-Number: 775 + +--=-BRzfigf5Z4v7YLyGn2+M +Content-Type: text/plain +Content-Transfer-Encoding: quoted-printable + +On Tue, 2003-02-11 at 12:10, Steve Crawford wrote: +> A quick-'n'-dirty first step would be more comments in postgresql.conf. M= +ost=20 + +This will not solve the issue with the large number of users who have no +interest in looking at the config file -- but are interested in +publishing their results. + +--=20 +Rod Taylor + +PGP Key: http://www.rbt.ca/rbtpub.asc + +--=-BRzfigf5Z4v7YLyGn2+M +Content-Type: application/pgp-signature; name=signature.asc +Content-Description: This is a digitally signed message part + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.2.1 (FreeBSD) + +iD8DBQA+STEI6DETLow6vwwRAidgAJ9Xgo6Q3p20h1W40de2ngjCKLEHBACfS1Pp +QZ0spoyiYdIzslQuJfapmAU= +=NZMb +-----END PGP SIGNATURE----- + +--=-BRzfigf5Z4v7YLyGn2+M-- + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:17:44 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id D31C7475B8A; Tue, 11 Feb 2003 12:17:42 -0500 (EST) +Received: from snoopy.mohawksoft.com (h0030f1382639.ne.client2.attbi.com + [24.60.194.163]) by postgresql.org (Postfix) with ESMTP + id 77EAE475AFA; Tue, 11 Feb 2003 12:17:41 -0500 (EST) +Received: from mohawksoft.com (snoopy.mohawksoft.com [127.0.0.1]) + by snoopy.mohawksoft.com (8.11.6/8.11.6) with ESMTP id h1BHNga30767; + Tue, 11 Feb 2003 12:23:43 -0500 +Message-ID: <3E49319E.80206@mohawksoft.com> +Date: Tue, 11 Feb 2003 12:23:42 -0500 +From: mlw +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; + rv:1.0.1) Gecko/20020823 Netscape/7.0 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Greg Copeland +Cc: Tom Lane , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: [HACKERS] Changing the default configuration (was Re: +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> + <1044981773.25889.165.camel@mouse.copelandconsulting.net> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/14 +X-Sequence-Number: 772 + + + +Greg Copeland wrote: + +> +> +>I'd personally rather have people stumble trying to get PostgreSQL +>running, up front, rather than allowing the lowest common denominator +>more easily run PostgreSQL only to be disappointed with it and move on. +> +>After it's all said and done, I would rather someone simply say, "it's +>beyond my skill set", and attempt to get help or walk away. That seems +>better than them being able to run it and say, "it's a dog", spreading +>word-of-mouth as such after they left PostgreSQL behind. Worse yet, +>those that do walk away and claim it performs horribly are probably +>doing more harm to the PostgreSQL community than expecting someone to be +>able to install software ever can. +> + + +And that my friends is why PostgreSQL is still relatively obscure. + +This attitude sucks. If you want a product to be used, you must put the +effort into making it usable. + +It is a no-brainer to make the default configuration file suitable for +the majority of users. It is lunacy to create a default configuration +which provides poor performance for over 90% of the users, but which +allows the lowest common denominator to work. + +A product must not perform poorly out of the box, period. A good product +manager would choose one of two possible configurations, (a) a high +speed fairly optimized system from the get-go, or (b) it does not run +unless you create the configuration file. Option (c) out of the box it +works like crap, is not an option. + +This is why open source gets such a bad reputation. Outright contempt +for the user who may not know the product as well as those developing +it. This attitude really sucks and it turns people off. We want people +to use PostgreSQL, to do that we must make PostgreSQL usable. Usability +IS important. + + + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:26:08 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E4D8E4759BD + for ; + Tue, 11 Feb 2003 12:26:06 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 2A68B475843 + for ; + Tue, 11 Feb 2003 12:26:06 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1BHQ55u026583; + Tue, 11 Feb 2003 12:26:05 -0500 (EST) +To: Josh Berkus +Cc: Justin Clift , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: Changing the default configuration (was Re: +In-reply-to: <200302110918.48614.josh@agliodbs.com> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> <3E492E06.2030702@postgresql.org> + <200302110918.48614.josh@agliodbs.com> +Comments: In-reply-to Josh Berkus + message dated "Tue, 11 Feb 2003 09:18:48 -0800" +Date: Tue, 11 Feb 2003 12:26:05 -0500 +Message-ID: <26582.1044984365@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/18 +X-Sequence-Number: 776 + +Josh Berkus writes: +> What if we supplied several sample .conf files, and let the user choose which +> to copy into the database directory? We could have a "high read +> performance" profile, and a "transaction database" profile, and a +> "workstation" profile, and a "low impact" profile. + +Uh ... do we have a basis for recommending any particular sets of +parameters for these different scenarios? This could be a good idea +in the abstract, but I'm not sure I know enough to fill in the details. + +A lower-tech way to accomplish the same result is to document these +alternatives in postgresql.conf comments and encourage people to review +that file, as Steve Crawford just suggested. But first we need the raw +knowledge. + + regards, tom lane + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 12:25:31 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 3BC1C475AAC + for ; + Tue, 11 Feb 2003 12:25:30 -0500 (EST) +Received: from smtp020.tiscali.dk (smtp020.tiscali.dk [212.54.64.104]) + by postgresql.org (Postfix) with ESMTP id 5ACD7475A97 + for ; + Tue, 11 Feb 2003 12:25:29 -0500 (EST) +Received: from cpmail.dk.tiscali.com (mail.tiscali.dk [212.54.64.159]) + by smtp020.tiscali.dk (8.12.5/8.12.5) with ESMTP id h1BHNnBT009927 + for ; + Tue, 11 Feb 2003 18:25:33 +0100 (MET) +Received: from strider (213.237.10.83) by cpmail.dk.tiscali.com (6.0.053) + id 3E282010002F58F2 for pgsql-hackers@postgresql.org; + Tue, 11 Feb 2003 18:25:21 +0100 +Content-Type: text/plain; + charset="iso-8859-1" +From: Kaare Rasmussen +Reply-To: kar@kakidata.dk +To: PostgresSQL Hackers Mailing List +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] +Date: Tue, 11 Feb 2003 18:26:46 +0100 +User-Agent: KMail/1.4.3 +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <3E492E06.2030702@postgresql.org> + <200302110918.48614.josh@agliodbs.com> +In-Reply-To: <200302110918.48614.josh@agliodbs.com> +MIME-Version: 1.0 +Message-Id: <200302111826.46674.kar@kakidata.dk> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/393 +X-Sequence-Number: 35335 + +> What if we supplied several sample .conf files, and let the user choose +> which to copy into the database directory? We could have a "high read + +Exactly my first thought when reading the proposal for a setting suited for= +=20 +performance tests.=20 + +> performance" profile, and a "transaction database" profile, and a +> "workstation" profile, and a "low impact" profile. We could even supply= + a + +And a .benchmark profile :-) + +> Perl script that would adjust SHMMAX and SHMMALL on platforms where this +> can be done from the command line. + +Or maybe configuration could be adjusted with ./configure if SHMMAX can be= +=20 +determined at that point? + +--=20 +Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582 +Kaki Data tshirts, merchandize Fax: 3816 2501 +Howitzvej 75 =C5ben 12.00-18.00 Email: kar@kakidata.dk +2000 Frederiksberg L=F8rdag 12.00-16.00 Web: www.suse.dk + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:29:23 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id DAF9E475A97; Tue, 11 Feb 2003 12:29:22 -0500 (EST) +Received: from grunt24.ihug.com.au (grunt24.ihug.com.au [203.109.249.144]) + by postgresql.org (Postfix) with ESMTP + id 21006475A45; Tue, 11 Feb 2003 12:29:22 -0500 (EST) +Received: from p43-tnt2.mel.ihug.com.au (postgresql.org) [203.173.164.43] + by grunt24.ihug.com.au with esmtp (Exim 3.35 #1 (Debian)) + id 18ieDi-0000xH-00; Wed, 12 Feb 2003 04:29:22 +1100 +Message-ID: <3E4932EF.3070604@postgresql.org> +Date: Wed, 12 Feb 2003 04:29:19 +1100 +From: Justin Clift +User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Josh Berkus +Cc: Tom Lane , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: Changing the default configuration (was Re: +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> <3E492E06.2030702@postgresql.org> + <200302110918.48614.josh@agliodbs.com> +In-Reply-To: <200302110918.48614.josh@agliodbs.com> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/19 +X-Sequence-Number: 777 + +Josh Berkus wrote: +> Tom, Justin, + +> +> What if we supplied several sample .conf files, and let the user choose which +> to copy into the database directory? We could have a "high read +> performance" profile, and a "transaction database" profile, and a +> "workstation" profile, and a "low impact" profile. We could even supply a +> Perl script that would adjust SHMMAX and SHMMALL on platforms where this can +> be done from the command line. + + +This might have value as the next step in the process of: + +a) Are we going to have better defaults? + +or + +b) Let's stick with the current approach. + + +If we decide to go with better (changed) defaults, we may also be able +to figure out a way of having profiles that could optionally be chosen from. + +As a longer term thought, it would be nice if the profiles weren't just +hard-coded example files, but more of: + +pg_autotune --setprofile=xxx + +Or similar utility, and it did all the work. Named profiles being one +capability, and other tuning measurements (i.e. cpu costings, disk +performance profiles, etc) being the others. + +Regards and best wishes, + +Justin Clift + +-- +"My grandfather once told me that there are two kinds of people: those +who work and those who take the credit. He told me to try to be in the +first group; there was less competition there." + - Indira Gandhi + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:34:22 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 15B09475A45; Tue, 11 Feb 2003 12:34:21 -0500 (EST) +Received: from grunt25.ihug.com.au (grunt25.ihug.com.au [203.109.249.145]) + by postgresql.org (Postfix) with ESMTP + id 2481A475D64; Tue, 11 Feb 2003 12:34:16 -0500 (EST) +Received: from p43-tnt2.mel.ihug.com.au (postgresql.org) [203.173.164.43] + by grunt25.ihug.com.au with esmtp (Exim 3.35 #1 (Debian)) + id 18ieIS-00043x-00; Wed, 12 Feb 2003 04:34:16 +1100 +Message-ID: <3E493415.9090004@postgresql.org> +Date: Wed, 12 Feb 2003 04:34:13 +1100 +From: Justin Clift +User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Tom Lane +Cc: Josh Berkus , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: Changing the default configuration (was Re: +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> <3E492E06.2030702@postgresql.org> + <200302110918.48614.josh@agliodbs.com> + <26582.1044984365@sss.pgh.pa.us> +In-Reply-To: <26582.1044984365@sss.pgh.pa.us> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/20 +X-Sequence-Number: 778 + +Tom Lane wrote: + +> Uh ... do we have a basis for recommending any particular sets of +> parameters for these different scenarios? This could be a good idea +> in the abstract, but I'm not sure I know enough to fill in the details. +> +> A lower-tech way to accomplish the same result is to document these +> alternatives in postgresql.conf comments and encourage people to review +> that file, as Steve Crawford just suggested. But first we need the raw +> knowledge. + +Without too much hacking around, you could pretty easily adapt the +pg_autotune code to do proper profiles of a system with different settings. + +i.e. increment one setting at a time, run pgbench on it with some decent +amount of transactions and users, stuff the results into a different +database. Aggregate data over time kind of thing. Let it run for a +week, etc. + +If it's helpful, there's a 100% spare Althon 1.6Ghz box around with +(choose your OS) + Adaptec 29160 + 512MB RAM + 2 x 9GB Seagate Cheetah +10k rpm drives hanging around. No stress to set that up and let it run +any long terms tests you'd like plus send back results. + +Regards and best wishes, + +Justin Clift + +> regards, tom lane + + +-- +"My grandfather once told me that there are two kinds of people: those +who work and those who take the credit. He told me to try to be in the +first group; there was less competition there." + - Indira Gandhi + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:37:23 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 9E625475EE4; Tue, 11 Feb 2003 12:37:22 -0500 (EST) +Received: from CopelandConsulting.Net (dsl-24293-ld.customer.centurytel.net + [209.142.135.135]) by postgresql.org (Postfix) with ESMTP + id C429A475F38; Tue, 11 Feb 2003 12:36:21 -0500 (EST) +Received: from [192.168.1.2] (mouse.copelandconsulting.net [192.168.1.2]) + by CopelandConsulting.Net (8.10.1/8.10.1) with ESMTP id h1BHaC726199; + Tue, 11 Feb 2003 11:36:12 -0600 (CST) +X-Trade-Id: +To: mlw +Cc: Tom Lane , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +In-Reply-To: <3E49319E.80206@mohawksoft.com> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> + <1044981773.25889.165.camel@mouse.copelandconsulting.net> + <3E49319E.80206@mohawksoft.com> +Content-Type: text/plain +Organization: Copeland Computer Consulting +Message-Id: <1044984976.2518.191.camel@mouse.copelandconsulting.net> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.0 +Date: 11 Feb 2003 11:36:17 -0600 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/21 +X-Sequence-Number: 779 + +On Tue, 2003-02-11 at 11:23, mlw wrote: +> Greg Copeland wrote: +> +> > +> > +> >I'd personally rather have people stumble trying to get PostgreSQL +> >running, up front, rather than allowing the lowest common denominator +> >more easily run PostgreSQL only to be disappointed with it and move on. +> > +> >After it's all said and done, I would rather someone simply say, "it's +> >beyond my skill set", and attempt to get help or walk away. That seems +> >better than them being able to run it and say, "it's a dog", spreading +> >word-of-mouth as such after they left PostgreSQL behind. Worse yet, +> >those that do walk away and claim it performs horribly are probably +> >doing more harm to the PostgreSQL community than expecting someone to be +> >able to install software ever can. +> > +> +> +> And that my friends is why PostgreSQL is still relatively obscure. +> +> This attitude sucks. If you want a product to be used, you must put the +> effort into making it usable. +> + + +Ah..okay.... + + +> It is a no-brainer to make the default configuration file suitable for +> the majority of users. It is lunacy to create a default configuration +> which provides poor performance for over 90% of the users, but which +> allows the lowest common denominator to work. +> + +I think you read something into my email which I did not imply. I'm +certainly not advocating a default configuration file assuming 512M of +share memory or some such insane value. + +Basically, you're arguing that they should keep doing exactly what they +are doing. It's currently known to be causing problems and propagating +the misconception that PostgreSQL is unable to perform under any +circumstance. I'm arguing that who cares if 5% of the potential user +base has to learn to properly install software. Either they'll read and +learn, ask for assistance, or walk away. All of which are better than +Jonny-come-lately offering up a meaningless benchmark which others are +happy to eat with rather large spoons. + + +> A product must not perform poorly out of the box, period. A good product +> manager would choose one of two possible configurations, (a) a high +> speed fairly optimized system from the get-go, or (b) it does not run +> unless you create the configuration file. Option (c) out of the box it +> works like crap, is not an option. +> + +That's the problem. Option (c) is what we currently have. I'm amazed +that you even have a problem with option (a), as that's what I'm +suggesting. The problem is, potentially for some minority of users, it +may not run out of the box. As such, I'm more than happy with this +situation than 90% of the user base being stuck with a crappy default +configuration. + +Oddly enough, your option (b) is even worse than what you are ranting at +me about. Go figure. + +> This is why open source gets such a bad reputation. Outright contempt +> for the user who may not know the product as well as those developing +> it. This attitude really sucks and it turns people off. We want people +> to use PostgreSQL, to do that we must make PostgreSQL usable. Usability +> IS important. +> + + +There is no contempt here. Clearly you've read your own bias into this +thread. If you go back and re-read my posting, I think it's VERY clear +that it's entirely about usability. + + +Regards, + +-- +Greg Copeland +Copeland Computer Consulting + + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 12:38:48 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 7AFA4475D64 + for ; + Tue, 11 Feb 2003 12:38:47 -0500 (EST) +Received: from zuma.wtgcom.com (unknown [208.48.171.162]) + by postgresql.org (Postfix) with ESMTP id EF90D475D01 + for ; + Tue, 11 Feb 2003 12:38:09 -0500 (EST) +Received: (qmail 5014 invoked by uid 204); 11 Feb 2003 17:56:49 -0000 +Received: from jon@jongriffin.com by zuma.wtgcom.com by uid 1000 with + qmail-scanner-1.15 (sweep: 2.10/3.65. Clear:. + Processed in 0.802012 secs); 11 Feb 2003 17:56:49 -0000 +X-Qmail-Scanner-Mail-From: jon@jongriffin.com via zuma.wtgcom.com +X-Qmail-Scanner: 1.15 (Clear:. Processed in 0.802012 secs) +Received: from unknown (HELO mayuli.com) (192.168.1.202) + by 0 with SMTP; 11 Feb 2003 17:56:48 -0000 +Received: from 192.168.1.12 (proxying for unknown, 68.104.96.27) + (SquirrelMail authenticated user jon_clean@mayuli.com) + by mail.mayuli.com with HTTP; Tue, 11 Feb 2003 09:38:18 -0800 (PST) +Message-ID: <49391.192.168.1.12.1044985098.squirrel@mail.mayuli.com> +Date: Tue, 11 Feb 2003 09:38:18 -0800 (PST) +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] + PostgreSQL Benchmarks) +From: "Jon Griffin" +To: +In-Reply-To: <26004.1044980414@sss.pgh.pa.us> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> +X-Priority: 3 +Importance: Normal +X-Mailer: SquirrelMail (version 1.2.10) +MIME-Version: 1.0 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/399 +X-Sequence-Number: 35341 + +FYI, my stock linux 2.4.19 gentoo kernel has: +kernel.shmall =3D 2097152 +kernel.shmmax =3D 33554432 + +sysctl -a + +So it appears that linux at least is way above your 8 meg point, unless I +am missing something. + + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:49:39 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 8840C475B8A; Tue, 11 Feb 2003 12:49:36 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP + id 75D74475AAC; Tue, 11 Feb 2003 12:49:35 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2834383; Tue, 11 Feb 2003 09:49:46 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: Justin Clift , + Tom Lane +Subject: Re: Changing the default configuration (was Re: +Date: Tue, 11 Feb 2003 09:48:39 -0800 +User-Agent: KMail/1.4.3 +Cc: Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26582.1044984365@sss.pgh.pa.us> <3E493415.9090004@postgresql.org> +In-Reply-To: <3E493415.9090004@postgresql.org> +MIME-Version: 1.0 +Message-Id: <200302110948.39283.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/22 +X-Sequence-Number: 780 + +Tom, Justin, + +> > Uh ... do we have a basis for recommending any particular sets of +> > parameters for these different scenarios? This could be a good idea +> > in the abstract, but I'm not sure I know enough to fill in the details. + +Sure.=20=20 +Mostly-Read database, few users, good hardware, complex queries: + =3D High shared buffers and sort mem, high geqo and join collapse threshol= +ds, + moderate fsm settings, defaults for WAL. +Same as above with many users and simple queries (webserver) =3D + same as above, except lower sort mem and higher connection limit +High-Transaction Database =3D + Moderate shared buffers and sort mem, high FSM settings, increase WAL file= +s=20 +and buffers. +Workstation =3D + Moderate to low shared buffers and sort mem, moderate FSM, defaults for WA= +L,=20 +etc. +Low-Impact server =3D current defaults, more or less. + +While none of these settings will be *perfect* for anyone, they will be=20 +considerably better than what's shipping with postgresql. And, based on m= +y=20 +"Learning Perl" knowledge, I'm pretty sure I could write the program.=20=20 + +All we'd need to do is argue out, on the PERFORMANCE list, what's a good va= +lue=20 +for each profile. That's the tough part. The Perl script is easy. + +> > A lower-tech way to accomplish the same result is to document these +> > alternatives in postgresql.conf comments and encourage people to review +> > that file, as Steve Crawford just suggested. But first we need the raw +> > knowledge. + +That's also not a bad approach ... the CONF file should be more heavily=20 +commented, period, regardless of what approach we take. I volunteer to wor= +k=20 +on this with other participants. + +> Without too much hacking around, you could pretty easily adapt the +> pg_autotune code to do proper profiles of a system with different setting= +s. + +No offense, Justin, but I don't know anyone else who's gotten your pg_autot= +une=20 +script to run other than you. And pg_bench has not been useful performance= +=20 +measure for any real database server I have worked on so far. + +I'd be glad to help improve pg_autotune, with two caveats: +1) We will still need to figure out the "profiles" above so that we have=20 +decent starting values. +2) I suggest that we do pg_autotune in Perl or Python or another higher-lev= +el=20 +language. This would enable several performance buffs who don't do C to= +=20 +contribute to it, and a performance-tuning script is a higher-level-languag= +e=20 +sort of function, anyway. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:53:09 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0962B475C8B + for ; + Tue, 11 Feb 2003 12:53:08 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id ECF3D475AAC + for ; + Tue, 11 Feb 2003 12:52:56 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1BHqu5u026851; + Tue, 11 Feb 2003 12:52:56 -0500 (EST) +To: Justin Clift +Cc: Josh Berkus , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: Changing the default configuration (was Re: +In-reply-to: <3E493415.9090004@postgresql.org> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> <3E492E06.2030702@postgresql.org> + <200302110918.48614.josh@agliodbs.com> + <26582.1044984365@sss.pgh.pa.us> <3E493415.9090004@postgresql.org> +Comments: In-reply-to Justin Clift + message dated "Wed, 12 Feb 2003 04:34:13 +1100" +Date: Tue, 11 Feb 2003 12:52:55 -0500 +Message-ID: <26850.1044985975@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/23 +X-Sequence-Number: 781 + +Justin Clift writes: +> Tom Lane wrote: +>> Uh ... do we have a basis for recommending any particular sets of +>> parameters for these different scenarios? This could be a good idea +>> in the abstract, but I'm not sure I know enough to fill in the details. + +> Without too much hacking around, you could pretty easily adapt the +> pg_autotune code to do proper profiles of a system with different settings. + +> i.e. increment one setting at a time, run pgbench on it with some decent +> amount of transactions and users, stuff the results into a different +> database. + +If I thought that pgbench was representative of anything, or even +capable of reliably producing repeatable numbers, then I might subscribe +to results derived this way. But I have little or no confidence in +pgbench. Certainly I don't see how you'd use it to produce +recommendations for a range of application scenarios, when it's only +one very narrow scenario itself. + + regards, tom lane + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 12:54:39 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 7B2814759BD + for ; + Tue, 11 Feb 2003 12:54:38 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id C33B2475843 + for ; + Tue, 11 Feb 2003 12:54:37 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1BHsb5u026875; + Tue, 11 Feb 2003 12:54:37 -0500 (EST) +To: mlw +Cc: Greg Copeland , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: [HACKERS] Changing the default configuration (was Re: +In-reply-to: <3E49319E.80206@mohawksoft.com> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> + <1044981773.25889.165.camel@mouse.copelandconsulting.net> + <3E49319E.80206@mohawksoft.com> +Comments: In-reply-to mlw + message dated "Tue, 11 Feb 2003 12:23:42 -0500" +Date: Tue, 11 Feb 2003 12:54:37 -0500 +Message-ID: <26874.1044986077@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/24 +X-Sequence-Number: 782 + +mlw writes: +> This attitude sucks. If you want a product to be used, you must put the +> effort into making it usable. +> [snip] + +AFAICT, you are flaming Greg for recommending the exact same thing you +are recommending. Please calm down and read again. + + regards, tom lane + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 13:01:19 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 10B42475A9E + for ; + Tue, 11 Feb 2003 13:01:18 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 39C7C474E5C + for ; + Tue, 11 Feb 2003 13:01:16 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1BI1E5u026925; + Tue, 11 Feb 2003 13:01:14 -0500 (EST) +To: "Jon Griffin" +Cc: pgsql-hackers@postgresql.org +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] + PostgreSQL Benchmarks) +In-reply-to: <49391.192.168.1.12.1044985098.squirrel@mail.mayuli.com> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> + <49391.192.168.1.12.1044985098.squirrel@mail.mayuli.com> +Comments: In-reply-to "Jon Griffin" + message dated "Tue, 11 Feb 2003 09:38:18 -0800" +Date: Tue, 11 Feb 2003 13:01:13 -0500 +Message-ID: <26924.1044986473@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/403 +X-Sequence-Number: 35345 + +"Jon Griffin" writes: +> So it appears that linux at least is way above your 8 meg point, unless I +> am missing something. + +Yeah, AFAIK all recent Linuxen are well above the range of parameters +that I was suggesting (and even if they weren't, Linux is particularly +easy to change the SHMMAX setting on). It's other Unixoid platforms +that are likely to have a problem. Particularly the ones where you +have to rebuild the kernel to change SHMMAX; people may be afraid to +do that. + +Does anyone know whether cygwin has a setting comparable to SHMMAX, +and if so what is its default value? How about the upcoming native +Windows port --- any issues there? + + regards, tom lane + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 13:03:48 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 82A6E475A45 + for ; + Tue, 11 Feb 2003 13:03:47 -0500 (EST) +Received: from localhost.localdomain (unknown [65.217.53.66]) + by postgresql.org (Postfix) with ESMTP id A16DD4759BD + for ; + Tue, 11 Feb 2003 13:03:46 -0500 (EST) +Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) + by localhost.localdomain (8.12.5/8.12.5) with ESMTP id h1BISn6P003568 + for ; Tue, 11 Feb 2003 13:28:49 -0500 +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 h1BI3jj16740 + for ; Tue, 11 Feb 2003 13:03:45 -0500 +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 CWVLD9C8; Tue, 11 Feb 2003 13:03:45 -0500 +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] +From: Robert Treat +To: PostgresSQL Hackers Mailing List +In-Reply-To: <3E492E06.2030702@postgresql.org> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> <3E492E06.2030702@postgresql.org> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +X-Mailer: Ximian Evolution 1.0.8 +Date: 11 Feb 2003 13:03:45 -0500 +Message-Id: <1044986625.12931.27.camel@camel> +Mime-Version: 1.0 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/404 +X-Sequence-Number: 35346 + +On Tue, 2003-02-11 at 12:08, Justin Clift wrote: +> b) Said benchmarking person knows very little about PostgreSQL, so they +> install the RPM's, packages, or whatever, and "it works". Then they run +> whatever benchmark they've downloaded, or designed, or whatever +> + +Out of curiosity, how feasible is it for the rpm/package/deb/exe +maintainers to modify their supplied postgresql.conf settings when +building said distribution? AFAIK the minimum default SHHMAX setting on +Red Hat 8.0 is 32MB, seems like bumping shared buffers to work with that +amount would be acceptable inside the 8.0 rpm's. + +Robert Treat + + + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 13:21:31 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id EBF66475A9E; Tue, 11 Feb 2003 13:21:29 -0500 (EST) +Received: from snoopy.mohawksoft.com (h0030f1382639.ne.client2.attbi.com + [24.60.194.163]) by postgresql.org (Postfix) with ESMTP + id 04D98475A97; Tue, 11 Feb 2003 13:21:29 -0500 (EST) +Received: from mohawksoft.com (snoopy.mohawksoft.com [127.0.0.1]) + by snoopy.mohawksoft.com (8.11.6/8.11.6) with ESMTP id h1BIRJa31000; + Tue, 11 Feb 2003 13:27:19 -0500 +Message-ID: <3E494087.2010308@mohawksoft.com> +Date: Tue, 11 Feb 2003 13:27:19 -0500 +From: mlw +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; + rv:1.0.1) Gecko/20020823 Netscape/7.0 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Greg Copeland +Cc: Tom Lane , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: [HACKERS] Changing the default configuration (was Re: +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> + <1044981773.25889.165.camel@mouse.copelandconsulting.net> + <3E49319E.80206@mohawksoft.com> + <1044984976.2518.191.camel@mouse.copelandconsulting.net> +Content-Type: multipart/alternative; + boundary="------------010502000404020609010702" +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/25 +X-Sequence-Number: 783 + +--------------010502000404020609010702 +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit + +Apology + +After Mark calms down and, in fact, sees that Greg was saying the right +thing after all, chagrin is the only word. + +I'm sorry. + + +Greg Copeland wrote: + +>On Tue, 2003-02-11 at 11:23, mlw wrote: +> +> +>>Greg Copeland wrote: +>> +>> +>> +>>> +>>> +>>>I'd personally rather have people stumble trying to get PostgreSQL +>>>running, up front, rather than allowing the lowest common denominator +>>>more easily run PostgreSQL only to be disappointed with it and move on. +>>> +>>>After it's all said and done, I would rather someone simply say, "it's +>>>beyond my skill set", and attempt to get help or walk away. That seems +>>>better than them being able to run it and say, "it's a dog", spreading +>>>word-of-mouth as such after they left PostgreSQL behind. Worse yet, +>>>those that do walk away and claim it performs horribly are probably +>>>doing more harm to the PostgreSQL community than expecting someone to be +>>>able to install software ever can. +>>> +>>> +>>> +>> +>> +>>And that my friends is why PostgreSQL is still relatively obscure. +>> +>>This attitude sucks. If you want a product to be used, you must put the +>>effort into making it usable. +>> +>> +>> +> +> +>Ah..okay.... +> +> +> +> +>>It is a no-brainer to make the default configuration file suitable for +>>the majority of users. It is lunacy to create a default configuration +>>which provides poor performance for over 90% of the users, but which +>>allows the lowest common denominator to work. +>> +>> +>> +> +>I think you read something into my email which I did not imply. I'm +>certainly not advocating a default configuration file assuming 512M of +>share memory or some such insane value. +> +>Basically, you're arguing that they should keep doing exactly what they +>are doing. It's currently known to be causing problems and propagating +>the misconception that PostgreSQL is unable to perform under any +>circumstance. I'm arguing that who cares if 5% of the potential user +>base has to learn to properly install software. Either they'll read and +>learn, ask for assistance, or walk away. All of which are better than +>Jonny-come-lately offering up a meaningless benchmark which others are +>happy to eat with rather large spoons. +> +> +> +> +>>A product must not perform poorly out of the box, period. A good product +>>manager would choose one of two possible configurations, (a) a high +>>speed fairly optimized system from the get-go, or (b) it does not run +>>unless you create the configuration file. Option (c) out of the box it +>>works like crap, is not an option. +>> +>> +>> +> +>That's the problem. Option (c) is what we currently have. I'm amazed +>that you even have a problem with option (a), as that's what I'm +>suggesting. The problem is, potentially for some minority of users, it +>may not run out of the box. As such, I'm more than happy with this +>situation than 90% of the user base being stuck with a crappy default +>configuration. +> +>Oddly enough, your option (b) is even worse than what you are ranting at +>me about. Go figure. +> +> +> +>>This is why open source gets such a bad reputation. Outright contempt +>>for the user who may not know the product as well as those developing +>>it. This attitude really sucks and it turns people off. We want people +>>to use PostgreSQL, to do that we must make PostgreSQL usable. Usability +>>IS important. +>> +>> +>> +> +> +>There is no contempt here. Clearly you've read your own bias into this +>thread. If you go back and re-read my posting, I think it's VERY clear +>that it's entirely about usability. +> +> +>Regards, +> +> +> + + +--------------010502000404020609010702 +Content-Type: text/html; charset=us-ascii +Content-Transfer-Encoding: 7bit + + + + + + + +Apology
+
+After Mark calms down and, in fact, sees that Greg was saying the right thing +after all, chagrin is the only word.
+
+I'm sorry.
+
+
+Greg Copeland wrote:
+
+
On Tue, 2003-02-11 at 11:23, mlw wrote:
+  
+
+
Greg Copeland wrote:
+
+    
+
+
 
+
+I'd personally rather have people stumble trying to get PostgreSQL
+running, up front, rather than allowing the lowest common denominator
+more easily run PostgreSQL only to be disappointed with it and move on.
+
+After it's all said and done, I would rather someone simply say, "it's
+beyond my skill set", and attempt to get help or walk away.  That seems
+better than them being able to run it and say, "it's a dog", spreading
+word-of-mouth as such after they left PostgreSQL behind.  Worse yet,
+those that do walk away and claim it performs horribly are probably
+doing more harm to the PostgreSQL community than expecting someone to be
+able to install software ever can.
+
+      
+
+
<RANT>
+
+And that my friends is why PostgreSQL is still relatively obscure.
+
+This attitude sucks. If you want a product to be used, you must put the 
+effort into making it usable.
+
+    
+
+

+
+Ah..okay....
+
+
+  
+
+
It is a no-brainer to make the default configuration file suitable for 
+the majority of users. It is lunacy to create a default configuration 
+which provides poor performance for over 90% of the users, but which 
+allows the lowest common denominator to work.
+
+    
+
+

+I think you read something into my email which I did not imply.  I'm
+certainly not advocating a default configuration file assuming 512M of
+share memory or some such insane value.
+
+Basically, you're arguing that they should keep doing exactly what they
+are doing.  It's currently known to be causing problems and propagating
+the misconception that PostgreSQL is unable to perform under any
+circumstance.  I'm arguing that who cares if 5% of the potential user
+base has to learn to properly install software.  Either they'll read and
+learn, ask for assistance, or walk away.  All of which are better than
+Jonny-come-lately offering up a meaningless benchmark which others are
+happy to eat with rather large spoons.
+
+
+  
+
+
A product must not perform poorly out of the box, period. A good product 
+manager would choose one of two possible configurations, (a) a high 
+speed fairly optimized system from the get-go, or (b) it does not run 
+unless you create the configuration file. Option (c) out of the box it 
+works like crap, is not an option.
+
+    
+
+

+That's the problem.  Option (c) is what we currently have.  I'm amazed
+that you even have a problem with option (a), as that's what I'm
+suggesting.  The problem is, potentially for some minority of users, it
+may not run out of the box.  As such, I'm more than happy with this
+situation than 90% of the user base being stuck with a crappy default
+configuration.
+
+Oddly enough, your option (b) is even worse than what you are ranting at
+me about.  Go figure.
+
+  
+
+
This is why open source gets such a bad reputation. Outright contempt 
+for the user who may not know the product as well as those developing 
+it. This attitude really sucks and it turns people off. We want people 
+to use PostgreSQL, to do that we must make PostgreSQL usable. Usability 
+IS important.
+</RANT>
+    
+
+

+
+There is no contempt here.  Clearly you've read your own bias into this
+thread.  If you go back and re-read my posting, I think it's VERY clear
+that it's entirely about usability.
+
+
+Regards,
+
+  
+
+
+ + + +--------------010502000404020609010702-- + + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 13:43:17 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A0AC9474E5C + for ; + Tue, 11 Feb 2003 13:43:16 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id E90B5474E53 + for ; + Tue, 11 Feb 2003 13:43:15 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h1BIgZwQ008437 + for ; + Tue, 11 Feb 2003 11:42:35 -0700 (MST) +Date: Tue, 11 Feb 2003 11:34:32 -0700 (MST) +From: "scott.marlowe" +To: PostgresSQL Hackers Mailing List +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] +In-Reply-To: <3E494087.2010308@mohawksoft.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 AMaViS new-20020517 +X-Archive-Number: 200302/407 +X-Sequence-Number: 35349 + +My other pet peeve is the default max connections setting. This should be +higher if possible, but of course, there's always the possibility of +running out of file descriptors. + +Apache has a default max children of 150, and if using PHP or another +language that runs as an apache module, it is quite possible to use up all +the pgsql backend slots before using up all the apache child slots. + +Is setting the max connections to something like 200 reasonable, or likely +to cause too many problems? + + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 13:53:05 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 86A14475925 + for ; + Tue, 11 Feb 2003 13:53:04 -0500 (EST) +Received: from neuromancer.ctlno.com (unknown [208.13.35.90]) + by postgresql.org (Postfix) with ESMTP id EB1A2475843 + for ; + Tue, 11 Feb 2003 13:53:03 -0500 (EST) +Received: from [192.168.0.10] (ool-4352919e.dyn.optonline.net [67.82.145.158]) + by neuromancer.ctlno.com (8.12.6/8.12.6) with ESMTP id + h1BIYbv7009253; Tue, 11 Feb 2003 12:34:37 -0600 +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] +From: "Matthew T. O'Connor" +To: pgsql-hackers@postgresql.org, Tom Lane +In-Reply-To: <26924.1044986473@sss.pgh.pa.us> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> + <49391.192.168.1.12.1044985098.squirrel@mail.mayuli.com> + <26924.1044986473@sss.pgh.pa.us> +Content-Type: text/plain +Organization: +Message-Id: <1044989631.32185.151.camel@zeutrh80> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.1 (1.2.1-1) +Date: 11 Feb 2003 13:53:51 -0500 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-milter (http://amavis.org/) +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/409 +X-Sequence-Number: 35351 + +On Tue, 2003-02-11 at 13:01, Tom Lane wrote: +> "Jon Griffin" writes: +> > So it appears that linux at least is way above your 8 meg point, unless I +> > am missing something. +> +> Yeah, AFAIK all recent Linuxen are well above the range of parameters +> that I was suggesting (and even if they weren't, Linux is particularly +> easy to change the SHMMAX setting on). It's other Unixoid platforms +> that are likely to have a problem. Particularly the ones where you +> have to rebuild the kernel to change SHMMAX; people may be afraid to +> do that. + +The issue as I see it is: +Better performing vs. More Compatible Out of the box Defaults. + +Perhaps a compromise (hack?): +Set the default to some default value that performs well, a value we all +agree is not too big (16M? 32M?). On startup, if the OS can't give us +what we want, instead of failing, we can try again with a smaller +amount, perhaps half the default, if that fails try again with half +until we reach some bottom threshold (1M?). + +The argument against this might be: When I set shared_buffers=X, I want +X shared buffers. I don't want it to fail silently and give me less than +what I need / want. To address this we might want to add a guc option +that controls this behavior. So we ship postgresql.conf with 32M of +shared memory and auto_shared_mem_reduction = true. With a comment that +the administrator might want to turn this off for production. + +Thoughts? + +I think this will allow most uninformed users get decent performing +defaults as most systems will accommodate this larger value. + + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 13:55:48 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id AF54C475C8B + for ; + Tue, 11 Feb 2003 13:55:47 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 00CF4475C5F + for ; + Tue, 11 Feb 2003 13:55:47 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1BItT5u027233; + Tue, 11 Feb 2003 13:55:30 -0500 (EST) +To: "scott.marlowe" +Cc: PostgresSQL Hackers Mailing List +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] +In-reply-to: +References: +Comments: In-reply-to "scott.marlowe" + message dated "Tue, 11 Feb 2003 11:34:32 -0700" +Date: Tue, 11 Feb 2003 13:55:29 -0500 +Message-ID: <27232.1044989729@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/411 +X-Sequence-Number: 35353 + +"scott.marlowe" writes: +> Is setting the max connections to something like 200 reasonable, or likely +> to cause too many problems? + +That would likely run into number-of-semaphores limitations (SEMMNI, +SEMMNS). We do not seem to have as good documentation about changing +that as we do about changing the SHMMAX setting, so I'm not sure I want +to buy into the "it's okay to expect people to fix this before they can +start Postgres the first time" argument here. + +Also, max-connections doesn't silently skew your testing: if you need +to raise it, you *will* know it. + + regards, tom lane + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 14:06:35 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B43D7475A9E + for ; + Tue, 11 Feb 2003 14:06:33 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 022CA475A97 + for ; + Tue, 11 Feb 2003 14:06:33 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1BJ6W5u027296; + Tue, 11 Feb 2003 14:06:33 -0500 (EST) +To: "Matthew T. O'Connor" +Cc: pgsql-hackers@postgresql.org +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] + PostgreSQL Benchmarks) +In-reply-to: <1044989631.32185.151.camel@zeutrh80> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> + <49391.192.168.1.12.1044985098.squirrel@mail.mayuli.com> + <26924.1044986473@sss.pgh.pa.us> + <1044989631.32185.151.camel@zeutrh80> +Comments: In-reply-to "Matthew T. O'Connor" + message dated "11 Feb 2003 13:53:51 -0500" +Date: Tue, 11 Feb 2003 14:06:32 -0500 +Message-ID: <27295.1044990392@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/413 +X-Sequence-Number: 35355 + +"Matthew T. O'Connor" writes: +> ... So we ship postgresql.conf with 32M of +> shared memory and auto_shared_mem_reduction = true. With a comment that +> the administrator might want to turn this off for production. + +This really doesn't address Justin's point about clueless benchmarkers, +however. In fact I fear it would make that problem worse: if Joe Blow +says he got horrible performance, who knows whether he was running with +a reasonable number of buffers or not? Especially when you ask him +"did you have lots of shared buffers" and he responds "yes, of course, +it says 32M right here". + +We've recently been moving away from the notion that it's okay to +silently lose functionality in order to run on a given system. For +example, if you want to install without readline, you now have to +explicitly tell configure that, because we heard "why don't I have +history in psql" way too often from people who just ran configure +and paid no attention to what it told them. + +I think that what this discussion is really leading up to is that we +are going to decide to apply the same principle to performance. The +out-of-the-box settings ought to give reasonable performance, and if +your system can't handle it, you should have to take explicit action +to acknowledge the fact that you aren't going to get reasonable +performance. + + regards, tom lane + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 14:16:49 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 9559E474E5C + for ; + Tue, 11 Feb 2003 14:16:47 -0500 (EST) +Received: from CopelandConsulting.Net (dsl-24293-ld.customer.centurytel.net + [209.142.135.135]) + by postgresql.org (Postfix) with ESMTP id A7EE0474E53 + for ; + Tue, 11 Feb 2003 14:16:46 -0500 (EST) +Received: from [192.168.1.2] (mouse.copelandconsulting.net [192.168.1.2]) + by CopelandConsulting.Net (8.10.1/8.10.1) with ESMTP id h1BJG9703263; + Tue, 11 Feb 2003 13:16:09 -0600 (CST) +X-Trade-Id: +To: Tom Lane +Cc: "scott.marlowe" , + PostgresSQL Hackers Mailing List +In-Reply-To: <27232.1044989729@sss.pgh.pa.us> +References: + <27232.1044989729@sss.pgh.pa.us> +Content-Type: text/plain +Organization: Copeland Computer Consulting +Message-Id: <1044990974.2501.207.camel@mouse.copelandconsulting.net> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.0 +Date: 11 Feb 2003 13:16:15 -0600 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/414 +X-Sequence-Number: 35356 + +On Tue, 2003-02-11 at 12:55, Tom Lane wrote: +> "scott.marlowe" writes: +> > Is setting the max connections to something like 200 reasonable, or likely +> > to cause too many problems? +> +> That would likely run into number-of-semaphores limitations (SEMMNI, +> SEMMNS). We do not seem to have as good documentation about changing +> that as we do about changing the SHMMAX setting, so I'm not sure I want +> to buy into the "it's okay to expect people to fix this before they can +> start Postgres the first time" argument here. +> +> Also, max-connections doesn't silently skew your testing: if you need +> to raise it, you *will* know it. +> + +Besides, I'm not sure that it makes sense to let other product needs +dictate the default configurations for this one. It would be one thing +if the vast majority of people only used PostgreSQL with Apache. I know +I'm using it in environments in which no way relate to the web. I'm +thinking I'm not alone. + + +Regards, + +-- +Greg Copeland +Copeland Computer Consulting + + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 14:36:07 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 443B8475925 + for ; + Tue, 11 Feb 2003 14:36:06 -0500 (EST) +Received: from mail.propertykey.com (propertykey.com [206.196.37.193]) + by postgresql.org (Postfix) with ESMTP id 67246475843 + for ; + Tue, 11 Feb 2003 14:36:05 -0500 (EST) +Received: from propertykey.com (gotojail.propertykey.com [206.196.37.197]) + by mail.propertykey.com (8.11.6/8.9.3) with ESMTP id h1BJa5S25594 + for ; Tue, 11 Feb 2003 13:36:05 -0600 +Message-ID: <3E4950A5.1050905@propertykey.com> +Date: Tue, 11 Feb 2003 13:36:05 -0600 +From: Jeff Hoffmann +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; + rv:1.3a) Gecko/20021212 +X-Accept-Language: en-us, en, ja, zh +MIME-Version: 1.0 +To: pgsql-hackers@postgresql.org +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> + <49391.192.168.1.12.1044985098.squirrel@mail.mayuli.com> + <26924.1044986473@sss.pgh.pa.us> + <1044989631.32185.151.camel@zeutrh80> + <27295.1044990392@sss.pgh.pa.us> +In-Reply-To: <27295.1044990392@sss.pgh.pa.us> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/416 +X-Sequence-Number: 35358 + +Tom Lane wrote: + +> I think that what this discussion is really leading up to is that we +> are going to decide to apply the same principle to performance. The +> out-of-the-box settings ought to give reasonable performance, and if +> your system can't handle it, you should have to take explicit action +> to acknowledge the fact that you aren't going to get reasonable +> performance. + +What I don't understand is why this is such a huge issue. Set it to a +reasonable level (be it 4M or whatever the concensus is) & let the +packagers worry about it if that's not appropriate. Isn't it their job +to have a good out-of-the-package experience? Won't they have better +knowledge of what the system limits are for the packages they develop +for? Worst case, couldn't they have a standard conf package & a special +"high-performance" conf package in addition to all the base packages? +After all, it's the users of the RPMs that are the real problem, not +usually the people that compile it on their own. If you were having +problems with the "compile-it-yourself" audience, couldn't you just hit +them over the head three or four times (configure, install, initdb & +failed startup to name a few) reminding them to change it if it wasn't +appropriate. What more can you really do? At some point, the end user +has to bear some responsibility... + +-- + +Jeff Hoffmann +PropertyKey.com + + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 15:04:27 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 90E02474E5C + for ; + Tue, 11 Feb 2003 15:04:26 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id C854C474E53 + for ; + Tue, 11 Feb 2003 15:04:25 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h1BK2AwQ013983; + Tue, 11 Feb 2003 13:02:11 -0700 (MST) +Date: Tue, 11 Feb 2003 12:54:06 -0700 (MST) +From: "scott.marlowe" +To: Tom Lane +Cc: PostgresSQL Hackers Mailing List +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] +In-Reply-To: <27232.1044989729@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 AMaViS new-20020517 +X-Archive-Number: 200302/417 +X-Sequence-Number: 35359 + +On Tue, 11 Feb 2003, Tom Lane wrote: + +> "scott.marlowe" writes: +> > Is setting the max connections to something like 200 reasonable, or likely +> > to cause too many problems? +> +> That would likely run into number-of-semaphores limitations (SEMMNI, +> SEMMNS). We do not seem to have as good documentation about changing +> that as we do about changing the SHMMAX setting, so I'm not sure I want +> to buy into the "it's okay to expect people to fix this before they can +> start Postgres the first time" argument here. +> +> Also, max-connections doesn't silently skew your testing: if you need +> to raise it, you *will* know it. + +True, but unfortunately, the time you usually learn that the first time is +when your web server starts issuing error messages about not being able to +connect to the database. i.e. it fails at the worst possible time. + +OK. I just did some very simple testing in RH Linux 7.2 and here's what I +found about file handles: default max appears to be 8192 now, not 4096. + +With max file handles set to 4096, I run out of handles when opening about +450 or more simultaneous connections. At 8192, the default for RH72, I +pretty much run out of memory on a 512 Meg box and start swapping +massively long before I can exhaust the file handle pool. + +At 200 connections, I use about half of all my file descriptors out of +4096, which seems pretty safe to me. + +Note that setting the max connections to 200 in the conf does NOT result +in huge allocations of file handles right away, but only while the +database is under load, so this leads us to the other possible problem, +that the database will exhaust file handles if we set this number too +high, as opposed to not being able to connect because it's too low. + +I'm guessing that 200 or less is pretty safe on most modern flavors of +Unix, but I'm not one of those folks who keeps the older flavors happy +really, so I can't speak for them. + +Back in the day, a P100 with 30 or 40 connections was a heavy load, +nowadays, a typical workstation has 512 Meg ram or more, and a 1.5+GHz +CPU, so I can see increasing this setting too. I'd rather the only issue +for the user be adjusting their kernel than having to up the connection +limit in postgresql. I can up the max file handles in Linux on the fly, +with no one noticeing it, I have to stop and restart postgresql to make +the max backends take affect, so that's another reason not to have too low +a limit. + +Is there a place on the web somewhere that lists the default settings for +most major unixes for file handles, inodes, and shared memory? + + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 15:21:22 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 86BBB475A1E + for ; + Tue, 11 Feb 2003 15:21:21 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id 69ED9475E88 + for ; + Tue, 11 Feb 2003 15:19:32 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h1BKILwQ015117; + Tue, 11 Feb 2003 13:18:21 -0700 (MST) +Date: Tue, 11 Feb 2003 13:10:17 -0700 (MST) +From: "scott.marlowe" +To: Greg Copeland +Cc: Tom Lane , + PostgresSQL Hackers Mailing List +Subject: Re: Changing the default configuration (was Re: +In-Reply-To: <1044990974.2501.207.camel@mouse.copelandconsulting.net> +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 AMaViS new-20020517 +X-Archive-Number: 200302/418 +X-Sequence-Number: 35360 + +On 11 Feb 2003, Greg Copeland wrote: + +> On Tue, 2003-02-11 at 12:55, Tom Lane wrote: +> > "scott.marlowe" writes: +> > > Is setting the max connections to something like 200 reasonable, or likely +> > > to cause too many problems? +> > +> > That would likely run into number-of-semaphores limitations (SEMMNI, +> > SEMMNS). We do not seem to have as good documentation about changing +> > that as we do about changing the SHMMAX setting, so I'm not sure I want +> > to buy into the "it's okay to expect people to fix this before they can +> > start Postgres the first time" argument here. +> > +> > Also, max-connections doesn't silently skew your testing: if you need +> > to raise it, you *will* know it. +> > +> +> Besides, I'm not sure that it makes sense to let other product needs +> dictate the default configurations for this one. It would be one thing +> if the vast majority of people only used PostgreSQL with Apache. I know +> I'm using it in environments in which no way relate to the web. I'm +> thinking I'm not alone. + +True, but even so, 32 max connections is a bit light. I have more +pgsql databases than that on my box now. My point in my previous answer +to Tom was that you HAVE to shut down postgresql to change this. It +doesn't allocate tons of semaphores on startup, just when the child +processes are spawned, and I'd rather have the user adjust their OS to +meet the higher need than have to shut down and restart postgresql as +well. This is one of the settings that make it feel like a "toy" when you +first open it. + +How many other high quality databases in the whole world restrict max +connections to 32? The original choice of 32 was set because the original +choice of 64 shared memory blocks as the most we could hope for on common +OS installs. Now that we're looking at cranking that up to 1000, +shouldn't max connections get a look too? + +You don't have to be using apache to need more than 32 simo connections. +Heck, how many postgresql databases do you figure are in production with +that setting still in there? My guess is not many. + +I'm not saying we should do this to make benchmarks better either, I'm +saying we should do it to improve the user experience. A limit of 32 +connects makes things tough for a beginning DBA, not only does he find out +the problem while his database is under load the first time, but then he +can't fix it without shutting down and restarting postgresql. If the max +is set to 200 or 500 and he starts running out of semaphores, that's a +problem he can address while his database is still up and running in most +operating systems, at least in the ones I use. + +So, my main point is that any setting that requires you to shut down +postgresql to make the change, we should pick a compromise value that +means you never likely will have to shut down the database once you've +started it up and it's under load. shared buffers, max connects, etc... +should not need tweaking for 95% or more of the users if we can help it. +It would be nice if we could find a set of numbers that reduce the number +of problems users have, so all I'm doing is looking for the sweetspot, +which is NOT 32 max connections. + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 16:03:43 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id C9DDF475C5F + for ; + Tue, 11 Feb 2003 16:03:42 -0500 (EST) +Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) + by postgresql.org (Postfix) with SMTP id B50C4475C2B + for ; + Tue, 11 Feb 2003 16:03:41 -0500 (EST) +Received: (qmail 18886 invoked by uid 0); 11 Feb 2003 21:03:41 -0000 +Received: from p3E990AA9.dip0.t-ipconnect.de (62.153.10.169) + by mail.gmx.net (mp021-rz3) with SMTP; 11 Feb 2003 21:03:41 -0000 +Date: Tue, 11 Feb 2003 22:13:37 +0100 (CET) +From: Peter Eisentraut +X-X-Sender: peter@peter.localdomain +To: Tom Lane +Cc: Merlin Moncure , + PostgresSQL Hackers Mailing List , + +Subject: Re: Changing the default configuration (was Re: +In-Reply-To: <26004.1044980414@sss.pgh.pa.us> +Message-ID: +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/26 +X-Sequence-Number: 784 + +Tom Lane writes: + +> We could retarget to try to stay under SHMMAX=4M, which I think is +> the next boundary that's significant in terms of real-world platforms +> (isn't that the default SHMMAX on some BSDen?). That would allow us +> 350 or so shared_buffers, which is better, but still not really a +> serious choice for production work. + +What is a serious choice for production work? And what is the ideal +choice? The answer probably involves some variables, but maybe we should +get values for those variables in each case and work from there. + +-- +Peter Eisentraut peter_e@gmx.net + + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 16:53:44 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id D4978474E5C + for ; + Tue, 11 Feb 2003 16:53:42 -0500 (EST) +Received: from utility.wgcr.org (unknown [206.74.232.205]) + by postgresql.org (Postfix) with ESMTP id 44DB4474E53 + for ; + Tue, 11 Feb 2003 16:53:42 -0500 (EST) +Received: from utility.wgcr.org ([10.1.0.2]) + by utility.wgcr.org (8.12.5/8.12.5) with ESMTP id h1BLrh6q005284; + Tue, 11 Feb 2003 16:53:43 -0500 +Received: from ([10.1.2.238]) + by utility.wgcr.org (MailMonitor for SMTP v1.2.1 ) ; + Tue, 11 Feb 2003 16:53:43 -0500 (EST) +Content-Type: text/plain; + charset="utf-8" +From: Lamar Owen +To: Robert Treat , + PostgresSQL Hackers Mailing List +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] +Date: Tue, 11 Feb 2003 16:53:39 -0500 +User-Agent: KMail/1.4.3 +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <3E492E06.2030702@postgresql.org> <1044986625.12931.27.camel@camel> +In-Reply-To: <1044986625.12931.27.camel@camel> +MIME-Version: 1.0 +Message-Id: <200302111653.39763.lamar.owen@wgcr.org> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/426 +X-Sequence-Number: 35368 + +On Tuesday 11 February 2003 13:03, Robert Treat wrote: +> On Tue, 2003-02-11 at 12:08, Justin Clift wrote: +> > b) Said benchmarking person knows very little about PostgreSQL, so they +> > install the RPM's, packages, or whatever, and "it works". Then they run +> > whatever benchmark they've downloaded, or designed, or whatever + +> Out of curiosity, how feasible is it for the rpm/package/deb/exe +> maintainers to modify their supplied postgresql.conf settings when +> building said distribution? AFAIK the minimum default SHHMAX setting on +> Red Hat 8.0 is 32MB, seems like bumping shared buffers to work with that +> amount would be acceptable inside the 8.0 rpm's. + +Yes, this is easy to do. But what is a sane default? I can patch any file= +=20 +I'd like to, but my preference is to patch as little as possible, as I'm=20 +trying to be generic here. I can't assume Red Hat 8 in the source RPM, and= +=20 +my binaries are to be preferred only if the distributor doesn't have update= +d=20 +ones. +--=20 +Lamar Owen +WGCR Internet Radio +1 Peter 4:11 + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 19:25:35 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 32EED474E44; Tue, 11 Feb 2003 19:25:35 -0500 (EST) +Received: from b0x.supernerd.com (unknown [208.186.134.90]) + by postgresql.org (Postfix) with ESMTP + id 97093474E5C; Tue, 11 Feb 2003 19:25:34 -0500 (EST) +Received: from grouch (12-255-29-13.client.attbi.com [12.255.29.13]) + by b0x.supernerd.com (Postfix) with ESMTP + id A14575FEFF; Tue, 11 Feb 2003 18:32:54 -0700 (MST) +Message-ID: <006c01c2d22d$4028c450$0a00000a@grouch> +From: "Rick Gigger" +To: "Greg Copeland" , + "Tom Lane" +Cc: "Merlin Moncure" , + "PostgresSQL Hackers Mailing List" , + +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> + <1044981773.25889.165.camel@mouse.copelandconsulting.net> +Subject: Re: [HACKERS] Changing the default configuration (was Re: +Date: Tue, 11 Feb 2003 17:25:29 -0700 +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.2720.3000 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/27 +X-Sequence-Number: 785 + +> On Tue, 2003-02-11 at 10:20, Tom Lane wrote: +> > "Merlin Moncure" writes: +> > > May I make a suggestion that maybe it is time to start thinking about +> > > tuning the default config file, IMHO its just a little bit too +> > > conservative, +> > +> > It's a lot too conservative. I've been thinking for awhile that we +> > should adjust the defaults. +> > +> > The original motivation for setting shared_buffers = 64 was so that +> > Postgres would start out-of-the-box on machines where SHMMAX is 1 meg +> > (64 buffers = 1/2 meg, leaving 1/2 meg for our other shared data +> > structures). At one time SHMMAX=1M was a pretty common stock kernel +> > setting. But our other data structures blew past the 1/2 meg mark +> > some time ago; at default settings the shmem request is now close to +> > 1.5 meg. So people with SHMMAX=1M have already got to twiddle their +> > postgresql.conf settings, or preferably learn how to increase SHMMAX. +> > That means there is *no* defensible reason anymore for defaulting to +> > 64 buffers. +> > +> > We could retarget to try to stay under SHMMAX=4M, which I think is +> > the next boundary that's significant in terms of real-world platforms +> > (isn't that the default SHMMAX on some BSDen?). That would allow us +> > 350 or so shared_buffers, which is better, but still not really a +> > serious choice for production work. +> > +> > What I would really like to do is set the default shared_buffers to +> > 1000. That would be 8 meg worth of shared buffer space. Coupled with +> > more-realistic settings for FSM size, we'd probably be talking a shared +> > memory request approaching 16 meg. This is not enough RAM to bother +> > any modern machine from a performance standpoint, but there are probably +> > quite a few platforms out there that would need an increase in their +> > stock SHMMAX kernel setting before they'd take it. +> > +> > So what this comes down to is making it harder for people to get +> > Postgres running for the first time, versus making it more likely that +> > they'll see decent performance when they do get it running. +> > +> > It's worth noting that increasing SHMMAX is not nearly as painful as +> > it was back when these decisions were taken. Most people have moved +> > to platforms where it doesn't even take a kernel rebuild, and we've +> > acquired documentation that tells how to do it on all(?) our supported +> > platforms. So I think it might be okay to expect people to do it. +> > +> > The alternative approach is to leave the settings where they are, and +> > to try to put more emphasis in the documentation on the fact that the +> > factory-default settings produce a toy configuration that you *must* +> > adjust upward for decent performance. But we've not had a lot of +> > success spreading that word, I think. With SHMMMAX too small, you +> > do at least get a pretty specific error message telling you so. +> > +> > Comments? +> +> I'd personally rather have people stumble trying to get PostgreSQL +> running, up front, rather than allowing the lowest common denominator +> more easily run PostgreSQL only to be disappointed with it and move on. +> +> After it's all said and done, I would rather someone simply say, "it's +> beyond my skill set", and attempt to get help or walk away. That seems +> better than them being able to run it and say, "it's a dog", spreading +> word-of-mouth as such after they left PostgreSQL behind. Worse yet, +> those that do walk away and claim it performs horribly are probably +> doing more harm to the PostgreSQL community than expecting someone to be +> able to install software ever can. +> +> Nutshell: +> "Easy to install but is horribly slow." +> +> or +> +> "Took a couple of minutes to configure and it rocks!" +> +> +> +> Seems fairly cut-n-dry to me. ;) + +The type of person who can't configure it or doesnt' think to try is +probably not doing a project that requires any serious performance. As long +as you are running it on decent hardware postgres will run fantastic for +anything but a very heavy load. I think there may be many people out there +who have little experience but want an RDBMS to manage their data. Those +people need something very, very easy. Look at the following that mysql +gets despite how poor of a product it is. It's very, very easy. Mysql +works great for many peoples needs but then when they need to do something +real they need to move to a different database entirely. I think there is a +huge advantage to having a product that can be set up very quickly out of +the box. Those who need serious performance, hopefully for ther employers +sake, will be more like to take a few minutes to do some quick performance +tuning. + +Rick Gigger + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 19:42:27 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id E6A4F4759BD; Tue, 11 Feb 2003 19:42:25 -0500 (EST) +Received: from platonic.cynic.net (platonic.cynic.net [204.80.150.245]) + by postgresql.org (Postfix) with ESMTP + id 64143475843; Tue, 11 Feb 2003 19:42:25 -0500 (EST) +Received: from angelic.cynic.net (angelic-platonic.cvpn.cynic.net + [198.73.220.226]) by platonic.cynic.net (Postfix) with ESMTP + id B0143BF4C; Wed, 12 Feb 2003 00:42:10 +0000 (UTC) +Received: from localhost (localhost [127.0.0.1]) + by angelic.cynic.net (Postfix) with ESMTP + id 42B328736; Wed, 12 Feb 2003 09:41:45 +0900 (JST) +Date: Wed, 12 Feb 2003 09:41:45 +0900 (JST) +From: Curt Sampson +To: Tom Lane +Cc: Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: Changing the default configuration (was Re: +In-Reply-To: <26004.1044980414@sss.pgh.pa.us> +Message-ID: +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/28 +X-Sequence-Number: 786 + +On Tue, 11 Feb 2003, Tom Lane wrote: + +> It's a lot too conservative. I've been thinking for awhile that we +> should adjust the defaults. + +Some of these issues could be made to Just Go Away with some code +changes. For example, using mmap rather than SysV shared memory +would automatically optimize your memory usage, and get rid of the +double-buffering problem as well. If we could find a way to avoid using +semephores proportional to the number of connections we have, then you +wouldn't have to worry about that configuration parameter, either. + +In fact, some of this stuff might well improve our portability, too. +For example, mmap is a POSIX standard, whereas shmget is only an X/Open +standard. That makes me suspect that mmap is more widely available on +non-Unix platforms. (But I could be wrong.) + +cjs +-- +Curt Sampson +81 90 7737 2974 http://www.netbsd.org + Don't you know, in this new Dark Age, we're all light. --XTC + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 19:50:42 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 2C442475843; Tue, 11 Feb 2003 19:50:42 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP + id 75F70474E5C; Tue, 11 Feb 2003 19:50:41 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h1C0oBwQ002153; + Tue, 11 Feb 2003 17:50:11 -0700 (MST) +Date: Tue, 11 Feb 2003 17:42:06 -0700 (MST) +From: "scott.marlowe" +To: Rick Gigger +Cc: Greg Copeland , Tom Lane , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + +Subject: Re: [HACKERS] Changing the default configuration (was Re: +In-Reply-To: <006c01c2d22d$4028c450$0a00000a@grouch> +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 AMaViS new-20020517 +X-Archive-Number: 200302/29 +X-Sequence-Number: 787 + +On Tue, 11 Feb 2003, Rick Gigger wrote: + +> The type of person who can't configure it or doesnt' think to try is +> probably not doing a project that requires any serious performance. As long +> as you are running it on decent hardware postgres will run fantastic for +> anything but a very heavy load. I think there may be many people out there +> who have little experience but want an RDBMS to manage their data. Those +> people need something very, very easy. Look at the following that mysql +> gets despite how poor of a product it is. It's very, very easy. Mysql +> works great for many peoples needs but then when they need to do something +> real they need to move to a different database entirely. I think there is a +> huge advantage to having a product that can be set up very quickly out of +> the box. Those who need serious performance, hopefully for ther employers +> sake, will be more like to take a few minutes to do some quick performance +> tuning. + +Very good point. I'm pushing for changes that will NOT negatively impact +joe beginner on the major platforms (Linux, BSD, Windows) in terms of +install. I figure anyone installing on big iron already knows enough +about their OS we don't have to worry about shared buffers being too big +for that machine. + +So, a compromise of faster performance out of the box, with little or no +negative user impact seems the sweet spot here. + +I'm thinking a good knee setting for each one, where not too much memory / +semaphores / file handles get gobbled up, but the database isn't pokey. + +The poor performance of Postgresql in it's current default configuration +HAS cost us users, trust me, I know a few we've almost lost where I work +that I converted after some quick tweaking of their database. + +In it's stock form Postgresql is very slow at large simple queries, like +'select * from table1 t1 natural join table2 t2 where t1.field='a'; where +you get back something like 10,000 rows. The real bottleneck here is +sort_mem. A simple bump up to 8192 or so makes the database much more +responsive. + +If we're looking at changing default settings for 7.4, then we should look +at changing ALL of them that matter, since we'll have the most time to +shake out problems if we do them early, and we won't have four or five +rounds of setting different defaults over time and finding the limitations +of the HOST OSes one at a time. + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 20:19:19 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 18E5B4759BD; Tue, 11 Feb 2003 20:19:19 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP + id 94CC84758FE; Tue, 11 Feb 2003 20:19:13 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h1C1AFwQ003097; + Tue, 11 Feb 2003 18:10:15 -0700 (MST) +Date: Tue, 11 Feb 2003 18:02:09 -0700 (MST) +From: "scott.marlowe" +To: Curt Sampson +Cc: Tom Lane , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + +Subject: Re: [HACKERS] Changing the default configuration (was Re: +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 AMaViS new-20020517 +X-Archive-Number: 200302/31 +X-Sequence-Number: 789 + +On Wed, 12 Feb 2003, Curt Sampson wrote: + +> On Tue, 11 Feb 2003, Tom Lane wrote: +> +> > It's a lot too conservative. I've been thinking for awhile that we +> > should adjust the defaults. +> +> Some of these issues could be made to Just Go Away with some code +> changes. For example, using mmap rather than SysV shared memory +> would automatically optimize your memory usage, and get rid of the +> double-buffering problem as well. If we could find a way to avoid using +> semephores proportional to the number of connections we have, then you +> wouldn't have to worry about that configuration parameter, either. +> +> In fact, some of this stuff might well improve our portability, too. +> For example, mmap is a POSIX standard, whereas shmget is only an X/Open +> standard. That makes me suspect that mmap is more widely available on +> non-Unix platforms. (But I could be wrong.) + +I'll vote for mmap. I use the mm libs with apache/openldap/authldap and +it is very fast and pretty common nowadays. It seems quite stable as +well. + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 20:09:00 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 0CCB9474E5C; Tue, 11 Feb 2003 20:08:59 -0500 (EST) +Received: from sraigw.sra.co.jp (sraigw.sra.co.jp [202.32.10.2]) + by postgresql.org (Postfix) with ESMTP + id 1E30A474E44; Tue, 11 Feb 2003 20:08:58 -0500 (EST) +Received: from srascb.sra.co.jp (srascb [133.137.8.65]) + by sraigw.sra.co.jp (Postfix) with ESMTP + id B035162360; Wed, 12 Feb 2003 10:09:00 +0900 (JST) +Received: from sranhm.sra.co.jp (IDENT:root@localhost [127.0.0.1]) + by srascb.sra.co.jp (8.9.3/3.7W-sra) with ESMTP id KAA17054; + Wed, 12 Feb 2003 10:09:00 +0900 +Received: from localhost (IDENT:t-ishii@srapc1977.sra.co.jp [133.137.170.63]) + by sranhm.sra.co.jp (8.9.3+3.2W/3.7W-srambox) with ESMTP id KAA03038; + Wed, 12 Feb 2003 10:09:00 +0900 +Date: Wed, 12 Feb 2003 10:10:00 +0900 (JST) +Message-Id: <20030212.101000.74752335.t-ishii@sra.co.jp> +To: tgl@sss.pgh.pa.us +Cc: justin@postgresql.org, josh@agliodbs.com, + merlin.moncure@rcsonline.com, pgsql-hackers@postgresql.org, + pgsql-advocacy@postgresql.org +Subject: Re: [HACKERS] Changing the default configuration +From: Tatsuo Ishii +In-Reply-To: <26850.1044985975@sss.pgh.pa.us> +References: <26582.1044984365@sss.pgh.pa.us> <3E493415.9090004@postgresql.org> + <26850.1044985975@sss.pgh.pa.us> +X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 + =?iso-2022-jp?B?KBskQjAqGyhCKQ==?= +Mime-Version: 1.0 +Content-Type: Text/Plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/30 +X-Sequence-Number: 788 + +> If I thought that pgbench was representative of anything, or even +> capable of reliably producing repeatable numbers, then I might subscribe +> to results derived this way. But I have little or no confidence in +> pgbench. Certainly I don't see how you'd use it to produce +> recommendations for a range of application scenarios, when it's only +> one very narrow scenario itself. + +Sigh. People always complain "pgbench does not reliably producing +repeatable numbers" or something then say "that's because pgbench's +transaction has too much contention on the branches table". So I added +-N option to pgbench which makes pgbench not to do any UPDATE to +the branches table. But still people continue to complian... + +There should be many factors that would produce non-repeatable +results exist, for instance kenel buffer, PostgreSQL's buffer manager, +pgbench itself etc. etc... So far it seems no one has ever made clean +explanation why non-repeatable results happen... +-- +Tatsuo Ishii + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 20:09:07 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A1886475A45 + for ; + Tue, 11 Feb 2003 20:09:06 -0500 (EST) +Received: from sraigw.sra.co.jp (sraigw.sra.co.jp [202.32.10.2]) + by postgresql.org (Postfix) with ESMTP id C4C01475A1E + for ; + Tue, 11 Feb 2003 20:09:05 -0500 (EST) +Received: from srascb.sra.co.jp (srascb [133.137.8.65]) + by sraigw.sra.co.jp (Postfix) with ESMTP + id A2F82622F7; Wed, 12 Feb 2003 10:09:08 +0900 (JST) +Received: from sranhm.sra.co.jp (IDENT:root@localhost [127.0.0.1]) + by srascb.sra.co.jp (8.9.3/3.7W-sra) with ESMTP id KAA17075; + Wed, 12 Feb 2003 10:09:08 +0900 +Received: from localhost (IDENT:t-ishii@srapc1977.sra.co.jp [133.137.170.63]) + by sranhm.sra.co.jp (8.9.3+3.2W/3.7W-srambox) with ESMTP id KAA03047; + Wed, 12 Feb 2003 10:09:08 +0900 +Date: Wed, 12 Feb 2003 10:10:08 +0900 (JST) +Message-Id: <20030212.101008.41630074.t-ishii@sra.co.jp> +To: scott.marlowe@ihs.com +Cc: pgsql-hackers@postgresql.org +Subject: Re: Changing the default configuration +From: Tatsuo Ishii +In-Reply-To: +References: <3E494087.2010308@mohawksoft.com> + +X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 + =?iso-2022-jp?B?KBskQjAqGyhCKQ==?= +Mime-Version: 1.0 +Content-Type: Text/Plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/436 +X-Sequence-Number: 35378 + +> My other pet peeve is the default max connections setting. This should be +> higher if possible, but of course, there's always the possibility of +> running out of file descriptors. +> +> Apache has a default max children of 150, and if using PHP or another +> language that runs as an apache module, it is quite possible to use up all +> the pgsql backend slots before using up all the apache child slots. +> +> Is setting the max connections to something like 200 reasonable, or likely +> to cause too many problems? + +It likely. First you will ran out kernel file descriptors. This could +be solved by increasing the kernel table or lowering +max_files_per_process, though. Second the total throughput will +rapidly descrease if you don't have enough RAM and many +CPUs. PostgreSQL can not handle many concurrent +connections/transactions effectively. I recommend to employ some kind +of connection pooling software and lower the max connections. +-- +Tatsuo Ishii + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 20:09:26 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id F1BC2475BA1 + for ; + Tue, 11 Feb 2003 20:09:24 -0500 (EST) +Received: from sraigw.sra.co.jp (sraigw.sra.co.jp [202.32.10.2]) + by postgresql.org (Postfix) with ESMTP id 4B179475AFA + for ; + Tue, 11 Feb 2003 20:09:24 -0500 (EST) +Received: from srascb.sra.co.jp (srascb [133.137.8.65]) + by sraigw.sra.co.jp (Postfix) with ESMTP + id 3CDAD62273; Wed, 12 Feb 2003 10:09:27 +0900 (JST) +Received: from sranhm.sra.co.jp (IDENT:root@localhost [127.0.0.1]) + by srascb.sra.co.jp (8.9.3/3.7W-sra) with ESMTP id KAA17082; + Wed, 12 Feb 2003 10:09:27 +0900 +Received: from localhost (IDENT:t-ishii@srapc1977.sra.co.jp [133.137.170.63]) + by sranhm.sra.co.jp (8.9.3+3.2W/3.7W-srambox) with ESMTP id KAA03054; + Wed, 12 Feb 2003 10:09:27 +0900 +Date: Wed, 12 Feb 2003 10:10:26 +0900 (JST) +Message-Id: <20030212.101026.71083976.t-ishii@sra.co.jp> +To: matthew@zeut.net +Cc: pgsql-hackers@postgresql.org, tgl@sss.pgh.pa.us +Subject: Re: Changing the default configuration +From: Tatsuo Ishii +In-Reply-To: <1044989631.32185.151.camel@zeutrh80> +References: <49391.192.168.1.12.1044985098.squirrel@mail.mayuli.com> + <26924.1044986473@sss.pgh.pa.us> + <1044989631.32185.151.camel@zeutrh80> +X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 + =?iso-2022-jp?B?KBskQjAqGyhCKQ==?= +Mime-Version: 1.0 +Content-Type: Text/Plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/437 +X-Sequence-Number: 35379 + +It's interesting that people focus on shared_buffers. From my +experience the most dominating parameter for performance is +wal_sync_method. It sometimes makes ~20% performance difference. On +the otherhand, shared_buffers does very little for +performance. Moreover too many shared_buffers cause performance +degration! I guess this is due to the poor design of bufmgr. Until it +is fixed, just increasing the number of shared_buffers a bit, say +1024, is enough IMHO. +-- +Tatsuo Ishii + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 20:32:37 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B71B4475843 + for ; + Tue, 11 Feb 2003 20:32:36 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id 297C5474E5C + for ; + Tue, 11 Feb 2003 20:32:36 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h1C1VYwQ004138; + Tue, 11 Feb 2003 18:31:34 -0700 (MST) +Date: Tue, 11 Feb 2003 18:23:28 -0700 (MST) +From: "scott.marlowe" +To: Tatsuo Ishii +Cc: +Subject: Re: Changing the default configuration +In-Reply-To: <20030212.101008.41630074.t-ishii@sra.co.jp> +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 AMaViS new-20020517 +X-Archive-Number: 200302/440 +X-Sequence-Number: 35382 + +On Wed, 12 Feb 2003, Tatsuo Ishii wrote: + +> > My other pet peeve is the default max connections setting. This should be +> > higher if possible, but of course, there's always the possibility of +> > running out of file descriptors. +> > +> > Apache has a default max children of 150, and if using PHP or another +> > language that runs as an apache module, it is quite possible to use up all +> > the pgsql backend slots before using up all the apache child slots. +> > +> > Is setting the max connections to something like 200 reasonable, or likely +> > to cause too many problems? +> +> It likely. First you will ran out kernel file descriptors. This could +> be solved by increasing the kernel table or lowering +> max_files_per_process, though. Second the total throughput will +> rapidly descrease if you don't have enough RAM and many +> CPUs. PostgreSQL can not handle many concurrent +> connections/transactions effectively. I recommend to employ some kind +> of connection pooling software and lower the max connections. + +Don't know if you saw my other message, but increasing max connects to 200 +used about 10% of all my semaphores and about 10% of my file handles. +That was while running pgbench to create 200 simo sessions. + +Keep in mind, on my fairly small intranet database server, I routinely +have >32 connections, most coming from outside my webserver. Probably no +more than 4 or 5 connects at a time come from there. These are all things +like Windows boxes with ODBC running access or something similar. Many of +the connections are idle 98% of the time, and use little or no real +resources, even getting swapped out should the server need the spare +memory (it doesn't :-) that machine is set to 120 max simos if I remember +correctly. + +while 200 may seem high, 32 definitely seems low. So, what IS a good +compromise? for this and ALL the other settings that should probably be a +bit higher. I'm guessing sort_mem or 4 or 8 meg hits the knee for most +folks, and the max fsm settings tom has suggested make sense. + +What wal_sync method should we make default? Or should we pick one based +on the OS the user is running? + + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 20:24:27 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E9021475A97 + for ; + Tue, 11 Feb 2003 20:24:25 -0500 (EST) +Received: from wolff.to (wolff.to [66.93.249.74]) + by postgresql.org (Postfix) with SMTP id 3255B4758FE + for ; + Tue, 11 Feb 2003 20:24:25 -0500 (EST) +Received: (qmail 6084 invoked by uid 500); 12 Feb 2003 01:37:48 -0000 +Date: Tue, 11 Feb 2003 19:37:48 -0600 +From: Bruno Wolff III +To: "scott.marlowe" +Cc: Rick Gigger , + Greg Copeland , Tom Lane , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: [HACKERS] Changing the default configuration (was Re: +Message-ID: <20030212013748.GA5831@wolff.to> +Mail-Followup-To: "scott.marlowe" , + Rick Gigger , + Greg Copeland , + Tom Lane , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +References: <006c01c2d22d$4028c450$0a00000a@grouch> + +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: +User-Agent: Mutt/1.3.25i +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/32 +X-Sequence-Number: 790 + +On Tue, Feb 11, 2003 at 17:42:06 -0700, + "scott.marlowe" wrote: +> +> The poor performance of Postgresql in it's current default configuration +> HAS cost us users, trust me, I know a few we've almost lost where I work +> that I converted after some quick tweaking of their database. + +About two years ago I talked some people into trying it at work to +use with IMP/Horde which had been having some corruption problems +while using MySQL (though it wasn't necessarily a problem with MySQL). +I told them to be sure to use 7.1. When they tried it out it couldn't +keep up with the load. I asked the guys what they tried and found out +they couldn't find 7.1 rpms and didn't want to compile from source and +so ended up using 7.0.?. Also as far as I could tell from talking to them, +they didn't do any tuning at all. They weren't interested in taking another +look at it after that. We are still using MySQL with that system today. + +One of our DBAs is using it for some trial projects (including one for me) +even though we have a site license for Oracle. + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 20:59:00 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 34E76474E5C + for ; + Tue, 11 Feb 2003 20:58:59 -0500 (EST) +Received: from sraigw.sra.co.jp (sraigw.sra.co.jp [202.32.10.2]) + by postgresql.org (Postfix) with ESMTP id 2B2E6474E44 + for ; + Tue, 11 Feb 2003 20:58:58 -0500 (EST) +Received: from srascb.sra.co.jp (srascb [133.137.8.65]) + by sraigw.sra.co.jp (Postfix) with ESMTP + id 128626239A; Wed, 12 Feb 2003 10:59:01 +0900 (JST) +Received: from sranhm.sra.co.jp (IDENT:root@localhost [127.0.0.1]) + by srascb.sra.co.jp (8.9.3/3.7W-sra) with ESMTP id KAA22117; + Wed, 12 Feb 2003 10:59:00 +0900 +Received: from localhost (IDENT:t-ishii@srapc1977.sra.co.jp [133.137.170.63]) + by sranhm.sra.co.jp (8.9.3+3.2W/3.7W-srambox) with ESMTP id KAA04614; + Wed, 12 Feb 2003 10:59:00 +0900 +Date: Wed, 12 Feb 2003 11:00:00 +0900 (JST) +Message-Id: <20030212.110000.97298009.t-ishii@sra.co.jp> +To: scott.marlowe@ihs.com +Cc: pgsql-hackers@postgresql.org +Subject: Re: Changing the default configuration +From: Tatsuo Ishii +In-Reply-To: +References: <20030212.101008.41630074.t-ishii@sra.co.jp> + +X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 + =?iso-2022-jp?B?KBskQjAqGyhCKQ==?= +Mime-Version: 1.0 +Content-Type: Text/Plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/442 +X-Sequence-Number: 35384 + +> > It likely. First you will ran out kernel file descriptors. This could +> > be solved by increasing the kernel table or lowering +> > max_files_per_process, though. Second the total throughput will +> > rapidly descrease if you don't have enough RAM and many +> > CPUs. PostgreSQL can not handle many concurrent +> > connections/transactions effectively. I recommend to employ some kind +> > of connection pooling software and lower the max connections. +> +> Don't know if you saw my other message, but increasing max connects to 200 +> used about 10% of all my semaphores and about 10% of my file handles. +> That was while running pgbench to create 200 simo sessions. + +I'm not talking about semaphores. You see the low usage of file +descriptors is just because pgbench uses very few tables. + +> Keep in mind, on my fairly small intranet database server, I routinely +> have >32 connections, most coming from outside my webserver. Probably no +> more than 4 or 5 connects at a time come from there. These are all things +> like Windows boxes with ODBC running access or something similar. Many of +> the connections are idle 98% of the time, and use little or no real +> resources, even getting swapped out should the server need the spare +> memory (it doesn't :-) that machine is set to 120 max simos if I remember +> correctly. +> +> while 200 may seem high, 32 definitely seems low. So, what IS a good +> compromise? for this and ALL the other settings that should probably be a +> bit higher. I'm guessing sort_mem or 4 or 8 meg hits the knee for most +> folks, and the max fsm settings tom has suggested make sense. + +32 is not too low if the kernel file descriptors is not +increased. Beware that running out of the kernel file descriptors is a +serious problem for the entire system, not only for PostgreSQL. + +> What wal_sync method should we make default? Or should we pick one based +> on the OS the user is running? + +It's really depending on the OS or kernel version. I saw open_sync is +best for certain version of Linux kernel, while fdatasync is good for +another version of kernel. I'm not sure, but it could be possible that +the file system type might affect the wal_sync choice. +-- +Tatsuo Ishii + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 21:42:51 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id D69CF4758FE + for ; + Tue, 11 Feb 2003 21:42:49 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 9A6FD474E5C + for ; + Tue, 11 Feb 2003 21:42:47 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1C2gpc28213 + for pgsql-advocacy@postgresql.org; Wed, 12 Feb 2003 10:42:51 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1C2gX728031; + Wed, 12 Feb 2003 10:42:34 +0800 (WST) +From: "Christopher Kings-Lynne" +To: "Merlin Moncure" , + "Greg Copeland" +Cc: "PostgresSQL Hackers Mailing List" , + +Subject: Re: [HACKERS] PostgreSQL Benchmarks +Date: Wed, 12 Feb 2003 10:42:42 +0800 +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: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +Importance: Normal +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/33 +X-Sequence-Number: 791 + +Why don't we include a postgresql.conf.recommended along with our +postgresql.conf.sample. That shouldn't be too hard. We can just jack up +the shared buffers and wal buffers and everything - it doesn't matter if +it's not perfect, but it will at least give people an idea of what needs to +be increased, etc to get good results. + +I'm currently benchmarking our new DB server before we put it into +production. I plan to publish the results from that shortly. + +Regards, + +Chris + +> -----Original Message----- +> From: pgsql-advocacy-owner@postgresql.org +> [mailto:pgsql-advocacy-owner@postgresql.org]On Behalf Of Merlin Moncure +> Sent: Tuesday, 11 February 2003 11:44 PM +> To: Greg Copeland +> Cc: PostgresSQL Hackers Mailing List; pgsql-advocacy@postgresql.org +> Subject: Re: [pgsql-advocacy] [HACKERS] PostgreSQL Benchmarks +> +> +> I've tested all the win32 versions of postgres I can get my hands on +> (cygwin and not), and my general feeling is that they have problems with +> insert performance with fsync() turned on, probably the fault of the os. +> Select performance is not so much affected. +> +> This is easily solved with transactions and other such things. Also +> Postgres benefits from pl just like oracle. +> +> May I make a suggestion that maybe it is time to start thinking about +> tuning the default config file, IMHO its just a little bit too +> conservative, and its hurting you in benchmarks being run by idiots, but +> its still bad publicity. Any real database admin would know his test +> are synthetic and not meaningful without having to look at the #s. +> +> This is irritating me so much that I am going to put together a +> benchmark of my own, a real world one, on (publicly available) real +> world data. Mysql is a real dog in a lot of situations. The FCC +> publishes a database of wireless transmitters that has tables with 10 +> million records in it. I'll pump that into pg, run some benchmarks, +> real world queries, and we'll see who the faster database *really* is. +> This is just a publicity issue, that's all. Its still annoying though. +> +> I'll even run an open challenge to database admin to beat query +> performance of postgres in such datasets, complex multi table joins, +> etc. I'll even throw out the whole table locking issue and analyze +> single user performance. +> +> Merlin +> +> +> +> _____________ +> How much of the performance difference is from the RDBMS, from the +> middleware, and from the quality of implementation in the middleware. +> +> While I'm not surprised that the the cygwin version of PostgreSQL is +> slow, those results don't tell me anything about the quality of the +> middleware interface between PHP and PostgreSQL. Does anyone know if we +> can rule out some of the performance loss by pinning it to bad +> middleware implementation for PostgreSQL? +> +> +> Regards, +> +> -- +> Greg Copeland +> Copeland Computer Consulting +> +> +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 6: Have you searched our list archives? +> +> http://archives.postgresql.org +> + + +From pgsql-advocacy-owner@postgresql.org Tue Feb 11 21:47:08 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 60833475AAC + for ; + Tue, 11 Feb 2003 21:47:07 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 57E6E475925 + for ; + Tue, 11 Feb 2003 21:47:05 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1C2l8328723 + for pgsql-advocacy@postgresql.org; Wed, 12 Feb 2003 10:47:08 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1C2l3728452; + Wed, 12 Feb 2003 10:47:03 +0800 (WST) +From: "Christopher Kings-Lynne" +To: "mlw" , + "Greg Copeland" +Cc: "Tom Lane" , + "Merlin Moncure" , + "PostgresSQL Hackers Mailing List" , + +Subject: Re: [HACKERS] Changing the default configuration (was Re: +Date: Wed, 12 Feb 2003 10:47:12 +0800 +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: <3E49319E.80206@mohawksoft.com> +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +Importance: Normal +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/34 +X-Sequence-Number: 792 + +> >After it's all said and done, I would rather someone simply say, "it's +> >beyond my skill set", and attempt to get help or walk away. That seems +> >better than them being able to run it and say, "it's a dog", spreading +> >word-of-mouth as such after they left PostgreSQL behind. Worse yet, +> >those that do walk away and claim it performs horribly are probably +> >doing more harm to the PostgreSQL community than expecting someone to be +> >able to install software ever can. +> > +> +> +> And that my friends is why PostgreSQL is still relatively obscure. + +Dude - I hang out on PHPBuilder's database forums and you wouldn't believe +how often the "oh, don't use Postgres, it has a history of database +corruption problems" thing is mentioned. + +Chris + + + +From pgsql-hackers-owner@postgresql.org Tue Feb 11 23:24:29 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 20F1F475CEE + for ; + Tue, 11 Feb 2003 23:24:27 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 2E6A5475CC4 + for ; + Tue, 11 Feb 2003 23:24:26 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1C4OQ5u000496; + Tue, 11 Feb 2003 23:24:26 -0500 (EST) +To: "scott.marlowe" +Cc: Greg Copeland , + PostgresSQL Hackers Mailing List +Subject: Re: Changing the default configuration (was Re: +In-reply-to: +References: +Comments: In-reply-to "scott.marlowe" + message dated "Tue, 11 Feb 2003 13:10:17 -0700" +Date: Tue, 11 Feb 2003 23:24:26 -0500 +Message-ID: <495.1045023866@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/450 +X-Sequence-Number: 35392 + +"scott.marlowe" writes: +> ... The original choice of 32 was set because the original +> choice of 64 shared memory blocks as the most we could hope for on common +> OS installs. Now that we're looking at cranking that up to 1000, +> shouldn't max connections get a look too? + +Actually I think max-connections at 32 was set because of SEMMAX limits, +and had only the most marginal connection to shared_buffers (anyone care +to troll the archives to check?) But sure, let's take another look at +the realistic limits today. + +> ... If he starts running out of semaphores, that's a +> problem he can address while his database is still up and running in most +> operating systems, at least in the ones I use. + +Back in the day, this took a kernel rebuild and system reboot to fix. +If this has changed, great ... but on exactly which Unixen can you +alter SEMMAX on the fly? + +> So, my main point is that any setting that requires you to shut down +> postgresql to make the change, we should pick a compromise value that +> means you never likely will have to shut down the database once you've +> started it up and it's under load. + +When I started using Postgres, it did not allocate the max number of +semas it might need at startup, but was instead prone to fail when you +tried to open the 17th or 33rd or so connection. It was universally +agreed to be an improvement to refuse to start at all if we could not +meet the specified max_connections setting. I don't want to backtrack +from that. If we can up the default max_connections setting, great ... +but let's not increase the odds of failing under load. + + regards, tom lane + +From pgsql-advocacy-owner@postgresql.org Wed Feb 12 00:27:31 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id BCBB5475925 + for ; + Wed, 12 Feb 2003 00:27:29 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 0CDDC4758FE + for ; + Wed, 12 Feb 2003 00:27:29 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1C5RW5u000933; + Wed, 12 Feb 2003 00:27:32 -0500 (EST) +To: Peter Eisentraut +Cc: Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: [HACKERS] Changing the default configuration (was Re: +In-reply-to: +References: +Comments: In-reply-to Peter Eisentraut + message dated "Tue, 11 Feb 2003 22:13:37 +0100" +Date: Wed, 12 Feb 2003 00:27:31 -0500 +Message-ID: <932.1045027651@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/39 +X-Sequence-Number: 797 + +Peter Eisentraut writes: +> Tom Lane writes: +>> We could retarget to try to stay under SHMMAX=4M, which I think is +>> the next boundary that's significant in terms of real-world platforms +>> (isn't that the default SHMMAX on some BSDen?). That would allow us +>> 350 or so shared_buffers, which is better, but still not really a +>> serious choice for production work. + +> What is a serious choice for production work? + +Well, as I commented later in that mail, I feel that 1000 buffers is +a reasonable choice --- but I have to admit that I have no hard data +to back up that feeling. Perhaps we should take this to the +pgsql-perform list and argue about reasonable choices. + +A separate line of investigation is "what is the lowest common +denominator nowadays?" I think we've established that SHMMAX=1M +is obsolete, but what replaces it as the next LCD? 4M seems to be +correct for some BSD flavors, and I can confirm that that's the +current default for Mac OS X --- any other comments? + + regards, tom lane + +From pgsql-advocacy-owner@postgresql.org Wed Feb 12 00:32:43 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E61B4475925 + for ; + Wed, 12 Feb 2003 00:32:38 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 2F9D0474E5C + for ; + Wed, 12 Feb 2003 00:32:34 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1C5Wdl33702 + for pgsql-advocacy@postgresql.org; Wed, 12 Feb 2003 13:32:39 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1C5WW733475; + Wed, 12 Feb 2003 13:32:32 +0800 (WST) +From: "Christopher Kings-Lynne" +To: "Tom Lane" , + "Peter Eisentraut" +Cc: "Merlin Moncure" , + "PostgresSQL Hackers Mailing List" , + +Subject: Re: [HACKERS] Changing the default configuration (was Re: +Date: Wed, 12 Feb 2003 13:32:41 +0800 +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) +In-Reply-To: <932.1045027651@sss.pgh.pa.us> +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +Importance: Normal +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/40 +X-Sequence-Number: 798 + +> >> We could retarget to try to stay under SHMMAX=4M, which I think is +> >> the next boundary that's significant in terms of real-world platforms +> >> (isn't that the default SHMMAX on some BSDen?). That would allow us +> >> 350 or so shared_buffers, which is better, but still not really a +> >> serious choice for production work. +> +> > What is a serious choice for production work? +> +> Well, as I commented later in that mail, I feel that 1000 buffers is +> a reasonable choice --- but I have to admit that I have no hard data +> to back up that feeling. Perhaps we should take this to the +> pgsql-perform list and argue about reasonable choices. + +Damn. Another list I have to subscribe to! + +The results I just posted indicate that 1000 buffers is really quite bad +performance comaped to 4000, perhaps up to 100 TPS for selects and 30 TPS +for TPC-B. + +Still, that 1000 is in itself vastly better than 64!! + +Chris + + + +From pgsql-advocacy-owner@postgresql.org Wed Feb 12 00:33:45 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 70FEF475D00 + for ; + Wed, 12 Feb 2003 00:33:44 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 007E0475CA6 + for ; + Wed, 12 Feb 2003 00:33:41 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1C5Xk433987 + for pgsql-advocacy@postgresql.org; Wed, 12 Feb 2003 13:33:46 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1C5Xg733762; + Wed, 12 Feb 2003 13:33:42 +0800 (WST) +From: "Christopher Kings-Lynne" +To: "Tom Lane" , + "Peter Eisentraut" +Cc: "Merlin Moncure" , + "PostgresSQL Hackers Mailing List" , + +Subject: Re: [HACKERS] Changing the default configuration (was Re: +Date: Wed, 12 Feb 2003 13:33:52 +0800 +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) +In-Reply-To: <932.1045027651@sss.pgh.pa.us> +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +Importance: Normal +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/41 +X-Sequence-Number: 799 + +> A separate line of investigation is "what is the lowest common +> denominator nowadays?" I think we've established that SHMMAX=1M +> is obsolete, but what replaces it as the next LCD? 4M seems to be +> correct for some BSD flavors, and I can confirm that that's the +> current default for Mac OS X --- any other comments? + +It's 1025 * 4k pages on FreeBSD = 4MB + +Chris + + +From pgsql-performance-owner@postgresql.org Wed Feb 12 00:52:24 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 8F74B474E5C + for ; + Wed, 12 Feb 2003 00:52:23 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP id C1B2B474E44 + for ; + Wed, 12 Feb 2003 00:52:21 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h1C5q8B09618; + Wed, 12 Feb 2003 00:52:08 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302120552.h1C5q8B09618@candle.pha.pa.us> +Subject: Re: how to configure my new server +In-Reply-To: <200302100935.14455.josh@agliodbs.com> +To: Josh Berkus +Date: Wed, 12 Feb 2003 00:52:08 -0500 (EST) +Cc: philip johnson , + 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 AMaViS new-20020517 +X-Archive-Number: 200302/52 +X-Sequence-Number: 1108 + +Josh Berkus wrote: +> > > how can I put indexes on a seperate disk ? +> +> Move the index object (use the oid2name package in /contrib to find the index) +> to a different location, and symlink it back to its original location. Make +> sure that you REINDEX at maintainence time, and don't drop and re-create the +> index, as that will have the effect of moving it back to the original +> location. + +I believe reindex will create a new file and hence remove the symlink, +at least in 7.3. + +-- + 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 Feb 12 01:21:23 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 03ADA475C15 + for ; + Wed, 12 Feb 2003 01:21:21 -0500 (EST) +Received: from www.pspl.co.in (www.pspl.co.in [202.54.11.65]) + by postgresql.org (Postfix) with ESMTP id DC884475BF9 + for ; + Wed, 12 Feb 2003 01:21:18 -0500 (EST) +Received: (from root@localhost) + by www.pspl.co.in (8.11.6/8.11.6) id h1C6LK126354 + for ; Wed, 12 Feb 2003 11:51:20 +0530 +Received: from daithan.intranet.pspl.co.in (daithan.intranet.pspl.co.in + [192.168.7.161]) + by www.pspl.co.in (8.11.6/8.11.0) with ESMTP id h1C6LKw26349 + for ; Wed, 12 Feb 2003 11:51:20 +0530 +From: "Shridhar Daithankar" + +To: PostgresSQL Hackers Mailing List +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] +Date: Wed, 12 Feb 2003 11:51:44 +0530 +User-Agent: KMail/1.5 +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <200302110918.48614.josh@agliodbs.com> + <26582.1044984365@sss.pgh.pa.us> +In-Reply-To: <26582.1044984365@sss.pgh.pa.us> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +Message-Id: <200302121151.44843.shridhar_daithankar@persistent.co.in> +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/464 +X-Sequence-Number: 35406 + +On Tuesday 11 Feb 2003 10:56 pm, you wrote: +> Josh Berkus writes: +> > What if we supplied several sample .conf files, and let the user choose +> > which to copy into the database directory? We could have a "high read +> > performance" profile, and a "transaction database" profile, and a +> > "workstation" profile, and a "low impact" profile. +> +> Uh ... do we have a basis for recommending any particular sets of +> parameters for these different scenarios? This could be a good idea +> in the abstract, but I'm not sure I know enough to fill in the details. + +Let's take very simple scenario to supply pre-configured postgresql.conf. + +Assume that SHMMAX=Total memory/2 and supply different config files for + +64MB/128Mb/256MB/512MB and above. + +Is it simple enough? + + Shridhar + +From pgsql-performance-owner@postgresql.org Wed Feb 12 06:52:08 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 5F317474E5C + for ; + Wed, 12 Feb 2003 06:52:07 -0500 (EST) +Received: from grunt23.ihug.com.au (grunt23.ihug.com.au [203.109.249.143]) + by postgresql.org (Postfix) with ESMTP id BB513474E44 + for ; + Wed, 12 Feb 2003 06:52:06 -0500 (EST) +Received: from p455-tnt1.mel.ihug.com.au (postgresql.org) [203.173.161.201] + by grunt23.ihug.com.au with esmtp (Exim 3.35 #1 (Debian)) + id 18ivQl-00079e-00; Wed, 12 Feb 2003 22:51:59 +1100 +Message-ID: <3E4A355C.1040109@postgresql.org> +Date: Wed, 12 Feb 2003 22:51:56 +1100 +From: Justin Clift +User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Bruce Momjian +Cc: Josh Berkus , + philip johnson , + pgsql-performance@postgresql.org +Subject: Re: how to configure my new server +References: <200302120552.h1C5q8B09618@candle.pha.pa.us> +In-Reply-To: <200302120552.h1C5q8B09618@candle.pha.pa.us> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/53 +X-Sequence-Number: 1109 + +Bruce Momjian wrote: +> Josh Berkus wrote: +> +>>>>how can I put indexes on a seperate disk ? +>> +>>Move the index object (use the oid2name package in /contrib to find the index) +>>to a different location, and symlink it back to its original location. Make +>>sure that you REINDEX at maintainence time, and don't drop and re-create the +>>index, as that will have the effect of moving it back to the original +>>location. +> +> I believe reindex will create a new file and hence remove the symlink, +> at least in 7.3. + +Yep, it's a complete pain. You can't stabily have indexes moved to +different drives, or even different partitions on the same drive (i.e. +fastest disk area), as they're recreated in the default data location at +index time. + +This was one of the things I was hoping would _somehow_ be solved with +namespaces, as in high transaction volume environments it would be nice +to have frequently used indexes [be practical] on separate drives from +the data. At present, that's not very workable. + +Regards and best wishes, + +Justin Clift + +-- +"My grandfather once told me that there are two kinds of people: those +who work and those who take the credit. He told me to try to be in the +first group; there was less competition there." + - Indira Gandhi + + +From pgsql-hackers-owner@postgresql.org Wed Feb 12 11:36:28 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 11211475A80 + for ; + Wed, 12 Feb 2003 11:36:28 -0500 (EST) +Received: from localhost.localdomain (unknown [65.217.53.66]) + by postgresql.org (Postfix) with ESMTP id 661FD475A45 + for ; + Wed, 12 Feb 2003 11:36:27 -0500 (EST) +Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) + by localhost.localdomain (8.12.5/8.12.5) with ESMTP id h1CH1d6P007642; + Wed, 12 Feb 2003 12:01:39 -0500 +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 h1CGaJj29503; + Wed, 12 Feb 2003 11:36:19 -0500 +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 CWVL1BQL; Wed, 12 Feb 2003 11:36:19 -0500 +Subject: Re: Changing the default configuration +From: Robert Treat +To: Tatsuo Ishii +Cc: scott.marlowe@ihs.com, pgsql-hackers@postgresql.org +In-Reply-To: <20030212.110000.97298009.t-ishii@sra.co.jp> +References: <20030212.101008.41630074.t-ishii@sra.co.jp> + + <20030212.110000.97298009.t-ishii@sra.co.jp> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +X-Mailer: Ximian Evolution 1.0.8 +Date: 12 Feb 2003 11:36:19 -0500 +Message-Id: <1045067779.12931.258.camel@camel> +Mime-Version: 1.0 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/493 +X-Sequence-Number: 35435 + +On Tue, 2003-02-11 at 21:00, Tatsuo Ishii wrote: +> > +> > while 200 may seem high, 32 definitely seems low. So, what IS a good +> > compromise? for this and ALL the other settings that should probably be a +> > bit higher. I'm guessing sort_mem or 4 or 8 meg hits the knee for most +> > folks, and the max fsm settings tom has suggested make sense. +> +> 32 is not too low if the kernel file descriptors is not +> increased. Beware that running out of the kernel file descriptors is a +> serious problem for the entire system, not only for PostgreSQL. +> + +Had this happen at a previous employer, and it definitely is bad. I +believe we had to do a reboot to clear it up. And we saw the problem a +couple of times since the sys admin wasn't able to deduce what had +happened the first time we got it. IIRC the problem hit somewhere around +150 connections, so we ran with 128 max. I think this is a safe number +on most servers these days (running linux as least) though out of the +box I might be more inclined to limit it to 64. If you do hit a file +descriptor problem, *you are hosed*. + +Robert Treat + + + +From pgsql-advocacy-owner@postgresql.org Wed Feb 12 11:39:37 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 5F0EA475B8A; Wed, 12 Feb 2003 11:39:36 -0500 (EST) +Received: from mail.libertyrms.com (unknown [209.167.124.227]) + by postgresql.org (Postfix) with ESMTP + id BB696475BA1; Wed, 12 Feb 2003 11:39:35 -0500 (EST) +Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 + (Debian)) + id 18izvB-0005cP-00; Wed, 12 Feb 2003 11:39:41 -0500 +Date: Wed, 12 Feb 2003 11:39:41 -0500 +From: Andrew Sullivan +To: PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: [HACKERS] Changing the default configuration (was Re: +Message-ID: <20030212113940.H13362@mail.libertyrms.com> +Mail-Followup-To: Andrew Sullivan , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> + <1044981773.25889.165.camel@mouse.copelandconsulting.net> + <006c01c2d22d$4028c450$0a00000a@grouch> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.2.5i +In-Reply-To: <006c01c2d22d$4028c450$0a00000a@grouch>; + from rick@alpinenetworking.com on Tue, Feb 11, 2003 at 05:25:29PM + -0700 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/50 +X-Sequence-Number: 808 + +On Tue, Feb 11, 2003 at 05:25:29PM -0700, Rick Gigger wrote: + +> The type of person who can't configure it or doesnt' think to try is +> probably not doing a project that requires any serious performance. + +I have piles of email, have fielded thousands of phone calls, and +have had many conversations which prove that claim false. People +think that computers are magic. That they don't think the machines +require a little bit of attention is nowise an indication that they +don't need the system to come with reasonable defaults. + +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 Wed Feb 12 11:43:26 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 9F92B475B8A + for ; + Wed, 12 Feb 2003 11:43:25 -0500 (EST) +Received: from CopelandConsulting.Net (dsl-24293-ld.customer.centurytel.net + [209.142.135.135]) + by postgresql.org (Postfix) with ESMTP id 84A2D474E44 + for ; + Wed, 12 Feb 2003 11:43:22 -0500 (EST) +Received: from [192.168.1.2] (mouse.copelandconsulting.net [192.168.1.2]) + by CopelandConsulting.Net (8.10.1/8.10.1) with ESMTP id h1CGh0730167; + Wed, 12 Feb 2003 10:43:00 -0600 (CST) +X-Trade-Id: +To: Robert Treat +Cc: Tatsuo Ishii , scott.marlowe@ihs.com, + PostgresSQL Hackers Mailing List +In-Reply-To: <1045067779.12931.258.camel@camel> +References: <20030212.101008.41630074.t-ishii@sra.co.jp> + + <20030212.110000.97298009.t-ishii@sra.co.jp> + <1045067779.12931.258.camel@camel> +Content-Type: text/plain +Organization: Copeland Computer Consulting +Message-Id: <1045068185.2518.244.camel@mouse.copelandconsulting.net> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.0 +Date: 12 Feb 2003 10:43:05 -0600 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/497 +X-Sequence-Number: 35439 + +On Wed, 2003-02-12 at 10:36, Robert Treat wrote: +> On Tue, 2003-02-11 at 21:00, Tatsuo Ishii wrote: +> > > +> > > while 200 may seem high, 32 definitely seems low. So, what IS a good +> > > compromise? for this and ALL the other settings that should probably be a +> > > bit higher. I'm guessing sort_mem or 4 or 8 meg hits the knee for most +> > > folks, and the max fsm settings tom has suggested make sense. +> > +> > 32 is not too low if the kernel file descriptors is not +> > increased. Beware that running out of the kernel file descriptors is a +> > serious problem for the entire system, not only for PostgreSQL. +> > +> +> Had this happen at a previous employer, and it definitely is bad. I +> believe we had to do a reboot to clear it up. And we saw the problem a +> couple of times since the sys admin wasn't able to deduce what had +> happened the first time we got it. IIRC the problem hit somewhere around +> 150 connections, so we ran with 128 max. I think this is a safe number +> on most servers these days (running linux as least) though out of the +> box I might be more inclined to limit it to 64. If you do hit a file +> descriptor problem, *you are hosed*. +> + +That does seem like a more reasonable upper limit. I would rather see +people have to knowingly increase the limit rather than bump into system +upper limits and start scratching their heads trying to figure out what +the heck is going on. + + +-- +Greg Copeland +Copeland Computer Consulting + + +From pgsql-advocacy-owner@postgresql.org Wed Feb 12 11:42:44 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 5548D475A80; Wed, 12 Feb 2003 11:42:41 -0500 (EST) +Received: from jester.inquent.com (unknown [216.208.117.7]) + by postgresql.org (Postfix) with ESMTP + id 9C83E475A45; Wed, 12 Feb 2003 11:42:40 -0500 (EST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by jester.inquent.com (8.12.6/8.12.6) with ESMTP id h1CGhFEi081374; + Wed, 12 Feb 2003 11:43:15 -0500 (EST) (envelope-from rbt@rbt.ca) +Subject: Re: [HACKERS] Changing the default configuration (was Re: +From: Rod Taylor +To: Andrew Sullivan +Cc: PostgresSQL Hackers Mailing List , + Postgresql Advocacy +In-Reply-To: <20030212113940.H13362@mail.libertyrms.com> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> + <1044981773.25889.165.camel@mouse.copelandconsulting.net> + <006c01c2d22d$4028c450$0a00000a@grouch> + <20030212113940.H13362@mail.libertyrms.com> +Content-Type: multipart/signed; micalg=pgp-sha1; + protocol="application/pgp-signature"; + boundary="=-Uu+/fHfmYKXPrUZwyvdU" +Organization: +Message-Id: <1045068194.80901.22.camel@jester> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.1 +Date: 12 Feb 2003 11:43:15 -0500 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/51 +X-Sequence-Number: 809 + +--=-Uu+/fHfmYKXPrUZwyvdU +Content-Type: text/plain +Content-Transfer-Encoding: quoted-printable + +On Wed, 2003-02-12 at 11:39, Andrew Sullivan wrote: +> On Tue, Feb 11, 2003 at 05:25:29PM -0700, Rick Gigger wrote: +>=20 +> > The type of person who can't configure it or doesnt' think to try is +> > probably not doing a project that requires any serious performance. +>=20 +> I have piles of email, have fielded thousands of phone calls, and +> have had many conversations which prove that claim false. People + +But IBM told me computers are self healing, so if there is a performance +problem should it just fix itself? + +--=20 +Rod Taylor + +PGP Key: http://www.rbt.ca/rbtpub.asc + +--=-Uu+/fHfmYKXPrUZwyvdU +Content-Type: application/pgp-signature; name=signature.asc +Content-Description: This is a digitally signed message part + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.2.1 (FreeBSD) + +iD8DBQA+Snmi6DETLow6vwwRAizeAJ9+7hSF2VwR/G8jGITyJh0i808MjACfc4V1 +IqzUQxIxZUzPLmdTHKFkDnY= +=oVmN +-----END PGP SIGNATURE----- + +--=-Uu+/fHfmYKXPrUZwyvdU-- + + +From pgsql-hackers-owner@postgresql.org Wed Feb 12 11:48:54 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id DFB7C475B8A + for ; + Wed, 12 Feb 2003 11:48:53 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 3013D475AFA + for ; + Wed, 12 Feb 2003 11:48:53 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1CGmw5u005062; + Wed, 12 Feb 2003 11:48:58 -0500 (EST) +To: Robert Treat +Cc: Tatsuo Ishii , scott.marlowe@ihs.com, + pgsql-hackers@postgresql.org +Subject: Re: Changing the default configuration +In-reply-to: <1045067779.12931.258.camel@camel> +References: <20030212.101008.41630074.t-ishii@sra.co.jp> + + <20030212.110000.97298009.t-ishii@sra.co.jp> + <1045067779.12931.258.camel@camel> +Comments: In-reply-to Robert Treat + message dated "12 Feb 2003 11:36:19 -0500" +Date: Wed, 12 Feb 2003 11:48:57 -0500 +Message-ID: <5061.1045068537@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/499 +X-Sequence-Number: 35441 + +Robert Treat writes: +> Had this happen at a previous employer, and it definitely is bad. I +> believe we had to do a reboot to clear it up. And we saw the problem a +> couple of times since the sys admin wasn't able to deduce what had +> happened the first time we got it. IIRC the problem hit somewhere around +> 150 connections, so we ran with 128 max. I think this is a safe number +> on most servers these days (running linux as least) though out of the +> box I might be more inclined to limit it to 64. If you do hit a file +> descriptor problem, *you are hosed*. + +If you want to run lots of connections, it's a real good idea to set +max_files_per_process to positively ensure Postgres won't overflow +your kernel file table, ie, max_connections * max_files_per_process +should be less than the file table size. + +Before about 7.2, we didn't have max_files_per_process, and would +naively believe whatever sysconf() told us was an okay number of files +to open. Unfortunately, way too many kernels promise more than they +can deliver ... + + regards, tom lane + +From pgsql-hackers-owner@postgresql.org Wed Feb 12 13:37:21 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id F2151475D20 + for ; + Wed, 12 Feb 2003 13:37:20 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id 731EC475E6F + for ; + Wed, 12 Feb 2003 13:36:52 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h1CIZ0wQ014417; + Wed, 12 Feb 2003 11:35:00 -0700 (MST) +Date: Wed, 12 Feb 2003 11:26:49 -0700 (MST) +From: "scott.marlowe" +To: Tom Lane +Cc: Greg Copeland , + PostgresSQL Hackers Mailing List +Subject: Re: Changing the default configuration (was Re: +In-Reply-To: <495.1045023866@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 AMaViS new-20020517 +X-Archive-Number: 200302/507 +X-Sequence-Number: 35449 + +On Tue, 11 Feb 2003, Tom Lane wrote: + +> "scott.marlowe" writes: +> > ... If he starts running out of semaphores, that's a +> > problem he can address while his database is still up and running in most +> > operating systems, at least in the ones I use. +> +> Back in the day, this took a kernel rebuild and system reboot to fix. +> If this has changed, great ... but on exactly which Unixen can you +> alter SEMMAX on the fly? + +Tom, now you're making me all misty eyed for 14" platter 10 Meg hard +drives and paper tape readers. :-) + +Seriously, I know Linux can change these on the fly, and I'm pretty sure +Solaris can too. I haven't played with BSD for a while so can't speak +about that. Anyone else know? + +> > So, my main point is that any setting that requires you to shut down +> > postgresql to make the change, we should pick a compromise value that +> > means you never likely will have to shut down the database once you've +> > started it up and it's under load. +> +> When I started using Postgres, it did not allocate the max number of +> semas it might need at startup, but was instead prone to fail when you +> tried to open the 17th or 33rd or so connection. It was universally +> agreed to be an improvement to refuse to start at all if we could not +> meet the specified max_connections setting. I don't want to backtrack +> from that. If we can up the default max_connections setting, great ... +> but let's not increase the odds of failing under load. + +I don't want to backtrack either, and I prefer that we now grab the +semaphores we need at startup. + +Note that on a stock RH 72 box, the max number of +backends you can startup before you exhaust semphores is 2047 backends, +more than I'd ever want to try and run on normal PC hardware. So, on a +linux box 150 to 200 max backends comes no where near exhausting +semaphores. + +I imagine that any "joe average" who doesn't really understand sysadmin +duties that well and is trying for the first time to install Postgresql +WILL be doing so on one of three general platforms, Linux, BSD, or +Windows. As long as the initial settings use only 10% or so of the file +handle and / or semaphore resources on each of those systems, we're +probably safe. + +64 or 128 seems like a nice power of two number that is likely to keep us +safe on inital installs while forestalling problems with too many +connections. + +Just for score, here's the default max output of rh72's kernel config: + +kernel.sem = 250 32000 32 128 +fs.file-max = 8192 + +Note that while older kernels needed to have max inodes bumped up as well, +nowadays that doesn't seem to be a problem, or they just set it really +high and I can't hit the ceiling on my workstation without swap storms. + +the definitions of the kernel.sem line are: + +kernel.sem: max_sem_per_id max_sem_total max_ops_sem_call max_sem_ids + +I'll try to get FreeBSD running today and see what research I can find on +it, but 5.0 is likely to be a whole new beast for me, so if someone can +tell us what the maxes are by default on different BSDs and what the +settings are in postgresql that can exhaust them that gets us closer. + +Like I've said before, anyone running HPUX, Irix, Solaris, or any other +"Industrial Strength Unix" should already know to increase all these +things and likely had to long before Postgresql showed up on their box, so +a setting that keeps pgsql from coming up won't be likely, and if it +happens, they'll most likely know how to handle it. + +BSD and Linux users are more likely to contain the group of folks who +don't know all this and don't ever want to (not that all BSD/Linux users +are like that, just that the sub group mostly exists on those platforms, +and windows as well.) So the default settings really probably should be +determined, for the most part, by the needs of those users. + + +From pgsql-hackers-owner@postgresql.org Wed Feb 12 13:39:36 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 260E4474E44 + for ; + Wed, 12 Feb 2003 13:39:35 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id 1E593475AE5 + for ; + Wed, 12 Feb 2003 13:39:33 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h1CIcNwQ014673 + for ; + Wed, 12 Feb 2003 11:38:23 -0700 (MST) +Date: Wed, 12 Feb 2003 11:30:13 -0700 (MST) +From: "scott.marlowe" +To: +Subject: Re: Changing the default configuration +In-Reply-To: <1045067779.12931.258.camel@camel> +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 AMaViS new-20020517 +X-Archive-Number: 200302/508 +X-Sequence-Number: 35450 + +Oh, another setting that should be a "default" for most users is to initdb +automatically with locale of C. If they need a different locale, they +should have to pick it. + +The performance of Postgresql with a locale other than C when doing like +and such is a serious ding. I'd much rather have the user experience the +faster searches first, then get to test with other locales and see if +performance is good enough, than to start out slow and wonder why they +need to change their initdb settings to get decent performance on a where +clause with like in it. + + +From pgsql-advocacy-owner@postgresql.org Wed Feb 12 18:42:30 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B7ED8475C2B + for ; + Wed, 12 Feb 2003 18:42:28 -0500 (EST) +Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) + by postgresql.org (Postfix) with SMTP id 955D2475C14 + for ; + Wed, 12 Feb 2003 18:42:27 -0500 (EST) +Received: (qmail 18608 invoked by uid 0); 12 Feb 2003 23:42:28 -0000 +Received: from p3E990AE7.dip0.t-ipconnect.de (62.153.10.231) + by mail.gmx.net (mp016-rz3) with SMTP; 12 Feb 2003 23:42:28 -0000 +Date: Thu, 13 Feb 2003 00:52:25 +0100 (CET) +From: Peter Eisentraut +X-X-Sender: peter@peter.localdomain +To: Tom Lane +Cc: Merlin Moncure , + PostgresSQL Hackers Mailing List , + +Subject: Re: [HACKERS] Changing the default configuration (was Re: +In-Reply-To: <932.1045027651@sss.pgh.pa.us> +Message-ID: +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/52 +X-Sequence-Number: 810 + +Tom Lane writes: + +> Well, as I commented later in that mail, I feel that 1000 buffers is +> a reasonable choice --- but I have to admit that I have no hard data +> to back up that feeling. + +I know you like it in that range, and 4 or 8 MB of buffers by default +should not be a problem. But personally I think if the optimal buffer +size does not depend on both the physical RAM you want to dedicate to +PostgreSQL and the nature and size of the database, then we have achieved +a medium revolution in computer science. ;-) + +-- +Peter Eisentraut peter_e@gmx.net + + +From pgsql-hackers-owner@postgresql.org Wed Feb 12 20:43:15 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 99096474E44 + for ; + Wed, 12 Feb 2003 20:43:14 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 68767474E42 + for ; + Wed, 12 Feb 2003 20:43:12 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1D1hFV60306 + for pgsql-hackers@postgresql.org; Thu, 13 Feb 2003 09:43:15 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1D1h9760126; + Thu, 13 Feb 2003 09:43:09 +0800 (WST) +From: "Christopher Kings-Lynne" +To: "Robert Treat" , + "Tatsuo Ishii" +Cc: , +Subject: Re: Changing the default configuration +Date: Thu, 13 Feb 2003 09:43:23 +0800 +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) +In-Reply-To: <1045067779.12931.258.camel@camel> +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +Importance: Normal +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/519 +X-Sequence-Number: 35461 + +> Had this happen at a previous employer, and it definitely is bad. I +> believe we had to do a reboot to clear it up. And we saw the problem a +> couple of times since the sys admin wasn't able to deduce what had +> happened the first time we got it. IIRC the problem hit somewhere around +> 150 connections, so we ran with 128 max. I think this is a safe number +> on most servers these days (running linux as least) though out of the +> box I might be more inclined to limit it to 64. If you do hit a file +> descriptor problem, *you are hosed*. + +Just yesterday I managed to hose my new Postgres installation during a +particular benchmarking run. Postgres did restart itself nicely though. I +have no idea why that particular run caused problems when all other runs +with identical settings didn't. I checked the log and saw file descriptor +probs. I was doing 128 connections with 128 max connetions. This was the +log: + +> 2003-02-12 04:16:15 LOG: PGSTAT: cannot open temp stats file +> /usr/local/pgsql/data/global/pgstat.tmp.41388: Too many open files in +> system +> 2003-02-12 04:16:15 LOG: PGSTAT: cannot open temp stats file +> /usr/local/pgsql/data/global/pgstat.tmp.41388: Too many open files in +> system +> 2003-02-12 04:16:39 PANIC: could not open transaction-commit log +> directory +> (/usr/local/pgsql/data/pg_clog): Too many open files in system +> 2003-02-12 04:16:39 LOG: statement: SET autocommit TO 'on';VACUUM +> ANALYZE +> 2003-02-12 04:16:39 LOG: PGSTAT: cannot open temp stats file +> /usr/local/pgsql/data/global/pgstat.tmp.41388: Too many open files in +> system + +This was the MIB: + +> kern.maxfiles: 1064 +> kern.maxfilesperproc: 957 + +This was the solution: + +> sysctl -w kern.maxfiles=65536 +> sysctl -w kern.maxfilesperproc=8192 +> +> .. and then stick +> +> kern.maxfiles=65536 +> kern.maxfilesperproc=8192 +> +> in /etc/sysctl.conf so its set during a reboot. + +Which just goes to highlight the importance of rigorously testing a +production installation... + +Chris + + + + + +From pgsql-hackers-owner@postgresql.org Wed Feb 12 20:47:19 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id BD515474E44 + for ; + Wed, 12 Feb 2003 20:47:18 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 0EDD6474E42 + for ; + Wed, 12 Feb 2003 20:47:17 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1D1lJb60805 + for pgsql-hackers@postgresql.org; Thu, 13 Feb 2003 09:47:19 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1D1lE760625; + Thu, 13 Feb 2003 09:47:14 +0800 (WST) +From: "Christopher Kings-Lynne" +To: "scott.marlowe" , + "Tom Lane" +Cc: "Greg Copeland" , + "PostgresSQL Hackers Mailing List" +Subject: Re: Changing the default configuration (was Re: +Date: Thu, 13 Feb 2003 09:47:28 +0800 +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.2600.0000 +Importance: Normal +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/521 +X-Sequence-Number: 35463 + +> Seriously, I know Linux can change these on the fly, and I'm pretty sure +> Solaris can too. I haven't played with BSD for a while so can't speak +> about that. Anyone else know? + +You cannot change SHMMAX on the fly on FreeBSD. + +Chris + + +From pgsql-hackers-owner@postgresql.org Wed Feb 12 20:52:29 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id EA7C0475C8B + for ; + Wed, 12 Feb 2003 20:52:27 -0500 (EST) +Received: from lerami.lerctr.org (lerami.lerctr.org [207.158.72.11]) + by postgresql.org (Postfix) with ESMTP id ECAEF475458 + for ; + Wed, 12 Feb 2003 20:52:07 -0500 (EST) +Received: from lerlaptop.lerctr.org (lerlaptop.lerctr.org [207.158.72.14]) + (authenticated bits=0) + by lerami.lerctr.org (8.12.7/8.12.7/20030207) with ESMTP id + h1D1pcxE016717; Wed, 12 Feb 2003 19:51:39 -0600 (CST) +Date: Wed, 12 Feb 2003 19:51:38 -0600 +From: Larry Rosenman +To: Christopher Kings-Lynne , + "scott.marlowe" , Tom Lane +Cc: Greg Copeland , + PostgresSQL Hackers Mailing List +Subject: Re: Changing the default configuration (was Re: +Message-ID: <58760000.1045101098@lerlaptop.lerctr.org> +In-Reply-To: +References: +X-Mailer: Mulberry/3.0.1 (Linux/x86) +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +X-Virus-Scanned: by amavisd-milter (http://amavis.org/) +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/522 +X-Sequence-Number: 35464 + + + +--On Thursday, February 13, 2003 09:47:28 +0800 Christopher Kings-Lynne + wrote: + +>> Seriously, I know Linux can change these on the fly, and I'm pretty sure +>> Solaris can too. I haven't played with BSD for a while so can't speak +>> about that. Anyone else know? +> +> You cannot change SHMMAX on the fly on FreeBSD. +Yes you can, on recent 4-STABLE: + +Password: +lerlaptop# sysctl kern.ipc.shmmax=66000000 +kern.ipc.shmmax: 33554432 -> 66000000 +lerlaptop#uname -a +FreeBSD lerlaptop.lerctr.org 4.7-STABLE FreeBSD 4.7-STABLE #38: Mon Feb 3 +21:51:25 CST 2003 +ler@lerlaptop.lerctr.org:/usr/obj/usr/src/sys/LERLAPTOP i386 +lerlaptop# + +> +> Chris +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 4: Don't 'kill -9' the postmaster +> + + + +-- +Larry Rosenman http://www.lerctr.org/~ler +Phone: +1 972-414-9812 E-Mail: ler@lerctr.org +US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749 + + + + +From pgsql-hackers-owner@postgresql.org Wed Feb 12 21:37:12 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 07442474E44 + for ; + Wed, 12 Feb 2003 21:37:12 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP id AC8B6474E42 + for ; + Wed, 12 Feb 2003 21:37:09 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h1D2ajh17527; + Wed, 12 Feb 2003 21:36:45 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302130236.h1D2ajh17527@candle.pha.pa.us> +Subject: Re: Changing the default configuration (was Re: +In-Reply-To: +To: Christopher Kings-Lynne +Date: Wed, 12 Feb 2003 21:36:45 -0500 (EST) +Cc: "scott.marlowe" , Tom Lane , + Greg Copeland , + PostgresSQL Hackers Mailing List +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 AMaViS new-20020517 +X-Archive-Number: 200302/528 +X-Sequence-Number: 35470 + +Christopher Kings-Lynne wrote: +> > Seriously, I know Linux can change these on the fly, and I'm pretty sure +> > Solaris can too. I haven't played with BSD for a while so can't speak +> > about that. Anyone else know? +> +> You cannot change SHMMAX on the fly on FreeBSD. + +And part of the reason is because some/most BSD's map the page tables +into physical RAM (kernel space) rather than use some shared page table +mechanism. This is good because it prevents the shared memory from +being swapped out (performance disaster). + +It doesn't actually allocate RAM unless someone needs it, but it does +lock the shared memory into a specific fixed location for all processes. + +The more flexible approach is to make shared memory act just like the +memory of a user process, and have other user processes share those page +tables, but that adds extra overhead and can cause the memory to behave +just like user memory (swapable). + +-- + 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-advocacy-owner@postgresql.org Wed Feb 12 22:08:29 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 2A8544758C9 + for ; + Wed, 12 Feb 2003 22:08:26 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id A4283474E42 + for ; + Wed, 12 Feb 2003 22:08:24 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1D38Q5u009701; + Wed, 12 Feb 2003 22:08:26 -0500 (EST) +To: Peter Eisentraut +Cc: Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: [HACKERS] Changing the default configuration (was Re: +In-reply-to: +References: +Comments: In-reply-to Peter Eisentraut + message dated "Thu, 13 Feb 2003 00:52:25 +0100" +Date: Wed, 12 Feb 2003 22:08:26 -0500 +Message-ID: <9700.1045105706@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/53 +X-Sequence-Number: 811 + +Peter Eisentraut writes: +> I know you like it in that range, and 4 or 8 MB of buffers by default +> should not be a problem. But personally I think if the optimal buffer +> size does not depend on both the physical RAM you want to dedicate to +> PostgreSQL and the nature and size of the database, then we have achieved +> a medium revolution in computer science. ;-) + +But this is not about "optimal" settings. This is about "pretty good" +settings. As long as we can get past the knee of the performance curve, +I think we've done what should be expected of a default parameter set. + +I believe that 1000 buffers is enough to get past the knee in most +scenarios. Again, I haven't got hard evidence, but that's my best +guess. + + regards, tom lane + +From pgsql-hackers-owner@postgresql.org Wed Feb 12 22:18:47 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 65FBA474E44 + for ; + Wed, 12 Feb 2003 22:18:45 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id AB7F3474E42 + for ; + Wed, 12 Feb 2003 22:18:44 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1D3IZ5u009793; + Wed, 12 Feb 2003 22:18:35 -0500 (EST) +To: Bruce Momjian +Cc: Christopher Kings-Lynne , + "scott.marlowe" , + Greg Copeland , + PostgresSQL Hackers Mailing List +Subject: Re: Changing the default configuration (was Re: +In-reply-to: <200302130236.h1D2ajh17527@candle.pha.pa.us> +References: <200302130236.h1D2ajh17527@candle.pha.pa.us> +Comments: In-reply-to Bruce Momjian + message dated "Wed, 12 Feb 2003 21:36:45 -0500" +Date: Wed, 12 Feb 2003 22:18:35 -0500 +Message-ID: <9792.1045106315@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/535 +X-Sequence-Number: 35477 + +>> You cannot change SHMMAX on the fly on FreeBSD. + +I think we suffered some topic drift here --- wasn't the last question +about whether SEMMAX can be increased on-the-fly? That wouldn't have +anything to do with memory-mapping strategies... + + regards, tom lane + +From pgsql-hackers-owner@postgresql.org Thu Feb 13 04:53:04 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id C3999475AFA + for ; + Thu, 13 Feb 2003 04:53:03 -0500 (EST) +Received: from platonic.cynic.net (platonic.cynic.net [204.80.150.245]) + by postgresql.org (Postfix) with ESMTP id 19D76475AE5 + for ; + Thu, 13 Feb 2003 04:53:03 -0500 (EST) +Received: from angelic.cynic.net (angelic-platonic.cvpn.cynic.net + [198.73.220.226]) by platonic.cynic.net (Postfix) with ESMTP + id 0493DC009; Thu, 13 Feb 2003 09:52:59 +0000 (UTC) +Received: from localhost (localhost [127.0.0.1]) + by angelic.cynic.net (Postfix) with ESMTP + id 8DDA18744; Thu, 13 Feb 2003 13:32:15 +0900 (JST) +Date: Thu, 13 Feb 2003 13:32:15 +0900 (JST) +From: Curt Sampson +To: Bruce Momjian +Cc: Christopher Kings-Lynne , + "scott.marlowe" , Tom Lane , + Greg Copeland , + PostgresSQL Hackers Mailing List +Subject: Re: Changing the default configuration (was Re: +In-Reply-To: <200302130236.h1D2ajh17527@candle.pha.pa.us> +Message-ID: +References: <200302130236.h1D2ajh17527@candle.pha.pa.us> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/568 +X-Sequence-Number: 35510 + +On Wed, 12 Feb 2003, Bruce Momjian wrote: + +> Christopher Kings-Lynne wrote: +> +> > You cannot change SHMMAX on the fly on FreeBSD. +> +> And part of the reason is because some/most BSD's map the page tables +> into physical RAM (kernel space) rather than use some shared page table +> mechanism. This is good because it prevents the shared memory from +> being swapped out (performance disaster). + +Not at all! In all the BSDs, as far as I'm aware, SysV shared memory is +just normal mmap'd memory. + +FreeBSD offers a sysctl that lets you mlock() that memory, and that is +helpful only because postgres insists on taking data blocks that are +already in memory, fully sharable amongst all back ends and ready to be +used, and making a copy of that data to be shared amongst all back ends. + +> It doesn't actually allocate RAM unless someone needs it, but it does +> lock the shared memory into a specific fixed location for all processes. + +I don't believe that the shared memory is not locked to a specific VM +address for every process. There's certainly no reason it needs to be. + +cjs +-- +Curt Sampson +81 90 7737 2974 http://www.netbsd.org + Don't you know, in this new Dark Age, we're all light. --XTC + +From pgsql-hackers-owner@postgresql.org Thu Feb 13 00:15:03 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id DCA99475A45 + for ; + Thu, 13 Feb 2003 00:15:02 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 342E04759BD + for ; + Thu, 13 Feb 2003 00:15:02 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1D5F25u010629; + Thu, 13 Feb 2003 00:15:02 -0500 (EST) +To: "scott.marlowe" +Cc: Greg Copeland , + PostgresSQL Hackers Mailing List +Subject: Re: Changing the default configuration (was Re: +In-reply-to: +References: +Comments: In-reply-to "scott.marlowe" + message dated "Wed, 12 Feb 2003 11:26:49 -0700" +Date: Thu, 13 Feb 2003 00:15:02 -0500 +Message-ID: <10628.1045113302@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/552 +X-Sequence-Number: 35494 + +"scott.marlowe" writes: +> Tom, now you're making me all misty eyed for 14" platter 10 Meg hard +> drives and paper tape readers. :-) + + Och, we used to *dream* of 10 meg drives... + + regards, tom lane + +From pgsql-advocacy-owner@postgresql.org Thu Feb 13 00:16:19 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E000E4759BD + for ; + Thu, 13 Feb 2003 00:16:15 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id BAC3C474E5C + for ; + Thu, 13 Feb 2003 00:16:02 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1D5G6872554 + for pgsql-advocacy@postgresql.org; Thu, 13 Feb 2003 13:16:06 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1D5G2772420; + Thu, 13 Feb 2003 13:16:02 +0800 (WST) +From: "Christopher Kings-Lynne" +To: "Hackers" , + , + "Advocacy" +Subject: More benchmarking of wal_buffers +Date: Thu, 13 Feb 2003 13:16:16 +0800 +Message-ID: +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_NextPart_000_00A0_01C2D362.16CA7D20" +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.2600.0000 +Importance: Normal +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/54 +X-Sequence-Number: 812 + +This is a multi-part message in MIME format. + +------=_NextPart_000_00A0_01C2D362.16CA7D20 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: 7bit + +Hi Everyone, + +I've just spent the last day and a half trying to benchmark our new database +installation to find a good value for wal_buffers. The quick answer - there +isn't, just leave it on the default of 8. + +The numbers just swing up and down so much it's impossible to say that one +setting is better than another. I've attached an openoffice doc with my old +shared_buffers tests plus the wal_buffers tests. The wal results are a bit +deceptive as the results I've included are really what I consider the +'average' results. Just occasionally, I'd get a spike that I could never +repeat... + +Even if you look at the attached charts and you think that 128 buffers are +better than 8, think again - there's nothing in it. Next time I run that +benchmark it could be the same, lower or higher. And the difference between +the worst and best results is less than 3 TPS - ie. nothing. + +One proof that has come out of this is that wal_buffers does not affect +SELECT only performance in any way. So, for websites where the +select/update ratio is very high, wal_buffers is almost an irrelevant +optimisation. + +Even massively heavy sites where you are getting write transactions +continuously by 64 simultaneous people, I was unable to prove that any +setting other than the default helped. In this situation, probably the +commit_delay and commit_siblings variables will give you the best gains. + +I'm not sure what I could test next. Does FreeBSD support anything other +than fsync? eg. fdatasync, etc. I can't see it in the man pages... + +Chris + +ps. I don't think the attachments are too large, but if they annoy anyone, +tell me. Also, I've cross posted to make sure people who read my previous +benchmark, see this one also. + +------=_NextPart_000_00A0_01C2D362.16CA7D20 +Content-Type: application/vnd.sun.xml.calc; name="PostgreSQL Benchmarking.sxc" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="PostgreSQL Benchmarking.sxc" + +UEsDBBQACAAIALYoTS4AAAAAAAAAAAAAAAALAAAAY29udGVudC54bWztXW1z +47YR/t5fwTIzmWTmRBLgC0THcmqf5LNTO3dzvkvb6XQ6tERZzEmkhqLsc359 +saResNYLRdqrWGn8wfYCIBbYxT5YLBfS8Y9fR0PtPkwnURK3dGZYuhbG3aQX +xXct/fOn80ZT//HkL8d/bb9/++lfHzpa0u9H3fCol3SnozDOGt0kzuRf7cPn +s6vLt5reMM334zB+nzczkvTONNuf2lpBt2dPaZKPaXZ+1jW96M/oZT395HhT +53KM8eSoqG3pgywbH5lmItkkSzbcsiyzoPXZA5Pscbi9fd5i3jwLv2ZbW0OD +RePgtqTvvMW8eS8NHra2hgZS5vP2/WTR+uHhwXiw85bM933znzdX5nmSjoLF +WL4Oo/jLxvZ57bxpPB3dhun2kQRZgOQyub9b13khwPvFkLuDIN0uv7zFUiJ2 +r0Qidm/eWE52sGGCTfNaVua/rq+W4ktHWzuHBov5ddNovH3kRRN9vvq7w2Ay +aemTcRoGvckgDJdVyJQWK7p43lzQfbmwG72wO5ycHOeyXpZoBR0HI7m8TtMo +GGqf40haZKhd3+haPyma9oNRNHxs6d8G42Tyw9N2RamuKX2Po6wrZXgfyKaw +MM3tnC/eaddR3B0k2lV0N8i0nzaxXmn4fN6nw9sgflxlOC9Xni2qGndhHKZR +V6rkIZpMyniba7QwKwqmWSIXW9Rt5F0s1JP/RoPsJmzBZza+3OIlaA2no1if +PzlO5YJKsyicwHxu5Yr50rgN5fqTfQC3eSfFY42HqAdL3TZc3+2O8tEqI9g2 +HE44HG54brPacGzS4XBPVBlOuklZafKw+1h2ZpcF69nNC0cSYMO0MQ7uwkbx +RDvsB9Nhtm4s+ZNHvWgyHgbQUToNV0dS4PqRxO6wsTqen23xdDyA8o0ZzM8e +Xq79JO3BJpGzUvp+nLecbazDRG5Y5qIBbI8n5rGpkvO6kTS1Qf3HH8MghTmv +THPLCgw32Wc4HM5rxkEKfkZOlGtijkcPISBdS79Nhr0KJhFustDdBjRrsVRc +Y6lccxvbTZb4TLaWCqWruDmruE16jyfHxRrOf8/Wc9HJDeydUk9Fmdo9mBB6 +boYca5rmSDyzkmLQ+dzWzsbcuU9O0Kc977NYx7Omk0YajkO5pKU/JOpylUC2 +hiXg3pPRyf5kiTSuo/HJ6TQbJOnRsTmjj801TTc9/HaQRpMsGQ/CVPu7dF0n +javHOA4rdVYuDvNJP3KeLzDxziiIhjXnXfwNtNyvPhqkYb+lQ3dZIl1gKZIv +w78VhjYIg2E2MLrJyAim+smWytlAgpODEF5bdl9Tdoxr5+GtJn1q+yCmeiUh +LJ7Une2H6e0w6mptiYxRfBDz/ZQkdc3iw91tKI8Bb7RJN5Ao3w+6WZJq7CCm +fR10B1FcV83c9a7PtI+n12+08zQMz27ammOIN1rnst3RLtrtN9q3d9kPGtPe +DX47CHF8+vC2caZ1k7gf3dWUybhYDVqjq3mO1sg0ZlmzshcVAV/ZfdVRfPdz +IqFKS+LhIwxjOpGHc03uV+H3LzoIh0gPN52rzttPz1NE8XdiqhphvDlTida4 +0X43tfSnsiMYy6vUC+5ctsPzqz4a/2VXyToHM8wbzhbPxenHTvu/Z5/Pzzsf +b+rIFXfN9Sf48E0tbC/rlFN0WsvZ2CjZ01/e1bPFmT1XFNzK49VEtPL4foVB +vuBnxffBcBo2ssexLO4PEwiOKxUtnUm0s5bDzsnnC8Lelb1nGYrQgNovc46Y +1zKyUi7cEAoXSb3EQpsVQ7x+Ogxaeuv0l87H03ed7/5tnDF+ZLQZ/8/3OwtC +1UEtDZQLwUeyBpKEj+sjaQNJw8c1fJWPJInVeg5qvaikVqdpcG/xo8oFarYL +5tUAlIUBytovQAnFNMQ+wUko5iJobMVDpuLtAZhsACa7wgr2kZX59Yys3E48 +o6kahyRJ+Ph4K/Br7gWlfAQ3XIUPkOTgZAM4VVGtsAxvPThBzWGAk4+wyd8v +NLme4SyZA7VX30n1nChWsesYnjI9SZHDkwPw5Oy+hl1l1bpEfoavKjknaSDQ +Rf4ZkDTQ5CFEB5IcmhyApgpq9eRRQMVPIA8CjpoIjpp7hiNb1SxQ+2XOEXOS +1StBiCFIegGHsASSXIAktwIk2YawlR8kFFErxrHLTm7j7ZuGj/T/kFn69dya +Uj5NgTAXSHKMcgGjKujZEy5StCp/t0zRrwWvBMIrsefQk+ry1/L36zLGy6vm +6toPl0pY5QFWeVXWsOrhAUUjCORw0JwgfRedIIGk4CMYClnmJDk0eQBNVdTq +u0gUBwFFHoIib99BJnX1ALVPOHLR7u1Sbd4Ijl7ksFoCRwLgSFSCo+Z61ymv +IbFnCx1yc5KEj83RCgOSho+lHgJykhyfBOBTBT0Lzg2xNvKU1xxG5MlFeOXW +xKtyKFeRnCbwgHDBIXKGLORpWHuIJTUBfZpVXtao4VD8sqYsHFpXKgJFXUl4 +CEfBUUmQ8HDVU4T7Ajt3CeI0AXEq6FZw21i/sxQ1B4E4DkIchwhxXEd9RQIU +CRdXjSQARcIFvYZx6d/CnDEfUMevEC5yDL4hXAQ1NGcYD3u7RG/bhNtEvgiQ +NHyEumRzkhyBfECgCnoWjtxZ1/s8UHMYPo+NEMgmQiAHBU4covCMayGcs4hw +Drn9bk2vvwoCcUsiELcqIBAKHrtEsWPh4CO2U/OMXe4w2+g0DSTNQauJAkFA +UoMOqPaiimoFl9Cywe2BmoMAHY5Ah1OBDlf3KqBIuKCkNadmzlopF089bAFF +DjoMQIftvjLl1Nl6tyevoQmA4RCxRxQi9po2OusCScOnieYDJDkCMUCgCnr2 +BE6fEGXpE3/UWxEnx/BBKkfJ7a9hN5s9Fca9vK4R9HppCB/cUVw7Njq2rytt +vsIHCzDX647U0seWLvdqHz79QMv7/q0Rxb1QNrZmBXGSRf3HRhI3puP8ZnrS +b6RBfBcuOZ0ydjT/lzNtzn9Z2uFwW/3+7mj2CQeMG57PgCcUDmYXzsW8ALgb +fFGfj5EJDrR6LfUbw3xfSILPK4o1NIlG4/wDXvKyySB5aOmh1FBvXhR0s6mc +SktP4qsk6K0oaetS334h51kq+2lFZczwHXdXlbHnquxyWXr5VGXSt/WaJSqz +/N11Zr8Kndlkl6iY//vjxQZwXiDpP06v/rxC9ecVqieP/39eoXKZmnrGSDLP +OIox8Zohpi33Uncdh+LycfJgggPZb06FrCgpGB+JiSbi9yRriYQHRwGinKQJ +WOALU37NC1NV3HhQ60UVtQoLh4ytspDxa4EG7ipHMUmQQAPK3+BE+RscaYAT +xew5AjlyeIGENadCZpOctr3+HS3U0Lw/tdSwWb2Ph9klIUJ9U8KJwk+CCfzm +R9CHDEDHF1V0LJhjuOvflEDNYbwpYeo+zept1OWugJoMDxSR4+OhHZ0GQ1E0 +ndMH088cyE5zKmQtgTOzAXtkDZFvgHOIfapUZd9FIUsgafAH+1Sspk9VCX8g +O62KnoXF1Ffyjor+rOyV/GvBHw/ldJFYLMob40R5Yy+DCzu4FT5yJahzJs8c +yE5zKmQwyUG5aIg0N28Ew7cDGZUj4qs+c07SvHXmiA+Q5IADyWlVVCsYM9gG +h0fWHIbDYytmatMYqY8OQD7RAQjdY+RE9xhlvwxxIb/H6EBimlMhYQnOsRvc +HZfsqGUZaLu1aDYVwZkKpjlJg3I2mg+Q5OgDiWlV9AwYsyEZH2oOA32Y4r0y +mgOKJ5EYbcAlwFybj8qE6ED3AiHaKtjjQkqaWyFvSUrXww4Zzd0HYWEDtWoa +aLmNNdEtIyBpgM1BSWlAUgMOKPeiinIFczEqukQpIS8NMor3QeN6OMjFd2g2 +JWlMHJkW0euyfcaRXUg/cyukJXGUh8eJ8vDAzm1s9kSXGAXiAyQJH9vGlxht ++vAxqPaiimrhLNnER8s9v6p6nSllXnM1pazpr8lP4p63mp/EK+QnOc4iP8ld +ppQtSzvuSkpZk4vt+UnMEig/yXI2pyexV5Ge9AIpZetUVuRlPVGZLcSqyuzn +quxyWXr5VGXMYDZfUZnBHIbUZgmO1cY2q815FWrbkFWmlqBO5/0tvzVmkcpR ++1tjFp8cQPldK8+dpv2HmaaJvhHI3PBdjyf/A1BLBwi/PueRFAwAAJJyAABQ +SwMEFAAIAAgAtihNLgAAAAAAAAAAAAAAAAoAAABzdHlsZXMueG1s1VjtTxs3 +GP++v+J2napW2sWXAB2hJIiVdt0EBRWQto+Oz7lY9dknn4/A/vr55ezcWy4t +RRUDBNjPz8+7n+dxjk/uMxrcYVEQzmbheBSHAWaIJ4Sls/D25kN0GJ7Mfzr+ ++ezy3c0/V+8DvlwShI8SjsoMMxkV8oHiIri6/f38z3dBGAFwmWN2aVAjLlIA +zm7OArs+qw4FSgwA7z+FQWjZjRKZhPPjLbyVhqw4ssRZuJIyPwKAKyl8I2US +xzGw67A6YE4P4g3CwSW+l4NoDfBguNjB2yAcPBFwPYjWAOVxh19yj16v16P1 +nkGOp9Mp+Pv6HHzgIoNel3tK2JeteEN1UFZmCyyGNYESNvxS3KV9zK0D77zK +aAXFsP8MYuORvWSHR/YSB1bGrrYYeAguFNH8ujjfuE9kg8w1wNuHBMmHNbeQ +0OV+47b4rF1ylbEJRrSYHxsHbnYCu2YwUzlzKgikwS0j6pLh4OI6DJbcQpcw +I/RhFr6EOS/etnF2NwxqvHMikXLMHVRQnW1gWPLHP4ILwtCKB+ckXcngr22i +O8Dvl31KF5A9dAW6/dpZS4pSzLAgaBYWa1IUu2SDnihUW7aKOPUSvIQlrWqL +Y1opY+5shDCloYPnQiWEkESVIXcekQzSKKcQ4WIWThqadYylkKUlTNUmZmYD +8ZJJoYTdXndORrAgkPUGyiIdNwdknGFHqxj3kTYCEM9yiu/7srAlwSP7ZPQS +lfeUV3keJaSQkOlaPR5NDlBm4tPj/a8JSSpgviKo6AuI8Sblqp69iM1XN71u +VlywBFI8mGGCZ5ANZphnXJB/tV0TXQ6ePLxegkNO9rWcHxX7jXgP7VXgEamh +WmcES8mLHOq8IAnmJrIRpPkKOlheMiRLKFVxjdaKrO4+0dy8BoThaCEwVO2u +kCp00qeFS75ik2ubTNmWfrYdVl2xkX72Hn+Kw1Y66u5ogWHreFCtMsIiwiRO +FceEpESqGjE2N6BHmueBSiHU2PXQp8Q43r8aUqSi3HGqPKenEinKmnob1g/Z +glOnZzNzHdZl7+ltOP/Fq9xiscXynso46BNHTQUvczNuGsVrrmp65WudNRiz +oSKyXJoiArwgnbbzyKtjlv9jt1rbM5j7K8sSIs0kcwdpiV+9fpnKtzOfazDP +aeXkqJGLAyGyJ7uBObM3rx2bWscF2w9/xsXwWVc/oPDPhqgptz/ytuLZdwKR +kBLUqFglS7DQRUcXIpZS3E+NqgQy3Mz/m36xxrrEz0IV36TWB3d4yxo8eZTF +TWdtkr8WwiFff8QwMS+RJ3e2bQKUpCrfkDqKRbM9aEpU8FLoDrEk952m+6Zq +un1R+z5/V0aPH2W181i/1QkRGNlLRqW3WHBp2xzUaTULp3FXWdCaX6ulbqPq +QURQ1Bxsc92aM/V2U6WjbluejbeoZk6sSaIfV5N4pF6LalbzhFXlycl09MZQ +fNKslMGbDtbHWVcmdz4e/XYwrhhnUKSKRPFSE5qbooI3dxdcKnM1l9Yk2afE +knP5oxRTs0aPVk0NQCcyu4M1CZ+BmzVlwUWiPyuIR/HhIcqCglOSBPVJO4eJ +/ZhIQcaH7hhEX3TrYYkriy9QrL+9XTWEamwpHpzYnlOYn49XdqcZ2FotKoIF +tmpItak5DXXvmqSoW2RsyObHuqof5dXfYoWxfYfMT05OjkF7s9rJW4Fvhtzz +vNIKVgutix1G5mPHpbbXYexYgY7Ju7zwGedcDDqhfXndSuBUF3udd9/ol+CV +xUkiaR1i16871jUkNbZMfrekq+kAbx0U1PjhQZEZEFVOR7H+CefjPRBP9Kdj +e5UKGjX/NXDaKtXHe0fxwdH+gde4L8xN5Z449gGoA80UPp9O60C79005Avov +EOj/8Hr+H1BLBwj2SuyygAUAAGEXAABQSwMEFAAIAAgAtihNLgAAAAAAAAAA +AAAAABQAAABPYmplY3QgMS9jb250ZW50LnhtbO0aa2/bNvD7foWmFfuml23Z +VuakSJp0KJC2AZLs8ZGWaJsLLQqUHMf99TuSol6WHHtrYhSIC8jQ3fHeD/rS +yfunJTUeMU8Ji09Nz3ZNA8chi0g8PzXv7z5aY/P92U+Tny+/frj7++bKYLMZ +CfFJxMLVEseZFbI4g2/j5v7i+tMHw7Qc52uC46+SzGZ87jiXd5eGer/MTxkg +x3GuvpiGqfjZURaZZ5Mu5qBjnJ4o7Km5yLLkxHEYiGGlmJ7ruo56N/MDabah +u+klhSbP8FO2k1oQFMRo+gxvSaHJI47WO6kFAfhc089YQb1er+11X1J6QRA4 +f91eOx8ZX6JClydK4odOeonVpPFqOcV8tyYoQzW/pI/zNubKgY+FyuEC8d3+ +kxSlR/rRMx7pR5oYjF10GDh2PgNSPj5fl+7jy53MBUFhX8hJsltzRWLq7A8p +StNTM7cnB9aKqMhltMoYaE9CS/o0PZuoEOSRUFBDPk9itISU+gIlqN5naEno +5tQUEVGEZuO4kb8tSWwRqJU5cIzInGSgnWc6ZxOnRdrZRLHfFh0uvKZsZaM+ +knDwDs8ITg2RsMCCswc4GLMY0kWCZoRSKFzKIMt+mcmPVKQic5cCvb0VmLGT +iHAcZtLpNOPmTp2eVVIw1CBXfiRoBj3I0sqc0ymKN4WKJcqa4xhzEp6a6Zqk +aY0iIVkI2fuIOFEtQXNNyTfQ0+uLzNrmiFKCwLBfUcLS387jCIGvblGcGvef +FGxbiD5TiqpQCGmaoEtmyJYJxU+FVGBDjfuYwEDAxufbTrnFuW7JBYmUfUBG +9A9LSRXrlFEStQU7CsS/14ns8PUD2yHyNeI6PCysg73DKhHAg4UP1iqJ2Dq2 +pohDh5shmoJGVfyaZAvrkdGVEFLDZwuOMTRHuFiINo1oAx9hnDRAMDgxiMn4 +qpSS5EC3gGyWUwbMrJ6GPAq9wy0B8qC1SnFUOQ03nBhaWKtBkHVwIGUrLm49 +oTAqTjV2iVFsPSK6atqJOWfcWiI+J3FFkAJTtoYpQMmSZFu4VZJ04kIEs4Xx +jW6iVRycCuGShua4cozjOcepcLSVbRJcPyfnGUVTTC19H+lAqytZPU4lVrte +4Q/IPb8993JgOW6tYiJ3pmVEICXQRmlUzxVIggcRiIcUnv+ApwjEmjfTsknE +VpkgqjKibA7lly2WogvVT4N/LAYJR1GZvAIos82acoweGryk5xDnKJ5jccmG +vkYiIN1Y4rvIYZISecFVZ5+btXm7hdtgDoJCjMSVzQ2XNXDLgD3GzB29fmfu +EPkanXl0WGcevvQV7EhBD14/6B0iXyPowWFBH/1YLbFKQ+I9GEminFF9LHc2 +V8aJnKE9X0PmKNGNzXOLWVf0X/ewtlxX460vv/Xl3SU6/rFK9P/eWt7K4608 +DimPYO9rS0tgA/iIHdD2wkBj3hYGR14YeFt70f+0m3x+N3SITt95XxrIz7YG +Tuc2OUdMWbQ5m+Q7BfGUSa7vKj173BvrlrbAZL6A/jmyXdcTwPyU2mmLDlyu +VMppIlbDWkBGMuEJ4AVRHNi+O9S8wQGu7Q1KrnUWPWAh+3xydnfzwbowLnAc +LsQcmTg5fOJUZGiBFENNRUb1xYIEJKqvc2GPqfXxPHvkjyoK9e2+G3Rp1Be+ +VoiEsgwmDEathAOYUCKfT0IM8ZJjyEJRJJYcp+btAuPMs9+dvxsMTsSX7xka +dqVgVwCrrTDUXsdaoFRNYWAzZdmimJFCWL4esShJxU7GcAsrXbvn170elBEu +rqh2EDSj7ttBvw9AbTV6Imk9A/SuR2uiPJBwAnHaWE/tfvTbk8O3B+NBRc2h +TpY2HsMyO/48vzYuVrMZ5mlXZjil/t22yAVZuyGbdiVG7YY0/d23h0NvD0Pu +bm53p/ack6ius7xQyRawj4VqS9hu4rd29cZlzqvTrVRB4QiZrgkjcVYs9xIM +SRJBD6noqXjpQ2tEaXsbcUvxM8oYb6fyKpyLygS3yhqUz7we1QnKQkQt9SfX +GpW1wCiCEsrXp3WcAgpBh51oBWp9VMnmhFbpK2XRs8xy6ZytGwiANMRCJ3K2 +QbkeMvXz5SuMHfG35SIrz//4vZKVTQYNkJTb5qBWFfdReg8Nfa+3U8M9WEJy +iT+RVxDwU35kB6UQ8XagH76HbdBJXsS2od0flp9RRWADcwSbvd74peLZYXMD +cwSbh4MXCrNfC61/BNP6L1OdfmcG+8fP4Jcq2mFQC+fwGC3pZYrTrzVb/+Bm +24SkdVBxP5DP8keS+i3kdPxnsrN/AVBLBwgyMyV9qAYAAPMmAABQSwMEFAAI +AAgAtihNLgAAAAAAAAAAAAAAABMAAABPYmplY3QgMS9zdHlsZXMueG1shZJB +b4JAEIXv/RXbvcNguVQCmFQ0aWKKSTGxR2QXJIVdsqxA/31xVzAmisfJfPPm +5eW5i64sUENFnXPm4ZlpYURZwknOMg/vorXxjhf+i/sahMvoZ7tCPE3zhDqE +J6eSMmnU8q+gNdruPjafS4QNgLCiLFSUyUUGEEQB0nNwOUL9G4DVF0ZYy5lE +Euy7D7R7h6x29NLDRykrB4D3X/j1y5tlWaBnfDlQ15O8IgZc0k5O0mdghOPD +E21FDDgRcTtJn4E+8YFP+Ui3bWu2tiJn8/kc9t8bWHNRxqOXrsjZ70NebQeU +ncoDFdNOYhnf5FI32T1xHWAzWk6OsZjOTxHXRGzyJBGbjBYSkVfT4hrBQz1v +Cj0WS/cJfBfuN83/B1BLBwi7WUydHgEAAA4DAABQSwMEFAAIAAgAtihNLgAA +AAAAAAAAAAAAABQAAABPYmplY3QgMi9jb250ZW50LnhtbO0a2W7jNvC9X6Gq +i77psnxEqeNFsskuFtgjQJKifaQl2mYjiQIl2/F+fYekqMuSY3fXMRaNAijg +zHAuziUm47dPUaitMEsJjS90x7R1Dcc+DUg8v9Af7t8bZ/rbyS/jX6+/vrv/ ++/ZGo7MZ8fF5QP1lhOPM8GmcwW/t9uHq08d3mm5Y1tcEx18FmUnZ3LKu7681 +ub7Od2kgx7JuvuiaLvmZQRbok3EXc9AxTs8l9kJfZFlyblkUxNBSTM+2bUuu +9XxDmm3C3fSCQpFn+CnbSc0JCmI0fYa3oFDkAUPrndScAHyu6Ge0oF6v1+ba +FZSO53nWX3efrPeURajQ5Skk8WMnvcAq0ngZTTHbrQnKUM0v6Wrexlw6cFWo +7C8Q2+0/QVF6xA2e8YgbKGIwdtFh4Jn1GZDi9flT6T4W7WTOCQr7fEaS3ZpL +El1Fvx+iNL3Qc3tyYC2JilhGy4yC9sQ3hE/TyVgeQX4SEqqJ93mMIgipL5CC +cj1DEQk3Fzo/EUmoN7Zr+SoisUEgV+bAMSBzkoF2jm5NxlaLtMlYst8W7S+c +pmxpo9qSMPAOywhONR6wwILRR9gY0xjCRYBmJAwhcUMKUfbbTDxCkYrMXQr0 +9lZgRs8DwrCfCaeHGdN36vSskpyhAtniEaAZ1CBDKXMZTlG8KVQsUcYcx5gR +/0JP1yRNaxQJyXyI3hViRJYExTUl30BPx+WRtc0RpQSBYb+jhKZ/XMYBAl/d +oTjVHj5K2LYQtacUVaHg0hRBl0yfRkmInwqpwCbUHmICDQFrn+865Rb7uiUX +JEL2ARHhHhaS8qxTGpKg7bADj/+8zMkOX/5gO0S+xLkODzvW/t7HKhDAg/qP +xjIJ6Do2pohBhZuhMAWNqvg1yRbGioZLLqSGzxYMYyiOMFjwMo3CBj7AOGmA +oHFiEJOxZSklyYF2AdlEUwrMDFdBVlxvf0uA2GgsUxxUdsOEE0MJazUIog42 +pHTJ+NTjc6PiVGEjjGJjhcJl007MGGVGhNicxBVBEhzSNXSBkEQk28Itk6QT +5yPoLZRtVBGt4mCXD0MamuPKNobnDKfc0Ua2SXB9n+hnIZri0FDzSAdajmT1 +cyqxyvUSf0DsDdpjLweW7dYoOnJnWAYEQgJtpEb1WIEgeOQH8ZjC+x/wFIGz +Zs2wbBLRZcaJqoxCOof0yxYRr0L13eAfg0LAhagMXg4U0WZMGUaPDV7Cc4gx +FM8xH7KhrpEASDcG/13EMEmJGHDl3ud6bV5uYRrMQZCIAR/ZbD+qgVsa7Cl6 +7ujlK3OHyJeozKPDKvPwfzeCeS8fDh0iXyIcvMPCYfRzFcsqDYn3YCSIckb1 +ht1Zdikjorv2i343R4kqeY5dQIvKbB9WsOtqvFbs14q9O0XPfq4U/d555jU9 +XtPjkPTwDv3U3Pqke/3aan5tteWABw+f4rbnO4V5vXU58a2Ls3W5/J8ueJ+/ +YDtEpx986eyJZ1sDq/NKPkdMabCZjPOLGf4WQa7Gup459Hqq+i8wmS8gWUam +bTscmO+Sfxjgzaq8lyobL79fVwIyknFPAC84xb7ZdweKNzjANh3XK9nWefSA +h+iJyeT+9p1xpV3h2F/wnju2cvjYqghREkMMSRVo1YUBEUhkD2TcIF0p5Dim +26so5JqufdalkMt9LRFJSDNoxhi1EvahmfN4PvcxnJfo2AYKAl67LvS7BcaZ +Y765fOM45/xXz9EU7EbCbgBWq0zycsxYoFQWKWAzpdmiGCe4sLzqQa1NeanV +7MJI2+zVne71RmpdDPPmaOQ2T31gei4HKqvRE0nrEaBKuNJEeiBhBI5pYzy1 ++3HQHhwDs+c6FT2HZt/rd53FsAyOO0DjQLtazmaYpV2xYZUmdJsjWl+7LZt2 +PUbttjRc7prD4R6W3N/e7Q7tOSNBXWMxfIoasI998q613cBv7eqdlUEvd7dS +eYUbRLwmlMRZ0bQTDFES8CCrKCqZqV1rFIbthcQu5c9CSlk7lVPhXOQm+FVk +oXjnGSl3hNRHMAeInlOjMhYYBZBE+S10HSeBXNBhO1qBSh+ZtDmhUXGW3hTU +yiyXzui6gQBIQyzUImsblOshIj+fqqDx8D/RF2F5+eeHSlg2GTRAQm6bg1pV +3EfpPTR0HPgC2anjHkwhvPj/GlQQUIOcUsjQOdALP8Qy+1iWeaZXsQ1WJ7DO +O5Jxg1EpYzA6gWFnxzLMNUdu5amY2cCcwOjRsUJ1ZFaaJF+dwLjh8Yw7az/R +JuYERg+OZXQfBqLyqWRrE3MCo/vHyt0+DLjtudvAnMBo91hG22bVUFidwLje +kYzrD+D7tfVEm5jvmZ/kmFQFFaOueJdf/PLD3ur499LJv1BLBwju1zf52wYA +AAUrAABQSwMEFAAIAAgAtihNLgAAAAAAAAAAAAAAABMAAABPYmplY3QgMi9z +dHlsZXMueG1shZJBb4JAEIXv/RXbvcNguVQCmFQ0aWKKSTGxR2QXJIVdsqxA +/31xVzAmisfJfPPm5eW5i64sUENFnXPm4ZlpYURZwknOMg/vorXxjhf+i/sa +hMvoZ7tCPE3zhDqEJ6eSMmnU8q+gNdruPjafS4QNgLCiLFSUyUUGEEQB0nNw +OUL9G4DVF0ZYy5lEEuy7D7R7h6x29NLDRykrB4D3X/j1y5tlWaBnfDlQ15O8 +IgZc0k5O0mdghOPDE21FDDgRcTtJn4E+8YFP+Ui3bWu2tiJn8/kc9t8bWHNR +xqOXrsjZ70NebQeUncoDFdNOYhnf5FI32T1xHWAzWk6OsZjOTxHXRGzyJBGb +jBYSkVfT4hrBQz1vCj0WS/cJfBfuN83/B1BLBwi7WUydHgEAAA4DAABQSwME +FAAIAAgAtihNLgAAAAAAAAAAAAAAABQAAABPYmplY3QgMy9jb250ZW50Lnht +bO0a227iRvS9X+G6q775hgnElLDKbrKrSNmLlKRqHwd7gGlsjzU2IezX98yM +xzdsAt0FtGqIRORzv805x5OM3z5HofaEWUpofKE7pq1rOPZpQOL5hf5w/8E4 +199Ofhn/evXl/f3fX681OpsRH48C6i8jHGeGT+MMfmtfH97d3rzXdMOyviQ4 +/iLITMrmlnV1f6XJ56ucSwM9lnX9Wdd0Kc8MskCfjLuEg41xOpLYC32RZcnI +siiooaWanm3blnzWc4Y0W4fb6QWFIs/wc7aVmhMUxGj6gmxBocgDhlZbqTkB +xFzRz2hBvVqtzJUrKB3P86y/7m6tD5RFqLDlOSTxYye9wCrSeBlNMdtuCcpQ +LS7p07xNuAzgU2Gyv0Bse/wERRkRN3ghIm6giMHZRYeD59YnQIqvT7dl+Fi0 +VTgnKPzzGUm2Wy5JdFX9fojS9ELP/cmBtUNU1DJaZhSsJ74hYppOxjIFeSYk +VBPfoxhFUFKf4QjK5xmKSLi+0HlGJKHeYNfyp4jEBoGzMgeJAZmTDKxzdGsy +tlq0TcZS/KZqf+E0dUsfFUvCIDosIzjVeMGCCEYfgTGmMZSLAM1IGMLBDSlU +2W8z8RGGVHRuM6C3swEzOgoIw34mgh5mTN9q04tGcoEKZIuPAM2gBxnKmMtw +iuJ1YWKJMuY4xoz4F3q6Imlao0hI5kP1PiFGZEtQUlPyDex0XF5ZmxJRShA4 +9jtKaPrHZRwgiNUdilPt4UbCNpUonlJVhYJrUwRdOn0aJSF+LrSCmFB7iAkM +BKx9uuvUW/B1ay5IhO49KsLdryRlrlMakqAt2YHHf46T2cHxE9uh8hh5HeyX +1v7OaRUIkEH9R2OZBHQVG1PEoMPNUJiCRVX8imQL44mGS66khs8WDGNojrBY +8DaNwgY+wDhpgGBwYlCTsWWpJcmBdgFZR1MKwgxXQZ643f6GAsFoLFMcVLhh +w4mhhbU6BFUHDCldMr71+NypOFXYCKPYeELhsuknZowyI0JsTuKKIgkO6Qqm +QEgikm3glknSifMRzBbK1qqJVnHA5cOShua4wsbwnOGUB9rI1gmu84l5FqIp +Dg21j3Sg5UpWz1OJVaGX+D1q76y99nJgOW6NYiJ3lmVAoCTQWlpUrxUogkee +iMcUvv+BSBHINWuWZZOILjNOVBUU0jkcv2wR8S5U54b4GBQKLkRl8XKgqDZj +yjB6bMgSkUOMoXiO+ZINfY0EQLo2+O+ihklKxIIreV+atXm7hW0wB8FBDPjK +ZvtRDdwyYE8xc4fH78wdKo/RmYf7debB/24F845fDh0qj1EO3n7lMPy5mmWV +hsQ7CBJEuaD6wO5su5QRMV0H/WLgzVGiep5jF9CiNdv7dey6Ha8t+7Vlbz+j +5z/XGf3eheb1eLwej32Oh7fvu+bGO93r61bzdavtDHjw4Wvc5oKnMK/XLie+ +dnE2bpf/0w3vyzds+9j0g2+dPfHZtMDqvJPPEVMarCfj/GaGf4siL9Y6czjw +VPdfYDJfwGEZmrbtcGDOJf8ywIdVeTFVDl5+wa4UZCTjkQBZkEXX7A17SjYE +wDadfim1LqIHIsRITCZ317fX7++1dzj2F3zmjq0cMbYqSpTGEMOhCrTqgwEV +SOQMZNwhXRnkmf2hWzHINV37vMsil8daIpKQZjCMMWol7MMw5/U88jHkS0xs +AwUB710X+t0C48wx31y+cZwR/9VzNAW7kbAbgNU6k7wdMxYolU0KxExptijW +Ca4s73rQa1PeajW7cNI2e45bi7rXG6rnPO2eafcHzayfmZ7LGZXX6Jmk9QpQ +LVxZIiOQMAJpWhvP7XE8ay+OvtkbOBUzB2bf68zFoFIdgMaB9m45m2GWdtWG +VbrQ7Y4Yfe2+rNvtGLb70gy5aw4GO7hy//Vue23PGQnqJovtUzSBXRyUt63t +Hn5rN++8rHrJ3UrlFXEQBZtQEmfF1E4wlEnAe0vFUClMca1QGLZ3ErvUPwsp +Ze1UTkVycTghruIYiu/8SEqOkPoIFgExdGpUxgKjAE5Rfg9dx0kgV7QfRytQ +2SNPbU5oVIKlNxW1Csu1M7pqIADSUAvNyNoE5XaI0s/XKpg8/I/0RVle/vmx +UpZNAQ2Q0NsWoFYTdzF6BwsdB15Bttq4g1AoL/7fBhUEv/s4h7ZUfIalyiZm +zwj9EK/tQ3k9tM1Bu9cNzAm89g7l9MA2zyqe8scTuHd+sJyemUO3/FRzWsec +wOnhoZz2qhn1TpHPwYFcG/Z6sKm3ndEm5gROnx3MadjQW4u4iTmB0/1DOd3v +m/32TDcwJ3DaPVimwbWOTNcxJ3C6d7AeDS+k1cYMj9+zeckFqwoqlmTxXV4W +yDsBq+NfUyf/AlBLBwjo/gcr5AYAAEErAABQSwMEFAAIAAgAtihNLgAAAAAA +AAAAAAAAABMAAABPYmplY3QgMy9zdHlsZXMueG1shZJBb4JAEIXv/RXbvcNg +uVQCmFQ0aWKKSTGxR2QXJIVdsqxA/31xVzAmisfJfPPm5eW5i64sUENFnXPm +4ZlpYURZwknOMg/vorXxjhf+i/sahMvoZ7tCPE3zhDqEJ6eSMmnU8q+gNdru +PjafS4QNgLCiLFSUyUUGEEQB0nNwOUL9G4DVF0ZYy5lEEuy7D7R7h6x29NLD +RykrB4D3X/j1y5tlWaBnfDlQ15O8IgZc0k5O0mdghOPDE21FDDgRcTtJn4E+ +8YFP+Ui3bWu2tiJn8/kc9t8bWHNRxqOXrsjZ70NebQeUncoDFdNOYhnf5FI3 +2T1xHWAzWk6OsZjOTxHXRGzyJBGbjBYSkVfT4hrBQz1vCj0WS/cJfBfuN83/ +B1BLBwi7WUydHgEAAA4DAABQSwMEFAAIAAgAtihNLgAAAAAAAAAAAAAAABQA +AABPYmplY3QgNC9jb250ZW50LnhtbO1aWW/jNhB+769Q1UXfdPuIU8dFdpMt +AmQPIEmPR1qibTaUKFCyHe+v75AUddiSY+9uEmwRB5ChmeFc/GaGYTL+/SGm +xgrzjLDkzPRs1zRwErKIJPMz8+72vXVi/j75afzzxad3t/98vjTYbEZCfBqx +cBnjJLdCluTwbXy+e3t99c4wLcf5lOLkkxSzGZ87zsXthaHeL4pVBthxnMuP +pmEqfXaUR+Zk3KUcfEyyU8U9Mxd5np46DgMzrDLju67rqHezWJDlG7pfXkpo +8Rw/5HulhUApjKaP6JYSWjziaL1XWghAzrX8jJXS6/XaXgdS0huNRs7fN9fO +e8ZjVPryQEly3ykvuVo0WcZTzPd7gnLUyEu2mrcpVwlclS6HC8T3509KVBkJ +okcyEkRaGIJddAR44nwApnx8uK7Sx+O9yoVAGV/ISbrfcyViavSHFGXZmVnE +UxAbRVRiGS1zBt6T0JI5zSZjtQXFTiiqIZ+nCYoBUh+hBNX7DMWEbs5MsSNK +0NxabhRvMUksArUyB40RmZMcvPNMZzJ2WqxNxkr9rulw4W3bVjHqJSmH7PCc +4MwQgAUVnN3DwoQlABdJmhFKoXApA5T9MpMf6UjN5j4H/IMdmLHTiHAc5jLp +NOfmXp80AZZp71z5kaQZdBpLmzynU5RsSkcqljXHCeYkPDOzNcmyhkRK8hAw +ukKcqMLXWjPyBbzxAltUI+DVHfmDvifQtKsfZQRBML+ilGW/nScRgvzcoCQz +7q4UbdekXlMZrkkI21rgMA9CFqcUP5Q+gFJq3CUERgI2Ptx0elGu6/ajFGnx +5AiEBMdBVO19xiiJ2hAajcTP82BgYLsy7JHbGwR+f/j8GDjMg+fAQIsnR2Cg +dzAGJAN0sPDeWqYRWyfWFHFojzNEM3Cwzl+TfGGtGF0KIw1+vuAYQ2eFU4no +8Yhu8SOM0y0STF0MZnK+rKykBdEtKZt4ykCZ5WvKSvgd7hiQC61lhqPaajge +JdD/WgMCiMKCjC25ODKFIqgk09wYo8RaIbrcjhNzzrgVIz4nSc2QIlO2hhFC +SUzyHd4yTTt5IYLBxPhGd+A6D1aFcMJDc1xbxvGc40wk2so3KW6uk8OQoimm +lj7MdLDVea65TxVXp17xj8Bevx17BbGa1VY5zjthGRGABNooj5pYARDci424 +z+D5L2SKwF7zbVhuC7FlLoTqiiibQzXmi1i0rOZqyI/FAHAUVeAVRIk2a8ox +ut/SJTOHOEfJHIsTOjRBEoHoxhLfJYZJRuTpWK19bFAXvRmOkgUJCjES5z03 +jBvklrn9EqN8+OJt/DAPnqONt3hyRCkN/qeHvVHzfNN7foQc5sFzIKTFkyMQ +Mvyxmm1dhiQHKJJChaLmwO9s24wTOZ0Hbjkw5yjVPdOrqGVrd4/r+E0/Xlv+ +a8v/ji3/5Mcq6G89Pb3W0mstPVktjQ4+PrWgQFidzdquRDTn9UrkR7oS8Xau +jb/q6vbxq7JjfPrO18kqPbseOJ2X7QVjyqLNZFzcmoinrAh9ZPJsLwh0s1xg +Ml/kojS9ni+IxSp15S96e3VpVM0pcXOuDeQkF5kAXbCpgd3zBlo3JMBtqm3q +8EGHHCHp5Oby+vLdrfEWJ+FCzKixUzDGTs2KNkkxlGBk1F8sQCRRM4OLiEzt +kefa7vCk5lJgB8Nhl0uByLZipJTlML0wahXswfQTAD8NMeyYHHEWiiJxkXNm +3iwwzj37zfmbXu9UfPU9Q9OuFO0KaI1rGnV3ZS1QpiY8qJmyfFHOX2GsuAKy +KMnEvZPhllG6tu/7jbyPekP9Xmz8CPZmZ9+hCvuCqKNGDyRrYkDfZ2lPVAZS +TmCfNtZDex777fDo2QOv5uXAHvijrq0YVOj46/zaeLuczTDPuoDhVO53hyLv +ANvj2LQ7MWyPYzvdgT3seQcEcvv5Zj+y55xETZ/lWU32gEMiVBeh7SF+aXfv +pIK8Wt0qNSoTIdGaMpLk5f1ligEjETSRmp9Kl160RpS29xG3Mj+jjPF2Ka+m +uSxMSKssQfksylGtoCxE1FJ/km5IWQuMIqig4oa4yVNEYei4Fa1E7Y+q2ELQ +qnKlInpUWWGds/UWAyhbZqERObukwg8J/eJ+GeaO+Nt7icrzP/+ooXJbwRZJ +2m1LUKuLhzh9gId9z9/r4QEqAVziXwhqDMCrO7BPKivy9chMfI/o/P7gSaLz +enZ/UH6GtUC3OC8Qs+fvz/RX76hn+0H56dU3t8l5gZgH+41+9TbDga5jm5uc +Fwg5eJq6hcCGnSEPXxjZT1TMfbuOZvH6AsE9TdF6o0YbFq/fMpDU3KmTyrOD +fFa/QalflJyOf8Sb/AdQSwcIA2TWENMGAAAvKAAAUEsDBBQACAAIALYoTS4A +AAAAAAAAAAAAAAATAAAAT2JqZWN0IDQvc3R5bGVzLnhtbIWSQW+CQBCF7/0V +273DYLlUAphUNGliikkxsUdkFySFXbKsQP99cVcwJorHyXzz5uXluYuuLFBD +RZ1z5uGZaWFEWcJJzjIP76K18Y4X/ov7GoTL6Ge7QjxN84Q6hCenkjJp1PKv +oDXa7j42n0uEDYCwoixUlMlFBhBEAdJzcDlC/RuA1RdGWMuZRBLsuw+0e4es +dvTSw0cpKweA91/49cubZVmgZ3w5UNeTvCIGXNJOTtJnYITjwxNtRQw4EXE7 +SZ+BPvGBT/lIt21rtrYiZ/P5HPbfG1hzUcajl67I2e9DXm0HlJ3KAxXTTmIZ +3+RSN9k9cR1gM1pOjrGYzk8R10Rs8iQRm4wWEpFX0+IawUM9bwo9Fkv3CXwX +7jfN/wdQSwcIu1lMnR4BAAAOAwAAUEsDBBQAAAAAALYoTS7L3JEUYgQAAGIE +AAAIAAAAbWV0YS54bWw8P3htbCB2ZXJzaW9uPSIxLjAiIGVuY29kaW5nPSJV +VEYtOCI/Pgo8IURPQ1RZUEUgb2ZmaWNlOmRvY3VtZW50LW1ldGEgUFVCTElD +ICItLy9PcGVuT2ZmaWNlLm9yZy8vRFREIE9mZmljZURvY3VtZW50IDEuMC8v +RU4iICJvZmZpY2UuZHRkIj48b2ZmaWNlOmRvY3VtZW50LW1ldGEgeG1sbnM6 +b2ZmaWNlPSJodHRwOi8vb3Blbm9mZmljZS5vcmcvMjAwMC9vZmZpY2UiIHht +bG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWxu +czpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5z +Om1ldGE9Imh0dHA6Ly9vcGVub2ZmaWNlLm9yZy8yMDAwL21ldGEiIG9mZmlj +ZTp2ZXJzaW9uPSIxLjAiPjxvZmZpY2U6bWV0YT48bWV0YTpnZW5lcmF0b3I+ +T3Blbk9mZmljZS5vcmcgMS4wIChXaW4zMik8L21ldGE6Z2VuZXJhdG9yPjwh +LS1TUkM2NDFfWzc2NjNdX1dOVF9JTlRFTF9fX2F0XzI5LzA0LzAyXzIxOjE1 +OjQzLS0+PG1ldGE6aW5pdGlhbC1jcmVhdG9yPkNocmlzdG9waGVyIEtpbmdz +LUx5bm5lPC9tZXRhOmluaXRpYWwtY3JlYXRvcj48bWV0YTpjcmVhdGlvbi1k +YXRlPjIwMDMtMDItMTFUMTY6Mjk6MzU8L21ldGE6Y3JlYXRpb24tZGF0ZT48 +ZGM6Y3JlYXRvcj5DaHJpc3RvcGhlciBLaW5ncy1MeW5uZTwvZGM6Y3JlYXRv +cj48ZGM6ZGF0ZT4yMDAzLTAyLTEzVDEzOjA1OjQ1PC9kYzpkYXRlPjxkYzps +YW5ndWFnZT5lbi1VUzwvZGM6bGFuZ3VhZ2U+PG1ldGE6ZWRpdGluZy1jeWNs +ZXM+MTA3PC9tZXRhOmVkaXRpbmctY3ljbGVzPjxtZXRhOmVkaXRpbmctZHVy +YXRpb24+UDFEVDE4SDQ1TTdTPC9tZXRhOmVkaXRpbmctZHVyYXRpb24+PG1l +dGE6dXNlci1kZWZpbmVkIG1ldGE6bmFtZT0iSW5mbyAxIi8+PG1ldGE6dXNl +ci1kZWZpbmVkIG1ldGE6bmFtZT0iSW5mbyAyIi8+PG1ldGE6dXNlci1kZWZp +bmVkIG1ldGE6bmFtZT0iSW5mbyAzIi8+PG1ldGE6dXNlci1kZWZpbmVkIG1l +dGE6bmFtZT0iSW5mbyA0Ii8+PG1ldGE6ZG9jdW1lbnQtc3RhdGlzdGljIG1l +dGE6dGFibGUtY291bnQ9IjMiIG1ldGE6Y2VsbC1jb3VudD0iMTg5IiBtZXRh +Om9iamVjdC1jb3VudD0iNCIvPjwvb2ZmaWNlOm1ldGE+PC9vZmZpY2U6ZG9j +dW1lbnQtbWV0YT5QSwMEFAAIAAgAtihNLgAAAAAAAAAAAAAAAAwAAABzZXR0 +aW5ncy54bWztmllzozgQgN/3V3h53XLwlUySSjwlMHGcyeE7R82LDApogiWX +JIydXz8C7BwEHAfj3a0p68GAJX3dulrdgpPvs7FbmCLGMSWnSnmvpBQQMamF +iX2qDPpnxUPle/2vk78bN3r/vm0U6OMjNtGxRU1vjIgociSELMsL7YF22dIL +SlFVbyaI3ITl9iizVbXRbxSi58aiWkEKUlXjWikoEXDPEpZSP0mlSy0JP46y +TxVHiMmxqlIph77KqZRKJTV6VhYVZi4mTy/lfd/f86th2fLR0ZEa5i6LmpQ8 +YnsFu6xGRZRlH7zrtRfdlyrXT6LiC3ARCzQO2lNY/E3gWLZkipH/0kolqc77 +8kPM8chFgCHYpxNlmSnmE5mJiVDqpRP1I+RL4Ev0KLZDvsWWcJLQlVrlqLYx +/hxh20lUvVr6Vq6syy+O4aSIiYVmyIrLQn7yKIV15Ixl83U0Rn7LiqnJBZNT +QKkHmeUvaRpAY3r2oeyRzxR9X6XnICTKa8xA3WOcsjblWMjJf5fU22vrv4p8 +n0TOOEfOKcPPlAjo9iYuFlfUQvHudyjbYIojJrC5LXpM+2UH5blE3+q/BT4w +BZ6ikN6FxE7pnrUX6Hv4Ut+czdYS202zKRty8zXfS6pGhaDjL4AT/lxty1Ya +kEo+BiRjJ6xhQPJZgjsDsjMgOwOylgFJyw69lnUHPvRnUhymyHHZeGGYjLru +CLJ0F/Vbxp59oHTcl5xcl3QAHULXi1Mj/6uUdRJAGwUO6Er6QUZ4z6F+IECT +nvpTm6Eg9InxR5S6CBKl/ghdjrKLeUCMhvrzNAGCeRvwr6nYFrrJcDw0yIEc +UHXqUhZDuzRYQuXKQbVS2T/IYVy30CvnkEvVvTHpUv8cQUtG3VsREhoSaWm2 +QG/xG0+4mKDefDyiLu+h+IaQi5AegZM+7UIuUHyg81hZEbjFFxH31iR0EZfj +nR5dlrKatzg+0UPcFN/zRhaeYp5zcPwBnqx81qkT4cEM896cmA6jBD+jDIYo +ozewOG1JLsCRWO8wLXrwGAwG9yunars94w/bMy4xeRpMLChQejBV3W1Hu+1o +tx390dvRZ5KAJ6gOXdNzpanIH9+WIapsx7V8SIlef/50qMcFJT9ncv+ZFTP2 +2EKQXMhe/FBgBDk6qGmYQDZX6rZ9949anpmweVQ2q93pyJ3VHu4upkgvzcD/ +MN02h/NR1ba7zaNf1lCbw9v9Usuoza/6rXLrTOu/LQqAAeags3zWAHB68mpY +8ueq3L0Z+gbQgWbeNZ2pdXddGlX2TRTxxVXng+igqgE6tybQO8ZAPQTAlvU7 +OtSfO62HkH8ohba0QK68NoJrp58IWjMZr7chpvXmPi1pncGTe1v7tYHYDKm5 +uBq62bmYASJvOxf+2xINA9ifUa5e7u6B0QFnoAR8QPHqBr+mS4Y7qPUjvA9k +tQ9f80LZRlKtXdql/zBpdjC9r4dO7zZhfrafgBlc973ROFgSpq05oHkPrH9d +z11aM/mBFcvofkwm7nzAEWtAAfNwP9I/XTijbIQtCxHdgQyaIghbNv2Q4RIS +24Mf38YsfBtEMr7Go14gP4U66GV8RQUZhiQe6Cyo6uf1NWRjIuPKlNauQTCI +tbL+pmcnn/brcuR1Op4wxAO3PfcXEy3+AzECuOzrtkdM4cGEV4G5nPPDKRpG +X2DdEN2lPEsEmHrcpH74mktN+zat/htQSwcIHfdObPsEAABEJwAAUEsDBBQA +CAAIALYoTS4AAAAAAAAAAAAAAAAVAAAATUVUQS1JTkYvbWFuaWZlc3QueG1s +xZZBa8IwFMfv+xRZ7u3TtochVmHqYLCtHtxhxyx91YyYluYp+u2XwdoO5hhK +g7ekJL/38v8F0vH0sNVsj7VVpUn5MBxwhkaWuTLrlL+uHoI7Pp3cjG/n2Wz1 +tlywrTCqQEujZsCWr/dPjzPGA4CsQpMVhZIYlvUaYL6as+dmnWMDLF44482n +MKecO/hvpmvK2Haa8g1RNQIoHb/s+NFgMIRmkQOxjlQojQEaqo8/OsZciYCO +FaZcVJVWUpA7NexNHtqdCV3RUAotebel2GkdVII2KQcOZ1U4TVkqSbsa7bk0 +wgOBa/A0VZaG3OavE/TKtXTUaC/AnsZl7x8o3UUAPym0eF9xtAUuzuXPa7cR +Nf1TtE8FkV8FkW8F0TUURL0qiP0qiH0riK+hIO5VQeJXQeJbQXINBUm/WW2R +RP/vFhK5H5g2mDF0kO/B5BNQSwcImAxsa0wBAAD6CAAAUEsBAhQAFAAIAAgA +tihNLr8+55EUDAAAknIAAAsAAAAAAAAAAAAAAAAAAAAAAGNvbnRlbnQueG1s +UEsBAhQAFAAIAAgAtihNLvZK7LKABQAAYRcAAAoAAAAAAAAAAAAAAAAATQwA +AHN0eWxlcy54bWxQSwECFAAUAAgACAC2KE0uMjMlfagGAADzJgAAFAAAAAAA +AAAAAAAAAAAFEgAAT2JqZWN0IDEvY29udGVudC54bWxQSwECFAAUAAgACAC2 +KE0uu1lMnR4BAAAOAwAAEwAAAAAAAAAAAAAAAADvGAAAT2JqZWN0IDEvc3R5 +bGVzLnhtbFBLAQIUABQACAAIALYoTS7u1zf52wYAAAUrAAAUAAAAAAAAAAAA +AAAAAE4aAABPYmplY3QgMi9jb250ZW50LnhtbFBLAQIUABQACAAIALYoTS67 +WUydHgEAAA4DAAATAAAAAAAAAAAAAAAAAGshAABPYmplY3QgMi9zdHlsZXMu +eG1sUEsBAhQAFAAIAAgAtihNLuj+ByvkBgAAQSsAABQAAAAAAAAAAAAAAAAA +yiIAAE9iamVjdCAzL2NvbnRlbnQueG1sUEsBAhQAFAAIAAgAtihNLrtZTJ0e +AQAADgMAABMAAAAAAAAAAAAAAAAA8CkAAE9iamVjdCAzL3N0eWxlcy54bWxQ +SwECFAAUAAgACAC2KE0uA2TWENMGAAAvKAAAFAAAAAAAAAAAAAAAAABPKwAA +T2JqZWN0IDQvY29udGVudC54bWxQSwECFAAUAAgACAC2KE0uu1lMnR4BAAAO +AwAAEwAAAAAAAAAAAAAAAABkMgAAT2JqZWN0IDQvc3R5bGVzLnhtbFBLAQIU +ABQAAAAAALYoTS7L3JEUYgQAAGIEAAAIAAAAAAAAAAAAAAAAAMMzAABtZXRh +LnhtbFBLAQIUABQACAAIALYoTS4d905s+wQAAEQnAAAMAAAAAAAAAAAAAAAA +AEs4AABzZXR0aW5ncy54bWxQSwECFAAUAAgACAC2KE0umAxsa0wBAAD6CAAA +FQAAAAAAAAAAAAAAAACAPQAATUVUQS1JTkYvbWFuaWZlc3QueG1sUEsFBgAA +AAANAA0AMAMAAA8/AAAAAA== + +------=_NextPart_000_00A0_01C2D362.16CA7D20 +Content-Type: image/gif; + name="select.gif" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="select.gif" + +R0lGODlhpgENAfcAAAAAAAgICBAQEBgYGCEhISkpKTExMTk5OUJCQkpKSlJS +UmNjY3Nzc4SEhJSUlJyc/6Wl/6Wtpa2trbW9tcbGxsbOxs7OztbW1tbe1t7e +3ufn5+fv5/////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +/////////////////////ywAAAAApgENAQAI/gA5CBxIsKDBgwgTKlzIsKHD +hxAjSpxIsaLFixgzatzIsaPHjyBDihxJsqTJkyhTqlzJsqXLlzBjypxJs6bN +mzhz6tzJs6fPn0CDCh1KtKjRo0iTKl3KtKnTgRoaIBAAwEADggCyat0qMOvB +rWABFGxgIKsBB1jDajWoVsGEj15Nxn1Kt+7FClTBCtDQVW3cuWn9DsSQd6uB +gX4B91UbwaNikY/tSp6skAAABXw5YCi7oK/CyJEJUlWAQWAEqlcLhvZMkAEA +Ao7FypVNubZt1bQFavibm21v1ggdAEBQMAIAAb4//56rQUFWzIgBYEBwvLPA +6dWjc1iQ3TN14hcs/iPILHAC9e4csuI9PJd749vw61J///V32voKqb8tSAF/ +QsWuWcdBYa9FR2BnGhBIXHrDbWVdVucB4IBlzw1kHFgPVnUZgwJxJ2B8IDJF +2GsLOFBaYGFp55taKja0GoNhKTBQgB0CkJpZfDVw3HYbTsCbAXy5hhyDMgoH +QGdGDmQZWhxUwJuAXnHHQIhUNqUBAxS+th+MKQKHIlgtMvSiXwtyYBlWC2Z1 +IoeWkRfdmrydmFVmimEQAQNlyaZmdO5V6WdTFSygQFlMjmmfoQ8hSpBwGXYJ +mFeg5cZbi4DlyRWH0WWV2p+cLrUjpghFmh8AWxJUqpfJqTakYKByKKqK/nPF +SptzBDQQwQWTRscAVWt26mtPc+KGqrCpBjdcQRMIICOxoS4n25n+edZmsZjK +Siltu+kpqVjClfnrtzlxZ8B+GnCXpn1hpmvQaCeeBkAF1FJb7rE8WifcYa1G +eWSTubJmLXBZvaVBnl7GRSi4COOUpVYCyJnYYmAmRhsGC2f1obpfbgUvBwmC +tfGjYo2oFWz5anvtQNw5uq1ATu6V8Ms0kZWVAAuQJzHEXN1MUAQKUHVWs8pt +pezGAl3gXFVbgsxynqQVbDLAuR09br+gurYszFhnrfXWXHft9ddghy322GSX +bfbZaKet9tpst+3223DHLffcdNdt9914533U/qVK6+0322Lp2dXgfxdudm+C +p2f44h2BKZmkiBHO+OQXAfDA5eh6qlrkimcs8eeghy766KSXbvrpqKeu+uqs +t+56Vg9YjvnjWNXeeagZ5K5B7hnsrjvvvvcO/PC/Fy+88cEnT/zxzCuP/PLO +Nw/99M9XL7310WdP/fXca4/99t53D/7432N/+fnnZ2A5BLHTDvFiCwHA+/z0 +12///fjnr//+/Pfv//8ADKAAB0jAAhpwgOhL3/0c9zL5Je8CuoNg7ySoAQpa +MIIYnGAGK7jBC2rwgxwEoQdDSMIRmrCDKBRhCku4whOq8IUshKELY0jDGdqw +hTjMQALPFz7lbU1+/ryT4AGHSMQiGvGISEyiEgW4wwfQT4gSjGLuICjFDPwQ +ejeUYQ5ruMUsclGLYPyiGL1Ixi6aMYxllCFYhAfBEDbxehfo4fauOMU6BvGO +dswAFPGoRz7uMY9/7CMg/UjIQRpSkIgMpCILmUhGLvKQj2wkJB1JyUlOUnax +0+Eb/1hFRvrvinIsn/ist0ZRhnKUqDylKsmXSlau0pSujOXvMHc+y2GPglhE +YRypyMI4WlFrQDykJIcZyUBiMpjErGQyLbnMZhZTmc9kZjSdCU1lNvFyuTsm +HjuJPyH+z5u5o2P3cAnL76FvfbF7wAPPOEZ2prGdaHSnPONJTw5eE4bq/ttK +KnnJS+CNkJXi7KQ3p7lI9NVxjQpcokIXytAkXtOJ9htoHusHTiWCU4KUudTt +WvWVVsozgSQEHzbhSdJ3mnSeJUWpB0upwodqr43k9KgGd6nHkCLvhDT15QZ/ +WZundS5z6ZlfIBHpP4NGVH9RTGhDl7o/ljKVftrU5A4tyU2hTpSPRAWgRK9K +0frZBnKEA2ows+dFo7IRhP7cqfEuB1OVurWeXlTfA9jnwD6W9KF4TSA6ZTe8 +NqYVreUEbPNiuk6aytR3Ov3gV233089sE6v3S2AVK/pEq15ViAokaDWluVlq +ypWWec3rYwU5WTuylIqW9R9qKftIyla2m6kF/mBPNxdW3KzunK8rHeZyy1vV +1bK3wA2ucIE7W8YmDnf9M+tTI4vN5SpRqc6NrnSNWFzOwSh+1APpX1952PFd +jrvglSX30BfewJa3u+YV73m5K07eKRe2XY3va+cb24pCl7VHlW9sIctVPULX +k/zNan/xq98AE5i+Bs4vgges4P3mEZhaMahf2ypYm1aYsBi+6QrZus7BatjD +IO7wOg2K2N359cMi3q6K1XphFK+4xSF+sYVnnOEYs3h3wMRc/7Zq2a36uMdA +brAEmxtkO/54tEYG8n0VXFFuOnmiTyZqlI+cZCSTtshXtvKUsbzlcGYNAHQ9 +q4n3md4yV5h45zsx/nq7a9QZ5/LMZl6veuccZzqjEsJZmS9qA9zgBBe4v1K2 +I5H9vGAB+3fQr12tofN3YAcbutGEdjSkGfznR/eZwaBU7wUNW2JycnqKNv30 +jQkrVU+H+tSmvkBmx+xmFG8a1cUTtaxhfbxZpzrWtO40rm9d61yDmte6Fl57 +eQxlPiuUxwQeMkSH+F4juna60I72/cSZ4gmTObEcxHY/MahtU267eTxMa7ex +He6dqjnbNL6xuAvL7nW7m9vthve7Zxpves8b3ff+Nr7lncFhBxq+hZ60pen7 +7Mom9QGuBSf69kzsPXfV4QUfeMAvLXFJU1zgGL+4xnmX0bWUDLtytHa9/ktM +PGyDuuQprumKRc289LE0fa1eM1n53WuU2xzXN685zneu856TnOc/9/nJgT50 +od8mcLXdKFsgO+lnZ7zAEY/4/tIJ2mUXnNjFlu9QJ17pp3P96xbv+sbBLsjF +NvbsyA0xqc8t4xqn3MM6HbeI+fm7vQq9pqbuq5jtnG4bw/jtfQe829vu4lEX +Hs48nUziFu/YKhMc4GEHe9SZnN+oUvzyd4Q4f70e+c5H+vOUJnvoPV9dxit9 +uKhPvepXz/rWu750pU+6WKVN+9rb/va4n3ZGM8X7xsuc78Cvs/B/P3w5Fz/4 +xE9++NoL+oo3n/PPH7vnRx99sVtf9M6nvvaz/s99ymZa5Yb3e+AJL/7Bh1/w +hx//+cmP/vKn3/x/Z7/8179+5ueXyll2fP7332X995//WYd//zeAAchlBahl +B+h/CQiA/yaACxhl1EZ3yod8xjeBx3eBFpiBFbiBdkZHUrd90AeC0ld92BeC +3TeCInh903eCKvh53wd3voZ3uzaDvQZsv0aDwZaDN1iDOLiDOiiDPBiEP2hr +PQiEQxiDRCiEPriERsiESXiEiQczyORouVeFVniFWPhJwHRv+QZ+9kZz+/aF +YhiGZKhvZuiFZYiGZyh3XciGYLiGIweHbRiHaliHbjiGckhzPUUbffMfgEaC +K2iCgoiCLFiChDiI/i2YgoaYiFmFUYo3OKY3ezNncmhYdEF3iZaYiZW4iZTY +ic7jiTmHiZz4iaQYipoIikQ3iqaoiqmIinfniqIobIr3F7Lne1SoiIF4iLrI +iIi4iL6Yi7y4i7+IVbunOJHoezGnfvFHf8vYjMr4jPAHje83je5Xje13jfPn +jG7niO6jLaaXKa8XjuI4juRYjuVYjEh3dpJIgeyIgRzoju2ogfH4jvL4PHt4 +LUAVVFm4j/zYj/5IPxH4VikFVwJ5UgR5kAOZkAapkAXZkC9kf/8YkRI5kdH1 +ggyJkAuZkQ55kRypkRi5kR7JkVHYQEzXWZrFWSjpWSp5kitpki6ZkiwZ/pMv +2ZIwOZIJM1bzmJPwuJP12JP0+JM6eWdbqIA1WZQ0eZQyaZRJiZQzuZRO2ZRQ ++WBbWIo8CZRVGZRW6ZNYuZXp5W+Up5RRyZRgOZZiWZZPSZZnaZbVRG2hGJJu +CZJw+ZFy2ZFxSZdz6UL36DTYlWQfSJF++ZeAqT/oqI6S01Hew2lveZd1mZh2 +2ZiM+ZiLuUI26RQed4x+WJKBmZmauZl3NJigclwd5W2RqZik6ZijaZqlCZmp +aTyDaZngaI6wGZuyOZu0qTPdSJhKpxpaeZW8uZu+mZXAyZXdlZef+SL6yJnI +mZzJGZCr2Zyo+ZyqCZ2nGZ2JCZHKeZ3Y+Y8W/kmd09mdzsmd3+md0imLX4aZ +aomWYZmW6pme7Ime7nmeLcmWvRmc8ymc9Pmb9hmUAZV18Lme7+mf/dmeAfqf +ArqUFqmJ+FmfCpqgDHqfDjo+Xql1BTqhBFqhA3qhAJqhE5qXGmWcOAl04Dme +IhqiJCqeJUpPnlmLl3llfZmdLvqiTNVxYIV2hkk9iGmiOBqeOjqiOcqjaJWi +fFiYS2eeMFqkRtpQEOSZYDV7ormjJ+qjUPqkUnqaHPeINAqaXFKbWrqlXNql +wkWc25KPdbWgD0qm+WmmaNqg02OdR9qmbspQzBmlPTqlTjqndtqcQ8Eb+ZgR +U/imfvqnSCQUQSqk/o6hdncqp3WaqIi6qNE5mToxqLnZOOapoRZKqRhKoZda +qZgqk4JqXXtaOWeqpmlapqJaqqQaPJ0qOZ9qEcEUZZn6qpYaq5s6q5paq4iU +p1QDEmN6d6Yaqqfqq8A6qsAXoXpGq7BqrLJqq8l6rGAJpiuDjG15qHTKqNJa +rYrKjUDhcS4CiSqadlLUooAaruLqZdlqXfGjp5yzjtVzo9dqrdTarvD6rjTk +qM1CXIlirp/BrbiZdo04rv76r1YVEX06RKuqqg4hOK6JM166sAzbsA7LIhAB +RBtYsLezqgjbraEJsBq7sV4VsYwmfRT7MMqBjyAXrL0qrCh7siobXgJL/nIn +JhwOkAEBAEEWEAAaYCQAIAEYRLEsMbC4CIhA+7NCW4jAOIxD24tFm7SQJbD3 +I0EJcAAJkAEK0AAZ0AAKoD4x6wABAFU8MVbR+LXUiI3MKI3WmI1kK7baGLZm +C7ZlO7Y1xrT5pBXAEwA1e7NRmwAxCwDZE7Ir0apE6YANaICBi4CD+7eCC7iI +e7iKS7iJy7iLa7iOG7n6R6+haXkSoBU6u7Vbqz7Z5Ld8qxK7+qspK7ora7Kk +u0otK1dhtjsL0ABRsQAZcAAMUAC9IyEZIBzF87kp4bNBS7S9i7S/K4xKe7TC +G7zB+HCUO6SWNwAWkAEWMABVCwAMkDs4G7MH/hWxrBISXqtWT+iESPi9NtiE +4tu94wu+RUi+6Gu+Sli+4Zu+7au+P5i8uhm3eRZnuosSQLR1HLu/fgq3kEdo +93sSoTuHBPyGdkiHd5iGCZyHeHjABdzAC+zABhzBFIzAFvzAIZW6rmZuHhbA +B8uH/7KiwzS8vku8x2u0JZzCwGvCKNyL2OoilbZoWcWzEvGNNDqkowSLp0iV +r8jDoqjDrNjDqwjEROzDOzzERhzEP5zERYzEywO3Z7tdNCyw6Jp03npZxcvC +JLzCKpzFXXzCW+zFFzU/VGyv2quvNrx0M9e2acvGUey2agvHbsy2aPvGbVzH +dLymVrqkhIoVqdVk/mIcyGBsvC0syIU8yFocaS9MFxe7rwr7sJAcyZIMm87a +eyLMv5gsrgc6uqbbyZz8yaXLplw8yoYcxoj8xYecyqZMdnG6tnF8x648x69s +x7Scx3KMx7NsyzC2nwzYuJD7y738uMEsucMMzARYuMWczMfsy8r8gFe1yaUL +yqfrydHcq2yayNiMyqu8zYTMzdlMysgbp+87zucLv95LzuvrvuWMzkfIzue8 +zvCczubMvkUov5ySv8aWyfp8ndCswBc8wf8MwQHtzxjMwAQN0AUtwQKd0BXM +0HRIno+DOBjjxwD2zaXczRht0acMzqpMgov8FMdFi5GKGOTTxK3IxCjt/sQn +rdJCvNIu3dIwvcQsLdMvTdMxXaURHaRpPL/7p80Z7dMa3dFB7c1A7bve1JoY +q8Zvhsuy3NRM/dSxDNW3HNVUPdVWLT2tmTNCOslc3dVezXop6sg4PM3STM1k +Xc2kS5xh5aH73Nb9O5XbNa1y7a5zHa91jWND+YduvdeaKZ92TdeA/deC/a68 +jGzIetjKitjMutjLGkn9bNaQXdaSjdbsGKGGndiYzdiK3dibfdh+DXiRTdmT +fdakLV6FjVWcndmprdmq3dm2+tgbPNh3PduBLa8Lac9IEcIchcMjDK58/du3 +l6R7jJtMOk61TduyfdzKjU/kahfamtQ8LVDA/j3dESlEQJqujtVDyG3by83d +yY2QwxPWafzV5F3e5r06SC3WPF3aox3a7C3aGVjJ8GOL1F3fgbmd3b3d+p3f +3Y3bfoJMvm3fAl57n73f3+3dCG7gdnnars3aDr7aEN7gAArb8P3eFu7eGA5L +lv3HEt7hrf3hD+7hyfTZMpbhFW7iFz7ZDP5vIQ7iEe7iIv7iwyTfw6KbqqTg +OM7fB37X/l0UjbzTFC1MAT7gRH5sPU4Uz63eQb7GCa7jTb7j/d3cdRHS2L2i +0l3kWC5t1j3cBnt65/3lYB7mXXKbG4WlPJ3laH6FHFqZbN3ebn7ib57i3AOR +HE3Udf7Tdz7UeH7R/v31fd3m1FUNy1ddy7lc6IA+6LpM6GV7zcbszMi8zMIM +6cQs6Y3+6I7OzJTezJa+6QHJcnL+6Sge6qDsgTvG50Wd56du6qi+6sXbzxLY +zvEM6/LszvQ867H+zrae67K+67jO67Xu6+l75CHis0Oe5sZOXXlNhg697Ajd +7Avt7Af97NIe7dRu0Nau0NWO7deeWKT+sRut6uD+7eIu1Kk+7vv10SA9o7tt +47lk0jetxEdc0/H+7u5u0/Y+7/cO7/pe7/je77+jpINa3LdY7uTO6ua+5wev +51oso8bVxyStbohu6FIt6BSv6BNv8YGO8beM7k1B5VYcmoCs8ARv5+Fe/vAl +T/KMKOWM3OU3LOYu//Llfd0fz9vHXvPSptYgLKaiDuc8D+pxjtNYM7AGb/IJ +P/IIT/RIT8J+fvGJ3vQSn/FOf+gVH/VM//Q7xeiajumXHulbP+ldX+lav+lh +P/ZcL/aW1enJuPM+3/NqL5zdvj9Dj/JJf/RyX/d0v7RwrWHqrOu93ve/7vd7 +D+zzHPiAP/iGT+vBbp3FbvOML0Bo3+4Dve2Rr+2U39DQLvnMPu2Yf/mVP/l3 +SOPrTtGTV/Rxf/ciX/qnf9EczxQ/PvPsrvcpLe/7Hvv0Tvv5zu+zP9P+jvu8 +b/sIitc5raICn8+ob/SpT/onb/ojn95A/vCI/qfxU2/10S/10F/9VA/1Er/6 +mmOMSQ3z3v/9kMz8rs9YrMqn5o8RU8wW518561/+6N/+FZH+QVHF15Wv73// +7I//7p///L///g8QHAQOJFjQIACDCRUSRLjQYcGGDyVOpFjR4sWFETEy3Hiw +I8SPHEMK1PixZMeTG1NiXHmxpcWXFWOOpFnT5syJOCXqfMjToc+MNYEqHJqw +qEeaR0EmtdnUqVOlIkdGHUiVpFCsTLVOzcp161OwYWF2DWmVg1m0ZE2qRclW +pVuxceXOpVvX7l28efXu5dvX71/AgQUPJlzY8GHEiRUvZtzY8WPIkSVPPgsg +okbLdzOT3FwZ72XM/mZdlhTNErTf06hLUybK8PJVug1li1z9c/ZZ2LV7wvas +d/Zt37d1y+TN+qllzEjtIkRetXNd0rk/d2aOWqpvzsOJ4zYOFnh0zdK5azd6 +/Tn0q8CxV7U+XnV3ua+vx16qfm5y8cvTIye/k31f4QAsDr6s5Bvwvv8C1K84 ++xDk7kD03GuvwfAeJPAm/Co7Tyz+OHPts+xSm26p4EIU0MP3LlRxRRZbdPFF +GGOUcUYaa7TxRhxz1HFHHnv08UcggxRySCKLNPJIJJNUckkmm3TySSijlHJK +Kqu08koss9RySy6vzNDCk1riL6bNNuzyTCZfM7C6+cwLCkI040xSTQYtnLTT +zQeZy6w5DdmTzUw5A63xtzrBKy9BRPP7k7f+BHXUMDZxW7NN5zrMk1FML310 +Uxsj9dRSOMHMVL4xGQSUU1QJ9FRTUVtLVEJY/yMxVVovNPTWNxUd9VUDa/XV +OFylGjM0Pk1ktVhif1V2WWabdfZZaKOVdlpqq7X2Wmyz1XZbbrv19tspKaBR +3BnJldHcbdGFUd0X2XXR3RUDAgA7 + +------=_NextPart_000_00A0_01C2D362.16CA7D20 +Content-Type: image/gif; + name="tpcb.gif" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="tpcb.gif" + +R0lGODlh5AEKAfcAAAAAAAgICBgYGCkpKTk5OUpKSlJSUmNjY3Nzc4SEhJSU +lJyc/6Wl/62trcbGxs7OztbW1t7e3ufn5/////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// +/////////////////////ywAAAAA5AEKAQAI/gAnCBxIsKDBgwgTKlzIsKHD +hxAjSpxIsaLFixgzatzIsaPHjyBDihxJsqTJkyhTqlzJsqXLlzBjypxJs6bN +mzhz6tzJs6fPn0CDCh1KtKjRo0iTKl3KtKnTp1CjSp16FIDVq1cHYs1qcOvC +rVYTggUQkmxJs1TTql3b9SBarQXfTpAbt61bux7pgtTLtq9fpnoDw8VLeHDd +whr55v3LuLFSwXYVi72LeG7csHCxdsUskKzmzJi5Evzcea7o0o5Tq9YJ+bBk +hHT5xj5sufPb24Y51zatFS3u3L5Hrx5OfGbr3BLHyh4rvLnc4M5p/0a9m/r0 +18Wza9/rFmxziLMp/n+vXvu5YdrWxwfm/Bv79vfwLx6vPPrzfOrfmZOHXph/ +9duhneeZe/EVaGBD943nUIKtySYdbA8KeN5uAOJ34IUYMpSgghZySF6HFLoW +4WDm4XfdiP9lqOKKlWFXIoTocfiifymml596Avo3HYs8YrjhZad15xVs3m22 +4366zYhjb2HpGGOPUEYp5ZRUVmnllVhmqeWWXHbp5ZdghinmmGSWaeaZaKap +5ppstunmm3DGKeecL7FHIJ14zmmWZyDm6eeffH7456B07tknoYi+GWhsyjXq +6KOQRirppJRWaumlmGaq6aacdurpp5w6ZqihCgEQgQQRpIqqqqme2uqq/q6y +KmustMJq66u4znqrrrnW2uuuvvIqbLDEAmvsr8gOe6yyyRbb7LLOMitttNRC +a+2z2M6aWmi6wdbqt+CGK+645JZr7rnopqvuuuy26+678MYr77z01gvviqaq +CoG+/J66r7/9SvCvwAEPbHDBCAOsMMELH9xwwgxH7LDEEE9sccUYP6wxxRtf +3HHGHIfsscggj2xyySgvHAG+9rbs8sswxyzzzDTXbDO7LNt68sc8k9zzzj4H +DfTQKQtdNNE/H6100kwb3TTSTrOc6r+tUm111VhPnXUEV2vtNddbdw3212KX +HfbZZKM99tpmp+0222q3Dffbctcd99104z33/t525+0333pTLXW12RI+7bWH +F4644Ywv7rjikCcueeORUz7545cjO/i/VAP+d9+ehw766IGX/rnpoqNO+ums +p9766q7HDvvVOecKAeaW54777pXznvnvuvcuPPC+B0/88CurmO/X4M6u+vOv +Qy+79M5Hb/3011eP/fbawz74rre/CvX4SzttPvlPl4/++eq3n/777MMPdfIZ +Ls/52jfnr//+/Pfv///y2lfthHW79RnQffFL4AHlh8AFKrCBEGSgBCPWKrbY +yUil+lbn8AfADnrwgyAMoQjFJTi1jMpCLlKcA1cYwQdOkIUvbCEMXUjDGY4M +V35ZVH1eYz+tbbB7/tQLYvaEyD0iAnGISCxiEo+oRPwJ0IKoaU8Gj7Wv4lkR +eVc8nhaNx8UsdhGLYNyiFxnWF99061Bz0aC5mMhGI7pxiW9sYhvhSEc5xlFu +9EsLdKS4Q1D58Y+ADKQgB0nIQhrykI1ai332yMMROvKRkIykJGs2wC+KMYyW +zOQYMbnJS3pSk5zE5ODCtUHmbU2NpCShKlPJyuat0pWtRCUsZynLWp7ylqbM +JQd1Wcpd+rKXwHylLXkpTFz+spjEjKUxgxmu7w1MfLp6ZsCgWStpqmya2Lym +NimYTW5u05reDCc4xxnNclbTnDpDJzXTec52svOd64xnN8npTnl+U53z/lTn +5rzWuftlrZ/M8yc/UQlQJwb0oAZNaEEXStCG/tOhA32oRCNK0bExdKIWhWhG +MSrQjVa0oyBF6EU/KlKNhjShlewkKD+p0paGkqUvXalMXTq5USLzmMpMJi2X +eVNm7lSnw8TpT4UaVJ8WtadIzSlReapUozJ1qE4Fah4vtLyQTY2bBZRVVmO1 +1VV19arS/CrXsErWsJZVq2flalq9ulawotWscH2rXNUaV7rOla11xetd3WrX +vurVr3z9q2ADS9ix5vWqUz1QvsQ2ycY69rGQdWRKoRk+flUWYJclWGb3tdmx +UjadnQ0taEf72dJalrSnNS1mUbta1WqWta91/i1nYTtb2Xo2tbhtbW5ju9va +9va2ug0ub4Xr28QaaHl7O2pTkwpV5iq3ucuNLnSn+9zqPtW6Us3uUrUb1e0u +9V/fS1ZmEYtW24HvvOZNb3nXq1b1tpe9bHVvfOFL3vfad773rS9+96vf/gKX +v//173gDTOABGxi99C0wgvPLqn1ysLsQdu51J8xdCVdYutj1boQxTGENW9jD +HL5wqrZlRg0Vi57wzGc9VZzie67YxS0WJz5hbE8Zv9jGMUZxjXXM4h3PGMc+ +vjGPNSaq0pBKLLIs5Yap2+ElZ9jJTf4wlEX8ZClbOcQgZrJ2R6waHWaQWVXE +VZhZNWZXlRlVZwbb/q3SzGZftXnNbo4znOcsZjnXmc5ktnOe8WxmPfeZz2j2 +c6ABreY7G3rPh/5zoge96EIj+tEq63IUv8JRV/7wwZi+tKYtzWk1btrTncba +p0Udah+WGmyjNjWoV01qVqu61bB+taxRfWrO1jrTt041rV2961hjWtK2YRQi +h03sYhv72MhOtiC3RSJKR/bZ0I62tG8mKq6csSsxpelMs81tmHp729/Wtktt +SuUoY3nKWa7yua+s5XSbu93ojje7qzzAzgr5x0MGco/3TWN+67vfAP+3wPNN +cHwb/N4Iz/HBFU4rcrNypB6N+EkhPnGTlrTSCrV4xjFO8YuTdOMf7zjI/iXu +cZKPvOIc17jIuVy/z4Kz2+COubhhPvNw0/zml5RaL+f9bnXDm+flDrq7hS7v +dRv950evJXiVd2LD7tXpgIX6YKVeWLFava1Uz/rVD6t1rG/96V+PetinPvaq +e/3sXC9719NO1goy/abTjrvc5y53ZxKYuP8t7nD3rve+5/3vorVt4H87eLwX +nu+Ap23iBa/4w/vd8YsnfOMnz3jE6nyNQB+65ouO9M77/PM9Dz3RM8/5oLq9 +5cbSu4AXDOADy3f1r1dw7F2fYNoz2PatZz3sa6972fN+9r3H/e5vH3xYOXzn +o0+66DdP+uYrP/meX37ppf/KpZuwxED68jaD/szw7nP/+/4ueMLBH3Dxez/8 +Cyf/wNOP/vF307hQOeF+TLxLxlL/+czH//ShD3r+3z/6/hd0nZND5bFDlAZP +b9ZoCQhpjMaAjqZoDriAEDiBDUiBD1iBGHiBGiiBGciBGyhoH0hoHjiCIEiC +Ith08BcV2NdsSGZMvmZrvAaDL4hrMUiDM6hrMjhrOdhrOmiDPYiDPsiDQriD +RBiERQiESJhrSliDusZyJjRp/aFsUjiFVFiFVniFoaJILAiF3kJ3XviFYBh3 +imRtjHSAOCdzZ1hzaGhzbLiGbog7DheA+QeAc9h/dfh/drh/dyiHemh37ld+ +7AeIf7h+g2h+6meI/u13foKoiITIiIhIYw6GciGncpSYcpY4iZdociK3iZWI +iZ6oiZ0IipkoiaL4iaR4UpPVhmq4imnYiqroim94hnGIh7TIh85Hh3qYi7eY +h7tIi36IdmAHjGInjGRHjGbHdsgYjMk4jMtYjM14jMoYjcwojc5YXpenS2GY +jdq4jfuTioZHeZJXeeE4jt8ojuVIjogHeeoIjufYjunIju9ojvGIjsU1SvZn +i/rXi/iIi/q4h/6oi/moTNbnI9kifL5HfMCXkL+3kAjJkLmnkA0ZkQ/pkMM3 +kRJZkRh5kBZ5K5HIjwHpkSDJix8pkiFZi/+4iyTWGyaWeoHYiIfYko/o/pKJ ++JKFCJM2WZM46Yg3+U4DSYCWcWRd+DYmCZAluY8keZRD2Y9EiZTfshpe1oLO +YoIKWIJUeYJWOZVXGYFViZVcqZVZaYFS6ZVdCZZbKZYM+EzAxhvOZnI3uIRt +yYRu+YNxOYRGWJdJCJd4+ZZ6KZd5yZd7SZd3OYNqBGxAGWxYeJiImZiKuZjL +VmRcGJTcaDMAsAALgFyReZlfWG3c8hVXEYuvaHOTyQD5woqf6ZmmSZpfpDyU +aZlMeZIjeUtYUS5LmZSvaZS0WZTHpJqVSZM6mZO8SZML0CrB6VlnFpPGuZO/ +OZPKuYjJyZzZpJuLNYold4rTWZ0nV3LDKZzZ/plL1Hmd3smJ0vmdodid4GmK +1lme+KM8nYma7IlJ2TlowWlv7Vma83masMiRb5edSqaU/Hluw7mD24l5tema +uDmbtsl/PQkU3HIn8uEqwZliahehxrh21AiNEfCedzacFCOhz0ih0/ih1Qii +FhqiJDqiJuqhxXh6QcEfDFoRyEWZO4iZ7EKZpnQ1C3CPMpqjj0QULHoW0LQA +8Ph4QRp57iikpgWkL6crGvorRkqPRDqPRfqkTRql6yiPUwqlWOpb4cOjyEES +PZQq/9mfBWphN5pK9lemA2qgBNqaaqqmKqqgXToSprIrQAqRG5mRBpmnvVen +7xcwNLp3eFp8dhqo/oOqkYRKkYaaqHoKkUVBhiZhmba2nW0qpkUVn9jITGia +ppR6m2y6qSKWoFKxoM9xbVohT0iKnMspk4DIp+40MbjyoM2pqrJ6nL6ZqrTa +m4yYgk4BlC/SgvsZoJOqqa0UoGqjdGB6oGvKqcqKrFM2gDxKqqUyIUGCbXhW +p2FJll/ZgWUJgacqVuN3o9kagmOpreF6reQ6ruJqltiKrh7YL1yKRoRRIpIB +qa6UqYA5l0eIr3YJLvZarML0L2EamH45sPfalwX7l/lqsAmLsPtqsE74EIEU +ETTyFRPiIaU6TWNGowFmrum6ruragaxqLQczYA66ref6sR17sh67sirb/rIp ++7Icy4FomRyf1KITOxkVW5iaUpmM+Sk8O0ir2bNCO7SHNBGsOS82W7FEEiAk +0kiLg6H0iXMh221TG7VWa59Xq21Gy5NFEwE2qxw+OqOYSaw0Q7Y6erbdSLPm +ogAAoAAREAAPEAEPEAARwLZW0QCt0qIuUVU3dKwy9LdJE7I2xC+CC7g1ZLiD +G0OKe7iuYrSpshXiUwAEUAARYAAJIAEJYABe67YKQLePK7EtcbTjcj+WGoZh +ajNUU7pou7rUpraTuZpYA7d0qwCUWwBue7RJyxJzuk5JeqG8i7gyRJlcu7g/ +OryMe7yJi7zAu7hIs7VeuwAMsJur0gBX0QAS/kC3AYAqc2oVrpK7K/Gl/go2 +qmtHdVQ3+klLc8Sv45u+7HtH7lu+7xs7jvu8sNsqB5AAEZAABxABBIAAA/C4 +nLs8X6sfcqpCwAW1WEs5D+qq4eYwCFyfEHyfEnw88wu5qiIAcQsBApC/AIAA +qWK3bZu3oKu7GDe6F6q67Vu+Zou+RHRKEHC65BvDKSzD8TvDpDO/Jtwu3qsS +uwtfZvUqS5q1kLPAEFNjvdO7DzzBCRzBQjwtzqssvXsrO5wSyIV8snmsNmxE +K+xRBbU9/wrDWQy/YkzDYxzGugqVvjZRV6O3oSteG7pfGpq8BkTE2wfFCERN +7ynHy6u8zLvHM3TG/l2IY1Eswj7xpUV4xb7rWMB6XVa8LniUyI3MupKMLk8k +sYD0Ez1sOJWVWWXKxzVExyzZquXzLAAbxH18yp6sx6j8xw+bQ3syrXFhXcgH +sJK0wqDTMjgqvkI4ybxMLiXEGLy6loD2w/8Vx35cMaA8yOi0PkyqpMt8zKsM +zam8xziUlilUUbc0y2BqxnZDrAL1yGXswomcUGRcztxcw+j8N2CTloISy1QU +LZtsK6bcnqB8xPQ5MJ2sxEy8xPpMTda8tIcUtMr2s0TbKARd0Aid0LAMRUqL +bTYHq/T5p/0sRhLdxPxs0RGsmYUJmTOzxR0dmR7dyyKdUn+czIZrzNGc/tIU +ZNIqrcrT3NLQbI8xQ8v5M77ZuC8hLdKSHF4tJD4sfbz5LM0u/cIwXdQvfdRD +3WBvx5baI5xJRkSL/NThPMZOnc7mbNXnPNVw441jZDAQrUn5nGYYjUXPBK4T +fdForYYyjVBe/DWZykS2fNVajannO9dYfdd2XUc8fWMG7CvCy0lhbYFjfTlJ +eqppfda+E5v7jJ8tR1FdfMuxhKbaU9e+jNcxLM5cQ9lZLdec3TWvW8VS3dlY +w9XNDD/F+7s9E9QUmNSobKrGy9pIbbifXdqxTWRLnVyRjMjJldPlotm85oU7 +1686TS+ffbq5nT97/dogQ8oXmkCqLbJCDUHy/onTgwbb1t1CAm0qGqvcKg3I +gLGCTKJ932wvuczb/Ko3X9jInWPew93bwc3eNVPJVCF/veot0G3az2zYQfPc +KHbdE0TbP5rH0W3UDjTPavbC+g3bb6pHpjGqjRS+nA3JaqOx27XZTAR34WLB +lm3h1APDo0ujHL7gU0EqfBSUoSxu1N0slpqrg10tDPwxABC9lQlgh321243a +sHLjUVtGjymtjJndW3HQCm1slCnkQ25IRj4pRY5sDF2AW+gWNT7OOY7YVK4s +ryuaLb7YVW08FK7W17eZUfTgkBSg8N3eXosVZb66aT6sa34vS13bQZO3sTng +cM7Kp/Kn/l3nGNPl/sysKnhuuN6dHaLbQVTzurtp5vTS5twoqfTiTxQ+MyRN +57gSmtJ74HSe58wsvJh+6c3d311LuCsOQw624Wdj6IMe4qJ9PauE06Se14AT +1Y8N4eTy6DGc3Pr8LxoeTlW+xC++Kl2+6y7112I0siFT5JvUka1OyWyN6syu +VFkDxsluw+drVOCcw24N7dGTiiSL4oSd5bdeTl+F0wbu7cdTz/6G48x9wlu0 +1q00w6G9n9Ee79g47xqEwvIuw3EtlPfoUzsn7tpj63/X3XaMgnpO4Mv9Yyhd +8J785wxG8OS07S+n6V3bkccNM7HOwoiOo10Mpopey/Ae2r7EXIyVumUu/t9U +Bc9wjuOebvAsb1XgzpLh89Ob3jQJ39dxnmCirO49I+IWBN6QeWn+U/EVL8ka +X9m0HnfCfTUXX9n0HjqkdPSt5JhPaeLpPs3T/VstP/O6TkAyluCczjTbrWNi +vTHNHM9V79Ugvn1O2eD0l1FAH+ECyvSpPvdNTe+llPauPtmYli5Lpt4dxvHG +SpjwmsmEpoq9bsTkfprPVJwJk8SJL+D1FGaMz9frBfHPfOdfTUbM5uR9dOSe +7/lAvphJ/vlXEfpsDBhPDuWJr+Wrn4bjjtaOH+WY8+sabRttj+i4Ly5QH0K7 +v+jBOSSKlfMKr/XE//WoIvPRXbhZD+h+Tumn/v8XoJ370l/KI+ThkelPpk6Q +lz/8xl/8LV+8m+71y9/as5L9J/9xdH/vzZ73aPPe7D81u7/069/Wj0saxyX7 +wJ7/99wvsR/sfwYQECJEkDCQoMGCAxMeVIjQYUOIDCUupPhwosWKCgVCWDjB +40eQIUWOJFnS5EmUKVWWBGAwgsCBMGMalFmT5s2ZOV/i3KnTpk+eP3sOFVo0 +6FGgSYkiXarUqFOeTAcuWNDU6tOrNKu65BoV61emYKGO7Qpz5Vm0adWuZYkR +IcyMFyPGpet2rl25eeve5asX716/fQEPxgi3sMKthAX/jVBVgmGNcyEHpqy4 +MuPIF9lu5ty5c8uc/kKzkhU72nRp1GFVk159ujXW11MXpGYte+lGqbRd1949 +lKvMCJ6FDydOsqXlx5mTE4TbXLlz5s+lR6e+3Dr069OzV8feXbt37t/Fh6+O ++aBj8NvVw519WXB6+OPXy48fvPh9/JxBK/Xd1f9/AAMUcEACCzTwQAQTVFDB +0qhaUMCtXAIutwcrtPC/CQ3Kb0MOV9qPrvrmI09EEkM0kT4URzxRxRRLfAk5 +gRZwkUWC2itIIBhbXHFGHiezzr4Og/QQgI8AMDIkI4lsK7SoLnTySSijlHJK +nSRsrbEnHaxyJtz4o/JLBAUSckyUlDRzJCVNOu6vHdvU8U0ae4RTzjjd/pSL +I/OScxDHFdu7CMc87aRz0BA1JPNQNSdIEskj1bRyS950kzS2SCntbdJKeRuw +tKl+ay1C4DJ8tL9ML7UU04EQVVWkMxUFqVXj2FxsVvdqRS5PXGm9VddcbXUO +zxcDta3WqgBVbqeEgJ3Ix153tbVZIFddNU2PqC3SUSYhNbVUVLs99Vtuwe0N +wytjFIuqDCeEKd0mw3V329GklTZNWF21t8gk89V3X3779fdfgAMWeGCCCzb4 +YIQTVphgqgJeYGGII5Z4YXlVzbdaejE+aT8wO/b4Y5BDvjBC/0gW+eSOK1aZ +rQ+h5fXlZ2F2dmaXY7aZZpkbk/GhnXP2+eaa/nHWbGWiz+K4XVKTFnVp/5gu +q2mon5ba06lHtRppp6nW+mpts+Za6aofztdkr7GOemuzq04b7a6hLvrtlNYM +9li6y6v7x7t91Fsyvpftm6K9/RYc8L/fKjzvw+1WHO/F9waAgYaTJXxwwylH +3PLGE2d888A7gvvzWAVc99FQqxwdp9J9Oz1b1ntK/XXSY0dd9tZXd53222fX +vXbTe1d9y9UBoOph0X2Hfffcef99+eOVb9430KNH0nCOmP1ZaOyD1v767YHm +XjB9G+Lze+/Lz34x6dNXVNuzvy67bbXhZxvs+Omf/3373W9/bf2fZnd/ctUP +fwMEYP7455VUqS96/nLzW/Ug4kCGQFBykJFgTPBWwRdR8IIb1GAHH8jBD3ow +giAcoQgnGEIUljCFJ1Qh5gazERKyUIYWNCENV2jDFs4wgzecW7QU+LajIQ1l +QyRiEY0IoNTd5ohLXNAPQfchGB5GWcmZYhQjU8UeUpFwWOTiFr1IvS9eMYzR +6SIYzSjGM5JxjFpMIxvRqJ2gWVGNbZSjG+f4xjvm0Y57rKMV8eTEz4FGVP27 +XwEJKEBDJhKRiywkIwn5yLU57XTqgqT8KmlASx6QfQkEZNEYuEYLPmSKofyg +KDMyyiyScoSmZGUpXbnKV0qulbCkpSxjqUpb1hKXu0wlHusCKGPpspeo/iTm +KY05y1wmk5fFNFQniRbEpGkSk9M8ZCOteclqYlOR1zygaDb1TUdKM5vi3KZZ +nHmfRikqnaFbXOUm9053xvNy8JynPDPnws7Zk3Oay2c9/dlOvjgQT+M7CDDv +Sc+D6rOfCf3n5nx4zs9US6JlgpQ3M3lRam5Tm+HE6Dg7qlFyCvFAg8woR0vK +zYsCB6L4IdKiNka5YN7oTzOtSEyR5RCb5pSmON2p+Hpa0J/KtKZBvalPh3pU +niLVqEllakzreBi/6FSpQJ2qUJm6VKxS9apa7dtKi9Mqa7HqazehZFk9ZVYr +oZWsZ2VrWtu6VrfGFa5z5dJb6yrXu9J1J2rN/mtf61dXSq6Vr3u1K2Hxali9 +dimx/VGsXznpVc9YK6wTo2xlLXtZzGZWs5vlbGc3C1nhZOxexkFnab9q2uGE +NaKnZS1xVLuZ18IWtaBdy8XUWabZhja3kW1tane7Wtf2VrfCpa2QYsuy3+on +ucglLnB921zZQje6xSXTcWu7XOYGV7vbfS53h9td8H6XusbF7nWlm13xppe3 +5zVveNfr3fFyyLpqmW9a6ouW+xqNvfQtL3/3i9/+2je+AyZwgQ18YAQnWMEL +ZnCDHfxgCEdYwhOWnkvvtU55pdOlGK4YvTwMNwznt7offiK+0sdhCrPkVWBV +GYsnKuINNepM9erw/kRvC2KJ0nhlMrYxjkebYuOsU7KeVKeZUDwvJNkLxjHW +8I+B+KoSF7nCPQYymmxMrSXnh8U6RvK1NEZkV3F5x1COsph3nGUJi5bKGU6y +mRGF5ReDuaW2DaSX66zkBa65ymRWM5pRO2M9T8vObj5Uvfys5TjnGc9l3rOa +4FzkQ0d2wyR+JsZkHOmvDjmQRj5yjb+8QEw3WtSjJnWpTX1qVKda1atmdatd +/WpYx1rWs6Z1rW19a1znWte75nWvff1rYAdb2MMmdrGNfWxkJ1vZy2Z2s539 +bGhHm7aP7rGm0UTnIN9Y2ts2dsb6PNrYUptVgeZ2uX3t7WqDW8Ve9ra+wPCF +bimbW96wBrS6xZ1kduf7wuyGVajn/e8Ft/Ra3yb3vq6c6H0nHOALV7XAc/zu +JpNW34v28IZX7G+GZ3zADg/zoO087om72MmqxbjGTT5tfP/YzI8Wbb9D/vGT +xzzC1ta0wSGOZYuDO+KWlnnPff5zoAdd6EMnetGNfnSkJ13pS2d6053+dKhH +XepT34wDRG31BWNdwVqnOlu4DuSvHzjsBh57189SdgmjfcBqjy/bzX4Stzs4 +7sWdO23r7tWAAAA7 + +------=_NextPart_000_00A0_01C2D362.16CA7D20-- + + +From pgsql-advocacy-owner@postgresql.org Thu Feb 13 00:36:15 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 346904761ED; Thu, 13 Feb 2003 00:36:11 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP + id 31ACF475EE2; Thu, 13 Feb 2003 00:30:11 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h1D5U7K03547; + Thu, 13 Feb 2003 00:30:07 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302130530.h1D5U7K03547@candle.pha.pa.us> +Subject: Re: [HACKERS] More benchmarking of wal_buffers +In-Reply-To: +To: Christopher Kings-Lynne +Date: Thu, 13 Feb 2003 00:30:07 -0500 (EST) +Cc: Hackers , pgsql-performance@postgresql.org, + Advocacy +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 AMaViS new-20020517 +X-Archive-Number: 200302/55 +X-Sequence-Number: 813 + +Christopher Kings-Lynne wrote: +> I'm not sure what I could test next. Does FreeBSD support anything other +> than fsync? eg. fdatasync, etc. I can't see it in the man pages... + +You are already getting the best default for your OS. It say 'fsync' +for default, but the comment says the default is OS-specific. The only +thing you can compare there is open_fdatasync vs fdatasync. + +-- + 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-advocacy-owner@postgresql.org Thu Feb 13 01:28:28 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 9EE18475A80; Thu, 13 Feb 2003 01:28:27 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP + id D44F2476548; Thu, 13 Feb 2003 01:12:36 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h1D6CHc14823; + Thu, 13 Feb 2003 01:12:17 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302130612.h1D6CHc14823@candle.pha.pa.us> +Subject: Re: [HACKERS] Changing the default configuration (was Re: +In-Reply-To: +To: Peter Eisentraut +Date: Thu, 13 Feb 2003 01:12:17 -0500 (EST) +Cc: Tom Lane , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@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 AMaViS new-20020517 +X-Archive-Number: 200302/56 +X-Sequence-Number: 814 + +Peter Eisentraut wrote: +> Tom Lane writes: +> +> > Well, as I commented later in that mail, I feel that 1000 buffers is +> > a reasonable choice --- but I have to admit that I have no hard data +> > to back up that feeling. +> +> I know you like it in that range, and 4 or 8 MB of buffers by default +> should not be a problem. But personally I think if the optimal buffer +> size does not depend on both the physical RAM you want to dedicate to +> PostgreSQL and the nature and size of the database, then we have achieved +> a medium revolution in computer science. ;-) + +I have thought about this and I have an idea. Basically, increasing the +default values may get us closer, but it will discourage some to tweek, +and it will cause problems with some OS's that have small SysV params. + +So, my idea is to add a message at the end of initdb that states people +should run the pgtune script before running a production server. + +The pgtune script will basically allow us to query the user, test the OS +version and perhaps parameters, and modify postgresql.conf with +reasonable values. I think this is the only way to cleanly get folks +close to where they should be. + +For example, we can ask them how many rows and tables they will be +changing, on average, between VACUUM runs. That will allow us set the +FSM params. We can ask them about using 25% of their RAM for shared +buffers. If they have other major apps running on the server or have +small tables, we can make no changes. We can basically ask them +questions and use that info to set values. + +We can even ask about sort usage maybe and set sort memory. We can even +control checkpoint_segments this way if they say they will have high +database write activity and don't worry about disk space usage. We may +even be able to compute some random page cost estimate. + +Seems a script is going to be the best way to test values and assist +folks in making reasonable decisions about each parameter. Of course, +they can still edit the file, and we can ask them if they want +assistance to set each parameter or leave it alone. + +I would restrict the script to only deal with tuning values, and tell +people they still need to review that file for other useful parameters. + +Another option would be to make a big checklist or web page that asks +such questions and computes proper values, but it seems a script would +be easiest. We can even support '?' which would explain why the +question is being ask and how it affects the value. + +-- + 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-advocacy-owner@postgresql.org Thu Feb 13 01:29:54 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id BAEBD475A45; Thu, 13 Feb 2003 01:29:47 -0500 (EST) +Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) + by postgresql.org (Postfix) with ESMTP + id 7331D475EEB; Thu, 13 Feb 2003 01:17:59 -0500 (EST) +Received: from DU150.N224.ResNet.QueensU.CA (DU150.N224.ResNet.QueensU.CA + [130.15.224.150]) by bob.samurai.com (Postfix) with ESMTP + id 431431DD0; Thu, 13 Feb 2003 01:17:58 -0500 (EST) +Subject: Re: [HACKERS] More benchmarking of wal_buffers +From: Neil Conway +To: Christopher Kings-Lynne +Cc: PostgreSQL Hackers , + pgsql-performance@postgresql.org, pgsql-advocacy@postgresql.org +In-Reply-To: +References: +Content-Type: text/plain +Organization: +Message-Id: <1045117072.16760.7.camel@tokyo> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.1 +Date: 13 Feb 2003 01:17:52 -0500 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/57 +X-Sequence-Number: 815 + +On Thu, 2003-02-13 at 00:16, Christopher Kings-Lynne wrote: +> Even if you look at the attached charts and you think that 128 buffers are +> better than 8, think again - there's nothing in it. Next time I run that +> benchmark it could be the same, lower or higher. And the difference between +> the worst and best results is less than 3 TPS - ie. nothing. + +One could conclude that this a result of the irrelevancy of wal_buffers; +another possible conclusion is that the testing tool (pgbench) is not a +particularly good database benchmark, as it tends to be very difficult +to use it to reproduceable results. Alternatively, it's possible that +the limited set of test-cases you've used doesn't happen to include any +circumstances in which wal_buffers is useful. + +We definitely need some better benchmarking tools for PostgreSQL (and +no, OSDB does not cut it, IMHO). I've been thinking of taking a look at +improving this, but I can't promise I'll get the time or inclination to +actually do anything about it :-) + +Cheers, + +Neil +-- +Neil Conway || PGP Key ID: DB3C29FC + + + + +From pgsql-performance-owner@postgresql.org Thu Feb 13 04:20:48 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 994E34758E6 + for ; + Thu, 13 Feb 2003 04:20:46 -0500 (EST) +Received: from trill.maridan.net (unknown [217.6.52.210]) + by postgresql.org (Postfix) with ESMTP id 3AB36474E5C + for ; + Thu, 13 Feb 2003 04:20:44 -0500 (EST) +Received: from polonium.de ([212.121.156.162]) + by trill.maridan.net (8.9.3/8.9.3) with ESMTP id KAA28610 + for ; Thu, 13 Feb 2003 10:20:44 +0100 +Message-ID: <3E4B63CC.5070201@polonium.de> +Date: Thu, 13 Feb 2003 10:22:20 +0100 +From: Rafal Kedziorski +Organization: POLONIUM +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; + rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: JBoss CMP Performance Problems with PostgreSQL 7.2.3 +References: <000201c2d33a$7aecd320$ac584618@ltd924607.ca> +In-Reply-To: <000201c2d33a$7aecd320$ac584618@ltd924607.ca> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/58 +X-Sequence-Number: 1114 + +Darryl A. J. Staflund wrote: + +>Hi Everyone, +> +>I am developing a JBoss 3.0.x application using PostgreSQL 7.2.3 as a +>back-end database and Solaris 2.8 (SPARC) as my deployment OS. In this +>application, I am using an EJB technology called Container Managed +>Persistence (CMP 2.0) to manage data persistence for me. Instead of +>writing and submitting my own queries to the PostgreSQL database, JBoss is +>doing this for me. +> +>Although this works well for the most part, the insertion of many records +>within the context of a single transaction can take a very long time to +>complete. Inserting 800 records, for instance, can take upward of a +>minute to finish - even though the database is fully indexed and records +>consist of no more than a string field and several foreign key integer +>values. +> +>I think I've tracked the problem down to the way in which PostgreSQL +>manages transactions. Although on the Java side of things I perform all +>my insertions and updates within the context of a single transaction, +>PostgreSQL seems to treat each individual query as a separate transaction +>and this is slowing down performance immensely. Here is a sample of my +>PostgreSQL logging output: +> +> +[...] + + +I think the problem isn't PostgreSQL. This is the JBoss-CMP. Take a look +on EJB Benchmark from urbancode +(http://www.urbancode.com/projects/ejbbenchmark/default.jsp). + + +Best Regards, +Rafal + + +From pgsql-performance-owner@postgresql.org Thu Feb 13 06:00:40 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 9597E474E4F + for ; + Thu, 13 Feb 2003 06:00:38 -0500 (EST) +Received: from jobs1.unisoftbg.com (unknown [194.12.229.208]) + by postgresql.org (Postfix) with SMTP id 621EC474E42 + for ; + Thu, 13 Feb 2003 06:00:35 -0500 (EST) +Received: (qmail 11011 invoked from network); 13 Feb 2003 12:36:53 -0000 +Received: from unisoft.unisoftbg.com (HELO t1.unisoftbg.com) (194.12.229.193) + by 0 with SMTP; 13 Feb 2003 12:36:53 -0000 +Message-ID: <3E4B6CFA.725CA585@t1.unisoftbg.com> +Date: Thu, 13 Feb 2003 11:01:31 +0100 +From: pginfo +X-Mailer: Mozilla 4.03 [en] (Win95; I) +MIME-Version: 1.0 +To: Rafal Kedziorski +Cc: pgsql-performance@postgresql.org, darryl.staflund@shaw.ca +Subject: Re: JBoss CMP Performance Problems with PostgreSQL 7.2.3 +References: <000201c2d33a$7aecd320$ac584618@ltd924607.ca> + <3E4B63CC.5070201@polonium.de> +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/59 +X-Sequence-Number: 1115 + + + +Rafal Kedziorski wrote: + +> Darryl A. J. Staflund wrote: +> +> >Hi Everyone, +> > +> >I am developing a JBoss 3.0.x application using PostgreSQL 7.2.3 as a +> >back-end database and Solaris 2.8 (SPARC) as my deployment OS. In this +> >application, I am using an EJB technology called Container Managed +> >Persistence (CMP 2.0) to manage data persistence for me. Instead of +> >writing and submitting my own queries to the PostgreSQL database, JBoss is +> >doing this for me. +> > +> >Although this works well for the most part, the insertion of many records +> >within the context of a single transaction can take a very long time to +> >complete. Inserting 800 records, for instance, can take upward of a +> >minute to finish - even though the database is fully indexed and records +> >consist of no more than a string field and several foreign key integer +> >values. +> > +> >I think I've tracked the problem down to the way in which PostgreSQL +> >manages transactions. Although on the Java side of things I perform all +> >my insertions and updates within the context of a single transaction, +> >PostgreSQL seems to treat each individual query as a separate transaction +> >and this is slowing down performance immensely. Here is a sample of my +> >PostgreSQL logging output: +> > +> > +> [...] +> +> I think the problem isn't PostgreSQL. This is the JBoss-CMP. Take a look +> on EJB Benchmark from urbancode +> (http://www.urbancode.com/projects/ejbbenchmark/default.jsp). +> +> Best Regards, +> Rafal +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org + + I think the problem is not in the jboss. +I am using pg + jboss from a long time and if you know how to wirk with it the +combination is excelent. +The main problem in this case is CMP and also EntityBeans. +By CMP jboss will try to insert this 800 records separate. +In this case pg will be slow. + +I never got good results by using EB and CMP. +If you will to have working produkt use BMP. +regards, +ivan. + + +From pgsql-advocacy-owner@postgresql.org Thu Feb 13 10:06:49 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id BBB3E475D99 + for ; + Thu, 13 Feb 2003 10:06:47 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 4D9A24759BD + for ; + Thu, 13 Feb 2003 10:06:31 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1DF6T5u013184; + Thu, 13 Feb 2003 10:06:29 -0500 (EST) +To: Bruce Momjian +Cc: Peter Eisentraut , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: [HACKERS] Changing the default configuration (was Re: +In-reply-to: <200302130612.h1D6CHc14823@candle.pha.pa.us> +References: <200302130612.h1D6CHc14823@candle.pha.pa.us> +Comments: In-reply-to Bruce Momjian + message dated "Thu, 13 Feb 2003 01:12:17 -0500" +Date: Thu, 13 Feb 2003 10:06:29 -0500 +Message-ID: <13183.1045148789@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/62 +X-Sequence-Number: 820 + +Bruce Momjian writes: +> So, my idea is to add a message at the end of initdb that states people +> should run the pgtune script before running a production server. + +Do people read what initdb has to say? + +IIRC, the RPM install scripts hide initdb's output from the user +entirely. I wouldn't put much faith in such a message as having any +real effect on people... + + regards, tom lane + +From pgsql-advocacy-owner@postgresql.org Thu Feb 13 12:11:06 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 9643D474E4F; Thu, 13 Feb 2003 12:11:04 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP + id 38DF9474E42; Thu, 13 Feb 2003 12:11:03 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h1DHAui22918; + Thu, 13 Feb 2003 12:10:56 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302131710.h1DHAui22918@candle.pha.pa.us> +Subject: Re: [HACKERS] Changing the default configuration (was Re: +In-Reply-To: <13183.1045148789@sss.pgh.pa.us> +To: Tom Lane +Date: Thu, 13 Feb 2003 12:10:56 -0500 (EST) +Cc: Peter Eisentraut , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@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 AMaViS new-20020517 +X-Archive-Number: 200302/63 +X-Sequence-Number: 821 + +Tom Lane wrote: +> Bruce Momjian writes: +> > So, my idea is to add a message at the end of initdb that states people +> > should run the pgtune script before running a production server. +> +> Do people read what initdb has to say? +> +> IIRC, the RPM install scripts hide initdb's output from the user +> entirely. I wouldn't put much faith in such a message as having any +> real effect on people... + +Yes, that is a problem. We could show something in the server logs if +pg_tune hasn't been run. Not sure what else we can do, but it would +give folks a one-stop thing to run to deal with performance +configuration. + +We could prevent the postmaster from starting unless they run pg_tune or +if they have modified postgresql.conf from the default. Of course, +that's pretty drastic. + +-- + 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 Feb 13 13:06:17 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 7492C4758E6 + for ; + Thu, 13 Feb 2003 13:06:16 -0500 (EST) +Received: from biomax.de (unknown [212.6.137.236]) + by postgresql.org (Postfix) with ESMTP id 474B3474E42 + for ; + Thu, 13 Feb 2003 13:06:15 -0500 (EST) +Received: from biomax.de (guffert.biomax.de [192.168.3.166]) + by biomax.de (8.8.8/8.8.8) with ESMTP id TAA11165 + for ; Thu, 13 Feb 2003 19:05:56 +0100 +Message-ID: <3E4BDE8B.5040908@biomax.de> +Date: Thu, 13 Feb 2003 19:06:03 +0100 +From: Chantal Ackermann +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: cost and actual time +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/60 +X-Sequence-Number: 1116 + +hello all, + +I am still fiddling around with my "big" database. + +System: +RAM: 2GB +CPU: 1,6 MHz (cache: 256 Kb) +single disc: 120 GB :-( + +I have a query that joins to relatively large tables (10 - 15 Mio rows), +or part of these tables (explain analyze: rows=46849) respectively. + +long story short: + +allover cost estimated in pages by explain is: +cost=6926.59..6926.60 + +actual time is from explain analyze is: +actual time=275461.91..275462.44 + +most of it is consumed by a nested loop (surprise!) +this is the respective output: + +Sort Key: disease.disease_name, disease_occurrences.sentence_id +-> Nested Loop (cost=0.00..6922.38 rows=98 width=64) (actual +time=61.49..275047.46 rows=18910 loops=1) + -> Nested Loop (cost=0.00..6333.23 rows=98 width=28) (actual +time=61.42..274313.87 rows=18910 loops=1) + -> Nested Loop (cost=0.00..5894.04 rows=64 width=16) (actual +time=32.00..120617.26 rows=46849 loops=1) + +I tried to tweak the conf settings, but I think I already reached quite +a good value concerning shared buffers and sort mem. the database is +vacuum full analyzed. indexes seem fine. + +could one of you smart guys point me into a direction I might not have +considered? - I know that the hardware is the minimum. nevertheless - if +you have suggestions what exactely to add to the hardware to boost the +database up (more RAM or more discs - even a RAID) - this would be a +good argument for my boss. + +Thank you a lot +Chantal + + +From pgsql-hackers-owner@postgresql.org Thu Feb 13 13:49:43 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id CD42E475AFA + for ; + Thu, 13 Feb 2003 13:49:42 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP id 6EDA2475A9E + for ; + Thu, 13 Feb 2003 13:49:40 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h1DIn6r01827; + Thu, 13 Feb 2003 13:49:06 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302131849.h1DIn6r01827@candle.pha.pa.us> +Subject: Re: Changing the default configuration (was Re: +In-Reply-To: +To: Curt Sampson +Date: Thu, 13 Feb 2003 13:49:06 -0500 (EST) +Cc: Christopher Kings-Lynne , + "scott.marlowe" , Tom Lane , + Greg Copeland , + PostgresSQL Hackers Mailing List +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 AMaViS new-20020517 +X-Archive-Number: 200302/613 +X-Sequence-Number: 35555 + + +I was speaking of the 4.4 BSD. FreeBSD has the merged VM, and I think +NetBSD only recently did that. BSD/OS does do the locking by default +and it maps into the kernel address space. I believe FreeBSD has a +sysctl to control locking of SysV memory. + +One advantage of having it all at the same VM address is that they can +use the same page tables for virtual address lookups. + +--------------------------------------------------------------------------- + +Curt Sampson wrote: +> On Wed, 12 Feb 2003, Bruce Momjian wrote: +> +> > Christopher Kings-Lynne wrote: +> > +> > > You cannot change SHMMAX on the fly on FreeBSD. +> > +> > And part of the reason is because some/most BSD's map the page tables +> > into physical RAM (kernel space) rather than use some shared page table +> > mechanism. This is good because it prevents the shared memory from +> > being swapped out (performance disaster). +> +> Not at all! In all the BSDs, as far as I'm aware, SysV shared memory is +> just normal mmap'd memory. +> +> FreeBSD offers a sysctl that lets you mlock() that memory, and that is +> helpful only because postgres insists on taking data blocks that are +> already in memory, fully sharable amongst all back ends and ready to be +> used, and making a copy of that data to be shared amongst all back ends. +> +> > It doesn't actually allocate RAM unless someone needs it, but it does +> > lock the shared memory into a specific fixed location for all processes. +> +> I don't believe that the shared memory is not locked to a specific VM +> address for every process. There's certainly no reason it needs to be. +> +> cjs +> -- +> Curt Sampson +81 90 7737 2974 http://www.netbsd.org +> Don't you know, in this new Dark Age, we're all light. --XTC +> + +-- + 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 Feb 13 15:08:17 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B2C71475957 + for ; + Thu, 13 Feb 2003 15:08:15 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id B3897474E61 + for ; + Thu, 13 Feb 2003 15:08:14 -0500 (EST) +Received: from [216.135.165.74] (account ) + by davinci.ethosmedia.com (CommuniGate Pro WebUser 4.0.2) + with HTTP id 2838434; Thu, 13 Feb 2003 12:08:22 -0800 +From: "Josh Berkus" +Subject: Re: cost and actual time +To: Chantal Ackermann , + pgsql-performance@postgresql.org +X-Mailer: CommuniGate Pro Web Mailer v.4.0.2 +Date: Thu, 13 Feb 2003 12:08:22 -0800 +Message-ID: +In-Reply-To: <3E4BDE8B.5040908@biomax.de> +MIME-Version: 1.0 +Content-Type: text/plain; charset="ISO-8859-1" +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/61 +X-Sequence-Number: 1117 + +Chantal,=20 + +> Sort Key: disease.disease_name, disease_occurrences.sentence_id +> -> Nested Loop (cost=3D0.00..6922.38 rows=3D98 width=3D64) (actual +> time=3D61.49..275047.46 rows=3D18910 loops=3D1) +> -> Nested Loop (cost=3D0.00..6333.23 rows=3D98 width=3D28) (actual=20 +> time=3D61.42..274313.87 rows=3D18910 loops=3D1) +> -> Nested Loop (cost=3D0.00..5894.04 rows=3D64 width=3D16) (actual= +=20 +> time=3D32.00..120617.26 rows=3D46849 loops=3D1) +>=20 +> I tried to tweak the conf settings, but I think I already reached +> quite a good value concerning shared buffers and sort mem. the +> database is vacuum full analyzed. indexes seem fine. + +You *sure* that you've vacuum analyzed recently? The planner above is +choosing a bad plan because its row estimates are way off ... if the +subquery was actually returning 98 rows, the plan above would make +sense ... but with 18,000 rows being returned, a Nested Loop is +suicidal. + +Perhaps you could post the full text of the query? If some of your +criteria are coming from volatile functions, then that could explain +why the planner is so far off ... + +-Josh Berkus + +From pgsql-hackers-owner@postgresql.org Thu Feb 13 15:47:12 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 10491475AFA + for ; + Thu, 13 Feb 2003 15:47:11 -0500 (EST) +Received: from sabre.velocet.net (sabre.velocet.net [216.138.209.205]) + by postgresql.org (Postfix) with ESMTP id D6038475A9E + for ; + Thu, 13 Feb 2003 15:47:09 -0500 (EST) +Received: from stark.dyndns.tv (H162.C233.tor.velocet.net [216.138.233.162]) + by sabre.velocet.net (Postfix) with ESMTP + id 77272137F46; Thu, 13 Feb 2003 15:47:10 -0500 (EST) +Received: from localhost ([127.0.0.1] helo=stark.dyndns.tv ident=foobar) + by stark.dyndns.tv with smtp (Exim 3.36 #1 (Debian)) + id 18jQGC-0000qm-00; Thu, 13 Feb 2003 15:47:08 -0500 +To: pgsql-hackers@postgresql.org +Subject: Re: Changing the default configuration (was Re: +References: <200302130236.h1D2ajh17527@candle.pha.pa.us> + +In-Reply-To: +From: Greg Stark +Organization: The Emacs Conspiracy; member since 1992 +Date: 13 Feb 2003 15:47:08 -0500 +Message-ID: <87znozkiwj.fsf@stark.dyndns.tv> +Lines: 16 +User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/636 +X-Sequence-Number: 35578 + + +> On Wed, 12 Feb 2003, Bruce Momjian wrote: +> > +> > And part of the reason is because some/most BSD's map the page tables +> > into physical RAM (kernel space) rather than use some shared page table +> > mechanism. This is good because it prevents the shared memory from +> > being swapped out (performance disaster). + +Well, it'll only be swapped out if it's not being used... + +In any case you can use madvise() to try to avoid that, but it doesn't seem +likely to be a problem since they would probably be the most heavily used +pages in postgres. + +-- +greg + + +From pgsql-performance-owner@postgresql.org Thu Feb 13 18:19:06 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 8895B474E4F + for ; + Thu, 13 Feb 2003 18:19:04 -0500 (EST) +Received: from ultra.echostar.com (che-ul.echostar.com [204.76.133.5]) + by postgresql.org (Postfix) with ESMTP id B9319474E42 + for ; + Thu, 13 Feb 2003 18:19:03 -0500 (EST) +Received: from localhost.localdomain ([10.70.20.88]) + by ultra.echostar.com (8.9.3/8.9.3) with ESMTP id SAA09501; + Thu, 13 Feb 2003 18:17:55 -0500 +Content-Type: text/plain; + charset="iso-8859-1" +From: Nick Pavlica +Reply-To: nick.pavlica@echostar.com +Organization: EchoStar Communications +To: pginfo , + Rafal Kedziorski +Subject: Re: JBoss CMP Performance Problems with PostgreSQL 7.2.3 +Date: Thu, 13 Feb 2003 16:19:12 -0700 +User-Agent: KMail/1.4.3 +Cc: pgsql-performance@postgresql.org, darryl.staflund@shaw.ca +References: <000201c2d33a$7aecd320$ac584618@ltd924607.ca> + <3E4B63CC.5070201@polonium.de> <3E4B6CFA.725CA585@t1.unisoftbg.com> +In-Reply-To: <3E4B6CFA.725CA585@t1.unisoftbg.com> +MIME-Version: 1.0 +Content-Transfer-Encoding: quoted-printable +Message-Id: <200302131619.12416.nick.pavlica@echostar.com> +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/62 +X-Sequence-Number: 1118 + +You may want to look at this tool as well: + +http://hibernate.bluemars.net/1.html + +On Thursday 13 February 2003 3:01 am, pginfo wrote: +> Rafal Kedziorski wrote: +> > Darryl A. J. Staflund wrote: +> > >Hi Everyone, +> > > +> > >I am developing a JBoss 3.0.x application using PostgreSQL 7.2.3 as a +> > >back-end database and Solaris 2.8 (SPARC) as my deployment OS. In this +> > >application, I am using an EJB technology called Container Managed +> > >Persistence (CMP 2.0) to manage data persistence for me. Instead of +> > >writing and submitting my own queries to the PostgreSQL database, JBoss +> > > is doing this for me. +> > > +> > >Although this works well for the most part, the insertion of many +> > > records within the context of a single transaction can take a very lo= +ng +> > > time to complete. Inserting 800 records, for instance, can take upwa= +rd +> > > of a minute to finish - even though the database is fully indexed and +> > > records consist of no more than a string field and several foreign key +> > > integer values. +> > > +> > >I think I've tracked the problem down to the way in which PostgreSQL +> > >manages transactions. Although on the Java side of things I perform a= +ll +> > >my insertions and updates within the context of a single transaction, +> > >PostgreSQL seems to treat each individual query as a separate +> > > transaction and this is slowing down performance immensely. Here is a +> > > sample of my PostgreSQL logging output: +> > +> > [...] +> > +> > I think the problem isn't PostgreSQL. This is the JBoss-CMP. Take a look +> > on EJB Benchmark from urbancode +> > (http://www.urbancode.com/projects/ejbbenchmark/default.jsp). +> > +> > Best Regards, +> > Rafal +> > +> > ---------------------------(end of broadcast)--------------------------- +> > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org +> +> I think the problem is not in the jboss. +> I am using pg + jboss from a long time and if you know how to wirk with it +> the combination is excelent. +> The main problem in this case is CMP and also EntityBeans. +> By CMP jboss will try to insert this 800 records separate. +> In this case pg will be slow. +> +> I never got good results by using EB and CMP. +> If you will to have working produkt use BMP. +> regards, +> ivan. +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 5: Have you checked our extensive FAQ? +> +> http://www.postgresql.org/users-lounge/docs/faq.html + +--=20 +Nick Pavlica +EchoStar Communications +CAS-Engineering +(307)633-5237 + +From pgsql-advocacy-owner@postgresql.org Thu Feb 13 21:29:24 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 169E8474E61; Thu, 13 Feb 2003 21:29:22 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP + id 45AFE474E5C; Thu, 13 Feb 2003 21:29:21 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1E2TH5u003332; + Thu, 13 Feb 2003 21:29:18 -0500 (EST) +To: "Christopher Kings-Lynne" +Cc: "Hackers" , + pgsql-performance@postgresql.org, + "Advocacy" +Subject: Re: [HACKERS] More benchmarking of wal_buffers +In-reply-to: +References: +Comments: In-reply-to "Christopher Kings-Lynne" + message dated "Thu, 13 Feb 2003 13:16:16 +0800" +Date: Thu, 13 Feb 2003 21:29:17 -0500 +Message-ID: <3331.1045189757@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/69 +X-Sequence-Number: 827 + +"Christopher Kings-Lynne" writes: +> I've just spent the last day and a half trying to benchmark our new database +> installation to find a good value for wal_buffers. The quick answer - there +> isn't, just leave it on the default of 8. + +I don't think this is based on a useful test for wal_buffers. The +wal_buffers setting only has to be large enough for the maximum amount +of WAL log data that your system emits between commits, because a commit +(from anyone) is going to flush the WAL data to disk (for everyone). +So a benchmark based on short transactions is just not going to show +any benefit to increasing the setting. + +Benchmarking, say, the speed of massive COPY IN operations might show +some advantage to larger wal_buffers. Although I'm not real sure that +it'll make any difference for any single-backend test. It's really just +the case where you have concurrent transactions that all make lots of +updates before committing that's likely to show a win. + +> One proof that has come out of this is that wal_buffers does not affect +> SELECT only performance in any way. + +Coulda told you that without testing ;-). Read-only transactions emit +no WAL entries. + + regards, tom lane + +From pgsql-advocacy-owner@postgresql.org Thu Feb 13 22:04:05 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A0CE04758E6 + for ; + Thu, 13 Feb 2003 22:04:04 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id B7DC4474E5C + for ; + Thu, 13 Feb 2003 22:04:02 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1E346j17771 + for pgsql-advocacy@postgresql.org; Fri, 14 Feb 2003 11:04:06 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1E341717591; + Fri, 14 Feb 2003 11:04:01 +0800 (WST) +From: "Christopher Kings-Lynne" +To: "Tom Lane" +Cc: "Hackers" , + , + "Advocacy" +Subject: Re: [HACKERS] More benchmarking of wal_buffers +Date: Fri, 14 Feb 2003 11:04:20 +0800 +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) +In-Reply-To: <3331.1045189757@sss.pgh.pa.us> +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +Importance: Normal +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/70 +X-Sequence-Number: 828 + +> I don't think this is based on a useful test for wal_buffers. The +> wal_buffers setting only has to be large enough for the maximum amount +> of WAL log data that your system emits between commits, because a commit +> (from anyone) is going to flush the WAL data to disk (for everyone). +> So a benchmark based on short transactions is just not going to show +> any benefit to increasing the setting. + +Yes, I guess the TPC-B test does many, very short transactions. Each +transaction bascially comprises a single update, so I guess it wouldn't +really test it. + +> > One proof that has come out of this is that wal_buffers does not affect +> > SELECT only performance in any way. +> +> Coulda told you that without testing ;-). Read-only transactions emit +> no WAL entries. + +I knew that as well, that's why I said "proof" ;) + +Chris + + +From pgsql-performance-owner@postgresql.org Thu Feb 13 22:04:48 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 4E498475CB4 + for ; + Thu, 13 Feb 2003 22:04:47 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 944F7475CC4 + for ; + Thu, 13 Feb 2003 22:04:45 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1E34nd18013 + for pgsql-performance@postgresql.org; + Fri, 14 Feb 2003 11:04:49 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1E34j717879; + Fri, 14 Feb 2003 11:04:45 +0800 (WST) +From: "Christopher Kings-Lynne" +To: "Tom Lane" +Cc: "Hackers" , + +Subject: Re: [HACKERS] More benchmarking of wal_buffers +Date: Fri, 14 Feb 2003 11:05:04 +0800 +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) +In-Reply-To: <3331.1045189757@sss.pgh.pa.us> +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +Importance: Normal +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/65 +X-Sequence-Number: 1121 + +> I don't think this is based on a useful test for wal_buffers. The +> wal_buffers setting only has to be large enough for the maximum amount +> of WAL log data that your system emits between commits, because a commit +> (from anyone) is going to flush the WAL data to disk (for everyone). +> So a benchmark based on short transactions is just not going to show +> any benefit to increasing the setting. + +Here's a question then - what is the _drawback_ to having 1024 wal_buffers +as opposed to 8? + +Chris + + +From pgsql-performance-owner@postgresql.org Thu Feb 13 22:10:58 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 5271D475A45; Thu, 13 Feb 2003 22:10:53 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP + id 056E84759AF; Thu, 13 Feb 2003 22:10:52 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1E3Aa5u003580; + Thu, 13 Feb 2003 22:10:56 -0500 (EST) +To: "Christopher Kings-Lynne" +Cc: "Hackers" , pgsql-performance@postgresql.org +Subject: Re: [HACKERS] More benchmarking of wal_buffers +In-reply-to: +References: +Comments: In-reply-to "Christopher Kings-Lynne" + message dated "Fri, 14 Feb 2003 11:05:04 +0800" +Date: Thu, 13 Feb 2003 22:10:35 -0500 +Message-ID: <3579.1045192235@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/66 +X-Sequence-Number: 1122 + +"Christopher Kings-Lynne" writes: +> Here's a question then - what is the _drawback_ to having 1024 wal_buffers +> as opposed to 8? + +Waste of RAM? You'd be better off leaving that 8 meg available for use +as general-purpose buffers ... + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Feb 13 22:15:50 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 60B6E475BA1 + for ; + Thu, 13 Feb 2003 22:15:47 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id BB063475B8A + for ; + Thu, 13 Feb 2003 22:15:45 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1E3FnJ19353 + for pgsql-performance@postgresql.org; + Fri, 14 Feb 2003 11:15:49 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1E3Fj719218; + Fri, 14 Feb 2003 11:15:45 +0800 (WST) +From: "Christopher Kings-Lynne" +To: "Tom Lane" +Cc: "Hackers" , + +Subject: Re: [HACKERS] More benchmarking of wal_buffers +Date: Fri, 14 Feb 2003 11:16:04 +0800 +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) +In-Reply-To: <3579.1045192235@sss.pgh.pa.us> +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +Importance: Normal +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/67 +X-Sequence-Number: 1123 + +> "Christopher Kings-Lynne" writes: +> > Here's a question then - what is the _drawback_ to having 1024 +> wal_buffers +> > as opposed to 8? +> +> Waste of RAM? You'd be better off leaving that 8 meg available for use +> as general-purpose buffers ... + +What I mean is say you have an enterprise server doing heaps of transactions +with lots of work. If you have scads of RAM, could you just shove up +wal_buffers really high and assume it will improve performance? + +Chris + + +From pgsql-advocacy-owner@postgresql.org Thu Feb 13 22:26:04 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 0A759474E5C; Thu, 13 Feb 2003 22:26:02 -0500 (EST) +Received: from filer (12-234-86-219.client.attbi.com [12.234.86.219]) + by postgresql.org (Postfix) with ESMTP + id D04B8474E4F; Thu, 13 Feb 2003 22:26:00 -0500 (EST) +Received: from localhost (localhost [127.0.0.1]) (uid 1000) + by filer with local; Thu, 13 Feb 2003 19:26:05 -0800 +Date: Thu, 13 Feb 2003 19:26:05 -0800 +From: Kevin Brown +To: PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: Changing the default configuration (was Re: +Message-ID: <20030214032605.GA18932@filer> +Mail-Followup-To: Kevin Brown , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26582.1044984365@sss.pgh.pa.us> <3E493415.9090004@postgresql.org> + <200302110948.39283.josh@agliodbs.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +In-Reply-To: <200302110948.39283.josh@agliodbs.com> +User-Agent: Mutt/1.4i +Organization: Frobozzco International +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/71 +X-Sequence-Number: 829 + +Josh Berkus wrote: +> > > Uh ... do we have a basis for recommending any particular sets of +> > > parameters for these different scenarios? This could be a good idea +> > > in the abstract, but I'm not sure I know enough to fill in the details. +> +> Sure. +> Mostly-Read database, few users, good hardware, complex queries: +> = High shared buffers and sort mem, high geqo and join collapse thresholds, +> moderate fsm settings, defaults for WAL. +> Same as above with many users and simple queries (webserver) = +> same as above, except lower sort mem and higher connection limit +> High-Transaction Database = +> Moderate shared buffers and sort mem, high FSM settings, increase WAL files +> and buffers. +> Workstation = +> Moderate to low shared buffers and sort mem, moderate FSM, defaults for WAL, +> etc. +> Low-Impact server = current defaults, more or less. + +Okay, but there should probably be one more, called "Benchmark". The +real problem is what values to use for it. :-) + + + +-- +Kevin Brown kevin@sysexperts.com + +From pgsql-advocacy-owner@postgresql.org Thu Feb 13 22:46:42 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 33E54474E4F; Thu, 13 Feb 2003 22:46:42 -0500 (EST) +Received: from filer (12-234-86-219.client.attbi.com [12.234.86.219]) + by postgresql.org (Postfix) with ESMTP + id 9992C474E42; Thu, 13 Feb 2003 22:46:41 -0500 (EST) +Received: from localhost (localhost [127.0.0.1]) (uid 1000) + by filer with local; Thu, 13 Feb 2003 19:46:46 -0800 +Date: Thu, 13 Feb 2003 19:46:46 -0800 +From: Kevin Brown +To: Hackers , pgsql-performance@postgresql.org, + Advocacy +Subject: Re: [PERFORM] [HACKERS] More benchmarking of wal_buffers +Message-ID: <20030214034646.GA1847@filer> +Mail-Followup-To: Kevin Brown , + Hackers , + pgsql-performance@postgresql.org, + Advocacy +References: + <3331.1045189757@sss.pgh.pa.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +In-Reply-To: <3331.1045189757@sss.pgh.pa.us> +User-Agent: Mutt/1.4i +Organization: Frobozzco International +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/72 +X-Sequence-Number: 830 + +Tom Lane wrote: +> "Christopher Kings-Lynne" writes: +> > I've just spent the last day and a half trying to benchmark our new database +> > installation to find a good value for wal_buffers. The quick answer - there +> > isn't, just leave it on the default of 8. +> +> I don't think this is based on a useful test for wal_buffers. The +> wal_buffers setting only has to be large enough for the maximum amount +> of WAL log data that your system emits between commits, because a commit +> (from anyone) is going to flush the WAL data to disk (for everyone). + +What happens when the only transaction running emits more WAL log data +than wal_buffers can handle? A flush happens when the WAL buffers +fill up (that's what I'd expect)? Didn't find much in the +documentation about it... + + +-- +Kevin Brown kevin@sysexperts.com + +From pgsql-advocacy-owner@postgresql.org Thu Feb 13 23:00:58 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 1D1B6474E4F; Thu, 13 Feb 2003 23:00:57 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP + id 54D0B474E42; Thu, 13 Feb 2003 23:00:56 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2839304; Thu, 13 Feb 2003 20:01:08 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: Tatsuo Ishii , tgl@sss.pgh.pa.us +Subject: Re: [HACKERS] Changing the default configuration +Date: Thu, 13 Feb 2003 20:00:35 -0800 +User-Agent: KMail/1.4.3 +Cc: justin@postgresql.org, merlin.moncure@rcsonline.com, + pgsql-hackers@postgresql.org, pgsql-advocacy@postgresql.org +References: <26582.1044984365@sss.pgh.pa.us> <26850.1044985975@sss.pgh.pa.us> + <20030212.101000.74752335.t-ishii@sra.co.jp> +In-Reply-To: <20030212.101000.74752335.t-ishii@sra.co.jp> +MIME-Version: 1.0 +Message-Id: <200302132000.35639.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/73 +X-Sequence-Number: 831 + +Tatsuo, + +> Sigh. People always complain "pgbench does not reliably producing +> repeatable numbers" or something then say "that's because pgbench's +> transaction has too much contention on the branches table". So I added +> -N option to pgbench which makes pgbench not to do any UPDATE to +> the branches table. But still people continue to complian... + +Hey, pg_bench is a good start on a Postgres performance tester, and it's mu= +ch,=20 +much better than what there was before you came along ... which was nothing= +.=20=20 +Thank you again for contributing it. + +pg_bench is, however, only a start on a performance tester, and we'd need = +to=20 +build it up before we could use it as the basis of a PG tuner. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-advocacy-owner@postgresql.org Thu Feb 13 23:16:51 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id F2112475C2B; Thu, 13 Feb 2003 23:16:48 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP + id D8D15475A80; Thu, 13 Feb 2003 23:14:45 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1E4Eo5u003915; + Thu, 13 Feb 2003 23:14:50 -0500 (EST) +To: Kevin Brown +Cc: Hackers , pgsql-performance@postgresql.org, + Advocacy +Subject: Re: [PERFORM] [HACKERS] More benchmarking of wal_buffers +In-reply-to: <20030214034646.GA1847@filer> +References: + <3331.1045189757@sss.pgh.pa.us> <20030214034646.GA1847@filer> +Comments: In-reply-to Kevin Brown + message dated "Thu, 13 Feb 2003 19:46:46 -0800" +Date: Thu, 13 Feb 2003 23:14:49 -0500 +Message-ID: <3914.1045196089@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/74 +X-Sequence-Number: 832 + +Kevin Brown writes: +> What happens when the only transaction running emits more WAL log data +> than wal_buffers can handle? A flush happens when the WAL buffers +> fill up (that's what I'd expect)? Didn't find much in the +> documentation about it... + +A write, not a flush (ie, we don't force an fsync). Also, I think it +writes only a few blocks, not all the available data. Don't recall the +details on that. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Feb 13 23:19:36 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 80492475E30 + for ; + Thu, 13 Feb 2003 23:19:35 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id C20DE475DC5 + for ; + Thu, 13 Feb 2003 23:18:47 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1E4Iq5u003962; + Thu, 13 Feb 2003 23:18:52 -0500 (EST) +To: "Darryl A. J. Staflund" +Cc: pgsql-performance@postgresql.org +Subject: Re: JBoss CMP Performance Problems with PostgreSQL 7.2.3 +In-reply-to: <000f01c2d3dc$f8ad2d80$ac584618@ltd924607.ca> +References: <000f01c2d3dc$f8ad2d80$ac584618@ltd924607.ca> +Comments: In-reply-to "Darryl A. J. Staflund" + message dated "Thu, 13 Feb 2003 20:55:53 -0700" +Date: Thu, 13 Feb 2003 23:18:52 -0500 +Message-ID: <3961.1045196332@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/71 +X-Sequence-Number: 1127 + +"Darryl A. J. Staflund" writes: +> MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEH +> AaCAJIAEggX+Q29udGVudC1UeXBlOiB0ZXh0L3BsYWluOw0KCWNoYXJzZXQ9 +> IlVTLUFTQ0lJIg0KQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogN2JpdA0K +> DQpIaSBldmVyeW9uZSwNCg0KVGhhbmtzIGZvciB5b3VyIGNvbW1lbnRzIGFu +> ZCBsaW5rcyB0byB0aGUgdmFyaW91cyB0b29scy4gIEkgd2lsbCBtYWtlIHN1 +> cmUNCnRvIGludmVzdGlnYXRlIHRoZW0hDQoNCk5vdyBvbnRvIHRoaXMgbGV0 +> dGVyLi4uDQoNCk9uIHRoZSBhc3N1bXB0aW9uIHRoYXQgUG9zdGdyZVNRTCB3 +> [etc] + +I might answer this if it weren't so unremittingly nastily encoded... +*please* turn off whatever the heck that is. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Feb 13 23:21:00 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 00EFD475A6D + for ; + Thu, 13 Feb 2003 23:20:59 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 5C1ED475A45 + for ; + Thu, 13 Feb 2003 23:20:58 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2839329; Thu, 13 Feb 2003 20:21:10 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: "Darryl A. J. Staflund" , + pgsql-performance@postgresql.org +Subject: Re: JBoss CMP Performance Problems with PostgreSQL 7.2.3 +Date: Thu, 13 Feb 2003 20:20:38 -0800 +User-Agent: KMail/1.4.3 +References: <000f01c2d3dc$f8ad2d80$ac584618@ltd924607.ca> +In-Reply-To: <000f01c2d3dc$f8ad2d80$ac584618@ltd924607.ca> +MIME-Version: 1.0 +Message-Id: <200302132020.38033.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/72 +X-Sequence-Number: 1128 + +Darryl, + +Your last e-mail got mangled in transit. I think you'll want to re-send it= + so=20 +you get responses from others. You said: + +"On the assumption that PostgreSQL was auto-committing each of the 1400 +queries wrapped within the a BEGIN; and COMMIT;, I asked my DBA to disable +auto-commit so that I could see if there was any performance improvement." + +Er, no, Darryl, you mis-understood. CMP is Auto-Committing. PostgreSQL i= +s=20 +performing normally. Your problem is with CMP, not Postgres.=20 + +" I was told he couldn't do that in our current version of PostgreSQL +(7.2.3?) but he did turn fsync off in order to achieve a similar effect." + +Which is fine up until you have an unexpected power-out, at which point you= +'d=20 +better have good backups. + +"What a difference. Whereas before it took at least a minute to insert +1400 queries into the database, with fsync turned off it only took 12 +seconds. If anything, this shows me that JBoss' implementation, although +slow in comparison to other CMP implementations, is not the primary source +of the performance problems. Also, I'm inclined to believe that +PostgreSQL is auto-committing each query within the transaction even +though it shouldn't. Otherwise, why would turning fsync off make such a +big performance difference?" + +Perhaps because CMP is sending a "commit" statement after each query to=20 +PostgreSQL? + +"So the questions I have now is -- is this improvement in performance +evidence of my assumption that PostgreSQL is auto-committing each of the +1400 queries within the transaction (the logs sure suggest this.) And if +so, why is it auto-committing these queries? I thought PostgreSQL +suspended auto-commit after encountering a BEGIN; statement." + +See above. You need to examine your tools better, and to read the e-mails= +=20 +which respond to you. Another poster already gave you a link to a bug repo= +rt=20 +mentioning that this is a problem with CMP. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Thu Feb 13 23:23:47 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 13943474E4F; Thu, 13 Feb 2003 23:23:44 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP + id 50F58474E42; Thu, 13 Feb 2003 23:23:43 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1E4Ni5u004004; + Thu, 13 Feb 2003 23:23:44 -0500 (EST) +To: "Christopher Kings-Lynne" +Cc: "Hackers" , pgsql-performance@postgresql.org +Subject: Re: [HACKERS] More benchmarking of wal_buffers +In-reply-to: +References: +Comments: In-reply-to "Christopher Kings-Lynne" + message dated "Fri, 14 Feb 2003 11:16:04 +0800" +Date: Thu, 13 Feb 2003 23:23:44 -0500 +Message-ID: <4003.1045196624@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/73 +X-Sequence-Number: 1129 + +"Christopher Kings-Lynne" writes: +> What I mean is say you have an enterprise server doing heaps of transactions +> with lots of work. If you have scads of RAM, could you just shove up +> wal_buffers really high and assume it will improve performance? + +There is no such thing as infinite RAM (or if there is, you paid *way* +too much for your database server). My feeling is that it's a bad +idea to put more than you absolutely have to into single-use buffers. +Multi-purpose buffers are usually a better use of RAM. + + regards, tom lane + +From pgsql-advocacy-owner@postgresql.org Fri Feb 14 00:05:58 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 2F70B474E5C; Fri, 14 Feb 2003 00:05:56 -0500 (EST) +Received: from filer (12-234-86-219.client.attbi.com [12.234.86.219]) + by postgresql.org (Postfix) with ESMTP + id 7B6F9474E4F; Fri, 14 Feb 2003 00:05:55 -0500 (EST) +Received: from localhost (localhost [127.0.0.1]) (uid 1000) + by filer with local; Thu, 13 Feb 2003 21:06:00 -0800 +Date: Thu, 13 Feb 2003 21:06:00 -0800 +From: Kevin Brown +To: PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +Subject: Re: [HACKERS] Changing the default configuration (was Re: +Message-ID: <20030214050600.GP1833@filer> +Mail-Followup-To: Kevin Brown , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@postgresql.org +References: <13183.1045148789@sss.pgh.pa.us> + <200302131710.h1DHAui22918@candle.pha.pa.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +In-Reply-To: <200302131710.h1DHAui22918@candle.pha.pa.us> +User-Agent: Mutt/1.4i +Organization: Frobozzco International +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/76 +X-Sequence-Number: 834 + +Bruce Momjian wrote: +> We could prevent the postmaster from starting unless they run pg_tune or +> if they have modified postgresql.conf from the default. Of course, +> that's pretty drastic. + +If you're going to do that, then you may as well make the defaults +something that will perform reasonably well under the widest +circumstances possible and let the postmaster fail when it can't +acquire the resources those defaults demand. + +What I'd do is go ahead and make the defaults something reasonable, +and if the postmaster can't allocate, say, enough shared memory pages, +then it should issue an error message saying not only that it wasn't +able to allocate enough shared memory, but also which parameter to +change and (if it's not too much trouble to implement) what it can be +changed to in order to get past that part of the initialization (this +means that the postmaster has to figure out how much shared memory it +can actually allocate, via a binary search allocate/free method). It +should also warn that by lowering the value, the resulting performance +may be much less than satisfactory, and that the alternative (to +increase SHMMAX, in this example) should be used if good performance +is desired. + +That way, someone whose only concern is to make it work will be able +to do so without having to do a lot of experimentation, and will get +plenty of warning that the result isn't likely to work very well. + +And we end up getting better benchmarks in the cases where people +don't have to touch the default config. :-) + + +-- +Kevin Brown kevin@sysexperts.com + +From pgsql-performance-owner@postgresql.org Fri Feb 14 00:31:27 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id C41CA474E4F + for ; + Fri, 14 Feb 2003 00:31:21 -0500 (EST) +Received: from filer (12-234-86-219.client.attbi.com [12.234.86.219]) + by postgresql.org (Postfix) with ESMTP id 56E6A474E42 + for ; + Fri, 14 Feb 2003 00:31:19 -0500 (EST) +Received: from localhost (localhost [127.0.0.1]) (uid 1000) + by filer with local; Thu, 13 Feb 2003 21:31:24 -0800 +Date: Thu, 13 Feb 2003 21:31:24 -0800 +From: Kevin Brown +To: pgsql-performance@postgresql.org +Subject: Tuning scenarios (was Changing the default configuration) +Message-ID: <20030214053124.GQ1833@filer> +Mail-Followup-To: Kevin Brown , + pgsql-performance@postgresql.org +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> <3E492E06.2030702@postgresql.org> + <200302110918.48614.josh@agliodbs.com> + <26582.1044984365@sss.pgh.pa.us> <3E493415.9090004@postgresql.org> + <26850.1044985975@sss.pgh.pa.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +In-Reply-To: <26850.1044985975@sss.pgh.pa.us> +User-Agent: Mutt/1.4i +Organization: Frobozzco International +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/74 +X-Sequence-Number: 1130 + +Tom Lane wrote: +> If I thought that pgbench was representative of anything, or even +> capable of reliably producing repeatable numbers, then I might subscribe +> to results derived this way. But I have little or no confidence in +> pgbench. Certainly I don't see how you'd use it to produce +> recommendations for a range of application scenarios, when it's only +> one very narrow scenario itself. + +So let's say you were designing a tool to help someone get reasonable +performance out of a PostgreSQL installation. What scenarios would +you include in such a tool, and what information would you want out of +it? + +You don't have any real confidence in pgbench. Fair enough. What +*would* you have confidence in? + + +-- +Kevin Brown kevin@sysexperts.com + +From pgsql-performance-owner@postgresql.org Fri Feb 14 01:04:37 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 760F5474E4F + for ; + Fri, 14 Feb 2003 01:04:35 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id CF7C6474E42 + for ; + Fri, 14 Feb 2003 01:04:34 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1E64Y5u004591; + Fri, 14 Feb 2003 01:04:34 -0500 (EST) +To: Kevin Brown +Cc: pgsql-performance@postgresql.org +Subject: Re: Tuning scenarios (was Changing the default configuration) +In-reply-to: <20030214053124.GQ1833@filer> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> <3E492E06.2030702@postgresql.org> + <200302110918.48614.josh@agliodbs.com> + <26582.1044984365@sss.pgh.pa.us> <3E493415.9090004@postgresql.org> + <26850.1044985975@sss.pgh.pa.us> <20030214053124.GQ1833@filer> +Comments: In-reply-to Kevin Brown + message dated "Thu, 13 Feb 2003 21:31:24 -0800" +Date: Fri, 14 Feb 2003 01:04:34 -0500 +Message-ID: <4590.1045202674@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/75 +X-Sequence-Number: 1131 + +Kevin Brown writes: +> You don't have any real confidence in pgbench. Fair enough. What +> *would* you have confidence in? + +Measurements on your actual application? + +In fairness to pgbench, most of its problems come from people running +it at tiny scale factors, where it reduces to an exercise in how many +angels can dance on the same pin (or, how many backends can contend to +update the same row). And in that regime it runs into two or three +different Postgres limitations that might or might not have any +relevance to your real-world application --- dead-index-row references +used to be the worst, but I think probably aren't anymore in 7.3. +But those same limitations cause the results to be unstable from run +to run, which is why I don't have a lot of faith in reports of pgbench +numbers. You need to work quite hard to get reproducible numbers out +of it. + +No, I don't have a better benchmark in my pocket :-( + + regards, tom lane + +From pgsql-hackers-owner@postgresql.org Fri Feb 14 01:14:36 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 1B0AC475EAA + for ; + Fri, 14 Feb 2003 01:14:34 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id A13C7475EBF + for ; + Fri, 14 Feb 2003 01:12:37 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1E6CZ327249 + for pgsql-hackers@postgresql.org; Fri, 14 Feb 2003 14:12:35 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1E6CV727201 + for ; + Fri, 14 Feb 2003 14:12:31 +0800 (WST) +From: "Christopher Kings-Lynne" +To: "PostgresSQL Hackers Mailing List" +Subject: Offering tuned config files +Date: Fri, 14 Feb 2003 14:12:50 +0800 +Message-ID: +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_NextPart_000_00DE_01C2D433.286F5240" +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) +In-Reply-To: <20030214032605.GA18932@filer> +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +Importance: Normal +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/716 +X-Sequence-Number: 35657 + +This is a multi-part message in MIME format. + +------=_NextPart_000_00DE_01C2D433.286F5240 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 7bit + +OK, + +Here's a stab at some extra conf files. Feel free to shoot them down. + +If we can come up with at least _some_ alternative files that we can put +somewhere for them to see when postgres is installed, then at least people +can see what variables will affect what... + +I didn't see the point of a 'workstation' option, the default is fine for +that. + +Chris + + +> -----Original Message----- +> From: pgsql-hackers-owner@postgresql.org +> [mailto:pgsql-hackers-owner@postgresql.org]On Behalf Of Kevin Brown +> Sent: Friday, 14 February 2003 11:26 AM +> To: PostgresSQL Hackers Mailing List; pgsql-advocacy@postgresql.org +> Subject: Re: [HACKERS] Changing the default configuration (was Re: +> [pgsql-advocacy] +> +> +> Josh Berkus wrote: +> > > > Uh ... do we have a basis for recommending any particular sets of +> > > > parameters for these different scenarios? This could be a good idea +> > > > in the abstract, but I'm not sure I know enough to fill in +> the details. +> > +> > Sure. +> > Mostly-Read database, few users, good hardware, complex queries: +> > = High shared buffers and sort mem, high geqo and join +> collapse thresholds, +> > moderate fsm settings, defaults for WAL. +> > Same as above with many users and simple queries (webserver) = +> > same as above, except lower sort mem and higher connection limit +> > High-Transaction Database = +> > Moderate shared buffers and sort mem, high FSM settings, +> increase WAL files +> > and buffers. +> > Workstation = +> > Moderate to low shared buffers and sort mem, moderate FSM, +> defaults for WAL, +> > etc. +> > Low-Impact server = current defaults, more or less. +> +> Okay, but there should probably be one more, called "Benchmark". The +> real problem is what values to use for it. :-) +> +> +> +> -- +> Kevin Brown kevin@sysexperts.com +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org +> + +------=_NextPart_000_00DE_01C2D433.286F5240 +Content-Type: application/octet-stream; + name="postgresql.conf.sample-olap" +Content-Transfer-Encoding: quoted-printable +Content-Disposition: attachment; + filename="postgresql.conf.sample-olap" + +# +# PostgreSQL configuration file +# ----------------------------- +# +# This file consists of lines of the form: +# +# name =3D value +# +# (The '=3D' is optional.) White space may be used. Comments are introduced +# with '#' 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=3Don'. Some options +# can be changed at run-time with the 'SET' SQL command. +# +# This file is read on postmaster startup and when the postmaster +# receives a SIGHUP. If you edit the file on a running system, you have=20 +# to SIGHUP the postmaster for the changes to take effect, or use=20 +# "pg_ctl reload". + +# THIS CONFIGURATION FILE GIVES BASIC OPTIMISATION FOR A DECISION SUPPORT +# SYSTEM THAT PROCESSES COMPLEX QUERIES. SHARED BUFFERS ARE AT A +# REASONABLE LEVEL FOR 256MB RAM (ALL FOR POSTGRESQL) AND THE DEFAULT +# ATTRIBUTE STATISTICS TARGET HAS BEEN GREATLY INCREASED TO PROVIDE +# BETTER INFORMATION FOR THE QUERY PLANNER. + +#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + + +# +# Connection Parameters +# +#tcpip_socket =3D false +#ssl =3D false + +max_connections =3D 64 +#superuser_reserved_connections =3D 2 + +#port =3D 5432=20 + +#unix_socket_directory =3D '' +#unix_socket_group =3D '' +#unix_socket_permissions =3D 0777 # octal + +#virtual_host =3D '' + +#krb_server_keyfile =3D '' + + +# +# Shared Memory Size +# +shared_buffers =3D 5000 # min max_connections*2 or 16, 8KB each +#max_fsm_relations =3D 1000 # min 10, fsm is free space map, ~40 bytes +#max_fsm_pages =3D 10000 # min 1000, fsm is free space map, ~6 bytes +#max_locks_per_transaction =3D 64 # min 10 +#wal_buffers =3D 8 # min 4, typically 8KB each + +# +# Non-shared Memory Sizes +# +sort_mem =3D 4096 # min 64, size in KB +#vacuum_mem =3D 8192 # min 1024, size in KB + + +# +# Write-ahead log (WAL) +# +#checkpoint_segments =3D 3 # in logfile segments, min 1, 16MB each +#checkpoint_timeout =3D 300 # range 30-3600, in seconds +#checkpoint_warning =3D 30 # 0 is off, in seconds +# +#commit_delay =3D 0 # range 0-100000, in microseconds +#commit_siblings =3D 5 # range 1-1000 +# +#fsync =3D true +#wal_sync_method =3D fsync # the default varies across platforms: +# # fsync, fdatasync, open_sync, or open_datasync +#wal_debug =3D 0 # range 0-16 + + +# +# Optimizer Parameters +# +#enable_seqscan =3D true +#enable_indexscan =3D true +#enable_tidscan =3D true +#enable_sort =3D true +#enable_hashagg =3D true +#enable_nestloop =3D true +#enable_mergejoin =3D true +#enable_hashjoin =3D true + +#effective_cache_size =3D 1000 # typically 8KB each +#random_page_cost =3D 4 # units are one sequential page fetch cost +#cpu_tuple_cost =3D 0.01 # (same) +#cpu_index_tuple_cost =3D 0.001 # (same) +#cpu_operator_cost =3D 0.0025 # (same) + +#from_collapse_limit =3D 8 +#join_collapse_limit =3D 8 # 1 disables collapsing of explicit JOINs + +default_statistics_target =3D 50 # range 1-1000 + +# +# GEQO Optimizer Parameters +# +#geqo =3D true +#geqo_selection_bias =3D 2.0 # range 1.5-2.0 +#geqo_threshold =3D 11 +#geqo_pool_size =3D 0 # default based on tables in statement,=20 + # range 128-1024 +#geqo_effort =3D 1 +#geqo_generations =3D 0 +#geqo_random_seed =3D -1 # auto-compute seed + + +# +# Message display +# +#log_min_messages =3D notice # Values, in order of decreasing detail: + # debug5, debug4, debug3, debug2, debug1, + # info, notice, warning, error, log, fatal, + # panic +#client_min_messages =3D notice # Values, in order of decreasing detail: + # debug5, debug4, debug3, debug2, debug1, + # log, info, notice, warning, error +#silent_mode =3D false + +#log_connections =3D false +#log_hostname =3D false +#log_source_port =3D false +#log_pid =3D false +#log_statement =3D false +#log_duration =3D false +#log_timestamp =3D false + +#log_min_error_statement =3D error # Values in order of increasing severity: + # debug5, debug4, debug3, debug2, debug1, + # info, notice, warning, error, panic(off) + +#debug_print_parse =3D false +#debug_print_rewritten =3D false +#debug_print_plan =3D false +#debug_pretty_print =3D false + +#explain_pretty_print =3D true + +# requires USE_ASSERT_CHECKING +#debug_assertions =3D true + + +# +# Syslog +# +#syslog =3D 0 # range 0-2 +#syslog_facility =3D 'LOCAL0' +#syslog_ident =3D 'postgres' + + +# +# Statistics +# +#log_parser_stats =3D false +#log_planner_stats =3D false +#log_executor_stats =3D false +#log_statement_stats =3D false + +# requires BTREE_BUILD_STATS +#log_btree_build_stats =3D false + + +# +# Access statistics collection +# +#stats_start_collector =3D true +#stats_reset_on_server_start =3D true +#stats_command_string =3D false +#stats_row_level =3D false +#stats_block_level =3D false + + +# +# Lock Tracing +# +#trace_notify =3D false + +# requires LOCK_DEBUG +#trace_locks =3D false +#trace_userlocks =3D false +#trace_lwlocks =3D false +#debug_deadlocks =3D false +#trace_lock_oidmin =3D 16384 +#trace_lock_table =3D 0 + + +# +# Misc +# +#autocommit =3D true +#dynamic_library_path =3D '$libdir' +#search_path =3D '$user,public' +#datestyle =3D 'iso, us' +#timezone =3D unknown # actually, defaults to TZ environment setting +#australian_timezones =3D false +#client_encoding =3D sql_ascii # actually, defaults to database encoding +#authentication_timeout =3D 60 # 1-600, in seconds +#deadlock_timeout =3D 1000 # in milliseconds +#default_transaction_isolation =3D 'read committed' +#extra_float_digits =3D 0 # min -15, max 2 +#max_expr_depth =3D 10000 # min 10 +#max_files_per_process =3D 1000 # min 25 +#password_encryption =3D true +#regex_flavor =3D advanced # advanced, extended, or basic +#sql_inheritance =3D true +#transform_null_equals =3D false +#statement_timeout =3D 0 # 0 is disabled, in milliseconds +#db_user_namespace =3D false +=20 + +------=_NextPart_000_00DE_01C2D433.286F5240 +Content-Type: application/octet-stream; + name="postgresql.conf.sample-web" +Content-Transfer-Encoding: quoted-printable +Content-Disposition: attachment; + filename="postgresql.conf.sample-web" + +# +# PostgreSQL configuration file +# ----------------------------- +# +# This file consists of lines of the form: +# +# name =3D value +# +# (The '=3D' is optional.) White space may be used. Comments are introduced +# with '#' 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=3Don'. Some options +# can be changed at run-time with the 'SET' SQL command. +# +# This file is read on postmaster startup and when the postmaster +# receives a SIGHUP. If you edit the file on a running system, you have=20 +# to SIGHUP the postmaster for the changes to take effect, or use=20 +# "pg_ctl reload". + +# THIS SAMPLE CONFIGURATION IS OPTIMIZED FOR A WEB SITE DATABASE SERVER. +# IT ASSUMES 256MB RAM (ALL FOR POSTGRESQL) AND A HIGH DATABASE READ TO=20 +# DATABASE WRITE RATIO. + +#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 + +# +# Connection Parameters +# +#tcpip_socket =3D false +#ssl =3D false + +max_connections =3D 128 +#superuser_reserved_connections =3D 2 + +#port =3D 5432=20 + +#unix_socket_directory =3D '' +#unix_socket_group =3D '' +#unix_socket_permissions =3D 0777 # octal + +#virtual_host =3D '' + +#krb_server_keyfile =3D '' + + +# +# Shared Memory Size +# +shared_buffers =3D 5000 # min max_connections*2 or 16, 8KB each +#max_fsm_relations =3D 1000 # min 10, fsm is free space map, ~40 bytes +#max_fsm_pages =3D 10000 # min 1000, fsm is free space map, ~6 bytes +#max_locks_per_transaction =3D 64 # min 10 +#wal_buffers =3D 8 # min 4, typically 8KB each + +# +# Non-shared Memory Sizes +# +sort_mem =3D 2048 # min 64, size in KB +#vacuum_mem =3D 8192 # min 1024, size in KB + + +# +# Write-ahead log (WAL) +# +#checkpoint_segments =3D 3 # in logfile segments, min 1, 16MB each +#checkpoint_timeout =3D 300 # range 30-3600, in seconds +#checkpoint_warning =3D 30 # 0 is off, in seconds +# +#commit_delay =3D 0 # range 0-100000, in microseconds +#commit_siblings =3D 5 # range 1-1000 +# +#fsync =3D true +#wal_sync_method =3D fsync # the default varies across platforms: +# # fsync, fdatasync, open_sync, or open_datasync +#wal_debug =3D 0 # range 0-16 + + +# +# Optimizer Parameters +# +#enable_seqscan =3D true +#enable_indexscan =3D true +#enable_tidscan =3D true +#enable_sort =3D true +#enable_hashagg =3D true +#enable_nestloop =3D true +#enable_mergejoin =3D true +#enable_hashjoin =3D true + +#effective_cache_size =3D 1000 # typically 8KB each +#random_page_cost =3D 4 # units are one sequential page fetch cost +#cpu_tuple_cost =3D 0.01 # (same) +#cpu_index_tuple_cost =3D 0.001 # (same) +#cpu_operator_cost =3D 0.0025 # (same) + +#from_collapse_limit =3D 8 +#join_collapse_limit =3D 8 # 1 disables collapsing of explicit JOINs + +#default_statistics_target =3D 10 # range 1-1000 + +# +# GEQO Optimizer Parameters +# +#geqo =3D true +#geqo_selection_bias =3D 2.0 # range 1.5-2.0 +#geqo_threshold =3D 11 +#geqo_pool_size =3D 0 # default based on tables in statement,=20 + # range 128-1024 +#geqo_effort =3D 1 +#geqo_generations =3D 0 +#geqo_random_seed =3D -1 # auto-compute seed + + +# +# Message display +# +#log_min_messages =3D notice # Values, in order of decreasing detail: + # debug5, debug4, debug3, debug2, debug1, + # info, notice, warning, error, log, fatal, + # panic +#client_min_messages =3D notice # Values, in order of decreasing detail: + # debug5, debug4, debug3, debug2, debug1, + # log, info, notice, warning, error +#silent_mode =3D false + +#log_connections =3D false +#log_hostname =3D false +#log_source_port =3D false +#log_pid =3D false +#log_statement =3D false +#log_duration =3D false +#log_timestamp =3D false + +#log_min_error_statement =3D error # Values in order of increasing severity: + # debug5, debug4, debug3, debug2, debug1, + # info, notice, warning, error, panic(off) + +#debug_print_parse =3D false +#debug_print_rewritten =3D false +#debug_print_plan =3D false +#debug_pretty_print =3D false + +#explain_pretty_print =3D true + +# requires USE_ASSERT_CHECKING +#debug_assertions =3D true + + +# +# Syslog +# +#syslog =3D 0 # range 0-2 +#syslog_facility =3D 'LOCAL0' +#syslog_ident =3D 'postgres' + + +# +# Statistics +# +#log_parser_stats =3D false +#log_planner_stats =3D false +#log_executor_stats =3D false +#log_statement_stats =3D false + +# requires BTREE_BUILD_STATS +#log_btree_build_stats =3D false + + +# +# Access statistics collection +# +#stats_start_collector =3D true +#stats_reset_on_server_start =3D true +#stats_command_string =3D false +#stats_row_level =3D false +#stats_block_level =3D false + + +# +# Lock Tracing +# +#trace_notify =3D false + +# requires LOCK_DEBUG +#trace_locks =3D false +#trace_userlocks =3D false +#trace_lwlocks =3D false +#debug_deadlocks =3D false +#trace_lock_oidmin =3D 16384 +#trace_lock_table =3D 0 + + +# +# Misc +# +#autocommit =3D true +#dynamic_library_path =3D '$libdir' +#search_path =3D '$user,public' +#datestyle =3D 'iso, us' +#timezone =3D unknown # actually, defaults to TZ environment setting +#australian_timezones =3D false +#client_encoding =3D sql_ascii # actually, defaults to database encoding +#authentication_timeout =3D 60 # 1-600, in seconds +#deadlock_timeout =3D 1000 # in milliseconds +#default_transaction_isolation =3D 'read committed' +#extra_float_digits =3D 0 # min -15, max 2 +#max_expr_depth =3D 10000 # min 10 +#max_files_per_process =3D 1000 # min 25 +#password_encryption =3D true +#regex_flavor =3D advanced # advanced, extended, or basic +#sql_inheritance =3D true +#transform_null_equals =3D false +#statement_timeout =3D 0 # 0 is disabled, in milliseconds +#db_user_namespace =3D false +=20 + +------=_NextPart_000_00DE_01C2D433.286F5240 +Content-Type: application/octet-stream; + name="postgresql.conf.sample-writeheavy" +Content-Transfer-Encoding: quoted-printable +Content-Disposition: attachment; filename="postgresql.conf.sample-writeheavy" + +# +# PostgreSQL configuration file +# ----------------------------- +# +# This file consists of lines of the form: +# +# name =3D value +# +# (The '=3D' is optional.) White space may be used. Comments are introduced +# with '#' 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=3Don'. Some options +# can be changed at run-time with the 'SET' SQL command. +# +# This file is read on postmaster startup and when the postmaster +# receives a SIGHUP. If you edit the file on a running system, you have=20 +# to SIGHUP the postmaster for the changes to take effect, or use=20 +# "pg_ctl reload". + + +#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + + +# +# Connection Parameters +# +#tcpip_socket =3D false +#ssl =3D false + +max_connections =3D 128 +#superuser_reserved_connections =3D 2 + +#port =3D 5432=20 + +#unix_socket_directory =3D '' +#unix_socket_group =3D '' +#unix_socket_permissions =3D 0777 # octal + +#virtual_host =3D '' + +#krb_server_keyfile =3D '' + + +# +# Shared Memory Size +# +shared_buffers =3D 5000 # min max_connections*2 or 16, 8KB each +#max_fsm_relations =3D 1000 # min 10, fsm is free space map, ~40 bytes +max_fsm_pages =3D 100000 # min 1000, fsm is free space map, ~6 bytes +#max_locks_per_transaction =3D 64 # min 10 +wal_buffers =3D 16 # min 4, typically 8KB each + +# +# Non-shared Memory Sizes +# +#sort_mem =3D 1024 # min 64, size in KB +#vacuum_mem =3D 8192 # min 1024, size in KB + + +# +# Write-ahead log (WAL) +# +checkpoint_segments =3D 6 # in logfile segments, min 1, 16MB each +#checkpoint_timeout =3D 300 # range 30-3600, in seconds +#checkpoint_warning =3D 30 # 0 is off, in seconds +# +commit_delay =3D 10000 # range 0-100000, in microseconds +#commit_siblings =3D 5 # range 1-1000 +# +#fsync =3D true +#wal_sync_method =3D fsync # the default varies across platforms: +# # fsync, fdatasync, open_sync, or open_datasync +#wal_debug =3D 0 # range 0-16 + + +# +# Optimizer Parameters +# +#enable_seqscan =3D true +#enable_indexscan =3D true +#enable_tidscan =3D true +#enable_sort =3D true +#enable_hashagg =3D true +#enable_nestloop =3D true +#enable_mergejoin =3D true +#enable_hashjoin =3D true + +#effective_cache_size =3D 1000 # typically 8KB each +#random_page_cost =3D 4 # units are one sequential page fetch cost +#cpu_tuple_cost =3D 0.01 # (same) +#cpu_index_tuple_cost =3D 0.001 # (same) +#cpu_operator_cost =3D 0.0025 # (same) + +#from_collapse_limit =3D 8 +#join_collapse_limit =3D 8 # 1 disables collapsing of explicit JOINs + +#default_statistics_target =3D 10 # range 1-1000 + +# +# GEQO Optimizer Parameters +# +#geqo =3D true +#geqo_selection_bias =3D 2.0 # range 1.5-2.0 +#geqo_threshold =3D 11 +#geqo_pool_size =3D 0 # default based on tables in statement,=20 + # range 128-1024 +#geqo_effort =3D 1 +#geqo_generations =3D 0 +#geqo_random_seed =3D -1 # auto-compute seed + + +# +# Message display +# +#log_min_messages =3D notice # Values, in order of decreasing detail: + # debug5, debug4, debug3, debug2, debug1, + # info, notice, warning, error, log, fatal, + # panic +#client_min_messages =3D notice # Values, in order of decreasing detail: + # debug5, debug4, debug3, debug2, debug1, + # log, info, notice, warning, error +#silent_mode =3D false + +#log_connections =3D false +#log_hostname =3D false +#log_source_port =3D false +#log_pid =3D false +#log_statement =3D false +#log_duration =3D false +#log_timestamp =3D false + +#log_min_error_statement =3D error # Values in order of increasing severity: + # debug5, debug4, debug3, debug2, debug1, + # info, notice, warning, error, panic(off) + +#debug_print_parse =3D false +#debug_print_rewritten =3D false +#debug_print_plan =3D false +#debug_pretty_print =3D false + +#explain_pretty_print =3D true + +# requires USE_ASSERT_CHECKING +#debug_assertions =3D true + + +# +# Syslog +# +#syslog =3D 0 # range 0-2 +#syslog_facility =3D 'LOCAL0' +#syslog_ident =3D 'postgres' + + +# +# Statistics +# +#log_parser_stats =3D false +#log_planner_stats =3D false +#log_executor_stats =3D false +#log_statement_stats =3D false + +# requires BTREE_BUILD_STATS +#log_btree_build_stats =3D false + + +# +# Access statistics collection +# +#stats_start_collector =3D true +#stats_reset_on_server_start =3D true +#stats_command_string =3D false +#stats_row_level =3D false +#stats_block_level =3D false + + +# +# Lock Tracing +# +#trace_notify =3D false + +# requires LOCK_DEBUG +#trace_locks =3D false +#trace_userlocks =3D false +#trace_lwlocks =3D false +#debug_deadlocks =3D false +#trace_lock_oidmin =3D 16384 +#trace_lock_table =3D 0 + + +# +# Misc +# +#autocommit =3D true +#dynamic_library_path =3D '$libdir' +#search_path =3D '$user,public' +#datestyle =3D 'iso, us' +#timezone =3D unknown # actually, defaults to TZ environment setting +#australian_timezones =3D false +#client_encoding =3D sql_ascii # actually, defaults to database encoding +#authentication_timeout =3D 60 # 1-600, in seconds +#deadlock_timeout =3D 1000 # in milliseconds +#default_transaction_isolation =3D 'read committed' +#extra_float_digits =3D 0 # min -15, max 2 +#max_expr_depth =3D 10000 # min 10 +#max_files_per_process =3D 1000 # min 25 +#password_encryption =3D true +#regex_flavor =3D advanced # advanced, extended, or basic +#sql_inheritance =3D true +#transform_null_equals =3D false +#statement_timeout =3D 0 # 0 is disabled, in milliseconds +#db_user_namespace =3D false +=20 + +------=_NextPart_000_00DE_01C2D433.286F5240-- + + +From pgsql-performance-owner@postgresql.org Fri Feb 14 06:48:42 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 68F0D474E4F + for ; + Fri, 14 Feb 2003 06:48:41 -0500 (EST) +Received: from filer (12-234-86-219.client.attbi.com [12.234.86.219]) + by postgresql.org (Postfix) with ESMTP id C055F474E42 + for ; + Fri, 14 Feb 2003 06:48:40 -0500 (EST) +Received: from localhost (localhost [127.0.0.1]) (uid 1000) + by filer with local; Fri, 14 Feb 2003 03:48:43 -0800 +Date: Fri, 14 Feb 2003 03:48:43 -0800 +From: Kevin Brown +To: pgsql-performance@postgresql.org +Subject: Re: Tuning scenarios (was Changing the default configuration) +Message-ID: <20030214114843.GB1847@filer> +Mail-Followup-To: Kevin Brown , + pgsql-performance@postgresql.org +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> <3E492E06.2030702@postgresql.org> + <200302110918.48614.josh@agliodbs.com> + <26582.1044984365@sss.pgh.pa.us> <3E493415.9090004@postgresql.org> + <26850.1044985975@sss.pgh.pa.us> <20030214053124.GQ1833@filer> + <4590.1045202674@sss.pgh.pa.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +In-Reply-To: <4590.1045202674@sss.pgh.pa.us> +User-Agent: Mutt/1.4i +Organization: Frobozzco International +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/76 +X-Sequence-Number: 1132 + +Tom Lane wrote: +> Kevin Brown writes: +> > You don't have any real confidence in pgbench. Fair enough. What +> > *would* you have confidence in? +> +> Measurements on your actual application? + +That unfortunately doesn't help us a whole lot in figuring out +defaults that will perform reasonably well under broad conditions, +unless there's some way to determine a reasonably consistent pattern +(or set of patterns) amongst a lot of those applications. + +> In fairness to pgbench, most of its problems come from people running +> it at tiny scale factors, where it reduces to an exercise in how many +> angels can dance on the same pin (or, how many backends can contend to +> update the same row). + +This isn't easy to fix, but I don't think it's impossible either. +It's probably sufficient to make the defaults dependent on information +gathered about the system. I'd think total system memory would be the +primary thing to consider, since most database engines are pretty fast +once all the data and indexes are cached. :-) + +> And in that regime it runs into two or three different Postgres +> limitations that might or might not have any relevance to your +> real-world application --- dead-index-row references used to be the +> worst, but I think probably aren't anymore in 7.3. But those same +> limitations cause the results to be unstable from run to run, which +> is why I don't have a lot of faith in reports of pgbench numbers. +> You need to work quite hard to get reproducible numbers out of it. + +The interesting question is whether that's more an indictment of how +PG does things or how pg_bench does things. I imagine it's probably +difficult to get truly reproducible numbers out of pretty much any +benchmark coupled with pretty much any database engine. There are +simply far too many parameters to tweak on any but the simplest +database engines, and we haven't even started talking about tuning the +OS around the database... + +And benchmarks (as well as real-world applications) will always run +into limitations of the database (locking mechanisms, IPC limits, +etc.). In fact, that's another useful purpose: to see where the +limits of the database are. + +Despite the limits, it's probably better to have a benchmark that only +gives you an order of magnitude idea of what to expect than to not +have anything at all. And thus we're more or less right back where we +started: what kinds of benchmarking tests should go into a benchmark +for the purposes of tuning a database system (PG in particular but the +answer might easily apply to others as well) so that it will perform +decently, if not optimally, under the most likely loads? + +I think we might be able to come up with some reasonable answers to +that, as long as we don't expect too much out of the resulting +benchmark. The right people to ask are probably the people who are +actually running production databases. + +Anyone wanna chime in here with some opinions and perspectives? + + + + + +-- +Kevin Brown kevin@sysexperts.com + +From pgsql-hackers-owner@postgresql.org Fri Feb 14 06:59:44 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 8C94A4759AF + for ; + Fri, 14 Feb 2003 06:59:43 -0500 (EST) +Received: from email02.aon.at (WARSL402PIP7.highway.telekom.at [195.3.96.94]) + by postgresql.org (Postfix) with SMTP id B8A43475957 + for ; + Fri, 14 Feb 2003 06:59:42 -0500 (EST) +Received: (qmail 406350 invoked from network); 14 Feb 2003 11:59:44 -0000 +Received: from m162p021.dipool.highway.telekom.at (HELO cantor) + ([62.46.10.53]) (envelope-sender ) + by qmail2rs.highway.telekom.at (qmail-ldap-1.03) with SMTP + for ; 14 Feb 2003 11:59:44 -0000 +From: Manfred Koizar +To: "Christopher Kings-Lynne" +Cc: "PostgresSQL Hackers Mailing List" +Subject: Re: Offering tuned config files +Date: Fri, 14 Feb 2003 12:58:57 +0100 +Message-ID: +References: <20030214032605.GA18932@filer> + +In-Reply-To: +X-Mailer: Forte Agent 1.8/32.548 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/732 +X-Sequence-Number: 35673 + +On Fri, 14 Feb 2003 14:12:50 +0800, "Christopher Kings-Lynne" + wrote: +>Here's a stab at some extra conf files. Feel free to shoot them down. + +No intent to shoot anything down, just random thoughts: + +effective_cache_size = 20000 (~ 160 MB) should be more adequate for a +256 MB machine than the extremely conservative default of 1000. I +admit that the effect of this change is hard to benchmark. A way too +low (or too high) setting may lead the planner to wrong conclusions. + +More parameters affecting the planner: + #cpu_tuple_cost = 0.01 + #cpu_index_tuple_cost = 0.001 + #cpu_operator_cost = 0.0025 + +Are these still good defaults? I have no hard facts, but ISTM that +CPU speed is increasing more rapidly than disk access speed. + +In postgresql.conf.sample-writeheavy you have: + commit_delay = 10000 + +Is this still needed with "ganged WAL writes"? Tom? + +Servus + Manfred + +From pgsql-performance-owner@postgresql.org Fri Feb 14 07:35:54 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 3D2F3474E4F + for ; + Fri, 14 Feb 2003 07:35:53 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP id B3D77475D0F + for ; + Fri, 14 Feb 2003 07:35:51 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h1ECZlh01865; + Fri, 14 Feb 2003 07:35:47 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302141235.h1ECZlh01865@candle.pha.pa.us> +Subject: Re: JBoss CMP Performance Problems with PostgreSQL 7.2.3 +In-Reply-To: <3961.1045196332@sss.pgh.pa.us> +To: Tom Lane +Date: Fri, 14 Feb 2003 07:35:46 -0500 (EST) +Cc: "Darryl A. J. Staflund" , + 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 AMaViS new-20020517 +X-Archive-Number: 200302/77 +X-Sequence-Number: 1133 + +Tom Lane wrote: +> "Darryl A. J. Staflund" writes: +> > MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEH +> > AaCAJIAEggX+Q29udGVudC1UeXBlOiB0ZXh0L3BsYWluOw0KCWNoYXJzZXQ9 +> > IlVTLUFTQ0lJIg0KQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogN2JpdA0K +> > DQpIaSBldmVyeW9uZSwNCg0KVGhhbmtzIGZvciB5b3VyIGNvbW1lbnRzIGFu +> > ZCBsaW5rcyB0byB0aGUgdmFyaW91cyB0b29scy4gIEkgd2lsbCBtYWtlIHN1 +> > cmUNCnRvIGludmVzdGlnYXRlIHRoZW0hDQoNCk5vdyBvbnRvIHRoaXMgbGV0 +> > dGVyLi4uDQoNCk9uIHRoZSBhc3N1bXB0aW9uIHRoYXQgUG9zdGdyZVNRTCB3 +> > [etc] +> +> I might answer this if it weren't so unremittingly nastily encoded... +> *please* turn off whatever the heck that is. + +Tom, the answer is obvious: + + ljasdfJOJAAJDJFoaijwsdojoAIJSDOIJAsdoFIJSoiJFOIJASDOFIJOLJAASDFaoiojfos + +:-) + +-- + 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 Feb 14 08:12:01 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id A05F2475A6D; Fri, 14 Feb 2003 08:11:57 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP + id ECCAB475957; Fri, 14 Feb 2003 08:11:55 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h1EDBb020716; + Fri, 14 Feb 2003 08:11:37 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302141311.h1EDBb020716@candle.pha.pa.us> +Subject: Re: [HACKERS] Terrible performance on wide selects +In-Reply-To: <25661.1043332885@sss.pgh.pa.us> +To: Tom Lane +Date: Fri, 14 Feb 2003 08:11:37 -0500 (EST) +Cc: Hannu Krosing , Dann Corbit , + Steve Crawford , + pgsql-performance@postgresql.org, 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 AMaViS new-20020517 +X-Archive-Number: 200302/78 +X-Sequence-Number: 1134 + + +Added to TODO: + + * Cache last known per-tuple offsets to speed long tuple access + + +--------------------------------------------------------------------------- + +Tom Lane wrote: +> Hannu Krosing writes: +> >> i.e. for tuple with 100 cols, allocate an array of 100 pointers, plus +> >> keep count of how many are actually valid, +> +> > Additionally, this should also make repeted determining of NULL fields +> > faster - just put a NULL-pointer in and voila - no more bit-shifting and +> > AND-ing to find out if the field is null. +> +> Right, the output of the operation would be a pair of arrays: Datum +> values and is-null flags. (NULL pointers don't work for pass-by-value +> datatypes.) +> +> I like the idea of keeping track of a last-known-column position and +> incrementally extending that as needed. +> +> I think the way to manage this is to add the overhead data (the output +> arrays and last-column state) to TupleTableSlots. Then we'd have +> a routine similar to heap_getattr except that it takes a TupleTableSlot +> and makes use of the extra state data. The infrastructure to manage +> the state data is already in place: for example, ExecStoreTuple would +> reset the last-known-column to 0, ExecSetSlotDescriptor would be +> responsible for allocating the output arrays using the natts value from +> the provided tupdesc, etc. +> +> This wouldn't help for accesses that are not in the context of a slot, +> but certainly all the ones from ExecEvalVar are. The executor always +> works with tuples stored in slots, so I think we could fix all the +> high-traffic cases this way. +> +> regards, tom lane +> +> ---------------------------(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 Fri Feb 14 09:30:37 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 1A4B1474E5C; Fri, 14 Feb 2003 09:30:35 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP + id 042EF474E4F; Fri, 14 Feb 2003 09:30:33 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h1EEUUr06607; + Fri, 14 Feb 2003 09:30:30 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302141430.h1EEUUr06607@candle.pha.pa.us> +Subject: Re: WAL replay logic (was Re: Mount options for Ext3?) +In-Reply-To: <20030125101111.GB12957@filer> +To: Kevin Brown +Date: Fri, 14 Feb 2003 09:30:30 -0500 (EST) +Cc: pgsql-performance@postgresql.org, 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 AMaViS new-20020517 +X-Archive-Number: 200302/79 +X-Sequence-Number: 1135 + + +Is there a TODO here, like "Allow recovery from corrupt pg_control via +WAL"? + +--------------------------------------------------------------------------- + +Kevin Brown wrote: +> Tom Lane wrote: +> > Kevin Brown writes: +> > > One question I have is: in the event of a crash, why not simply replay +> > > all the transactions found in the WAL? Is the startup time of the +> > > database that badly affected if pg_control is ignored? +> > +> > Interesting thought, indeed. Since we truncate the WAL after each +> > checkpoint, seems like this approach would no more than double the time +> > for restart. +> +> Hmm...truncating the WAL after each checkpoint minimizes the amount of +> disk space eaten by the WAL, but on the other hand keeping older +> segments around buys you some safety in the event that things get +> really hosed. But your later comments make it sound like the older +> WAL segments are kept around anyway, just rotated. +> +> > The win is it'd eliminate pg_control as a single point of +> > failure. It's always bothered me that we have to update pg_control on +> > every checkpoint --- it should be a write-pretty-darn-seldom file, +> > considering how critical it is. +> > +> > I think we'd have to make some changes in the code for deleting old +> > WAL segments --- right now it's not careful to delete them in order. +> > But surely that can be coped with. +> +> Even that might not be necessary. See below. +> +> > OTOH, this might just move the locus for fatal failures out of +> > pg_control and into the OS' algorithms for writing directory updates. +> > We would have no cross-check that the set of WAL file names visible in +> > pg_xlog is sensible or aligned with the true state of the datafile +> > area. +> +> Well, what we somehow need to guarantee is that there is always WAL +> data that is older than the newest consistent data in the datafile +> area, right? Meaning that if the datafile area gets scribbled on in +> an inconsistent manner, you always have WAL data to fill in the gaps. +> +> Right now we do that by using fsync() and sync(). But I think it +> would be highly desirable to be able to more or less guarantee +> database consistency even if fsync were turned off. The price for +> that might be too high, though. +> +> > We'd have to take it on faith that we should replay the visible files +> > in their name order. This might mean we'd have to abandon the current +> > hack of recycling xlog segments by renaming them --- which would be a +> > nontrivial performance hit. +> +> It's probably a bad idea for the replay to be based on the filenames. +> Instead, it should probably be based strictly on the contents of the +> xlog segment files. Seems to me the beginning of each segment file +> should have some kind of header information that makes it clear where +> in the scheme of things it belongs. Additionally, writing some sort +> of checksum, either at the beginning or the end, might not be a bad +> idea either (doesn't have to be a strict checksum, but it needs to be +> something that's reasonably likely to catch corruption within a +> segment). +> +> Do that, and you don't have to worry about renaming xlog segments at +> all: you simply move on to the next logical segment in the list (a +> replay just reads the header info for all the segments and orders the +> list as it sees fit, and discards all segments prior to any gap it +> finds. It may be that you simply have to bail out if you find a gap, +> though). As long as the xlog segment checksum information is +> consistent with the contents of the segment and as long as its +> transactions pick up where the previous segment's left off (assuming +> it's not the first segment, of course), you can safely replay the +> transactions it contains. +> +> I presume we're recycling xlog segments in order to avoid file +> creation and unlink overhead? Otherwise you can simply create new +> segments as needed and unlink old segments as policy dictates. +> +> > Comments anyone? +> > +> > > If there exists somewhere a reasonably succinct description of the +> > > reasoning behind the current transaction management scheme (including +> > > an analysis of the pros and cons), I'd love to read it and quit +> > > bugging you. :-) +> > +> > Not that I know of. Would you care to prepare such a writeup? There +> > is a lot of material in the source-code comments, but no coherent +> > presentation. +> +> Be happy to. Just point me to any non-obvious source files. +> +> Thus far on my plate: +> +> 1. PID file locking for postmaster startup (doesn't strictly need +> to be the PID file but it may as well be, since we're already +> messing with it anyway). I'm currently looking at how to do +> the autoconf tests, since I've never developed using autoconf +> before. +> +> 2. Documenting the transaction management scheme. +> +> I was initially interested in implementing the explicit JOIN +> reordering but based on your recent comments I think you have a much +> better handle on that than I. I'll be very interested to see what you +> do, to see if it's anything close to what I figure has to happen... +> +> +> -- +> Kevin Brown kevin@sysexperts.com +> +> ---------------------------(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 Fri Feb 14 10:05:43 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 3B483475D0D + for ; + Fri, 14 Feb 2003 10:05:42 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id CBEF4475D17 + for ; + Fri, 14 Feb 2003 10:05:40 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1EF5i5u007028; + Fri, 14 Feb 2003 10:05:45 -0500 (EST) +To: Kevin Brown +Cc: pgsql-performance@postgresql.org +Subject: Re: Tuning scenarios (was Changing the default configuration) +In-reply-to: <20030214114843.GB1847@filer> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> <3E492E06.2030702@postgresql.org> + <200302110918.48614.josh@agliodbs.com> + <26582.1044984365@sss.pgh.pa.us> <3E493415.9090004@postgresql.org> + <26850.1044985975@sss.pgh.pa.us> <20030214053124.GQ1833@filer> + <4590.1045202674@sss.pgh.pa.us> <20030214114843.GB1847@filer> +Comments: In-reply-to Kevin Brown + message dated "Fri, 14 Feb 2003 03:48:43 -0800" +Date: Fri, 14 Feb 2003 10:05:44 -0500 +Message-ID: <7027.1045235144@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/80 +X-Sequence-Number: 1136 + +Kevin Brown writes: +> Tom Lane wrote: +>> ... But those same +>> limitations cause the results to be unstable from run to run, which +>> is why I don't have a lot of faith in reports of pgbench numbers. +>> You need to work quite hard to get reproducible numbers out of it. + +> The interesting question is whether that's more an indictment of how +> PG does things or how pg_bench does things. + +I didn't draw a conclusion on that ;-). I merely pointed out that the +numbers are unstable, and therefore not to be trusted without a great +deal of context ... + + regards, tom lane + +From pgsql-hackers-owner@postgresql.org Fri Feb 14 10:07:54 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 3D88D474E4F + for ; + Fri, 14 Feb 2003 10:07:54 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 84CA0474E42 + for ; + Fri, 14 Feb 2003 10:07:53 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1EF7k5u007051; + Fri, 14 Feb 2003 10:07:46 -0500 (EST) +To: Manfred Koizar +Cc: "Christopher Kings-Lynne" , + "PostgresSQL Hackers Mailing List" +Subject: Re: Offering tuned config files +In-reply-to: +References: <20030214032605.GA18932@filer> + + +Comments: In-reply-to Manfred Koizar + message dated "Fri, 14 Feb 2003 12:58:57 +0100" +Date: Fri, 14 Feb 2003 10:07:45 -0500 +Message-ID: <7050.1045235265@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/766 +X-Sequence-Number: 35707 + +Manfred Koizar writes: +> In postgresql.conf.sample-writeheavy you have: +> commit_delay = 10000 +> Is this still needed with "ganged WAL writes"? Tom? + +I doubt that the current options for grouped commits are worth anything +at the moment. Chris, do you have any evidence backing up using +commit_delay with 7.3? + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Fri Feb 14 11:13:25 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id DEB82474E4F + for ; + Fri, 14 Feb 2003 11:13:23 -0500 (EST) +Received: from phaedrusdeinus.org (dsl092-130-239.chi1.dsl.speakeasy.net + [66.92.130.239]) by postgresql.org (Postfix) with SMTP id F14D9474E42 + for ; + Fri, 14 Feb 2003 11:13:22 -0500 (EST) +Received: (qmail 20728 invoked by uid 1001); 14 Feb 2003 16:33:14 -0000 +Date: Fri, 14 Feb 2003 10:33:14 -0600 +From: johnnnnnn +To: pgsql-performance@postgresql.org +Subject: Re: Tuning scenarios (was Changing the default configuration) +Message-ID: <20030214163314.GK11017@performics.com> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <26004.1044980414@sss.pgh.pa.us> <3E492E06.2030702@postgresql.org> + <200302110918.48614.josh@agliodbs.com> + <26582.1044984365@sss.pgh.pa.us> <3E493415.9090004@postgresql.org> + <26850.1044985975@sss.pgh.pa.us> <20030214053124.GQ1833@filer> + <4590.1045202674@sss.pgh.pa.us> <20030214114843.GB1847@filer> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20030214114843.GB1847@filer> +User-Agent: Mutt/1.5.1i +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/81 +X-Sequence-Number: 1137 + +On Fri, Feb 14, 2003 at 03:48:43AM -0800, Kevin Brown wrote: +> That unfortunately doesn't help us a whole lot in figuring out +> defaults that will perform reasonably well under broad conditions, +> unless there's some way to determine a reasonably consistent pattern +> (or set of patterns) amongst a lot of those applications. + +When moving to a new DB or DB box, we always run a series of +benchmarks to make sure there aren't any surprises +performance-wise. Our database activity, and thus our benchmarks, are +broken up into roughly three different patterns: + +1- Transaction processing: small number of arbitrary small +(single-row) selects intermixed with large numbers of small inserts +and updates. + +2- Reporting: large reads joining 6-12 tables, usually involving +calculations and/or aggregation. + +3- Application (object retrieval): large numbers of arbitrary, +single-row selects and updates, with smaller numbers of single row +inserts. + +We use our own application code to do our benchmarks, so they're not +general enough for your use, but it might be worthwhile to profile +each of those different patterns, or allow DB admins to limit it to a +relevant subset. Other patterns i can think of include logging (large +number of single row inserts, no updates, occasional large, simple +(1-3 table) selects), mining (complicated selects over 10 or more +tables), automated (small inserts/updates, with triggers cascading +everywhere), etc. + +The problem becomes dealing with the large amounts of data necessary +to frame all of these patterns. An additional wrinkle is accomodating +both columns with well-distributed data and columns that are top-heavy +or which only have one of a small number of values. Plus indexed vs +unindexed columns. + +Or, somewhat orthogonally, you could allow pgbench to take a workload +of different sql statements (with frequencies), and execute those +statements instead of the built-in transaction. Then it would be easy +enough to contribute a library of pattern workloads, or for the DBA to +write one herself. + +Just my two cents. + +-johnnnnnnnnnn + +From pgsql-performance-owner@postgresql.org Fri Feb 14 11:44:06 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 356A1474E4F + for ; + Fri, 14 Feb 2003 11:44:06 -0500 (EST) +Received: from lakemtao01.cox.net (lakemtao01.cox.net [68.1.17.244]) + by postgresql.org (Postfix) with ESMTP id 9983F474E42 + for ; + Fri, 14 Feb 2003 11:44:05 -0500 (EST) +Received: from [192.168.0.188] ([68.9.37.244]) by lakemtao01.cox.net + (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP + id <20030214164411.SJAK16369.lakemtao01.cox.net@[192.168.0.188]>; + Fri, 14 Feb 2003 11:44:11 -0500 +Subject: performace problem after VACUUM ANALYZE +From: Scott Cain +To: pgsql-performance@postgresql.org +Cc: gmod schema +Content-Type: text/plain +Organization: Cold Spring Harbor Lab +Message-Id: <1045241040.1486.600.camel@localhost.localdomain> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.2 +Date: 14 Feb 2003 11:44:00 -0500 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/82 +X-Sequence-Number: 1138 + +Hello, + +I am going to do my best to describe this problem, but the description +may be quite long. Also, this is my first post to this list, so I miss +important details please let me know. All of the following analysis was +done on my P4 laptop with 0.5 Gig ram and postgresql 7.3 installed from +RPM for RedHat linux 7.3 + +I have a database with two large tables that I need to do a join on. +Here is the query that is causing the problems: + +select distinct f.name,fl.nbeg,fl.nend,fl.strand,f.type_id,f.feature_id + from feature f, featureloc fl + where + fl.srcfeature_id = 1 and + ((fl.strand=1 and fl.nbeg <= 393164 and fl.nend >= 390956) OR + (fl.strand=-1 and fl.nend <= 393164 and fl.nbeg >= 390956)) and + f.feature_id = fl.feature_id + +The feature table has 3,685,287 rows and featureloc has 3,803,762 rows. +Here are all of the relevant indexes on these tables: + + Index "feature_pkey" + Column | Type +------------+--------- + feature_id | integer +unique btree (primary key) + +Index "featureloc_idx1" + Column | Type +------------+--------- + feature_id | integer +btree + + Index "featureloc_idx2" + Column | Type +---------------+--------- + srcfeature_id | integer +btree + +Index "featureloc_src_strand_beg_end" + Column | Type +---------------+---------- + srcfeature_id | integer + strand | smallint + nbeg | integer + nend | integer +btree + +In a naive database (ie, no ANALYZE has ever been run), the above query +runs in about 3 seconds after the first time it has been run (due to +caching?). Here is the output of EXPLAIN on that query: + +Unique (cost=75513.46..75513.48 rows=1 width=167) + -> Sort (cost=75513.46..75513.46 rows=1 width=167) + -> Nested Loop (cost=0.00..75513.45 rows=1 width=167) + -> Index Scan using featureloc_idx2 on featureloc fl +(cost=0.00..75508.43 rows=1 width=14) + -> Index Scan using feature_pkey on feature f +(cost=0.00..5.01 rows=1 width=153) + +Notice that for featureloc it is using featureloc_idx2, which is the +index on srcfeature_id. Ideally, it would be using +featureloc_src_strand_beg_end, but this is not bad. In fact, if I drop +featureloc_idx2 (not something I can do in a production database), it +does use that index and cuts the query runtime in half. + +Now comes the really bizarre part: if I run VACUUM ANALYZE, the +performance becomes truly awful. Instead of using an index for +featureloc, it now does a seq scan, causing the runtime to go up to +about 30 seconds. Here is the output of explain now: + +Unique (cost=344377.70..344759.85 rows=2548 width=47) + -> Sort (cost=344377.70..344377.70 rows=25477 width=47) + -> Nested Loop (cost=0.00..342053.97 rows=25477 width=47) + -> Seq Scan on featureloc fl (cost=0.00..261709.31 +rows=25477 width=14) + -> Index Scan using feature_pkey on feature f +(cost=0.00..3.14 rows=1 width=33) + +If I try to force it to use an index by setting enable_seqscan=0, it +then uses featureloc_idx1, the index on feature_id. This has slightly +worse performance than the seq scan, at just over 30 seconds. Here is +the output of explain for this case: + +Unique (cost=356513.46..356895.61 rows=2548 width=47) + -> Sort (cost=356513.46..356513.46 rows=25477 width=47) + -> Nested Loop (cost=0.00..354189.73 rows=25477 width=47) + -> Index Scan using featureloc_idx1 on featureloc fl +(cost=0.00..273845.08 rows=25477 width=14) + -> Index Scan using feature_pkey on feature f +(cost=0.00..3.14 rows=1 width=33) + +Now, if I drop featureloc_idx1 (again, not something I can do in +production) and still disallow seq scans, it uses featureloc_idx2, as it +did with the naive database above, but the performance is much worse, +running about 24 seconds for the query. Here is the output of explain: + +Unique (cost=1310195.21..1310577.36 rows=2548 width=47) + -> Sort (cost=1310195.21..1310195.21 rows=25477 width=47) + -> Nested Loop (cost=0.00..1307871.48 rows=25477 width=47) + -> Index Scan using featureloc_idx2 on featureloc fl +(cost=0.00..1227526.82 rows=25477 width=14) + -> Index Scan using feature_pkey on feature f +(cost=0.00..3.14 rows=1 width=33) + +Finally, if I drop featureloc_idx2, it uses the right index, and the +runtime gets back to about 2 seconds, but the database is unusable for +other queries because I dropped the other indexes and disallowed seq +scans. Here is the output for explain in this case: + +Unique (cost=1414516.98..1414899.13 rows=2548 width=47) + -> Sort (cost=1414516.98..1414516.98 rows=25477 width=47) + -> Nested Loop (cost=0.00..1412193.25 rows=25477 width=47) + -> Index Scan using featureloc_src_strand_beg_end on +featureloc fl (cost=0.00..1331848.60 rows=25477 width=14) + -> Index Scan using feature_pkey on feature f +(cost=0.00..3.14 rows=1 width=33) + +Now the question: can anybody tell me why the query planner does such a +bad job figuring out how to run this query after I run VACUUM ANALYZE, +and can you give me any advice on making this arrangement work without +forcing postgres' hand by limiting its options until it gets it right? + +Thank you very much for reading down to here, +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 Fri Feb 14 12:00:17 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 1A1C3474E4F + for ; + Fri, 14 Feb 2003 12:00:17 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 5277A474E42 + for ; + Fri, 14 Feb 2003 12:00:16 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1EH0I5u008001; + Fri, 14 Feb 2003 12:00:18 -0500 (EST) +To: Scott Cain +Cc: pgsql-performance@postgresql.org, + gmod schema +Subject: Re: performace problem after VACUUM ANALYZE +In-reply-to: <1045241040.1486.600.camel@localhost.localdomain> +References: <1045241040.1486.600.camel@localhost.localdomain> +Comments: In-reply-to Scott Cain + message dated "14 Feb 2003 11:44:00 -0500" +Date: Fri, 14 Feb 2003 12:00:18 -0500 +Message-ID: <8000.1045242018@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/83 +X-Sequence-Number: 1139 + +Scott Cain writes: +> [ much stuff ] + +Could we see EXPLAIN ANALYZE, not just EXPLAIN, output for all these +alternatives? Your question boils down to "why is the planner +misestimating these queries" ... which is a difficult question to +answer when given only the estimates and not the reality. + +A suggestion though is that you might need to raise the statistics +target on the indexed columns, so that ANALYZE will collect +finer-grained statistics. (See ALTER TABLE ... SET STATISTICS.) +Try booting it up to 100 (from the default 10), re-analyze, and +then see if/how the plans change. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Fri Feb 14 12:29:33 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 393AE475B33 + for ; + Fri, 14 Feb 2003 12:29:32 -0500 (EST) +Received: from lakemtao04.cox.net (lakemtao04.cox.net [68.1.17.241]) + by postgresql.org (Postfix) with ESMTP id 8384B475AFA + for ; + Fri, 14 Feb 2003 12:29:31 -0500 (EST) +Received: from [192.168.0.188] ([68.9.37.244]) by lakemtao04.cox.net + (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP + id <20030214172937.FXCL22825.lakemtao04.cox.net@[192.168.0.188]>; + Fri, 14 Feb 2003 12:29:37 -0500 +Subject: Re: performace problem after VACUUM ANALYZE +From: Scott Cain +To: Tom Lane +Cc: pgsql-performance@postgresql.org, + gmod schema +In-Reply-To: <8000.1045242018@sss.pgh.pa.us> +References: <1045241040.1486.600.camel@localhost.localdomain> + <8000.1045242018@sss.pgh.pa.us> +Content-Type: text/plain +Organization: Cold Spring Harbor Lab +Message-Id: <1045243776.1485.617.camel@localhost.localdomain> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.2 +Date: 14 Feb 2003 12:29:36 -0500 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/84 +X-Sequence-Number: 1140 + +Tom, + +Sorry about that: I'll try to briefly give the information you are +looking for. I've read the docs on ALTER TABLE, but it is not clear to +me what columns I should change STATISTICS on, or should I just do it on +all of the columns for which indexes exist? + +Here's the query again: + +select distinct f.name,fl.nbeg,fl.nend,fl.strand,f.type_id,f.feature_id + from feature f, featureloc fl + where + fl.srcfeature_id = 1 and + ((fl.strand=1 and fl.nbeg <= 393164 and fl.nend >= 390956) OR + (fl.strand=-1 and fl.nend <= 393164 and fl.nbeg >= 390956)) and + f.feature_id = fl.feature_id + +-------------------------------------------------------------------------- + +Naive database: + +Unique (cost=75513.46..75513.48 rows=1 width=167) (actual +time=22815.25..22815.93 rows=179 loops=1) + -> Sort (cost=75513.46..75513.46 rows=1 width=167) (actual +time=22815.24..22815.43 rows=186 loops=1) + -> Nested Loop (cost=0.00..75513.45 rows=1 width=167) (actual +time=2471.25..22814.01 rows=186 loops=1) + -> Index Scan using featureloc_idx2 on featureloc fl +(cost=0.00..75508.43 rows=1 width=14) (actual time=2463.83..22796.50 +rows=186 loops=1) + -> Index Scan using feature_pkey on feature f +(cost=0.00..5.01 rows=1 width=153) (actual time=0.08..0.08 rows=1 +loops=186) +Total runtime: 22816.63 msec +-------------------------------------------------------------------------- + +Naive database after featureloc_idx2 dropped: + +Unique (cost=75545.46..75545.48 rows=1 width=167) (actual +time=5232.36..5234.51 rows=179 loops=1) + -> Sort (cost=75545.46..75545.46 rows=1 width=167) (actual +time=5232.35..5232.54 rows=186 loops=1) + -> Nested Loop (cost=0.00..75545.45 rows=1 width=167) (actual +time=291.46..5220.69 rows=186 loops=1) + -> Index Scan using featureloc_src_strand_beg_end on +featureloc fl (cost=0.00..75540.43 rows=1 width=14) (actual +time=291.30..5214.46 rows=186 loops=1) + -> Index Scan using feature_pkey on feature f +(cost=0.00..5.01 rows=1 width=153) (actual time=0.02..0.03 rows=1 +loops=186) +Total runtime: 5234.89 msec +-------------------------------------------------------------------------- + +Database after VACUUM ANALYZE was run: + +Unique (cost=344377.70..344759.85 rows=2548 width=47) (actual +time=26466.82..26467.51 rows=179 loops=1) + -> Sort (cost=344377.70..344377.70 rows=25477 width=47) (actual +time=26466.82..26467.01 rows=186 loops=1) + -> Nested Loop (cost=0.00..342053.97 rows=25477 width=47) +(actual time=262.66..26465.63 rows=186 loops=1) + -> Seq Scan on featureloc fl (cost=0.00..261709.31 +rows=25477 width=14) (actual time=118.62..26006.05 rows=186 loops=1) + -> Index Scan using feature_pkey on feature f +(cost=0.00..3.14 rows=1 width=33) (actual time=2.45..2.46 rows=1 +loops=186) +Total runtime: 26467.85 msec +-------------------------------------------------------------------------- + +After disallowing seqscans (set enable_seqscan=0): + +Unique (cost=356513.46..356895.61 rows=2548 width=47) (actual +time=27494.62..27495.34 rows=179 loops=1) + -> Sort (cost=356513.46..356513.46 rows=25477 width=47) (actual +time=27494.61..27494.83 rows=186 loops=1) + -> Nested Loop (cost=0.00..354189.73 rows=25477 width=47) +(actual time=198.88..27493.48 rows=186 loops=1) + -> Index Scan using featureloc_idx1 on featureloc fl +(cost=0.00..273845.08 rows=25477 width=14) (actual time=129.30..27280.95 +rows=186 loops=1) + -> Index Scan using feature_pkey on feature f +(cost=0.00..3.14 rows=1 width=33) (actual time=1.13..1.13 rows=1 +loops=186) +Total runtime: 27495.66 msec +-------------------------------------------------------------------------- + +After dropping featureloc_idx1: + +Unique (cost=1310195.21..1310577.36 rows=2548 width=47) (actual +time=21692.69..21693.37 rows=179 loops=1) + -> Sort (cost=1310195.21..1310195.21 rows=25477 width=47) (actual +time=21692.69..21692.88 rows=186 loops=1) + -> Nested Loop (cost=0.00..1307871.48 rows=25477 width=47) +(actual time=2197.65..21691.39 rows=186 loops=1) + -> Index Scan using featureloc_idx2 on featureloc fl +(cost=0.00..1227526.82 rows=25477 width=14) (actual +time=2197.49..21618.89 rows=186 loops=1) + -> Index Scan using feature_pkey on feature f +(cost=0.00..3.14 rows=1 width=33) (actual time=0.37..0.38 rows=1 +loops=186) +Total runtime: 21693.72 msec +-------------------------------------------------------------------------- + +After dropping featureloc_idx2: + +Unique (cost=1414516.98..1414899.13 rows=2548 width=47) (actual +time=1669.17..1669.86 rows=179 loops=1) + -> Sort (cost=1414516.98..1414516.98 rows=25477 width=47) (actual +time=1669.17..1669.36 rows=186 loops=1) + -> Nested Loop (cost=0.00..1412193.25 rows=25477 width=47) +(actual time=122.69..1668.08 rows=186 loops=1) + -> Index Scan using featureloc_src_strand_beg_end on +featureloc fl (cost=0.00..1331848.60 rows=25477 width=14) (actual +time=122.51..1661.81 rows=186 loops=1) + -> Index Scan using feature_pkey on feature f +(cost=0.00..3.14 rows=1 width=33) (actual time=0.02..0.03 rows=1 +loops=186) +Total runtime: 1670.20 msec + + +On Fri, 2003-02-14 at 12:00, Tom Lane wrote: +> Scott Cain writes: +> > [ much stuff ] +> +> Could we see EXPLAIN ANALYZE, not just EXPLAIN, output for all these +> alternatives? Your question boils down to "why is the planner +> misestimating these queries" ... which is a difficult question to +> answer when given only the estimates and not the reality. +> +> A suggestion though is that you might need to raise the statistics +> target on the indexed columns, so that ANALYZE will collect +> finer-grained statistics. (See ALTER TABLE ... SET STATISTICS.) +> Try booting it up to 100 (from the default 10), re-analyze, and +> then see if/how the plans change. +> +> 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 Fri Feb 14 12:37:00 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0E8BB475B8D + for ; + Fri, 14 Feb 2003 12:36:57 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 43A1B475D12 + for ; + Fri, 14 Feb 2003 12:36:26 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2840189; Fri, 14 Feb 2003 09:36:38 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: Kevin Brown , + pgsql-performance@postgresql.org +Subject: Re: Tuning scenarios (was Changing the default configuration) +Date: Fri, 14 Feb 2003 09:36:02 -0800 +User-Agent: KMail/1.4.3 +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <4590.1045202674@sss.pgh.pa.us> <20030214114843.GB1847@filer> +In-Reply-To: <20030214114843.GB1847@filer> +MIME-Version: 1.0 +Message-Id: <200302140936.02011.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/85 +X-Sequence-Number: 1141 + +Kevin, + +> I think we might be able to come up with some reasonable answers to +> that, as long as we don't expect too much out of the resulting +> benchmark. The right people to ask are probably the people who are +> actually running production databases. +> +> Anyone wanna chime in here with some opinions and perspectives? + + I thought you'd *never* ask. + +(for background: I'm a consultant, and I administrate 6 postgresql database= +s=20 +for 5 different clients) + +First off, one can't do a useful performance test on the sort of random dat= +a=20 +which can be generated by a script. The only really useful tests come fro= +m=20 +testing on a copy of the user's own database(s), or on a real database of= +=20 +some sort.=20=20 + +For new installations, we'd need to make a copy of a public domain or OSS= +=20 +database as a part of our performance testing tool. This database would ne= +ed=20 +at least 10 tables, some of them quite large, with FK relationships. + +Second, there are five kinds of query tests relevant to performmance: + +A) Rapid-fire simple select queries. +B) Large complex select queries, combining at least 2 of: aggregates,=20 +sub-selects, unions, unindexed text searches, and outer joins. +C) Rapid-fire small (<10 rows) update/insert/delete queries. +D) Large update queries (> 10,000 rows, possibly in more than one table) +E) Long-running PL procedures. + +Testing on these five types of operations give an all-around test of server= +=20 +performance. Fortunately, for many installations, not all tests are=20 +relevant; in fact, for many, only 2 of the 5 above are relevant. For=20 +example, for a PHP-Nuke installation, you'd only need to test on A and C. = +As=20 +another example, an OLAP reporting server would only need to test on B. + +Unfortunately, for any real production server, you need to test all the=20 +different operations concurrently at the appropriate multi-user level.=20= +=20 +Meaning that for one of my servers (a company-wide calendaring tool) I'd ne= +ed=20 +to run tests on A, B, C, and E all simultaneously ... for that matter, A an= +d=20 +C by themselves would require multiple connections. + +So, once again, if we're talking about a testing database, we would need=20 +twenty examples of A and C, ten of each of B and D, and at least 3 of E tha= +t=20 +we could run. For real production databases, the user could supply "pools"= +=20 +of the 5 types of operations from their real query base. + +Thirdly, we're up against the problem that there are several factors which = +can=20 +have a much more profound effect on database performance than *any* amount = +of=20 +tuning postgresql.conf, even given a particular hardware platform. In my= +=20 +experience, these factors include (in no particular order):=20 + 1) Location of the pg_xlog for heavy-update databases. + 2) Location of other files on multi-disk systems + 3) Choice of RAID and controller for RAID systems. + 4) Filesystem choice and parameters + 5) VACUUM/FULL/ANALYZE/REINDEX frequency and strategy + 6) Database schema design + 7) Indexing +Thus the user would have to be somehow informed that they need to examine a= +ll=20 +of the above, possibly before running the tuning utility. + +Therefore, any tuning utility would have to: +1) Inform the user about the other factors affecting performance and notify= +=20 +them that they have to deal with these. + +2) Ask the user for all of the following data: + a) How much RAM does your system have? + b) How many concurrent users, typically? + c) How often do you run VACUUM/FULL/ANALYZE? + d) Which of the Five Basic Operations does your database perform frequentl= +y? + (this question could be reduced to "what kind of database do you have= +?" + web site database =3D A and C + reporting database =3D A and B + transaction processing =3D A, C, D and possibly E etc.) + e) For each of the 5 operations, how many times per minute is it run? + f) Do you care about crash recovery? (if not, we can turn off fsync) + g) (for users testing on their own database) Please make a copy of your=20 +database, and provide 5 pools of operation examples. + +3) The the script would need to draw random operations from the pool, with= +=20 +operation type randomly drawn weighted by relative frequency for that type = +of=20 +operation. Each operation would be timed and scores kept per type of=20 +operation. + +4) Based on the above scores, the tuning tool could adjust the following=20 +parameters: + For A) shared_buffers + For B) shared_buffers and sort_mem (and Tom's new JOIN COLLAPSE settings) + For C) and D) wal settings and FSM settings + For E) shared_buffers, wal, and FSM + +5) Then run 3) again. + +The problem is that the above process becomes insurmountably complex when w= +e=20 +are testing for several types of operations simultaneously. For example, i= +f=20 +operation D is slow, we might dramatically increase FSM, but that could tak= +e=20 +away memory needed for op. B, making op. B run slower. So if we're runnin= +g=20 +concurrently, we could could find the adjustments made for each type of=20 +operation contradictory, and the script would be more likely to end up in a= +n=20 +endless loop than at a balance. If we don't run the different types of=20 +operations simultaneously, then it's not a good test; the optimal settings= +=20 +for op. B, for example, may make ops. A and C slow down and vice-versa. + +So we'd actually need to run an optimization for each type of desired=20 +operation seperately, and then compare settings, adjust to a balance=20 +(weighted according to the expected relative frequency), and re-test=20 +concurrently. Aieee! + +Personally, I think this is a project in and of itself. GBorg, anyone? + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Fri Feb 14 13:10:32 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0D212474E61 + for ; + Fri, 14 Feb 2003 13:10:31 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 6C3F5474E5C + for ; + Fri, 14 Feb 2003 13:10:30 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2840264 for pgsql-performance@postgresql.org; + Fri, 14 Feb 2003 10:10:36 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: pgsql-performance@postgresql.org +Subject: Re: Tuning scenarios (was Changing the default configuration) +Date: Fri, 14 Feb 2003 10:10:00 -0800 +User-Agent: KMail/1.4.3 +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <20030214114843.GB1847@filer> + <200302140936.02011.josh@agliodbs.com> +In-Reply-To: <200302140936.02011.josh@agliodbs.com> +MIME-Version: 1.0 +Message-Id: <200302141010.00403.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/86 +X-Sequence-Number: 1142 + +Folks, + + I forgot one question: + +> 2) Ask the user for all of the following data: +> a) How much RAM does your system have? +> b) How many concurrent users, typically? +> c) How often do you run VACUUM/FULL/ANALYZE? +> d) Which of the Five Basic Operations does your database perform +> frequently? (this question could be reduced to "what kind of database do +> you have?" web site database =3D A and C +> reporting database =3D A and B +> transaction processing =3D A, C, D and possibly E etc.) +> e) For each of the 5 operations, how many times per minute is it run? +> f) Do you care about crash recovery? (if not, we can turn off fsync) +> g) (for users testing on their own database) Please make a copy of your +> database, and provide 5 pools of operation examples. +h) (for users using the test database) How large do you expect your main= +=20 +tables to be in your database? (then the test database would need to have= +=20 +its tables trimmed to match this estimate) + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Fri Feb 14 19:08:35 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 57E68475AEC + for ; + Fri, 14 Feb 2003 19:08:33 -0500 (EST) +Received: from imo-m09.mx.aol.com (imo-m09.mx.aol.com [64.12.136.164]) + by postgresql.org (Postfix) with ESMTP id 0161A475F80 + for ; + Fri, 14 Feb 2003 19:08:30 -0500 (EST) +Received: from SLetovsky@aol.com + by imo-m09.mx.aol.com (mail_out_v34.21.) id 2.27.394f051e (4529); + Fri, 14 Feb 2003 19:07:49 -0500 (EST) +From: SLetovsky@aol.com +Message-ID: <27.394f051e.2b7eded5@aol.com> +Date: Fri, 14 Feb 2003 19:07:49 EST +Subject: Re: [Gmod-schema] Re: performace problem after VACUUM ANALYZE +To: tgl@sss.pgh.pa.us, cain@cshl.org +Cc: pgsql-performance@postgresql.org, + gmod-schema@lists.sourceforge.net +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="part1_27.394f051e.2b7eded5_boundary" +X-Mailer: 8.0 for Windows sub 182 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/90 +X-Sequence-Number: 1146 + +--part1_27.394f051e.2b7eded5_boundary +Content-Type: text/plain; charset="US-ASCII" +Content-Transfer-Encoding: 7bit + +Tom, + Thanks for your help in this. We have some flexibility in the schema +design; we are going through our first PostGres performance testing now. +Am I correct in interpreting your comments as saying you believe that +if we could lose the OR and the strand constraint PG would probably +use the index properly? There is an alternative representation on the table +that would do that. + +Cheers, -Stan + +In a message dated 2/14/2003 6:22:15 PM Eastern Standard Time, +tgl@sss.pgh.pa.us writes: + +> Subj: [Gmod-schema] Re: [PERFORM] performace problem after VACUUM ANALYZE +> Date: 2/14/2003 6:22:15 PM Eastern Standard Time +> From: tgl@sss.pgh.pa.us +> To: cain@cshl.org +> CC: pgsql-performance@postgresql.org, gmod-schema@lists.sourceforge.net +> Sent from the Internet +> +> +> +> Scott Cain writes: +> >Here is the query that is causing the problems: +> +> >select distinct f.name,fl.nbeg,fl.nend,fl.strand,f.type_id,f.feature_id +> > from feature f, featureloc fl +> > where +> > fl.srcfeature_id = 1 and +> > ((fl.strand=1 and fl.nbeg <= 393164 and fl.nend >= 390956) OR +> > (fl.strand=-1 and fl.nend <= 393164 and fl.nbeg >= 390956)) and +> > f.feature_id = fl.feature_id +> +> >[ and the index he'd like it to use is ] +> +> >Index "featureloc_src_strand_beg_end" +> > Column | Type +> >---------------+---------- +> > srcfeature_id | integer +> > strand | smallint +> > nbeg | integer +> > nend | integer +> >btree +> +> After fooling with this I see a couple of problems. One is the +> same old cross-datatype-comparison issue that so frequently bites +> people: "1" and "-1" are integer constants, and comparing them to +> a smallint column isn't an indexable operation. You need casts. +> (Or, forget the "optimization" of storing strand as a smallint. +> Depending on your row layout, it's quite likely saving you no space +> anyway.) +> +> Problem two is that the optimizer isn't smart enough to recognize that a +> query condition laid out in this form should be processed as two +> indexscans --- it would possibly have gotten it right if the first index +> column had been inside the OR, but not this way. The upshot is that +> when you force it to use index featureloc_src_strand_beg_end, it's +> actually only using the srcfeature_id column of the index --- which is +> slow of course, and also explains why the optimizer doesn't find that +> option very attractive. +> +> I had some success in getting current sources to generate a desirable +> plan by doing this: +> +> regression=# explain select distinct * +> regression-# from feature f join featureloc fl on (f.feature_id = +> fl.feature_id) where +> regression-# ((fl.srcfeature_id = 1 and fl.strand=1::int2 and fl.nbeg <= +> 393164 and fl.nend >= 390956) OR +> regression(# (fl.srcfeature_id = 1 and fl.strand=-1::int2 and fl.nend <= +> 393164 and fl.nbeg >= 390956)); +> +> Unique (cost=34.79..34.85 rows=5 width=50) +> -> Sort (cost=34.79..34.80 rows=5 width=50) +> Sort Key: f.name, fl.nbeg, fl.nend, fl.strand +> -> Hash Join (cost=9.68..34.73 rows=5 width=50) +> Hash Cond: ("outer".feature_id = "inner".feature_id) +> -> Seq Scan on feature f (cost=0.00..20.00 rows=1000 width=36) +> -> Hash (cost=9.68..9.68 rows=1 width=14) +> -> Index Scan using featureloc_src_strand_beg_end, +> featureloc_src_strand_beg_end on featureloc fl (cost=0.00..9.68 rows=1 +> width=14) +> Index Cond: (((srcfeature_id = 1) AND (strand = 1::smallint) +> AND (nbeg <= 393164) AND (nend >= 390956)) OR ((srcfeature_id = 1) AND +> (strand = -1::smallint) AND (nbeg >= 390956) AND (nend <= 393164))) +> Filter: (((srcfeature_id = 1) AND (strand = 1::smallint) AND +> (nbeg <= 393164) AND (nend >= 390956)) OR ((srcfeature_id = 1) AND (strand +> = -1::smallint) AND (nend <= 393164) AND (nbeg >= 390956))) +> (10 rows) +> +> Shoving the join condition into an explicit JOIN clause is a hack, but +> it nicely does the job of keeping the WHERE clause as a pristine +> OR-of-ANDs structure, so that the optimizer can hardly fail to notice +> that that's the preferred canonical form. +> +> I would strongly recommend an upgrade to PG 7.3, both on general +> principles and because you can actually see what the indexscan condition +> is in EXPLAIN's output. Before 7.3 you had to grovel through EXPLAIN +> VERBOSE to be sure what was really happening with a multicolumn index. +> +> regards, tom lane +> +> +> ------------------------------------------------------- +> This SF.NET email is sponsored by: FREE SSL Guide from Thawte +> are you planning your Web Server Security? Click here to get a FREE +> Thawte SSL guide and find the answers to all your SSL security issues. +> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en +> _______________________________________________ +> Gmod-schema mailing list +> Gmod-schema@lists.sourceforge.net +> https://lists.sourceforge.net/lists/listinfo/gmod-schema +> + + +--part1_27.394f051e.2b7eded5_boundary +Content-Type: text/html; charset="US-ASCII" +Content-Transfer-Encoding: quoted-printable + +Tom,
+       Thanks for your help in this. We have = +some flexibility in the schema
+design; we are going through our first PostGres performance testing now.
+Am I correct in interpreting your comments as saying you believe that
+if we could lose the OR and the strand constraint PG would probably
+use the index properly? There is an alternative representation on the table= +
+that would do that.
+
+Cheers, -Stan
+
+In a message dated 2/14/2003 6:22:15 PM Eastern Standard Time, tgl@sss.pgh.= +pa.us writes:
+
+
Subj: [Gmod-schema] Re: [P= +ERFORM] performace problem after VACUUM ANALYZE
+ Date: 2/14/2003 6:22:15 PM Eastern Standard Time
+ From: tgl@sss.pgh.pa.us
+ To: cain@cshl.org
+ CC: pgsql-performance@= +postgresql.org, gm= +od-schema@lists.sourceforge.net
+ Sent from the Internet
+
+
+
+Scott Cain <cain@cshl.org> writes:
+>Here is the query that is causing the problems:
+
+>select distinct f.name,fl.nbeg,fl.nend,fl.strand,f.type_id,f.feature_id= +
+>   from feature f, featureloc fl
+>   where
+>    fl.srcfeature_id =3D 1 and
+>    ((fl.strand=3D1  and fl.nbeg <=3D 393164 and= + fl.nend >=3D 390956) OR
+>    (fl.strand=3D-1 and fl.nend <=3D 393164 and fl.nb= +eg >=3D 390956)) and
+>    f.feature_id  =3D fl.feature_id
+
+>[ and the index he'd like it to use is ]
+
+>Index "featureloc_src_strand_beg_end"
+>   Column    |   Type   +>---------------+----------
+> srcfeature_id | integer
+> strand     | smallint
+> nbeg      | integer
+> nend      | integer
+>btree
+
+After fooling with this I see a couple of problems.  One is the
+same old cross-datatype-comparison issue that so frequently bites
+people: "1" and "-1" are integer constants, and comparing them to
+a smallint column isn't an indexable operation.  You need casts.
+(Or, forget the "optimization" of storing strand as a smallint.
+Depending on your row layout, it's quite likely saving you no space
+anyway.)
+
+Problem two is that the optimizer isn't smart enough to recognize that a
+query condition laid out in this form should be processed as two
+indexscans --- it would possibly have gotten it right if the first index
+column had been inside the OR, but not this way.  The upshot is that +when you force it to use index featureloc_src_strand_beg_end, it's
+actually only using the srcfeature_id column of the index --- which is
+slow of course, and also explains why the optimizer doesn't find that
+option very attractive.
+
+I had some success in getting current sources to generate a desirable
+plan by doing this:
+
+regression=3D# explain select distinct *
+regression-#  from feature f join featureloc fl on (f.feature_id = + =3D fl.feature_id) where
+regression-#   ((fl.srcfeature_id =3D 1 and fl.strand=3D1::int2&n= +bsp; and fl.nbeg <=3D 393164 and fl.nend >=3D 390956) OR
+regression(#   (fl.srcfeature_id =3D 1 and fl.strand=3D-1::int2 a= +nd fl.nend <=3D 393164 and fl.nbeg >=3D 390956));
+
+Unique  (cost=3D34.79..34.85 rows=3D5 width=3D50)
+  ->  Sort  (cost=3D34.79..34.80 rows=3D5 width=3D50)
+     Sort Key: f.name, fl.nbeg, fl.nend, fl.strand
+     ->  Hash Join  (cost=3D9.68..34.73 ro= +ws=3D5 width=3D50)
+        Hash Cond: ("outer".feature_id = +=3D "inner".feature_id)
+        ->  Seq Scan on feature = +f  (cost=3D0.00..20.00 rows=3D1000 width=3D36)
+        ->  Hash  (cost=3D9= +.68..9.68 rows=3D1 width=3D14)
+           ->  In= +dex Scan using featureloc_src_strand_beg_end, featureloc_src_strand_beg_end= + on featureloc fl  (cost=3D0.00..9.68 rows=3D1 width=3D14)
+            &nb= +sp; Index Cond: (((srcfeature_id =3D 1) AND (strand =3D 1::smallint) AND (n= +beg <=3D 393164) AND (nend >=3D 390956)) OR ((srcfeature_id =3D 1) AN= +D (strand =3D -1::smallint) AND (nbeg >=3D 390956) AND (nend <=3D 393= +164)))
+            &nb= +sp; Filter: (((srcfeature_id =3D 1) AND (strand =3D 1::smallint) AND (nbeg = +<=3D 393164) AND (nend >=3D 390956)) OR ((srcfeature_id =3D 1) AND (s= +trand =3D -1::smallint) AND (nend <=3D 393164) AND (nbeg >=3D 390956)= +))
+(10 rows)
+
+Shoving the join condition into an explicit JOIN clause is a hack, but
+it nicely does the job of keeping the WHERE clause as a pristine
+OR-of-ANDs structure, so that the optimizer can hardly fail to notice
+that that's the preferred canonical form.
+
+I would strongly recommend an upgrade to PG 7.3, both on general
+principles and because you can actually see what the indexscan condition
+is in EXPLAIN's output.  Before 7.3 you had to grovel through EXPLAIN<= +BR> +VERBOSE to be sure what was really happening with a multicolumn index.
+
+      regards, tom lane
+
+
+-------------------------------------------------------
+This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
+are you planning your Web Server Security? Click here to get a FREE
+Thawte SSL guide and find the answers to all your  SSL security issues= +.
+http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
+_______________________________________________
+Gmod-schema mailing list
+Gmod-schema@lists.sourceforge.net
+https://lists.sourceforge.net/lists/listinfo/gmod-schema
+

+
+
+--part1_27.394f051e.2b7eded5_boundary-- + +From pgsql-performance-owner@postgresql.org Fri Feb 14 14:22:53 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id C6174475957 + for ; + Fri, 14 Feb 2003 14:22:52 -0500 (EST) +Received: from lakemtao01.cox.net (lakemtao01.cox.net [68.1.17.244]) + by postgresql.org (Postfix) with ESMTP id 16B334758E6 + for ; + Fri, 14 Feb 2003 14:22:52 -0500 (EST) +Received: from [192.168.0.188] ([68.9.37.244]) by lakemtao01.cox.net + (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP + id <20030214192252.TVAB16369.lakemtao01.cox.net@[192.168.0.188]>; + Fri, 14 Feb 2003 14:22:52 -0500 +Subject: Re: [Gmod-schema] Re: performace problem after VACUUM +From: Scott Cain +To: Tom Lane +Cc: pgsql-performance@postgresql.org, + gmod schema +In-Reply-To: <1045243776.1485.617.camel@localhost.localdomain> +References: <1045241040.1486.600.camel@localhost.localdomain> + <8000.1045242018@sss.pgh.pa.us> + <1045243776.1485.617.camel@localhost.localdomain> +Content-Type: text/plain +Organization: Cold Spring Harbor Lab +Message-Id: <1045250571.1486.625.camel@localhost.localdomain> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.2 +Date: 14 Feb 2003 14:22:51 -0500 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/87 +X-Sequence-Number: 1143 + +An update: I ran alter table as suggested, ie, + +alter table featureloc alter srcfeature_id set statistics 100; + +on each column in the table, running vacuum analyze and explain analyze +on the query in between each alter to see if it made any difference. It +did not. Postgres still instists on doing a seq scan on featureloc: + +Unique (cost=336831.46..337179.45 rows=2320 width=47) (actual +time=27219.62..27220.30 rows=179 loops=1) + -> Sort (cost=336831.46..336831.46 rows=23200 width=47) (actual +time=27219.61..27219.80 rows=186 loops=1) + -> Nested Loop (cost=0.00..334732.77 rows=23200 width=47) +(actual time=1003.04..27217.99 rows=186 loops=1) + -> Seq Scan on featureloc fl (cost=0.00..261709.31 +rows=23200 width=14) (actual time=814.68..26094.18 rows=186 loops=1) + -> Index Scan using feature_pkey on feature f +(cost=0.00..3.14 rows=1 width=33) (actual time=6.03..6.03 rows=1 +loops=186) +Total runtime: 27220.63 msec + + +On Fri, 2003-02-14 at 12:29, Scott Cain wrote: +> Tom, +> +> Sorry about that: I'll try to briefly give the information you are +> looking for. I've read the docs on ALTER TABLE, but it is not clear to +> me what columns I should change STATISTICS on, or should I just do it on +> all of the columns for which indexes exist? +> +> Here's the query again: +> +> select distinct f.name,fl.nbeg,fl.nend,fl.strand,f.type_id,f.feature_id +> from feature f, featureloc fl +> where +> fl.srcfeature_id = 1 and +> ((fl.strand=1 and fl.nbeg <= 393164 and fl.nend >= 390956) OR +> (fl.strand=-1 and fl.nend <= 393164 and fl.nbeg >= 390956)) and +> f.feature_id = fl.feature_id +> +> -------------------------------------------------------------------------- +> +> Naive database: +> +> Unique (cost=75513.46..75513.48 rows=1 width=167) (actual +> time=22815.25..22815.93 rows=179 loops=1) +> -> Sort (cost=75513.46..75513.46 rows=1 width=167) (actual +> time=22815.24..22815.43 rows=186 loops=1) +> -> Nested Loop (cost=0.00..75513.45 rows=1 width=167) (actual +> time=2471.25..22814.01 rows=186 loops=1) +> -> Index Scan using featureloc_idx2 on featureloc fl +> (cost=0.00..75508.43 rows=1 width=14) (actual time=2463.83..22796.50 +> rows=186 loops=1) +> -> Index Scan using feature_pkey on feature f +> (cost=0.00..5.01 rows=1 width=153) (actual time=0.08..0.08 rows=1 +> loops=186) +> Total runtime: 22816.63 msec +> -------------------------------------------------------------------------- +> +> Naive database after featureloc_idx2 dropped: +> +> Unique (cost=75545.46..75545.48 rows=1 width=167) (actual +> time=5232.36..5234.51 rows=179 loops=1) +> -> Sort (cost=75545.46..75545.46 rows=1 width=167) (actual +> time=5232.35..5232.54 rows=186 loops=1) +> -> Nested Loop (cost=0.00..75545.45 rows=1 width=167) (actual +> time=291.46..5220.69 rows=186 loops=1) +> -> Index Scan using featureloc_src_strand_beg_end on +> featureloc fl (cost=0.00..75540.43 rows=1 width=14) (actual +> time=291.30..5214.46 rows=186 loops=1) +> -> Index Scan using feature_pkey on feature f +> (cost=0.00..5.01 rows=1 width=153) (actual time=0.02..0.03 rows=1 +> loops=186) +> Total runtime: 5234.89 msec +> -------------------------------------------------------------------------- +> +> Database after VACUUM ANALYZE was run: +> +> Unique (cost=344377.70..344759.85 rows=2548 width=47) (actual +> time=26466.82..26467.51 rows=179 loops=1) +> -> Sort (cost=344377.70..344377.70 rows=25477 width=47) (actual +> time=26466.82..26467.01 rows=186 loops=1) +> -> Nested Loop (cost=0.00..342053.97 rows=25477 width=47) +> (actual time=262.66..26465.63 rows=186 loops=1) +> -> Seq Scan on featureloc fl (cost=0.00..261709.31 +> rows=25477 width=14) (actual time=118.62..26006.05 rows=186 loops=1) +> -> Index Scan using feature_pkey on feature f +> (cost=0.00..3.14 rows=1 width=33) (actual time=2.45..2.46 rows=1 +> loops=186) +> Total runtime: 26467.85 msec +> -------------------------------------------------------------------------- +> +> After disallowing seqscans (set enable_seqscan=0): +> +> Unique (cost=356513.46..356895.61 rows=2548 width=47) (actual +> time=27494.62..27495.34 rows=179 loops=1) +> -> Sort (cost=356513.46..356513.46 rows=25477 width=47) (actual +> time=27494.61..27494.83 rows=186 loops=1) +> -> Nested Loop (cost=0.00..354189.73 rows=25477 width=47) +> (actual time=198.88..27493.48 rows=186 loops=1) +> -> Index Scan using featureloc_idx1 on featureloc fl +> (cost=0.00..273845.08 rows=25477 width=14) (actual time=129.30..27280.95 +> rows=186 loops=1) +> -> Index Scan using feature_pkey on feature f +> (cost=0.00..3.14 rows=1 width=33) (actual time=1.13..1.13 rows=1 +> loops=186) +> Total runtime: 27495.66 msec +> -------------------------------------------------------------------------- +> +> After dropping featureloc_idx1: +> +> Unique (cost=1310195.21..1310577.36 rows=2548 width=47) (actual +> time=21692.69..21693.37 rows=179 loops=1) +> -> Sort (cost=1310195.21..1310195.21 rows=25477 width=47) (actual +> time=21692.69..21692.88 rows=186 loops=1) +> -> Nested Loop (cost=0.00..1307871.48 rows=25477 width=47) +> (actual time=2197.65..21691.39 rows=186 loops=1) +> -> Index Scan using featureloc_idx2 on featureloc fl +> (cost=0.00..1227526.82 rows=25477 width=14) (actual +> time=2197.49..21618.89 rows=186 loops=1) +> -> Index Scan using feature_pkey on feature f +> (cost=0.00..3.14 rows=1 width=33) (actual time=0.37..0.38 rows=1 +> loops=186) +> Total runtime: 21693.72 msec +> -------------------------------------------------------------------------- +> +> After dropping featureloc_idx2: +> +> Unique (cost=1414516.98..1414899.13 rows=2548 width=47) (actual +> time=1669.17..1669.86 rows=179 loops=1) +> -> Sort (cost=1414516.98..1414516.98 rows=25477 width=47) (actual +> time=1669.17..1669.36 rows=186 loops=1) +> -> Nested Loop (cost=0.00..1412193.25 rows=25477 width=47) +> (actual time=122.69..1668.08 rows=186 loops=1) +> -> Index Scan using featureloc_src_strand_beg_end on +> featureloc fl (cost=0.00..1331848.60 rows=25477 width=14) (actual +> time=122.51..1661.81 rows=186 loops=1) +> -> Index Scan using feature_pkey on feature f +> (cost=0.00..3.14 rows=1 width=33) (actual time=0.02..0.03 rows=1 +> loops=186) +> Total runtime: 1670.20 msec +> +> +> On Fri, 2003-02-14 at 12:00, Tom Lane wrote: +> > Scott Cain writes: +> > > [ much stuff ] +> > +> > Could we see EXPLAIN ANALYZE, not just EXPLAIN, output for all these +> > alternatives? Your question boils down to "why is the planner +> > misestimating these queries" ... which is a difficult question to +> > answer when given only the estimates and not the reality. +> > +> > A suggestion though is that you might need to raise the statistics +> > target on the indexed columns, so that ANALYZE will collect +> > finer-grained statistics. (See ALTER TABLE ... SET STATISTICS.) +> > Try booting it up to 100 (from the default 10), re-analyze, and +> > then see if/how the plans change. +> > +> > 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 Fri Feb 14 15:02:10 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B0CDD475B33 + for ; + Fri, 14 Feb 2003 15:02:09 -0500 (EST) +Received: from mail.fruitfly.org (ci.lbl.gov [131.243.192.220]) + by postgresql.org (Postfix) with ESMTP id F162D475AD7 + for ; + Fri, 14 Feb 2003 15:02:08 -0500 (EST) +Received: from localhost (localhost [127.0.0.1]) + by mail.fruitfly.org (Postfix on SuSE Linux eMail Server 3.0) with + ESMTP id 39CA1101891; Fri, 14 Feb 2003 12:02:09 -0800 (PST) +Received: from fruitfly.org (bigbrain.lbl.gov [131.243.193.104]) + by mail.fruitfly.org (Postfix on SuSE Linux eMail Server 3.0) with + ESMTP id 8F71C2FBD3; Fri, 14 Feb 2003 12:02:08 -0800 (PST) +Message-ID: <3E4D59C5.304@fruitfly.org> +Date: Fri, 14 Feb 2003 13:04:05 -0800 +From: ShengQiang Shu +Reply-To: sshu@fruitfly.org +Organization: BDGP +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021016 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Scott Cain +Cc: Tom Lane , pgsql-performance@postgresql.org, + gmod schema +Subject: Re: [Gmod-schema] Re: performace problem after VACUUM ANALYZE +References: <1045241040.1486.600.camel@localhost.localdomain> + <8000.1045242018@sss.pgh.pa.us> + <1045243776.1485.617.camel@localhost.localdomain> + <1045250571.1486.625.camel@localhost.localdomain> +In-Reply-To: <1045241040.1486.600.camel@localhost.localdomain> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS perl-11 +X-Spam-Status: No +X-Spam-Info: Spam probability 1.2057246845206e-24 by Bayespam +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/88 +X-Sequence-Number: 1144 + + +PG really does not do the right thing as I mentioned earlier for joining +tables. To force not to use seqscan, it still does not use right index +(srcfeature_id, nbeg, nend) and performance is even worse. + +c_gadfly3=# \d fl_src_b_e_key; +Index "public.fl_src_b_e_key" + Column | Type +---------------+--------- + srcfeature_id | integer + nbeg | integer + nend | integer +btree, for table "public.featureloc" + +c_gadfly3=# explain analyze select * from featureloc fl, feature f where +f.feature_id = fl.feature_id and srcfeature_id=1 and (nbeg >= 1000 and +nend <= 2000); + +QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------ + Merge Join (cost=115700.27..232516.85 rows=69007 width=445) (actual +time=12342.97..12461.23 rows=32 loops=1) + Merge Cond: ("outer".feature_id = "inner".feature_id) + -> Index Scan using feature_pkey on feature f +(cost=0.00..110535.53 rows=2060653 width=361) (actual time=17.85..490.86 +rows=28341 loops=1) + -> Sort (cost=115700.27..115872.79 rows=69007 width=84) (actual +time=11944.23..11944.25 rows=32 loops=1) + Sort Key: fl.feature_id + -> Seq Scan on featureloc fl (cost=0.00..107580.43 +rows=69007 width=84) (actual time=375.85..11944.10 rows=32 loops=1) + Filter: ((srcfeature_id = 1) AND (nbeg >= 1000) AND +(nend <= 2000)) + Total runtime: 12461.37 msec +(8 rows) + +c_gadfly3=# +c_gadfly3=# set enable_seqscan=0; +SET +c_gadfly3=# explain analyze select * from featureloc fl, feature f where +f.feature_id = fl.feature_id and srcfeature_id=1 and (nbeg >= 1000 and +nend <= 2000); + +QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------ + Merge Join (cost=0.00..236345.49 rows=69007 width=445) (actual +time=721.75..26078.64 rows=32 loops=1) + Merge Cond: ("outer".feature_id = "inner".feature_id) + -> Index Scan using fl_feature_id_key on featureloc fl +(cost=0.00..119701.43 rows=69007 width=84) (actual time=549.14..25854.12 +rows=32 loops=1) + Filter: ((srcfeature_id = 1) AND (nbeg >= 1000) AND (nend <= +2000)) + -> Index Scan using feature_pkey on feature f +(cost=0.00..110535.53 rows=2060653 width=361) (actual time=50.95..200.37 +rows=28342 loops=1) + Total runtime: 26078.80 msec +(6 rows) + + + + +Scott Cain wrote: + +> An update: I ran alter table as suggested, ie, +> +> alter table featureloc alter srcfeature_id set statistics 100; +> +> on each column in the table, running vacuum analyze and explain analyze +> on the query in between each alter to see if it made any difference. It +> did not. Postgres still instists on doing a seq scan on featureloc: +> +> Unique (cost=336831.46..337179.45 rows=2320 width=47) (actual +> time=27219.62..27220.30 rows=179 loops=1) +> -> Sort (cost=336831.46..336831.46 rows=23200 width=47) (actual +> time=27219.61..27219.80 rows=186 loops=1) +> -> Nested Loop (cost=0.00..334732.77 rows=23200 width=47) +> (actual time=1003.04..27217.99 rows=186 loops=1) +> -> Seq Scan on featureloc fl (cost=0.00..261709.31 +> rows=23200 width=14) (actual time=814.68..26094.18 rows=186 loops=1) +> -> Index Scan using feature_pkey on feature f +> (cost=0.00..3.14 rows=1 width=33) (actual time=6.03..6.03 rows=1 +> loops=186) +> Total runtime: 27220.63 msec +> +> +> On Fri, 2003-02-14 at 12:29, Scott Cain wrote: +> +> >Tom, +> > +> >Sorry about that: I'll try to briefly give the information you are +> >looking for. I've read the docs on ALTER TABLE, but it is not clear to +> >me what columns I should change STATISTICS on, or should I just do it on +> >all of the columns for which indexes exist? +> > +> >Here's the query again: +> > +> >select distinct f.name,fl.nbeg,fl.nend,fl.strand,f.type_id,f.feature_id +> > from feature f, featureloc fl +> > where +> > fl.srcfeature_id = 1 and +> > ((fl.strand=1 and fl.nbeg <= 393164 and fl.nend >= 390956) OR +> > (fl.strand=-1 and fl.nend <= 393164 and fl.nbeg >= 390956)) and +> > f.feature_id = fl.feature_id +> > +> >-------------------------------------------------------------------------- +> > +> >Naive database: +> > +> >Unique (cost=75513.46..75513.48 rows=1 width=167) (actual +> >time=22815.25..22815.93 rows=179 loops=1) +> > -> Sort (cost=75513.46..75513.46 rows=1 width=167) (actual +> >time=22815.24..22815.43 rows=186 loops=1) +> > -> Nested Loop (cost=0.00..75513.45 rows=1 width=167) (actual +> >time=2471.25..22814.01 rows=186 loops=1) +> > -> Index Scan using featureloc_idx2 on featureloc fl +> >(cost=0.00..75508.43 rows=1 width=14) (actual time=2463.83..22796.50 +> >rows=186 loops=1) +> > -> Index Scan using feature_pkey on feature f +> >(cost=0.00..5.01 rows=1 width=153) (actual time=0.08..0.08 rows=1 +> >loops=186) +> >Total runtime: 22816.63 msec +> >-------------------------------------------------------------------------- +> > +> >Naive database after featureloc_idx2 dropped: +> > +> >Unique (cost=75545.46..75545.48 rows=1 width=167) (actual +> >time=5232.36..5234.51 rows=179 loops=1) +> > -> Sort (cost=75545.46..75545.46 rows=1 width=167) (actual +> >time=5232.35..5232.54 rows=186 loops=1) +> > -> Nested Loop (cost=0.00..75545.45 rows=1 width=167) (actual +> >time=291.46..5220.69 rows=186 loops=1) +> > -> Index Scan using featureloc_src_strand_beg_end on +> >featureloc fl (cost=0.00..75540.43 rows=1 width=14) (actual +> >time=291.30..5214.46 rows=186 loops=1) +> > -> Index Scan using feature_pkey on feature f +> >(cost=0.00..5.01 rows=1 width=153) (actual time=0.02..0.03 rows=1 +> >loops=186) +> >Total runtime: 5234.89 msec +> >-------------------------------------------------------------------------- +> > +> >Database after VACUUM ANALYZE was run: +> > +> >Unique (cost=344377.70..344759.85 rows=2548 width=47) (actual +> >time=26466.82..26467.51 rows=179 loops=1) +> > -> Sort (cost=344377.70..344377.70 rows=25477 width=47) (actual +> >time=26466.82..26467.01 rows=186 loops=1) +> > -> Nested Loop (cost=0.00..342053.97 rows=25477 width=47) +> >(actual time=262.66..26465.63 rows=186 loops=1) +> > -> Seq Scan on featureloc fl (cost=0.00..261709.31 +> >rows=25477 width=14) (actual time=118.62..26006.05 rows=186 loops=1) +> > -> Index Scan using feature_pkey on feature f +> >(cost=0.00..3.14 rows=1 width=33) (actual time=2.45..2.46 rows=1 +> >loops=186) +> >Total runtime: 26467.85 msec +> >-------------------------------------------------------------------------- +> > +> >After disallowing seqscans (set enable_seqscan=0): +> > +> >Unique (cost=356513.46..356895.61 rows=2548 width=47) (actual +> >time=27494.62..27495.34 rows=179 loops=1) +> > -> Sort (cost=356513.46..356513.46 rows=25477 width=47) (actual +> >time=27494.61..27494.83 rows=186 loops=1) +> > -> Nested Loop (cost=0.00..354189.73 rows=25477 width=47) +> >(actual time=198.88..27493.48 rows=186 loops=1) +> > -> Index Scan using featureloc_idx1 on featureloc fl +> >(cost=0.00..273845.08 rows=25477 width=14) (actual time=129.30..27280.95 +> >rows=186 loops=1) +> > -> Index Scan using feature_pkey on feature f +> >(cost=0.00..3.14 rows=1 width=33) (actual time=1.13..1.13 rows=1 +> >loops=186) +> >Total runtime: 27495.66 msec +> >-------------------------------------------------------------------------- +> > +> >After dropping featureloc_idx1: +> > +> >Unique (cost=1310195.21..1310577.36 rows=2548 width=47) (actual +> >time=21692.69..21693.37 rows=179 loops=1) +> > -> Sort (cost=1310195.21..1310195.21 rows=25477 width=47) (actual +> >time=21692.69..21692.88 rows=186 loops=1) +> > -> Nested Loop (cost=0.00..1307871.48 rows=25477 width=47) +> >(actual time=2197.65..21691.39 rows=186 loops=1) +> > -> Index Scan using featureloc_idx2 on featureloc fl +> >(cost=0.00..1227526.82 rows=25477 width=14) (actual +> >time=2197.49..21618.89 rows=186 loops=1) +> > -> Index Scan using feature_pkey on feature f +> >(cost=0.00..3.14 rows=1 width=33) (actual time=0.37..0.38 rows=1 +> >loops=186) +> >Total runtime: 21693.72 msec +> >-------------------------------------------------------------------------- +> > +> >After dropping featureloc_idx2: +> > +> >Unique (cost=1414516.98..1414899.13 rows=2548 width=47) (actual +> >time=1669.17..1669.86 rows=179 loops=1) +> > -> Sort (cost=1414516.98..1414516.98 rows=25477 width=47) (actual +> >time=1669.17..1669.36 rows=186 loops=1) +> > -> Nested Loop (cost=0.00..1412193.25 rows=25477 width=47) +> >(actual time=122.69..1668.08 rows=186 loops=1) +> > -> Index Scan using featureloc_src_strand_beg_end on +> >featureloc fl (cost=0.00..1331848.60 rows=25477 width=14) (actual +> >time=122.51..1661.81 rows=186 loops=1) +> > -> Index Scan using feature_pkey on feature f +> >(cost=0.00..3.14 rows=1 width=33) (actual time=0.02..0.03 rows=1 +> >loops=186) +> >Total runtime: 1670.20 msec +> > +> > +> >On Fri, 2003-02-14 at 12:00, Tom Lane wrote: +> > +> >>Scott Cain writes: +> >> +> >>>[ much stuff ] +> >> +> >>Could we see EXPLAIN ANALYZE, not just EXPLAIN, output for all these +> >>alternatives? Your question boils down to "why is the planner +> >>misestimating these queries" ... which is a difficult question to +> >>answer when given only the estimates and not the reality. +> >> +> >>A suggestion though is that you might need to raise the statistics +> >>target on the indexed columns, so that ANALYZE will collect +> >>finer-grained statistics. (See ALTER TABLE ... SET STATISTICS.) +> >>Try booting it up to 100 (from the default 10), re-analyze, and +> >>then see if/how the plans change. +> >> +> >> regards, tom lane + + + +From pgsql-hackers-owner@postgresql.org Fri Feb 14 16:59:49 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 8FEFB475F31 + for ; + Fri, 14 Feb 2003 16:59:46 -0500 (EST) +Received: from post.webmailer.de (natsmtp01.webmailer.de [192.67.198.81]) + by postgresql.org (Postfix) with ESMTP id E2E8E47601E + for ; + Fri, 14 Feb 2003 16:54:37 -0500 (EST) +Received: from dell (p5091772C.dip.t-dialin.net [80.145.119.44]) + by post.webmailer.de (8.9.3/8.8.7) with ESMTP id WAA04790; + Fri, 14 Feb 2003 22:54:27 +0100 (MET) +Content-Type: text/plain; + charset="iso-8859-1" +From: Tilo Schwarz +To: Bruce Momjian +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] +Date: Fri, 14 Feb 2003 22:55:51 +0100 +User-Agent: KMail/1.4.3 +References: <200302131710.h1DHAui22918@candle.pha.pa.us> +In-Reply-To: <200302131710.h1DHAui22918@candle.pha.pa.us> +Cc: +MIME-Version: 1.0 +Content-Transfer-Encoding: quoted-printable +Message-Id: <200302142255.51683.mail@tilo-schwarz.de> +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/825 +X-Sequence-Number: 35766 + +Bruce Momjian writes: +> Tom Lane wrote: +> > Bruce Momjian writes: +> > > So, my idea is to add a message at the end of initdb that states peop= +le +> > > should run the pgtune script before running a production server. +> > +> > Do people read what initdb has to say? +> > +> > IIRC, the RPM install scripts hide initdb's output from the user +> > entirely. I wouldn't put much faith in such a message as having any +> > real effect on people... +> +> Yes, that is a problem. We could show something in the server logs if +> pg_tune hasn't been run. Not sure what else we can do, but it would +> give folks a one-stop thing to run to deal with performance +> configuration. +> +> We could prevent the postmaster from starting unless they run pg_tune or +> if they have modified postgresql.conf from the default. Of course, +> that's pretty drastic. + +I don't think, that's drastic, if it's done in a user friendy way ;-): + +I work with Postgresql for half a year now (and like it very much), but I m= +ust=20 +admit, that it takes time to understand the various tuning parameters (what= +=20 +is not surprising, because you need understand to a certain degree, what's= +=20 +going on under the hood). Now think of the following reasoning: + +- If the resouces of a system (like shared mem, max open files etc.) are no= +t=20 +known, it's pretty difficult to set good default values. That's why it is s= +o=20 +difficult to ship Postgresql with a postgresql.conf file which works nicely= +=20 +on all systems on this planet. +- On the other hand, if the resouces of a system _are_ known, I bet the peo= +ple=20 +on this list can set much better default values than any newbie or a static= +=20 +out-of-the-box postgresql.conf. + +Thus the know how which is somehow in the heads of the gurus should be=20 +condensed into a tune program which can be run on a system to detect the=20 +system resources and which dumps a reasonable postgresql.conf. Those defaul= +ts=20 +won't be perfect (because the application is not known yet) but much better= +=20 +than the newbie or out-of-the-box settings. + +If the tune program detects, that the system resouces are so limited, that = +it=20 +makes basically no sense to run Postgresql there, it tells the user what th= +e=20 +options are: Increase the system resources (and how to do it if possible) o= +r=20 +"downtune" the "least reasonable" postgresql.conf file by hand. Given the= +=20 +resources of average systems today, the chances are much higher, that users= +=20 +leave Postgresql because "it's slower than other databases" than that they= +=20 +get upset, because it doesn't start right away the first time. + +Now how to make sure, the tune program gets run before postmaster starts th= +e=20 +first time? Prevent postmaster from starting, unless the tune program was r= +un=20 +and fail with a clear error message. The message should state, that the tun= +e=20 +program needs to be run first, why it needs to be run first and the command= +=20 +line showing how to do that. + +If I think back, I would have been happy to see such a message, you just co= +py=20 +and paste the command to your shell, run the command and a few seconds late= +r=20 +you can restart postmaster with resonable settings. And the big distributor= +s=20 +have their own scipts anyway, so they can put it just before initdb. + +Regards, + + Tilo + +From pgsql-performance-owner@postgresql.org Fri Feb 14 18:48:18 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 75E324762C6 + for ; + Fri, 14 Feb 2003 18:48:15 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 43FC14768C4 + for ; + Fri, 14 Feb 2003 18:19:18 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1ENJH5u012085; + Fri, 14 Feb 2003 18:19:18 -0500 (EST) +To: Scott Cain +Cc: pgsql-performance@postgresql.org, + gmod schema +Subject: Re: performace problem after VACUUM ANALYZE +In-reply-to: <1045241040.1486.600.camel@localhost.localdomain> +References: <1045241040.1486.600.camel@localhost.localdomain> +Comments: In-reply-to Scott Cain + message dated "14 Feb 2003 11:44:00 -0500" +Date: Fri, 14 Feb 2003 18:19:17 -0500 +Message-ID: <12084.1045264757@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/89 +X-Sequence-Number: 1145 + +Scott Cain writes: +> Here is the query that is causing the problems: + +> select distinct f.name,fl.nbeg,fl.nend,fl.strand,f.type_id,f.feature_id +> from feature f, featureloc fl +> where +> fl.srcfeature_id = 1 and +> ((fl.strand=1 and fl.nbeg <= 393164 and fl.nend >= 390956) OR +> (fl.strand=-1 and fl.nend <= 393164 and fl.nbeg >= 390956)) and +> f.feature_id = fl.feature_id + +> [ and the index he'd like it to use is ] + +> Index "featureloc_src_strand_beg_end" +> Column | Type +> ---------------+---------- +> srcfeature_id | integer +> strand | smallint +> nbeg | integer +> nend | integer +> btree + +After fooling with this I see a couple of problems. One is the +same old cross-datatype-comparison issue that so frequently bites +people: "1" and "-1" are integer constants, and comparing them to +a smallint column isn't an indexable operation. You need casts. +(Or, forget the "optimization" of storing strand as a smallint. +Depending on your row layout, it's quite likely saving you no space +anyway.) + +Problem two is that the optimizer isn't smart enough to recognize that a +query condition laid out in this form should be processed as two +indexscans --- it would possibly have gotten it right if the first index +column had been inside the OR, but not this way. The upshot is that +when you force it to use index featureloc_src_strand_beg_end, it's +actually only using the srcfeature_id column of the index --- which is +slow of course, and also explains why the optimizer doesn't find that +option very attractive. + +I had some success in getting current sources to generate a desirable +plan by doing this: + +regression=# explain select distinct * +regression-# from feature f join featureloc fl on (f.feature_id = fl.feature_id) where +regression-# ((fl.srcfeature_id = 1 and fl.strand=1::int2 and fl.nbeg <= 393164 and fl.nend >= 390956) OR +regression(# (fl.srcfeature_id = 1 and fl.strand=-1::int2 and fl.nend <= 393164 and fl.nbeg >= 390956)); + + Unique (cost=34.79..34.85 rows=5 width=50) + -> Sort (cost=34.79..34.80 rows=5 width=50) + Sort Key: f.name, fl.nbeg, fl.nend, fl.strand + -> Hash Join (cost=9.68..34.73 rows=5 width=50) + Hash Cond: ("outer".feature_id = "inner".feature_id) + -> Seq Scan on feature f (cost=0.00..20.00 rows=1000 width=36) + -> Hash (cost=9.68..9.68 rows=1 width=14) + -> Index Scan using featureloc_src_strand_beg_end, featureloc_src_strand_beg_end on featureloc fl (cost=0.00..9.68 rows=1 width=14) + Index Cond: (((srcfeature_id = 1) AND (strand = 1::smallint) AND (nbeg <= 393164) AND (nend >= 390956)) OR ((srcfeature_id = 1) AND (strand = -1::smallint) AND (nbeg >= 390956) AND (nend <= 393164))) + Filter: (((srcfeature_id = 1) AND (strand = 1::smallint) AND (nbeg <= 393164) AND (nend >= 390956)) OR ((srcfeature_id = 1) AND (strand = -1::smallint) AND (nend <= 393164) AND (nbeg >= 390956))) +(10 rows) + +Shoving the join condition into an explicit JOIN clause is a hack, but +it nicely does the job of keeping the WHERE clause as a pristine +OR-of-ANDs structure, so that the optimizer can hardly fail to notice +that that's the preferred canonical form. + +I would strongly recommend an upgrade to PG 7.3, both on general +principles and because you can actually see what the indexscan condition +is in EXPLAIN's output. Before 7.3 you had to grovel through EXPLAIN +VERBOSE to be sure what was really happening with a multicolumn index. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Fri Feb 14 19:11:54 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 6FFAE475B8E + for ; + Fri, 14 Feb 2003 19:11:53 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 7FEA84759AF + for ; + Fri, 14 Feb 2003 19:11:52 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1F0Bq5u012379; + Fri, 14 Feb 2003 19:11:52 -0500 (EST) +To: SLetovsky@aol.com +Cc: cain@cshl.org, pgsql-performance@postgresql.org, + gmod-schema@lists.sourceforge.net +Subject: Re: [Gmod-schema] Re: performace problem after VACUUM ANALYZE +In-reply-to: <27.394f051e.2b7eded5@aol.com> +References: <27.394f051e.2b7eded5@aol.com> +Comments: In-reply-to SLetovsky@aol.com + message dated "Fri, 14 Feb 2003 19:07:49 -0500" +Date: Fri, 14 Feb 2003 19:11:52 -0500 +Message-ID: <12378.1045267912@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/91 +X-Sequence-Number: 1147 + +SLetovsky@aol.com writes: +> Am I correct in interpreting your comments as saying you believe that +> if we could lose the OR and the strand constraint PG would probably +> use the index properly? + +No, I said I thought it could do it without that ;-). But yes, you'd +have a much less fragile query if you could lose the OR condition. + +Have you looked into using a UNION ALL instead of OR to merge the two +sets of results? It sounds grotty, but might be faster... + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Sat Feb 15 03:29:24 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 8FFA8474E42; Sat, 15 Feb 2003 03:29:23 -0500 (EST) +Received: from platonic.cynic.net (platonic.cynic.net [204.80.150.245]) + by postgresql.org (Postfix) with ESMTP + id EE4AC474E61; Sat, 15 Feb 2003 03:29:22 -0500 (EST) +Received: from angelic.cynic.net (angelic-platonic.cvpn.cynic.net + [198.73.220.226]) by platonic.cynic.net (Postfix) with ESMTP + id 1BAE3BFF8; Sat, 15 Feb 2003 08:29:23 +0000 (UTC) +Received: from localhost (localhost [127.0.0.1]) + by angelic.cynic.net (Postfix) with ESMTP + id 012EC8745; Sat, 15 Feb 2003 17:29:21 +0900 (JST) +Date: Sat, 15 Feb 2003 17:29:21 +0900 (JST) +From: Curt Sampson +X-X-Sender: cjs@angelic-vtfw.cvpn.cynic.net +To: Bruce Momjian +Cc: Kevin Brown , + pgsql-performance@postgresql.org, pgsql-hackers@postgresql.org +Subject: Re: [HACKERS] WAL replay logic (was Re: Mount options for +In-Reply-To: <200302141430.h1EEUUr06607@candle.pha.pa.us> +Message-ID: +References: <200302141430.h1EEUUr06607@candle.pha.pa.us> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/92 +X-Sequence-Number: 1148 + +On Fri, 14 Feb 2003, Bruce Momjian wrote: + +> Is there a TODO here, like "Allow recovery from corrupt pg_control via +> WAL"? + +Isn't that already in section 12.2.1 of the documentation? + + Using pg_control to get the checkpoint position speeds up the + recovery process, but to handle possible corruption of pg_control, + we should actually implement the reading of existing log segments + in reverse order -- newest to oldest -- in order to find the last + checkpoint. This has not been implemented, yet. + +cjs +-- +Curt Sampson +81 90 7737 2974 http://www.netbsd.org + Don't you know, in this new Dark Age, we're all light. --XTC + +From pgsql-performance-owner@postgresql.org Sat Feb 15 03:36:44 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 5107B474E5C; Sat, 15 Feb 2003 03:36:42 -0500 (EST) +Received: from platonic.cynic.net (platonic.cynic.net [204.80.150.245]) + by postgresql.org (Postfix) with ESMTP + id 80EDB474E42; Sat, 15 Feb 2003 03:36:41 -0500 (EST) +Received: from angelic.cynic.net (angelic-platonic.cvpn.cynic.net + [198.73.220.226]) by platonic.cynic.net (Postfix) with ESMTP + id 093E2BFF8; Sat, 15 Feb 2003 08:36:41 +0000 (UTC) +Received: from localhost (localhost [127.0.0.1]) + by angelic.cynic.net (Postfix) with ESMTP + id 2D8B88745; Sat, 15 Feb 2003 17:36:39 +0900 (JST) +Date: Sat, 15 Feb 2003 17:36:39 +0900 (JST) +From: Curt Sampson +X-X-Sender: cjs@angelic-vtfw.cvpn.cynic.net +To: Tom Lane +Cc: Christopher Kings-Lynne , + Hackers , pgsql-performance@postgresql.org +Subject: Re: [HACKERS] More benchmarking of wal_buffers +In-Reply-To: <4003.1045196624@sss.pgh.pa.us> +Message-ID: +References: + <4003.1045196624@sss.pgh.pa.us> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/93 +X-Sequence-Number: 1149 + +On Thu, 13 Feb 2003, Tom Lane wrote: + +> "Christopher Kings-Lynne" writes: +> > What I mean is say you have an enterprise server doing heaps of transactions +> > with lots of work. If you have scads of RAM, could you just shove up +> > wal_buffers really high and assume it will improve performance? +> +> There is no such thing as infinite RAM (or if there is, you paid *way* +> too much for your database server). My feeling is that it's a bad +> idea to put more than you absolutely have to into single-use buffers. +> Multi-purpose buffers are usually a better use of RAM. + +Well, yes, but he was talking about 8 MB of WAL buffers. On a machine +with, say, 2 GB of RAM, that's an insignificant amount (0.4% of your +memory), and so I would say that it basically can't hurt at all. If your +log is on the same disk as your data, the larger writes when doing a big +transaction, such as a copy, might be a noticable win, in fact. + +(I was about to say that it would seem odd that someone would spend that +much on RAM and not splurge on an extra pair of disks to separate the +WAL log, but then I realized that we're only talking about $300 or so +worth of RAM....) + +cjs +-- +Curt Sampson +81 90 7737 2974 http://www.netbsd.org + Don't you know, in this new Dark Age, we're all light. --XTC + +From pgsql-hackers-owner@postgresql.org Sat Feb 15 09:15:21 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 4DE8E47592C + for ; + Sat, 15 Feb 2003 09:15:17 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 23D85474E42 + for ; + Sat, 15 Feb 2003 09:15:15 -0500 (EST) +Received: from localhost (chriskl@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) with ESMTP id + h1FEF1F63227; Sat, 15 Feb 2003 22:15:01 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Date: Sat, 15 Feb 2003 22:15:01 +0800 (WST) +From: Christopher Kings-Lynne +To: Tom Lane , + Christopher Kings-Lynne +Cc: Manfred Koizar , + PostgresSQL Hackers Mailing List +Subject: Re: Offering tuned config files +In-Reply-To: <7050.1045235265@sss.pgh.pa.us> +Message-ID: <20030215221429.J63048-100000@houston.familyhealth.com.au> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/844 +X-Sequence-Number: 35785 + +No, not really - I can do some more testing with pgbench to see what +happens though...I'll do it on monday + +Chris + +On Fri, 14 Feb 2003, Tom Lane wrote: + +> Manfred Koizar writes: +> > In postgresql.conf.sample-writeheavy you have: +> > commit_delay = 10000 +> > Is this still needed with "ganged WAL writes"? Tom? +> +> I doubt that the current options for grouped commits are worth anything +> at the moment. Chris, do you have any evidence backing up using +> commit_delay with 7.3? +> +> regards, tom lane +> + + +From pgsql-performance-owner@postgresql.org Sat Feb 15 15:36:32 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id C8DB8474E61 + for ; + Sat, 15 Feb 2003 15:36:31 -0500 (EST) +Received: from lakemtao03.cox.net (lakemtao03.cox.net [68.1.17.242]) + by postgresql.org (Postfix) with ESMTP id 2C87F474E42 + for ; + Sat, 15 Feb 2003 15:36:31 -0500 (EST) +Received: from [192.168.0.188] ([68.9.37.244]) by lakemtao03.cox.net + (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP + id <20030215203631.HONO8666.lakemtao03.cox.net@[192.168.0.188]>; + Sat, 15 Feb 2003 15:36:31 -0500 +Subject: Re: [Gmod-schema] Re: performace problem after VACUUM +From: Scott Cain +To: Tom Lane +Cc: stan letovsky , pgsql-performance@postgresql.org, + gmod schema +In-Reply-To: <12378.1045267912@sss.pgh.pa.us> +References: <27.394f051e.2b7eded5@aol.com> <12378.1045267912@sss.pgh.pa.us> +Content-Type: text/plain +Organization: Cold Spring Harbor Lab +Message-Id: <1045341390.3944.678.camel@localhost.localdomain> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.2 +Date: 15 Feb 2003 15:36:31 -0500 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/94 +X-Sequence-Number: 1150 + +Hello Tom, + +Here's the short answer: I've got it working much faster now (>100 msec +for the query by explain analyze). + +Here's the long answer: I reworked the table, horribly denormalizing +it. I changed the coordinate system, so that start is always less than +end, regardless of strand. Here is the original query: + +select distinct f.name,fl.nbeg,fl.nend,fl.strand,f.type_id,f.feature_id + from feature f, featureloc fl + where + fl.srcfeature_id = 1 and + ((fl.strand=1 and fl.nbeg <= 393164 and fl.nend >= 390956) OR + (fl.strand=-1 and fl.nend <= 393164 and fl.nbeg >= 390956)) and + f.feature_id = fl.feature_id + +and here is the equivalent query in the new coordinate system: + + select distinct f.name,fl.nbeg,fl.nend,fl.strand,f.type_id,f.feature_id + from feature f, featureloc fl + where + fl.srcfeature_id = 1 and + f.feature_id = fl.feature_id and + fl.max >= 390956 and + fl.min <= 393164 + +Notice that it is MUCH simpler, and the query planner uses exactly the +indexes I want, and as noted above, runs much faster. Of course, this +also means that I have to rewrite my database adaptor, but it shouldn't +be too bad. + +For those on the GMOD list, here is how I changed the table: + +alter table featureloc add column min int; +alter table featureloc add column max int; +update featureloc set min=nbeg where strand=1; +update featureloc set max=nend where strand=1; +update featureloc set max=nbeg where strand=-1; +update featureloc set min=nend where strand=-1; +update featureloc set min=nbeg where (strand=0 or strand is null) and nbegnend; +update featureloc set max=nbeg where (strand=0 or strand is null) and nbeg>nend; +create index featureloc_src_min_max on featureloc (srcfeature_id,min,max); +select count(*) from featureloc where min is null and nbeg is not null; + +The last select is just a test to make sure I didn't miss anything, and +it did return zero. Also, it doesn't appear that there are any features +that are strandless. I found that a little surprising, but included +those updates for completeness. + +Tom, thank you much for your help. Hopefully, I will get the group to +buy into this schema change, and life will be good. + +Scott + +On Fri, 2003-02-14 at 19:11, Tom Lane wrote: +> SLetovsky@aol.com writes: +> > Am I correct in interpreting your comments as saying you believe that +> > if we could lose the OR and the strand constraint PG would probably +> > use the index properly? +> +> No, I said I thought it could do it without that ;-). But yes, you'd +> have a much less fragile query if you could lose the OR condition. +> +> Have you looked into using a UNION ALL instead of OR to merge the two +> sets of results? It sounds grotty, but might be faster... +> +> 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 Sat Feb 15 18:48:04 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 61549474E61 + for ; + Sat, 15 Feb 2003 18:48:03 -0500 (EST) +Received: from mail.idea.net.pl (smtp-in.centertel.pl [194.9.223.8]) + by postgresql.org (Postfix) with ESMTP id B820C474E42 + for ; + Sat, 15 Feb 2003 18:48:02 -0500 (EST) +Received: from skorupa (vb145.neoplus.adsl.tpnet.pl [80.50.229.145]) + by mta3.centertel.pl (iPlanet Messaging Server 5.2 (built Feb 21 2002)) + with ESMTPA id <0HAD00AHZISKEF@mta3.centertel.pl> for + pgsql-performance@postgresql.org; Sun, 16 Feb 2003 00:33:58 +0100 (CET) +Date: Sun, 16 Feb 2003 00:48:13 +0100 +From: Mariusz =?iso-8859-2?q?Czu=B3ada?= +Subject: Views with unions +To: pgsql-performance@postgresql.org +Message-id: <200302160048.14681.manieq@idea.net.pl> +MIME-version: 1.0 +Content-type: text/plain; charset=iso-8859-2 +Content-transfer-encoding: quoted-printable +Content-disposition: inline +User-Agent: KMail/1.6.1-cool +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/95 +X-Sequence-Number: 1151 + +Hello, + +While testing multi-select views I found some problems. Here are details. I= + have 3 tables and I created a view on them: + +create view view123 as +select key, value from tab1 where key=3D1 +union all +select key, value from tab2 where key=3D2 +union all +select key, value from tab3 where key=3D3; + +When querying with no conditions, I get plan: + +test_db=3D# explain analyze select key, value from view123; + QUERY PLAN +---------------------------------------------------------------------------= +---------------------------------------- + Subquery Scan view123 (cost=3D0.00..3.19 rows=3D15 width=3D11) (actual ti= +me=3D0.15..1.00 rows=3D15 loops=3D1) + -> Append (cost=3D0.00..3.19 rows=3D15 width=3D11) (actual time=3D0.14= +..0.80 rows=3D15 loops=3D1) + -> Subquery Scan "*SELECT* 1" (cost=3D0.00..1.06 rows=3D5 width= +=3D11) (actual time=3D0.13..0.30 rows=3D5 loops=3D1) + -> Seq Scan on tab1 (cost=3D0.00..1.06 rows=3D5 width=3D11= +) (actual time=3D0.11..0.22 rows=3D5 loops=3D1) + Filter: ("key" =3D 1) + -> Subquery Scan "*SELECT* 2" (cost=3D0.00..1.06 rows=3D5 width= +=3D11) (actual time=3D0.07..0.22 rows=3D5 loops=3D1) + -> Seq Scan on tab2 (cost=3D0.00..1.06 rows=3D5 width=3D11= +) (actual time=3D0.05..0.15 rows=3D5 loops=3D1) + Filter: ("key" =3D 2) + -> Subquery Scan "*SELECT* 3" (cost=3D0.00..1.06 rows=3D5 width= +=3D11) (actual time=3D0.06..0.22 rows=3D5 loops=3D1) + -> Seq Scan on tab3 (cost=3D0.00..1.06 rows=3D5 width=3D11= +) (actual time=3D0.05..0.15 rows=3D5 loops=3D1) + Filter: ("key" =3D 3) + Total runtime: 1.57 msec +(12 rows) + +But with "key =3D 3": + +test_db# explain analyze select key, value from view123 where key=3D3; + QUERY PLAN +---------------------------------------------------------------------------= +---------------------------------------- + Subquery Scan view123 (cost=3D0.00..3.22 rows=3D7 width=3D11) (actual tim= +e=3D0.40..0.65 rows=3D5 loops=3D1) + -> Append (cost=3D0.00..3.22 rows=3D7 width=3D11) (actual time=3D0.38.= +.0.58 rows=3D5 loops=3D1) + -> Subquery Scan "*SELECT* 1" (cost=3D0.00..1.07 rows=3D1 width= +=3D11) (actual time=3D0.18..0.18 rows=3D0 loops=3D1) + -> Seq Scan on tab1 (cost=3D0.00..1.07 rows=3D1 width=3D11= +) (actual time=3D0.17..0.17 rows=3D0 loops=3D1) + Filter: (("key" =3D 1) AND ("key" =3D 3)) + -> Subquery Scan "*SELECT* 2" (cost=3D0.00..1.07 rows=3D1 width= +=3D11) (actual time=3D0.11..0.11 rows=3D0 loops=3D1) + -> Seq Scan on tab2 (cost=3D0.00..1.07 rows=3D1 width=3D11= +) (actual time=3D0.11..0.11 rows=3D0 loops=3D1) + Filter: (("key" =3D 2) AND ("key" =3D 3)) + -> Subquery Scan "*SELECT* 3" (cost=3D0.00..1.07 rows=3D5 width= +=3D11) (actual time=3D0.08..0.25 rows=3D5 loops=3D1) + -> Seq Scan on tab3 (cost=3D0.00..1.07 rows=3D5 width=3D11= +) (actual time=3D0.06..0.18 rows=3D5 loops=3D1) + Filter: (("key" =3D 3) AND ("key" =3D 3)) + Total runtime: 1.22 msec +(12 rows) + +I would expect, that false filters, like (("key" =3D 1) AND ("key" =3D 3)) = +will make table full scan unnecessary. So I expected plan like: + +test_db# explain analyze select key, value from view123 where key=3D3; + QUERY PLAN +---------------------------------------------------------------------------= +---------------------------------------- + Subquery Scan view123 (cost=3D0.00..3.22 rows=3D7 width=3D11) (actual tim= +e=3D0.40..0.65 rows=3D5 loops=3D1) + -> Append (cost=3D0.00..3.22 rows=3D7 width=3D11) (actual time=3D0.38.= +.0.58 rows=3D5 loops=3D1) + -> Subquery Scan "*SELECT* 1" (cost=3D0.00..1.07 rows=3D1 width= +=3D11) (actual time=3D0.18..0.18 rows=3D0 loops=3D1) + -> Result (cost=3D0.00..0.00 rows=3D0 width=3D11) (actual = +time=3D0.01..0.01 rows=3D0 loops=3D1) + ^^^^^^^^^^^ my change + Filter: (("key" =3D 1) AND ("key" =3D 3)) [always fals= +e] + = + ^^^^^^^^^^^ my change + -> Subquery Scan "*SELECT* 2" (cost=3D0.00..1.07 rows=3D1 width= +=3D11) (actual time=3D0.11..0.11 rows=3D0 loops=3D1) + -> Result (cost=3D0.00..0.00 rows=3D0 width=3D11) (actual = +time=3D0.01..0.01 rows=3D0 loops=3D1) + ^^^^^^^^^^^ my change + Filter: (("key" =3D 2) AND ("key" =3D 3)) [always fals= +e] + = + ^^^^^^^^^^^ my change + -> Subquery Scan "*SELECT* 3" (cost=3D0.00..1.07 rows=3D5 width= +=3D11) (actual time=3D0.08..0.25 rows=3D5 loops=3D1) + -> Seq Scan on tab3 (cost=3D0.00..1.07 rows=3D5 width=3D11= +) (actual time=3D0.06..0.18 rows=3D5 loops=3D1) + Filter: (("key" =3D 3) AND ("key" =3D 3)) + Total runtime: 1.22 msec +(12 rows) + +No "Seq Scan" on tables where filter is false. + +I realize that's how it works now, but: + +a) is there any way to avoid such scans? +b) is it possible (or in TODO) to optimize for such cases? + +Regards, + +Mariusz Czu=B3ada + +From pgsql-performance-owner@postgresql.org Sat Feb 15 22:55:20 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 08B26474E61 + for ; + Sat, 15 Feb 2003 22:55:20 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 5FF79474E42 + for ; + Sat, 15 Feb 2003 22:55:19 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2842191; Sat, 15 Feb 2003 19:55:20 -0800 +Content-Type: text/plain; + charset="iso-8859-2" +From: Josh Berkus +Organization: Aglio Database Solutions +To: Mariusz =?iso-8859-2?q?Czu=B3ada?= , + pgsql-performance@postgresql.org +Subject: Re: Views with unions +Date: Sat, 15 Feb 2003 19:54:33 -0800 +User-Agent: KMail/1.4.3 +References: <200302160048.14681.manieq@idea.net.pl> +In-Reply-To: <200302160048.14681.manieq@idea.net.pl> +MIME-Version: 1.0 +Message-Id: <200302151954.33740.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/96 +X-Sequence-Number: 1152 + +Mariusz, + +> While testing multi-select views I found some problems. Here are details.= + I +> have 3 tables and I created a view on them: + +What version of PostgreSQL are you using? UNION views optimized extremely= +=20 +poorly through 7.2.4; things have been improved in 7.3 + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Sun Feb 16 03:19:48 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B578F4759AF + for ; + Sun, 16 Feb 2003 03:19:45 -0500 (EST) +Received: from mail.idea.net.pl (smtp-in.centertel.pl [194.9.223.7]) + by postgresql.org (Postfix) with ESMTP id 06E8247592C + for ; + Sun, 16 Feb 2003 03:19:44 -0500 (EST) +Received: from skorupa (vb145.neoplus.adsl.tpnet.pl [80.50.229.145]) + by mta1.centertel.pl (iPlanet Messaging Server 5.2 (built Feb 21 2002)) + with ESMTPA id <0HAE0035P71YP8@mta1.centertel.pl> for + pgsql-performance@postgresql.org; Sun, 16 Feb 2003 09:17:58 +0100 (CET) +Date: Sun, 16 Feb 2003 09:19:06 +0100 +From: Mariusz =?iso-8859-2?q?Czu=B3ada?= +Subject: Re: Views with unions +In-reply-to: <200302151954.33740.josh@agliodbs.com> +To: Josh Berkus , pgsql-performance@postgresql.org +Message-id: <200302160919.07970.manieq@idea.net.pl> +MIME-version: 1.0 +Content-type: text/plain; charset=iso-8859-2 +Content-transfer-encoding: quoted-printable +Content-disposition: inline +User-Agent: KMail/1.6.1-cool +References: <200302160048.14681.manieq@idea.net.pl> + <200302151954.33740.josh@agliodbs.com> +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/97 +X-Sequence-Number: 1153 + +Hi, + +Dnia nie 16. lutego 2003 04:54, Josh Berkus napisa=B3: +> +> What version of PostgreSQL are you using? UNION views optimized extreme= +ly +> poorly through 7.2.4; things have been improved in 7.3 + +PostgreSQL 7.3 on sparc-sun-solaris2.9, compiled by GCC gcc (GCC) 3.2 (self= +=20 +compiled on SunBlade 100). + +Mariusz + +From pgsql-performance-owner@postgresql.org Sun Feb 16 13:05:36 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A8F9E475A9E + for ; + Sun, 16 Feb 2003 13:05:35 -0500 (EST) +Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) + by postgresql.org (Postfix) with ESMTP id 3219F475A8D + for ; + Sun, 16 Feb 2003 13:05:35 -0500 (EST) +Received: by megazone.bigpanda.com (Postfix, from userid 1001) + id 88C64D60D; Sun, 16 Feb 2003 10:05:34 -0800 (PST) +Received: from localhost (localhost [127.0.0.1]) + by megazone.bigpanda.com (Postfix) with ESMTP + id 7E8035C03; Sun, 16 Feb 2003 10:05:34 -0800 (PST) +Date: Sun, 16 Feb 2003 10:05:34 -0800 (PST) +From: Stephan Szabo +To: Josh Berkus +Cc: Mariusz =?iso-8859-2?q?Czu=B3ada?= , + +Subject: Re: Views with unions +In-Reply-To: <200302151954.33740.josh@agliodbs.com> +Message-ID: <20030216095555.K94589-100000@megazone23.bigpanda.com> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/98 +X-Sequence-Number: 1154 + +On Sat, 15 Feb 2003, Josh Berkus wrote: + +> Mariusz, +> +> > While testing multi-select views I found some problems. Here are details. I +> > have 3 tables and I created a view on them: +> +> What version of PostgreSQL are you using? UNION views optimized extremely +> poorly through 7.2.4; things have been improved in 7.3 + +Yeah, but I think what he's hoping is that it'll notice that +"key=1 and key=3" would be noticed as a false condition so that it doesn't +scan those tables since a row presumably can't satisify both. The question +would be, is the expense of checking the condition for all queries +greater than the potential gain for these sorts of queries. In addition, +you'd have to be careful to make it work correctly with operator +overloading, since someone could make operators whose semantics in +cross-datatype comparisons are wierd. + + +From pgsql-performance-owner@postgresql.org Sun Feb 16 13:51:28 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 9D4E1475461 + for ; + Sun, 16 Feb 2003 13:51:26 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id E850E474E42 + for ; + Sun, 16 Feb 2003 13:51:25 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1GIpJ5u028376; + Sun, 16 Feb 2003 13:51:19 -0500 (EST) +To: Stephan Szabo +Cc: Josh Berkus , + Mariusz =?iso-8859-2?q?Czu=B3ada?= , + pgsql-performance@postgresql.org +Subject: Re: Views with unions +In-reply-to: <20030216095555.K94589-100000@megazone23.bigpanda.com> +References: <20030216095555.K94589-100000@megazone23.bigpanda.com> +Comments: In-reply-to Stephan Szabo + message dated "Sun, 16 Feb 2003 10:05:34 -0800" +Date: Sun, 16 Feb 2003 13:51:18 -0500 +Message-ID: <28375.1045421478@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/99 +X-Sequence-Number: 1155 + +Stephan Szabo writes: +> Yeah, but I think what he's hoping is that it'll notice that +> "key=1 and key=3" would be noticed as a false condition so that it doesn't +> scan those tables since a row presumably can't satisify both. The question +> would be, is the expense of checking the condition for all queries +> greater than the potential gain for these sorts of queries. + +Yes, this is the key point: we won't put in an optimization that wins on +a small class of queries unless there is no material cost added for +planning cases where it doesn't apply. + +> In addition, you'd have to be careful to make it work correctly with +> operator overloading, since someone could make operators whose +> semantics in cross-datatype comparisons are wierd. + +In practice we would restrict such deductions to mergejoinable = +operators, which are sufficiently semantics-constrained that I think +you can treat equality at face value. + +Actually, in CVS tip we are on the hairy edge of being able to do this: +generate_implied_equalities() actually detects that the given conditions +imply that two constants are equal. But it doesn't do anything with the +knowledge, because I couldn't figure out just what to do --- it's not +always correct to add a "WHERE false" constraint to the top level, but +where exactly do we add it? Exactly which relations are guaranteed to +produce zero rows in such a case? (When there are outer joins in the +picture, zero rows out of some relations doesn't mean zero rows out +overall.) And how do we exploit that knowledge once we've got it? +It'd be a pretty considerable amount of work to optimize a plan tree +fully for this sort of thing (eg, suppressing unnecessary joins), and +I doubt it's worth the trouble. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Sun Feb 16 15:29:21 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E4AA147580B + for ; + Sun, 16 Feb 2003 15:29:18 -0500 (EST) +Received: from mail.idea.net.pl (smtp-in.centertel.pl [194.9.223.7]) + by postgresql.org (Postfix) with ESMTP id 474B2475461 + for ; + Sun, 16 Feb 2003 15:29:18 -0500 (EST) +Received: from skorupa (vb145.neoplus.adsl.tpnet.pl [80.50.229.145]) + by mta1.centertel.pl (iPlanet Messaging Server 5.2 (built Feb 21 2002)) + with ESMTPA id <0HAF003Y84TUYV@mta1.centertel.pl> for + pgsql-performance@postgresql.org; Sun, 16 Feb 2003 21:27:31 +0100 (CET) +Date: Sun, 16 Feb 2003 21:27:31 +0100 +From: Mariusz =?iso-8859-2?q?Czu=B3ada?= +Subject: Re: Views with unions +In-reply-to: <28375.1045421478@sss.pgh.pa.us> +To: pgsql-performance@postgresql.org +Message-id: <200302162127.31324.manieq@idea.net.pl> +MIME-version: 1.0 +Content-type: text/plain; charset=iso-8859-2 +Content-transfer-encoding: quoted-printable +Content-disposition: inline +User-Agent: KMail/1.6.1-cool +References: <20030216095555.K94589-100000@megazone23.bigpanda.com> + <28375.1045421478@sss.pgh.pa.us> +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/100 +X-Sequence-Number: 1156 + +Dnia nie 16. lutego 2003 19:51, Tom Lane napisa=B3: +> Stephan Szabo writes: +> > Yeah, but I think what he's hoping is that it'll notice that +> > "key=3D1 and key=3D3" would be noticed as a false condition so that it +> > doesn't scan those tables since a row presumably can't satisify both. T= +he + +Yes, that is what I expected. + +> +> Yes, this is the key point: we won't put in an optimization that wins on +> a small class of queries unless there is no material cost added for +> planning cases where it doesn't apply. +> +> > In addition, you'd have to be careful to make it work correctly with +> > operator overloading, since someone could make operators whose +> > semantics in cross-datatype comparisons are wierd. +> +> It'd be a pretty considerable amount of work to optimize a plan tree +> fully for this sort of thing (eg, suppressing unnecessary joins), and +> I doubt it's worth the trouble. + +Ok, perhaps I should give some explaination about my case. + +We are gathering lots of log data in a few tables. Each table grows by some= +=20 +300.000...500.000 rows a day. With average row size of 100 bytes we get up = +to=20 +50MB of data per day. Keeping data for 1 year only gives us some 18GB per= +=20 +table. Also, in each table there is a field with very low cardinality (5..2= +0=20 +unique values). This field appears in most of our queries to the table, in= +=20 +'where' clause (mostly key_field =3D 5, some times key_field in (1,2,3)). + +What I was thinking of is to implement some kind of horizontal table=20 +partitioning. I wanted to split physical storage of data to few smaller=20 +tables. In my case it could be come 12 subtables, 1..2 GB each. Now, with= +=20 +'union-all' view (and lots of rules, of course) I could simultate partition= +ed=20 +table as Oracle implements it. IMHO while querying this view (supertable) f= +or=20 +one or few 'key_field' values it should be much faster for scan 5 GB of 3= +=20 +partitions (subtables) than 18GB for one big table. + +I realize it is not the only solution. Perhaps it could be implemented by a= +=20 +function taking key_filed value and returning all rows from proper table=20 +(p[lus functions for insert/update/delete). Perhaps application code (log= +=20 +feeder and report module) could be recoded to know about splitted tables.= +=20 +Still I think it is 'elegant' and clear.=20 + +I wait for your comments, + +Mariusz Czulada + +From pgsql-jdbc-owner@postgresql.org Sun Feb 16 18:03:07 2003 +X-Original-To: pgsql-jdbc@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id BC50947580B; Sun, 16 Feb 2003 18:03:06 -0500 (EST) +Received: from trill.maridan.net (unknown [217.6.52.210]) + by postgresql.org (Postfix) with ESMTP + id 994DB475461; Sun, 16 Feb 2003 18:03:05 -0500 (EST) +Received: from rafcio.polonium.de (dialin-145-254-064-071.arcor-ip.net + [145.254.64.71]) + by trill.maridan.net (8.9.3/8.9.3) with ESMTP id AAA18805; + Mon, 17 Feb 2003 00:03:06 +0100 +Message-Id: <5.2.0.9.0.20030216232710.01b40810@mail.polonium.de> +X-Sender: rafcio@mail.polonium.de +X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 +Date: Mon, 17 Feb 2003 00:03:01 +0100 +To: pgsql-jdbc@postgresql.org, pgsql-performance@postgresql.org +From: Rafal Kedziorski +Subject: Good performance? +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii"; format=flowed +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/236 +X-Sequence-Number: 6407 + +Hi, + +I have following tables: + +with id as number(20,0): +CREATE TABLE public.firm ( + firm_id numeric(20, 0) NOT NULL, + name varchar(40) NOT NULL, + CONSTRAINT firm_pkey PRIMARY KEY (firm_id) +) + +with id as int8: + +CREATE TABLE public.firmint8 ( + firmint8_id int8 NOT NULL, + name varchar(40) NOT NULL, + CONSTRAINT firmint8_pkey PRIMARY KEY (firmint8_id) +) + +my system: +- dual PIII 800 MHz with 640 MB RAM +- cygwin +- PostgreSQL 7.3.1 (default configuration after install thru cygwin) +- J2SE 1.4.1_01 +- JDBC driver for J2SE 1.4.1_01 and J2SE 1.3.1_06 + +I get very bad performance inserting 1000 simple values in the tables +defined above. I'm using PreparedStatement without Batch. + +with J2SE 1.4.1_01 it need: + +java db.InsertFirmSQLNumber +InsertFirmSQLNumber() needed 74438 for creating 1000 entries +InsertFirmSQLNumber() needed 53140 for creating 1000 entries + +java db.InsertFirmSQLInt8 +InsertFirmSQLInt8() needed 44531 for creating 1000 entries +InsertFirmSQLInt8() needed 63500 for creating 1000 entries +InsertFirmSQLInt8() needed 70578 for creating 1000 entries +InsertFirmSQLInt8() needed 68375 for creating 1000 entries +InsertFirmSQLInt8() needed 80234 for creating 1000 entries + + +with J2SE 1.3.1_06 it need: + +java db.InsertFirmSQLNumber +InsertFirmSQLNumber() needed 40093 for creating 1000 entries +InsertFirmSQLNumber() needed 39016 for creating 1000 entries +InsertFirmSQLNumber() needed 39579 for creating 1000 entries + +java db.InsertFirmSQLInt8 +InsertFirmSQLInt8() needed 75437 for creating 1000 entries +InsertFirmSQLInt8() needed 39156 for creating 1000 entries +InsertFirmSQLInt8() needed 41421 for creating 1000 entries +InsertFirmSQLInt8() needed 41156 for creating 1000 entries + + +and there is the Java code: + + DriverManager.registerDriver(new org.postgresql.Driver()); + Connection conn = DriverManager.getConnection(db, dbuser, dbpassword); + PreparedStatement pstmt = null; + ResultSet rs = null; + + if (conn != null) { + String query = "insert into firm values(?,?)"; + pstmt = conn.prepareStatement(query); + + long start = System.currentTimeMillis(); + for (int i = 0; i < N; i++) { + pstmt.setLong(1, getUniquelongID()); + pstmt.setString(2, "" + i); + pstmt.executeUpdate(); + } + long end = System.currentTimeMillis() - start; + + System.out.println("InsertFirmSQLInt8() needed " + end + " for +creating " + N + " entries"); + } + + closeConnections(conn, pstmt, rs); + } + +Is this a JDBC driver or PostgreSQL configuration problem? Or is the +performance normal? + + +Best Regards, +Rafal + + +From pgsql-jdbc-owner@postgresql.org Sun Feb 16 18:23:27 2003 +X-Original-To: pgsql-jdbc@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0AD7647580B + for ; Sun, 16 Feb 2003 18:23:27 -0500 (EST) +Received: from fep03-mail.bloor.is.net.cable.rogers.com + (fep03-mail.bloor.is.net.cable.rogers.com [66.185.86.73]) + by postgresql.org (Postfix) with ESMTP id 5CBAC475461 + for ; Sun, 16 Feb 2003 18:23:26 -0500 (EST) +Received: from spook ([65.48.10.226]) + by fep03-mail.bloor.is.net.cable.rogers.com + (InterMail vM.5.01.05.06 201-253-122-126-106-20020509) with ESMTP id + <20030216232302.XGKI360645.fep03-mail.bloor.is.net.cable.rogers.com@spook> + for ; Sun, 16 Feb 2003 18:23:02 -0500 +Message-ID: <000e01c2d612$66b29450$6401a8c0@spook> +From: "John Cavacas" +To: +References: <5.2.0.9.0.20030216232710.01b40810@mail.polonium.de> +Subject: Re: Good performance? +Date: Sun, 16 Feb 2003 18:23:23 -0500 +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.2720.3000 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +X-Authentication-Info: Submitted using SMTP AUTH LOGIN at + fep03-mail.bloor.is.net.cable.rogers.com from [65.48.10.226] + using ID at Sun, 16 Feb 2003 18:23:02 -0500 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/237 +X-Sequence-Number: 6408 + +> .... +> pstmt.setLong(1, getUniquelongID()); +>.... + +What is getUniquelongID()? Can you post the code for that? I would +suspect that might be your problem. + +Your results point to something being wrong somewhere. Just yesterday I +was doing some benchmarking of my own, and using code similar to yours I +was inserting 10000 records in about 23 seconds. + +john + + +From pgsql-jdbc-owner@postgresql.org Sun Feb 16 19:23:53 2003 +X-Original-To: pgsql-jdbc@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 537E8475921 + for ; Sun, 16 Feb 2003 19:23:52 -0500 (EST) +Received: from trill.maridan.net (unknown [217.6.52.210]) + by postgresql.org (Postfix) with ESMTP id 5B5624758BD + for ; Sun, 16 Feb 2003 19:23:50 -0500 (EST) +Received: from rafcio.polonium.de (130-149-145-109.dialup.cs.tu-berlin.de + [130.149.145.109]) + by trill.maridan.net (8.9.3/8.9.3) with ESMTP id BAA23379 + for ; Mon, 17 Feb 2003 01:23:48 +0100 +Message-Id: <5.2.0.9.0.20030217012205.01c43398@mail.polonium.de> +X-Sender: rafcio@mail.polonium.de +X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 +Date: Mon, 17 Feb 2003 01:23:45 +0100 +To: +From: Rafal Kedziorski +Subject: Re: Good performance? +In-Reply-To: <000e01c2d612$66b29450$6401a8c0@spook> +References: <5.2.0.9.0.20030216232710.01b40810@mail.polonium.de> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii"; format=flowed +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/238 +X-Sequence-Number: 6409 + +At 18:23 16.02.2003 -0500, John Cavacas wrote: +> > .... +> > pstmt.setLong(1, getUniquelongID()); +> >.... +> +>What is getUniquelongID()? Can you post the code for that? I would +>suspect that might be your problem. + +here is the code. + +private final static long getUniquelongID() { + return (System.currentTimeMillis() * 1000 + (long) (100000 * +Math.random())); +} + +but this routine is very fast. for computing 100.000 values she need 6-7 +seconds. + +>Your results point to something being wrong somewhere. Just yesterday I +>was doing some benchmarking of my own, and using code similar to yours I +>was inserting 10000 records in about 23 seconds. +> +>john +> +> +>---------------------------(end of broadcast)--------------------------- +>TIP 3: if posting/reading through Usenet, please send an appropriate +>subscribe-nomail command to majordomo@postgresql.org so that your +>message can get through to the mailing list cleanly + + +From pgsql-jdbc-owner@postgresql.org Sun Feb 16 23:45:02 2003 +X-Original-To: pgsql-jdbc@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 7E299474E53; Sun, 16 Feb 2003 23:44:58 -0500 (EST) +Received: from mail.xythos.com (ip-216-36-77-241.dsl.sjc.megapath.net + [216.36.77.241]) by postgresql.org (Postfix) with ESMTP + id E70B3474E42; Sun, 16 Feb 2003 23:44:57 -0500 (EST) +Received: from ravms by mail.xythos.com with mail-ok (Exim 3.36 #3) + id 18kd9K-0003J9-00; Mon, 17 Feb 2003 04:45:02 +0000 +Received: from h-66-166-17-184.snvacaid.covad.net ([66.166.17.184] + helo=xythos.com) by mail.xythos.com with asmtp (Exim 3.36 #3) + id 18kd9K-0003Iy-00; Mon, 17 Feb 2003 04:45:02 +0000 +Message-ID: <3E5068CD.4050909@xythos.com> +Date: Sun, 16 Feb 2003 20:45:01 -0800 +From: Barry Lind +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Rafal Kedziorski +Cc: pgsql-jdbc@postgresql.org, pgsql-performance@postgresql.org +Subject: Re: Good performance? +References: <5.2.0.9.0.20030216232710.01b40810@mail.polonium.de> +In-Reply-To: <5.2.0.9.0.20030216232710.01b40810@mail.polonium.de> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Envelope-To: rafcio@polonium.de, pgsql-jdbc@postgresql.org, + pgsql-performance@postgresql.org +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/241 +X-Sequence-Number: 6412 + +Rafal, + +Performance of postgres running under cygwin isn't great. Can you try +the same test on a different platform? It also looks like you are +running in autocommit mode. You should see a significant performance +improvement if you batch your commits in say groups of 1000 inserts per +commit. + +thanks, +--Barry + +Rafal Kedziorski wrote: +> Hi, +> +> I have following tables: +> +> with id as number(20,0): +> CREATE TABLE public.firm ( +> firm_id numeric(20, 0) NOT NULL, +> name varchar(40) NOT NULL, +> CONSTRAINT firm_pkey PRIMARY KEY (firm_id) +> ) +> +> with id as int8: +> +> CREATE TABLE public.firmint8 ( +> firmint8_id int8 NOT NULL, +> name varchar(40) NOT NULL, +> CONSTRAINT firmint8_pkey PRIMARY KEY (firmint8_id) +> ) +> +> my system: +> - dual PIII 800 MHz with 640 MB RAM +> - cygwin +> - PostgreSQL 7.3.1 (default configuration after install thru cygwin) +> - J2SE 1.4.1_01 +> - JDBC driver for J2SE 1.4.1_01 and J2SE 1.3.1_06 +> +> I get very bad performance inserting 1000 simple values in the tables +> defined above. I'm using PreparedStatement without Batch. +> +> with J2SE 1.4.1_01 it need: +> +> java db.InsertFirmSQLNumber +> InsertFirmSQLNumber() needed 74438 for creating 1000 entries +> InsertFirmSQLNumber() needed 53140 for creating 1000 entries +> +> java db.InsertFirmSQLInt8 +> InsertFirmSQLInt8() needed 44531 for creating 1000 entries +> InsertFirmSQLInt8() needed 63500 for creating 1000 entries +> InsertFirmSQLInt8() needed 70578 for creating 1000 entries +> InsertFirmSQLInt8() needed 68375 for creating 1000 entries +> InsertFirmSQLInt8() needed 80234 for creating 1000 entries +> +> +> with J2SE 1.3.1_06 it need: +> +> java db.InsertFirmSQLNumber +> InsertFirmSQLNumber() needed 40093 for creating 1000 entries +> InsertFirmSQLNumber() needed 39016 for creating 1000 entries +> InsertFirmSQLNumber() needed 39579 for creating 1000 entries +> +> java db.InsertFirmSQLInt8 +> InsertFirmSQLInt8() needed 75437 for creating 1000 entries +> InsertFirmSQLInt8() needed 39156 for creating 1000 entries +> InsertFirmSQLInt8() needed 41421 for creating 1000 entries +> InsertFirmSQLInt8() needed 41156 for creating 1000 entries +> +> +> and there is the Java code: +> +> DriverManager.registerDriver(new org.postgresql.Driver()); +> Connection conn = DriverManager.getConnection(db, dbuser, +> dbpassword); +> PreparedStatement pstmt = null; +> ResultSet rs = null; +> +> if (conn != null) { +> String query = "insert into firm values(?,?)"; +> pstmt = conn.prepareStatement(query); +> +> long start = System.currentTimeMillis(); +> for (int i = 0; i < N; i++) { +> pstmt.setLong(1, getUniquelongID()); +> pstmt.setString(2, "" + i); +> pstmt.executeUpdate(); +> } +> long end = System.currentTimeMillis() - start; +> +> System.out.println("InsertFirmSQLInt8() needed " + end + " +> for creating " + N + " entries"); +> } +> +> closeConnections(conn, pstmt, rs); +> } +> +> Is this a JDBC driver or PostgreSQL configuration problem? Or is the +> performance normal? +> +> +> Best Regards, +> Rafal +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 5: Have you checked our extensive FAQ? +> +> http://www.postgresql.org/users-lounge/docs/faq.html +> + + + +From pgsql-jdbc-owner@postgresql.org Mon Feb 17 04:11:13 2003 +X-Original-To: pgsql-jdbc@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id C313A474E53; Mon, 17 Feb 2003 04:11:09 -0500 (EST) +Received: from trill.maridan.net (unknown [217.6.52.210]) + by postgresql.org (Postfix) with ESMTP + id 4ED6F474E42; Mon, 17 Feb 2003 04:11:08 -0500 (EST) +Received: from polonium.de ([212.121.156.162]) + by trill.maridan.net (8.9.3/8.9.3) with ESMTP id KAA20972; + Mon, 17 Feb 2003 10:11:09 +0100 +Message-ID: <3E50A78D.9000806@polonium.de> +Date: Mon, 17 Feb 2003 10:12:45 +0100 +From: Rafal Kedziorski +Organization: POLONIUM +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; + rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-jdbc@postgresql.org +Cc: pgsql-performance@postgresql.org +Subject: Re: Good performance? +References: <5.2.0.9.0.20030216232710.01b40810@mail.polonium.de> + <3E5068CD.4050909@xythos.com> +In-Reply-To: <3E5068CD.4050909@xythos.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/242 +X-Sequence-Number: 6413 + +hi, + +Barry Lind wrote: + +> Rafal, +> +> Performance of postgres running under cygwin isn't great. Can you try +> the same test on a different platform? It also looks like you are +> running in autocommit mode. You should see a significant performance +> improvement if you batch your commits in say groups of 1000 inserts +> per commit. + +after set autocommit false, I need 0,9 - 1,04 seconds for insert 1000 +new entries into my table. is this normal, that autocommit false is +40-50 times slower? + + +Rafal + +> thanks, +> --Barry + + + + +From pgsql-performance-owner@postgresql.org Mon Feb 17 05:52:41 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 04DDE474E53 + for ; + Mon, 17 Feb 2003 05:52:41 -0500 (EST) +Received: from biomax.de (unknown [212.6.137.236]) + by postgresql.org (Postfix) with ESMTP id B9DBC474E42 + for ; + Mon, 17 Feb 2003 05:52:39 -0500 (EST) +Received: from biomax.de (guffert.biomax.de [192.168.3.166]) + by biomax.de (8.8.8/8.8.8) with ESMTP id LAA24652; + Mon, 17 Feb 2003 11:51:48 +0100 +Message-ID: <3E50BECC.9090107@biomax.de> +Date: Mon, 17 Feb 2003 11:51:56 +0100 +From: Chantal Ackermann +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Josh Berkus , pgsql-performance@postgresql.org +Subject: Re: cost and actual time +References: +In-Reply-To: +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/104 +X-Sequence-Number: 1160 + +hello Josh, + +thank you for your fast answer. (I had some days off.) + +This posting is quite long, I apologize. But I wanted to provide enough +information to outline the problem. + +I did some vacuums analyze on all 4 tables concerned (gene, disease, +gene_occurrences, disease_occurrences) to be sure the planner is up to +date - but that did not minimize the difference between the estimation +of resulting rows and the actual result. + +I changed the settings for default_statistics_target to 1000 (default +10). The estimation goes up to 102 rows which is little more than +before, and still far away from the actual result. + +The effective_cache_size is at 80000. + +To be sure I didn't change it to be worse, I checked again with the +default_statistics_target set to 10 and a cache size of 1000 (ran vacuum +afterwards). the estimation is at 92 rows. so there's not a really big +difference. + +I wonder, if I can set some geqo or planner settings in the +postgresql.conf file to make the planner estimate better? The database +is exclusively for reading, so it's ok if the time for analyzing the +tables increases. + +The query I am testing with is: + +EXPLAIN ANALYZE +SELECT tmp.disease_name, count(tmp.disease_name) AS cnt + FROM (SELECT DISTINCT disease.disease_name, +disease_occurrences.sentence_id FROM gene, disease, gene_occurrences, +disease_occurrences + WHERE gene.gene_name='igg' + AND gene_occurrences.sentence_id=disease_occurrences.sentence_id + AND gene.gene_id=gene_occurrences.gene_id + AND disease.disease_id=disease_occurrences.disease_id) AS tmp +GROUP BY tmp.disease_name +ORDER BY cnt DESC; + +Row counts are: +'gene': 164657 +'disease': 129923 +'gene_occurrences': 10484141 +'disease_occurrences': 15079045 + +the gene_id for 'igg' occurres 110637 times in gene_occurrences, it is +the most frequent. + +the index on gene_occurences(sentence_id) and +disease_occurrences(sentence_id) is clustered. + +I have an alternative query which I am testing to see whether it is +better than the first one: + + +explain analyze SELECT disease.disease_name, count(disease.disease_name) +AS cnt FROM + ((SELECT gene_occurrences.sentence_id FROM gene_occurrences + WHERE gene_occurrences.gene_id=(SELECT gene.gene_id FROM gene +WHERE gene.gene_name='igg')) AS tmp + JOIN disease_occurrences USING (sentence_id)) as tmp2 + NATURAL JOIN disease +GROUP BY disease.disease_name +ORDER BY cnt DESC; + +the cost estimated by the planner is much higher, thus I thought this +query is worse than the first. However - maybe it's just more accurate? + +this is its explain-output (default settings for +default_statistics_target while 'vacuum analyze'): + +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Sort (cost=126690.02..126691.47 rows=581 width=57) (actual +time=8066.05..8067.05 rows=3364 loops=1) + Sort Key: count(disease.disease_name) + InitPlan + -> Index Scan using gene_uni on gene (cost=0.00..5.26 rows=1 +width=4) (actual time=0.19..0.20 rows=1 loops=1) + Index Cond: (gene_name = 'igg'::text) + -> Aggregate (cost=126619.79..126663.35 rows=581 width=57) (actual +time=7894.33..8055.43 rows=3364 loops=1) + -> Group (cost=126619.79..126648.83 rows=5809 width=57) +(actual time=7894.31..8020.00 rows=30513 loops=1) + -> Sort (cost=126619.79..126634.31 rows=5809 width=57) +(actual time=7894.30..7910.08 rows=30513 loops=1) + Sort Key: disease.disease_name + -> Merge Join (cost=119314.93..126256.64 +rows=5809 width=57) (actual time=6723.92..7732.94 rows=30513 loops=1) + Merge Cond: ("outer".disease_id = +"inner".disease_id) + -> Index Scan using disease_pkey on disease + (cost=0.00..6519.14 rows=129923 width=37) (actual time=0.04..742.20 +rows=129872 loops=1) + -> Sort (cost=119314.93..119329.45 +rows=5809 width=20) (actual time=6723.74..6740.24 rows=30513 loops=1) + Sort Key: disease_occurrences.disease_id + -> Nested Loop (cost=0.00..118951.78 +rows=5809 width=20) (actual time=1.19..6558.67 rows=30513 loops=1) + -> Index Scan using +gene_occ_id_i on gene_occurrences (cost=0.00..15700.31 rows=4039 +width=8) (actual time=0.36..1404.64 rows=110637 loops=1) + Index Cond: (gene_id = $0) + -> Index Scan using +disease_occ_uni on disease_occurrences (cost=0.00..25.47 rows=8 +width=12) (actual time=0.04..0.04 rows=0 loops=110637) + Index Cond: +("outer".sentence_id = disease_occurrences.sentence_id) + Total runtime: 8086.87 msec +(20 rows) + + +strangely, the estimation is far worse after running vacuum analyze +again with a default_statistics_target of 1000: + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Sort (cost=12521.37..12521.61 rows=96 width=57) (actual +time=124967.47..124968.47 rows=3364 loops=1) + Sort Key: count(disease.disease_name) + InitPlan + -> Index Scan using gene_uni on gene (cost=0.00..5.26 rows=1 +width=4) (actual time=20.27..20.28 rows=1 loops=1) + Index Cond: (gene_name = 'igg'::text) + -> Aggregate (cost=12510.99..12518.20 rows=96 width=57) (actual +time=124788.71..124956.77 rows=3364 loops=1) + -> Group (cost=12510.99..12515.80 rows=961 width=57) (actual +time=124788.68..124920.10 rows=30513 loops=1) + -> Sort (cost=12510.99..12513.39 rows=961 width=57) +(actual time=124788.66..124804.74 rows=30513 loops=1) + Sort Key: disease.disease_name + -> Nested Loop (cost=0.00..12463.35 rows=961 +width=57) (actual time=164.11..124529.76 rows=30513 loops=1) + -> Nested Loop (cost=0.00..6671.06 +rows=961 width=20) (actual time=148.34..120295.52 rows=30513 loops=1) + -> Index Scan using gene_occ_id_i on +gene_occurrences (cost=0.00..2407.09 rows=602 width=8) (actual +time=20.63..1613.99 rows=110637 loops=1) + Index Cond: (gene_id = $0) + -> Index Scan using disease_occ_uni +on disease_occurrences (cost=0.00..7.06 rows=2 width=12) (actual +time=1.07..1.07 rows=0 loops=110637) + Index Cond: ("outer".sentence_id += disease_occurrences.sentence_id) + -> Index Scan using disease_pkey on disease + (cost=0.00..6.01 rows=1 width=37) (actual time=0.13..0.13 rows=1 +loops=30513) + Index Cond: ("outer".disease_id = +disease.disease_id) + Total runtime: 124981.15 msec +(18 rows) + +There again is the estimation of 961 rows and the decision to choose a +Nested Loop while the actual result includes 30513 rows. + + +Thank you for taking the time to read my postings! +Chantal + + + +Josh Berkus wrote: +> Chantal, +> +> +>>Sort Key: disease.disease_name, disease_occurrences.sentence_id +>>-> Nested Loop (cost=0.00..6922.38 rows=98 width=64) (actual +>>time=61.49..275047.46 rows=18910 loops=1) +>> -> Nested Loop (cost=0.00..6333.23 rows=98 width=28) (actual +>>time=61.42..274313.87 rows=18910 loops=1) +>> -> Nested Loop (cost=0.00..5894.04 rows=64 width=16) (actual +>>time=32.00..120617.26 rows=46849 loops=1) +>> +>>I tried to tweak the conf settings, but I think I already reached +>>quite a good value concerning shared buffers and sort mem. the +>>database is vacuum full analyzed. indexes seem fine. +> +> +> You *sure* that you've vacuum analyzed recently? The planner above is +> choosing a bad plan because its row estimates are way off ... if the +> subquery was actually returning 98 rows, the plan above would make +> sense ... but with 18,000 rows being returned, a Nested Loop is +> suicidal. +> +> Perhaps you could post the full text of the query? If some of your +> criteria are coming from volatile functions, then that could explain +> why the planner is so far off ... +> +> -Josh Berkus +> +> + + +From pgsql-jdbc-owner@postgresql.org Mon Feb 17 13:40:26 2003 +X-Original-To: pgsql-jdbc@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id A33CE475461; Mon, 17 Feb 2003 05:59:32 -0500 (EST) +Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) + by postgresql.org (Postfix) with ESMTP + id 13D1A474E53; Mon, 17 Feb 2003 05:59:32 -0500 (EST) +Received: from klaster.net (pq197.krakow.cvx.ppp.tpnet.pl [213.76.41.197]) + by serwer.skawsoft.com.pl (Postfix) with ESMTP + id 260802B887; Mon, 17 Feb 2003 11:50:45 +0100 (CET) +Message-ID: <3E50C071.3090806@klaster.net> +Date: Mon, 17 Feb 2003 11:58:57 +0100 +From: Tomasz Myrta +User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; PL; rv:1.1) Gecko/20020826 +X-Accept-Language: pl, en-us, en +MIME-Version: 1.0 +To: Rafal Kedziorski +Cc: pgsql-jdbc@postgresql.org, pgsql-performance@postgresql.org +Subject: Re: [PERFORM] Good performance? +References: <5.2.0.9.0.20030216232710.01b40810@mail.polonium.de> + <3E5068CD.4050909@xythos.com> <3E50A78D.9000806@polonium.de> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/249 +X-Sequence-Number: 6420 + +Rafal Kedziorski wrote: + +> after set autocommit false, I need 0,9 - 1,04 seconds for insert 1000 +> new entries into my table. is this normal, that autocommit false is +> 40-50 times slower? +> +> +> Rafal +It is possible when you have "fsync=false" in your postgresql.conf. +(don't change it if you don't have to). +Regards, +Tomasz Myrta + + +From pgsql-jdbc-owner@postgresql.org Mon Feb 17 06:23:48 2003 +X-Original-To: pgsql-jdbc@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 6948947580B; Mon, 17 Feb 2003 06:23:46 -0500 (EST) +Received: from trill.maridan.net (unknown [217.6.52.210]) + by postgresql.org (Postfix) with ESMTP + id B775B475461; Mon, 17 Feb 2003 06:23:44 -0500 (EST) +Received: from polonium.de ([212.121.156.162]) + by trill.maridan.net (8.9.3/8.9.3) with ESMTP id MAA32251; + Mon, 17 Feb 2003 12:23:46 +0100 +Message-ID: <3E50C6A2.2000504@polonium.de> +Date: Mon, 17 Feb 2003 12:25:22 +0100 +From: Rafal Kedziorski +Organization: POLONIUM +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; + rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Cc: pgsql-jdbc@postgresql.org +Subject: Re: [PERFORM] Good performance? +References: <5.2.0.9.0.20030216232710.01b40810@mail.polonium.de> + <3E5068CD.4050909@xythos.com> <3E50A78D.9000806@polonium.de> + <3E50C071.3090806@klaster.net> +In-Reply-To: <3E50C071.3090806@klaster.net> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/243 +X-Sequence-Number: 6414 + +Tomasz Myrta wrote: + +> Rafal Kedziorski wrote: +> +> +>> after set autocommit false, I need 0,9 - 1,04 seconds for insert 1000 +>> new entries into my table. is this normal, that autocommit false is +>> 40-50 times slower? +>> +>> +>> Rafal +> +> It is possible when you have "fsync=false" in your postgresql.conf. +> (don't change it if you don't have to). + +fsync is: +#fsync = true + +but there are my new start options: postmaster -i -o -F -D ... + +after set fsync false I get this Performance for creating new entries +with entity beans: + +needed 9223 for creating 1000 entries + +instead of about 50.000 milliseconds. it's possible to make it faster? + + +Rafal + +> Regards, + +> Tomasz Myrta + + + +From pgsql-performance-owner@postgresql.org Mon Feb 17 07:26:26 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 8A9D5475A7F; Mon, 17 Feb 2003 07:26:24 -0500 (EST) +Received: from grunt21.ihug.com.au (grunt21.ihug.com.au [203.109.249.141]) + by postgresql.org (Postfix) with ESMTP + id C3663475A5C; Mon, 17 Feb 2003 07:26:23 -0500 (EST) +Received: from p341-tnt1.adl.ihug.com.au (postgresql.org) [203.173.255.87] + by grunt21.ihug.com.au with esmtp (Exim 3.35 #1 (Debian)) + id 18kkLo-0001mB-00; Mon, 17 Feb 2003 23:26:24 +1100 +Message-ID: <3E50D539.8030501@postgresql.org> +Date: Mon, 17 Feb 2003 22:57:37 +1030 +From: Justin Clift +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; + rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Rafal Kedziorski +Cc: pgsql-performance@postgresql.org, pgsql-jdbc@postgresql.org +Subject: Re: [JDBC] Good performance? +References: <5.2.0.9.0.20030216232710.01b40810@mail.polonium.de> + <3E5068CD.4050909@xythos.com> <3E50A78D.9000806@polonium.de> + <3E50C071.3090806@klaster.net> <3E50C6A2.2000504@polonium.de> +In-Reply-To: <3E50C6A2.2000504@polonium.de> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/107 +X-Sequence-Number: 1163 + +Rafal Kedziorski wrote: + +> instead of about 50.000 milliseconds. it's possible to make it faster? + +Hi Rafal, + +Have you tuned the memory settings of PostgreSQL yet? + +Regards and best wishes, + +Justin Clift + +> Rafal + +-- +"My grandfather once told me that there are two kinds of people: those +who work and those who take the credit. He told me to try to be in the +first group; there was less competition there." +- Indira Gandhi + + +From pgsql-jdbc-owner@postgresql.org Mon Feb 17 07:42:02 2003 +X-Original-To: pgsql-jdbc@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 90E67474E53; Mon, 17 Feb 2003 07:42:00 -0500 (EST) +Received: from trill.maridan.net (unknown [217.6.52.210]) + by postgresql.org (Postfix) with ESMTP + id 23985474E42; Mon, 17 Feb 2003 07:41:59 -0500 (EST) +Received: from polonium.de ([212.121.156.162]) + by trill.maridan.net (8.9.3/8.9.3) with ESMTP id NAA05874; + Mon, 17 Feb 2003 13:42:01 +0100 +Message-ID: <3E50D8F9.2080000@polonium.de> +Date: Mon, 17 Feb 2003 13:43:37 +0100 +From: Rafal Kedziorski +Organization: POLONIUM +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; + rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Cc: pgsql-jdbc@postgresql.org +Subject: Re: [PERFORM] Good performance? +References: <5.2.0.9.0.20030216232710.01b40810@mail.polonium.de> + <3E5068CD.4050909@xythos.com> <3E50A78D.9000806@polonium.de> + <3E50C071.3090806@klaster.net> <3E50C6A2.2000504@polonium.de> + <3E50D539.8030501@postgresql.org> +In-Reply-To: <3E50D539.8030501@postgresql.org> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/244 +X-Sequence-Number: 6415 + +Justin Clift wrote: + +> Rafal Kedziorski wrote: +> +> +>> instead of about 50.000 milliseconds. it's possible to make it faster? +> +> +> Hi Rafal, +> +> Have you tuned the memory settings of PostgreSQL yet? + +I'm working on it. + + +Rafal + +> Regards and best wishes, +> +> Justin Clift + + + +From pgsql-performance-owner@postgresql.org Mon Feb 17 11:22:09 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 419B4474E53 + for ; + Mon, 17 Feb 2003 11:22:08 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 9AA47474E42 + for ; + Mon, 17 Feb 2003 11:22:07 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1HGLu5u009094; + Mon, 17 Feb 2003 11:21:57 -0500 (EST) +To: Chantal Ackermann +Cc: Josh Berkus , pgsql-performance@postgresql.org +Subject: Re: cost and actual time +In-reply-to: <3E50BECC.9090107@biomax.de> +References: <3E50BECC.9090107@biomax.de> +Comments: In-reply-to Chantal Ackermann + message dated "Mon, 17 Feb 2003 11:51:56 +0100" +Date: Mon, 17 Feb 2003 11:21:56 -0500 +Message-ID: <9093.1045498916@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/109 +X-Sequence-Number: 1165 + +Chantal Ackermann writes: +> the gene_id for 'igg' occurres 110637 times in gene_occurrences, it is +> the most frequent. + +I think the problem here is that the planner doesn't know that (and +probably can't without some kind of cross-table statistics apparatus). +It's generating a plan based on the average frequency of gene_ids, which +is a loser for this outlier. + +Probably the most convenient way to do better is to structure things so +that the reduction from gene name to gene_id is done before the planner +starts to develop a plan. Instead of joining to gene, consider this: + +create function get_gene_id (text) returns int as -- adjust types as needed +'select gene_id from gene where gene_name = $1' language sql +immutable strict; -- in 7.2, instead say "with (isCachable, isStrict)" + +EXPLAIN ANALYZE +SELECT tmp.disease_name, count(tmp.disease_name) AS cnt + FROM (SELECT DISTINCT disease.disease_name, +disease_occurrences.sentence_id FROM disease, gene_occurrences, +disease_occurrences + WHERE + gene_occurrences.sentence_id=disease_occurrences.sentence_id + AND get_gene_id('igg')=gene_occurrences.gene_id + AND disease.disease_id=disease_occurrences.disease_id) AS tmp +GROUP BY tmp.disease_name +ORDER BY cnt DESC; + +Now get_gene_id() isn't really immutable (unless you never change the +gene table) but you have to lie and pretend that it is, so that the +function call will be constant-folded during planner startup. The +planner will then see something like gene_occurrences.gene_id = 42 +and it will have a much better shot at determining the number of rows +this matches. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Mon Feb 17 11:49:52 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id C7F70474E53 + for ; + Mon, 17 Feb 2003 11:49:50 -0500 (EST) +Received: from email05.aon.at (WARSL402PIP5.highway.telekom.at [195.3.96.79]) + by postgresql.org (Postfix) with SMTP id E684B474E42 + for ; + Mon, 17 Feb 2003 11:49:49 -0500 (EST) +Received: (qmail 270662 invoked from network); 17 Feb 2003 16:49:53 -0000 +Received: from m155p008.dipool.highway.telekom.at (HELO cantor) ([62.46.9.72]) + (envelope-sender ) + by qmail5rs.highway.telekom.at (qmail-ldap-1.03) with SMTP + for ; 17 Feb 2003 16:49:53 -0000 +From: Manfred Koizar +To: Chantal Ackermann +Cc: Josh Berkus , pgsql-performance@postgresql.org +Subject: Re: cost and actual time +Date: Mon, 17 Feb 2003 17:49:16 +0100 +Message-ID: +References: <3E50BECC.9090107@biomax.de> +In-Reply-To: <3E50BECC.9090107@biomax.de> +X-Mailer: Forte Agent 1.8/32.548 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/110 +X-Sequence-Number: 1166 + +On Mon, 17 Feb 2003 11:51:56 +0100, Chantal Ackermann + wrote: +>the gene_id for 'igg' occurres 110637 times in gene_occurrences, it is +>the most frequent. + +Chantal, could you try + +EXPLAIN ANALYZE +SELECT tmp.disease_name, count(tmp.disease_name) AS cnt + FROM (SELECT DISTINCT dd.disease_name, d_o.sentence_id + FROM disease d, + gene_occurrences g_o, + disease_occurrences d_o + WHERE g_o.sentence_id=d_o.sentence_id + AND g_o.gene_id=4711 + AND d.disease_id=d_o.disease_id) AS tmp + GROUP BY tmp.disease_name + ORDER BY cnt DESC; + +replacing 4711 by the result of + SELECT gene_id FROM gene WHERE gene_name='igg' + +and show us the plan you get? + +Servus + Manfred + +From pgsql-jdbc-owner@postgresql.org Mon Feb 17 12:50:26 2003 +X-Original-To: pgsql-jdbc@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 6B35D474E53; Mon, 17 Feb 2003 12:50:25 -0500 (EST) +Received: from mail.xythos.com (ip-216-36-77-241.dsl.sjc.megapath.net + [216.36.77.241]) by postgresql.org (Postfix) with ESMTP + id A96BC474E42; Mon, 17 Feb 2003 12:50:23 -0500 (EST) +Received: from ravms by mail.xythos.com with mail-ok (Exim 3.36 #3) + id 18kpPP-0007Y3-00; Mon, 17 Feb 2003 17:50:27 +0000 +Received: from ip-216-36-77-241.dsl.sjc.megapath.net ([216.36.77.241] + helo=xythos.com) by mail.xythos.com with asmtp (Exim 3.36 #3) + id 18kpPO-0007Xs-00; Mon, 17 Feb 2003 17:50:26 +0000 +Message-ID: <3E5120E2.30401@xythos.com> +Date: Mon, 17 Feb 2003 09:50:26 -0800 +From: Barry Lind +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Rafal Kedziorski +Cc: pgsql-jdbc@postgresql.org, pgsql-performance@postgresql.org +Subject: Re: Good performance? +References: <5.2.0.9.0.20030216232710.01b40810@mail.polonium.de> + <3E5068CD.4050909@xythos.com> <3E50A78D.9000806@polonium.de> +In-Reply-To: <3E50A78D.9000806@polonium.de> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Envelope-To: rafcio@polonium.de, pgsql-jdbc@postgresql.org, + pgsql-performance@postgresql.org +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/246 +X-Sequence-Number: 6417 + +Rafal, + +I would expect things to be slower with a commit after each insert, +since it is the commit that forces the data to be written to disk. +However 50x seems a bit much and I think is due to cygwin performance. + +I ran your code on my laptop running RH7.3 and get the following results: + +Running with autocommit on: +InsertFirmSQLInt8() needed 5129 for creating 1000 entries +InsertFirmSQLInt8() needed 5417 for creating 1000 entries +InsertFirmSQLInt8() needed 4976 for creating 1000 entries +InsertFirmSQLInt8() needed 4162 for creating 1000 entries + +Running with autocommit off: +InsertFirmSQLInt8() needed 1250 for creating 1000 entries +InsertFirmSQLInt8() needed 932 for creating 1000 entries +InsertFirmSQLInt8() needed 1000 for creating 1000 entries +InsertFirmSQLInt8() needed 1321 for creating 1000 entries +InsertFirmSQLInt8() needed 1248 for creating 1000 entries + +On linux I see about a 5x slowdown which is more in line with what I +would expect. + +thanks, +--Barry + + +Rafal Kedziorski wrote: +> hi, +> +> Barry Lind wrote: +> +>> Rafal, +>> +>> Performance of postgres running under cygwin isn't great. Can you try +>> the same test on a different platform? It also looks like you are +>> running in autocommit mode. You should see a significant performance +>> improvement if you batch your commits in say groups of 1000 inserts +>> per commit. +> +> +> after set autocommit false, I need 0,9 - 1,04 seconds for insert 1000 +> new entries into my table. is this normal, that autocommit false is +> 40-50 times slower? +> +> +> Rafal +> +>> thanks, +>> --Barry +> +> +> +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org +> + + + +From pgsql-jdbc-owner@postgresql.org Tue Feb 18 12:35:21 2003 +X-Original-To: pgsql-jdbc@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 95366474E53; Mon, 17 Feb 2003 15:04:35 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP + id CA45E474E42; Mon, 17 Feb 2003 15:04:34 -0500 (EST) +Received: from [66.219.92.2] (HELO chocolate-mousse) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2843978; Mon, 17 Feb 2003 12:04:41 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Reply-To: josh@agliodbs.com +Organization: Aglio Database Solutions +To: Tomasz Myrta , + Rafal Kedziorski +Subject: Re: [PERFORM] Good performance? +Date: Mon, 17 Feb 2003 12:03:58 -0800 +X-Mailer: KMail [version 1.4] +Cc: pgsql-jdbc@postgresql.org, pgsql-performance@postgresql.org +References: <5.2.0.9.0.20030216232710.01b40810@mail.polonium.de> + <3E50A78D.9000806@polonium.de> <3E50C071.3090806@klaster.net> +In-Reply-To: <3E50C071.3090806@klaster.net> +MIME-Version: 1.0 +Content-Transfer-Encoding: quoted-printable +Message-Id: <200302171203.58611.josh@agliodbs.com> +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/257 +X-Sequence-Number: 6428 + +Rafal, Tomasz, + +> It is possible when you have "fsync=3Dfalse" in your postgresql.conf.=20 +> (don't change it if you don't have to). + +You should NOT turn off fsync unless you know what you are doing. With fsy= +nc=20 +off, your database can be unrecoverably corrupted after an unexpected=20 +power-out, and you will be forced to restore from your last backup. + +--=20 +-Josh Berkus + Aglio Database Solutions + San Francisco + + +From pgsql-advocacy-owner@postgresql.org Mon Feb 17 21:49:49 2003 +X-Original-To: pgsql-advocacy@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 4B244474E42; Mon, 17 Feb 2003 21:49:48 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP + id 79C2047580B; Mon, 17 Feb 2003 21:49:46 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h1I2nVW06457; + Mon, 17 Feb 2003 21:49:31 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302180249.h1I2nVW06457@candle.pha.pa.us> +Subject: Re: [HACKERS] Changing the default configuration (was Re: +In-Reply-To: <200302130612.h1D6CHc14823@candle.pha.pa.us> +To: Bruce Momjian +Date: Mon, 17 Feb 2003 21:49:31 -0500 (EST) +Cc: Peter Eisentraut , Tom Lane , + Merlin Moncure , + PostgresSQL Hackers Mailing List , + pgsql-advocacy@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 AMaViS new-20020517 +X-Archive-Number: 200302/86 +X-Sequence-Number: 844 + + +People seemed to like the idea: + + Add a script to ask system configuration questions and tune + postgresql.conf. + + +--------------------------------------------------------------------------- + +Bruce Momjian wrote: +> Peter Eisentraut wrote: +> > Tom Lane writes: +> > +> > > Well, as I commented later in that mail, I feel that 1000 buffers is +> > > a reasonable choice --- but I have to admit that I have no hard data +> > > to back up that feeling. +> > +> > I know you like it in that range, and 4 or 8 MB of buffers by default +> > should not be a problem. But personally I think if the optimal buffer +> > size does not depend on both the physical RAM you want to dedicate to +> > PostgreSQL and the nature and size of the database, then we have achieved +> > a medium revolution in computer science. ;-) +> +> I have thought about this and I have an idea. Basically, increasing the +> default values may get us closer, but it will discourage some to tweek, +> and it will cause problems with some OS's that have small SysV params. +> +> So, my idea is to add a message at the end of initdb that states people +> should run the pgtune script before running a production server. +> +> The pgtune script will basically allow us to query the user, test the OS +> version and perhaps parameters, and modify postgresql.conf with +> reasonable values. I think this is the only way to cleanly get folks +> close to where they should be. +> +> For example, we can ask them how many rows and tables they will be +> changing, on average, between VACUUM runs. That will allow us set the +> FSM params. We can ask them about using 25% of their RAM for shared +> buffers. If they have other major apps running on the server or have +> small tables, we can make no changes. We can basically ask them +> questions and use that info to set values. +> +> We can even ask about sort usage maybe and set sort memory. We can even +> control checkpoint_segments this way if they say they will have high +> database write activity and don't worry about disk space usage. We may +> even be able to compute some random page cost estimate. +> +> Seems a script is going to be the best way to test values and assist +> folks in making reasonable decisions about each parameter. Of course, +> they can still edit the file, and we can ask them if they want +> assistance to set each parameter or leave it alone. +> +> I would restrict the script to only deal with tuning values, and tell +> people they still need to review that file for other useful parameters. +> +> Another option would be to make a big checklist or web page that asks +> such questions and computes proper values, but it seems a script would +> be easiest. We can even support '?' which would explain why the +> question is being ask and how it affects the value. +> +> -- +> 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 +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 1: subscribe and unsubscribe commands go to majordomo@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 Feb 18 00:16:07 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 16027475A1F; Tue, 18 Feb 2003 00:16:03 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP + id 6C7FF475957; Tue, 18 Feb 2003 00:16:01 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h1I5Fhc18116; + Tue, 18 Feb 2003 00:15:43 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302180515.h1I5Fhc18116@candle.pha.pa.us> +Subject: Re: [HACKERS] WAL replay logic (was Re: Mount options for +In-Reply-To: +To: Curt Sampson +Date: Tue, 18 Feb 2003 00:15:43 -0500 (EST) +Cc: Kevin Brown , + pgsql-performance@postgresql.org, 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 AMaViS new-20020517 +X-Archive-Number: 200302/113 +X-Sequence-Number: 1169 + + +Added to TODO: + + * Allow WAL information to recover corrupted pg_controldata + +--------------------------------------------------------------------------- + +Curt Sampson wrote: +> On Fri, 14 Feb 2003, Bruce Momjian wrote: +> +> > Is there a TODO here, like "Allow recovery from corrupt pg_control via +> > WAL"? +> +> Isn't that already in section 12.2.1 of the documentation? +> +> Using pg_control to get the checkpoint position speeds up the +> recovery process, but to handle possible corruption of pg_control, +> we should actually implement the reading of existing log segments +> in reverse order -- newest to oldest -- in order to find the last +> checkpoint. This has not been implemented, yet. +> +> cjs +> -- +> Curt Sampson +81 90 7737 2974 http://www.netbsd.org +> Don't you know, in this new Dark Age, we're all light. --XTC +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 1: subscribe and unsubscribe commands go to majordomo@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-hackers-owner@postgresql.org Tue Feb 18 00:26:47 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 19D67474E53 + for ; + Tue, 18 Feb 2003 00:26:45 -0500 (EST) +Received: from platonic.cynic.net (platonic.cynic.net [204.80.150.245]) + by postgresql.org (Postfix) with ESMTP id 6EBDC474E42 + for ; + Tue, 18 Feb 2003 00:26:44 -0500 (EST) +Received: from angelic.cynic.net (angelic-platonic.cvpn.cynic.net + [198.73.220.226]) by platonic.cynic.net (Postfix) with ESMTP + id CFABDBFF8; Tue, 18 Feb 2003 05:26:48 +0000 (UTC) +Received: from localhost (localhost [127.0.0.1]) + by angelic.cynic.net (Postfix) with ESMTP + id 8B2578736; Tue, 18 Feb 2003 14:26:46 +0900 (JST) +Date: Tue, 18 Feb 2003 14:26:46 +0900 (JST) +From: Curt Sampson +X-X-Sender: cjs@angelic-vtfw.cvpn.cynic.net +To: Bruce Momjian +Cc: pgsql-hackers@postgresql.org +Subject: Re: WAL replay logic (was Re: [PERFORM] Mount options for +In-Reply-To: <200302180515.h1I5Fhc18116@candle.pha.pa.us> +Message-ID: +References: <200302180515.h1I5Fhc18116@candle.pha.pa.us> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/963 +X-Sequence-Number: 35904 + +On Tue, 18 Feb 2003, Bruce Momjian wrote: + +> +> Added to TODO: +> +> * Allow WAL information to recover corrupted pg_controldata +>... +> > Using pg_control to get the checkpoint position speeds up the +> > recovery process, but to handle possible corruption of pg_control, +> > we should actually implement the reading of existing log segments +> > in reverse order -- newest to oldest -- in order to find the last +> > checkpoint. This has not been implemented, yet. + +So if you do this, do you still need to store that information in +pg_control at all? + +cjs +-- +Curt Sampson +81 90 7737 2974 http://www.netbsd.org + Don't you know, in this new Dark Age, we're all light. --XTC + +From pgsql-performance-owner@postgresql.org Tue Feb 18 05:29:59 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id EA9C7474E44 + for ; + Tue, 18 Feb 2003 05:29:57 -0500 (EST) +Received: from biomax.de (unknown [212.6.137.236]) + by postgresql.org (Postfix) with ESMTP id 516F0474E42 + for ; + Tue, 18 Feb 2003 05:29:56 -0500 (EST) +Received: from biomax.de (guffert.biomax.de [192.168.3.166]) + by biomax.de (8.8.8/8.8.8) with ESMTP id LAA00677; + Tue, 18 Feb 2003 11:28:29 +0100 +Message-ID: <3E520AD8.2000304@biomax.de> +Date: Tue, 18 Feb 2003 11:28:40 +0100 +From: Chantal Ackermann +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Manfred Koizar +Cc: Josh Berkus , + pgsql-performance@postgresql.org, tgl@sss.pgh.pa.us +Subject: Re: cost and actual time +References: <3E50BECC.9090107@biomax.de> + +In-Reply-To: +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/114 +X-Sequence-Number: 1170 + +hello Manfred, hello Josh, hello Tom, + +I followed your advices. Using the new query with explicit joins, +combined with the function that retrieves the gene_id, the estimated row +count is now far more realistic. Still, the same query using different +gene names takes sometimes less than a second, sometimes several +minutes, obviously due to (not) caching. In the resulting query plan, +there are still a Seq Scan, a Nested Loop and a Hash Join that take up +most of the cost. + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +In details: + +I have created the following function: +CREATE OR REPLACE FUNCTION get_gene_id(TEXT) RETURNS INT AS + 'SELECT gene_id FROM gene WHERE gene_name = $1' +LANGUAGE SQL +IMMUTABLE STRICT; + +Then I ran some queries with explain/explain analyze. For example: + +1. the old query, leaving out the table gene and setting +gene_occurrences.gene_id to a certain gene_id, or the function +get_gene_id, respectively. (This is the query you suggested, Manfred.) + +EXPLAIN ANALYZE + SELECT tmp.disease_name, count(tmp.disease_name) AS cnt + FROM + (SELECT DISTINCT disease.disease_name, + disease_occurrences.sentence_id + FROM disease, gene_occurrences, disease_occurrences + WHERE gene_occurrences.sentence_id=disease_occurrences.sentence_id + AND gene_occurrences.gene_id=get_gene_id('igm') + AND disease.disease_id=disease_occurrences.disease_id) AS tmp +GROUP BY tmp.disease_name ORDER BY cnt DESC; + +'igm' occures about 54.000 times in gene_occurrences. + + QUERY PLAN + +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Sort (cost=308065.26..308069.67 rows=882 width=57) (actual +time=53107.46..53108.13 rows=2326 loops=1) + Sort Key: count(disease_name) + -> Aggregate (cost=307846.61..307978.94 rows=882 width=57) (actual +time=53011.97..53100.58 rows=2326 loops=1) + -> Group (cost=307846.61..307934.83 rows=8822 width=57) +(actual time=53011.94..53079.74 rows=16711 loops=1) + -> Sort (cost=307846.61..307890.72 rows=8822 width=57) +(actual time=53011.93..53020.32 rows=16711 loops=1) + Sort Key: disease_name + -> Subquery Scan tmp (cost=305367.08..306690.35 +rows=8822 width=57) (actual time=52877.87..52958.72 rows=16711 loops=1) + -> Unique (cost=305367.08..306690.35 +rows=8822 width=57) (actual time=52877.85..52915.20 rows=16711 loops=1) + -> Sort (cost=305367.08..305808.17 +rows=88218 width=57) (actual time=52877.85..52886.47 rows=16711 loops=1) + Sort Key: disease.disease_name, +disease_occurrences.sentence_id + -> Hash Join +(cost=4610.17..290873.90 rows=88218 width=57) (actual +time=388.53..52752.92 rows=16711 loops=1) + Hash Cond: +("outer".disease_id = "inner".disease_id) + -> Nested Loop +(cost=0.00..282735.01 rows=88218 width=20) (actual time=0.25..52184.26 +rows=16711 loops=1) + -> Index Scan using +gene_occ_id_i on gene_occurrences (cost=0.00..57778.26 rows=54692 +width=8) (actual time=0.07..17455.52 rows=54677 loops=1) + Index Cond: +(gene_id = 70764) + -> Index Scan using +disease_occ_uni on disease_occurrences (cost=0.00..4.09 rows=2 +width=12) (actual time=0.63..0.63 rows=0 loops=54677) + Index Cond: +("outer".sentence_id = disease_occurrences.sentence_id) + -> Hash +(cost=2500.23..2500.23 rows=129923 width=37) (actual time=387.45..387.45 +rows=0 loops=1) + -> Seq Scan on +disease (cost=0.00..2500.23 rows=129923 width=37) (actual +time=0.02..207.71 rows=129923 loops=1) + Total runtime: 53118.81 msec +(20 rows) + +What takes up most of the runtime the Nested Loop (for the join of +disease and disease_occurrences, or rather for joining both occurrences +tables? I'm not sure which rows belong together in the explain output). + +The cost for 'igg' is higher: +estimation of pages by explain: 584729.76. +actual runtime: 693210.99 msec. +The query plan is the same. The Nested Loop takes up most of the runtime +(-> Nested Loop (cost=0.00..538119.44 rows=176211 width=20) (actual +time=0.28..691474.74 rows=30513 loops=1)) + + + +2. The new query, same changes (gene left out, subselect replaced with +get_gene_id): + +EXPLAIN ANALYZE + SELECT disease.disease_name, count(disease.disease_name) AS cnt + FROM + ((SELECT gene_occurrences.sentence_id + FROM gene_occurrences + WHERE gene_occurrences.gene_id=get_gene_id('csf')) AS tmp + JOIN disease_occurrences USING (sentence_id)) as tmp2 + NATURAL JOIN disease +GROUP BY disease.disease_name +ORDER BY cnt DESC; + +'csf' occurres about 55.000 times in gene_occurrences. + + QUERY PLAN + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Sort (cost=323834.95..323881.54 rows=9318 width=57) (actual +time=146975.89..146976.60 rows=2383 loops=1) + Sort Key: count(disease.disease_name) + -> Aggregate (cost=321208.63..322606.31 rows=9318 width=57) +(actual time=146840.89..146968.58 rows=2383 loops=1) + -> Group (cost=321208.63..322140.42 rows=93179 width=57) +(actual time=146840.87..146941.60 rows=24059 loops=1) + -> Sort (cost=321208.63..321674.53 rows=93179 +width=57) (actual time=146840.85..146852.92 rows=24059 loops=1) + Sort Key: disease.disease_name + -> Hash Join (cost=4485.78..305826.96 rows=93179 +width=57) (actual time=544.79..146651.05 rows=24059 loops=1) + Hash Cond: ("outer".disease_id = +"inner".disease_id) + -> Nested Loop (cost=0.00..297614.04 +rows=93179 width=20) (actual time=105.85..145936.47 rows=24059 loops=1) + -> Index Scan using gene_occ_id_i on +gene_occurrences (cost=0.00..60007.96 rows=57768 width=8) (actual +time=41.86..47116.68 rows=55752 loops=1) + Index Cond: (gene_id = 29877) + -> Index Scan using disease_occ_uni +on disease_occurrences (cost=0.00..4.09 rows=2 width=12) (actual +time=1.76..1.77 rows=0 loops=55752) + Index Cond: ("outer".sentence_id += disease_occurrences.sentence_id) + -> Hash (cost=2500.23..2500.23 rows=129923 +width=37) (actual time=438.16..438.16 rows=0 loops=1) + -> Seq Scan on disease +(cost=0.00..2500.23 rows=129923 width=37) (actual time=0.02..236.78 +rows=129923 loops=1) + Total runtime: 146986.12 msec +(16 rows) + +This query is obviously not as good as the old one, though I don't +understand where the explicit joins are worse than what the optimizer +choses. There is still the Nested Loop that takes up the biggest part. + +When I set enable_nestloop to false, explain outputs this plan: + +QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------- + Sort (cost=2146887.90..2146934.49 rows=9318 width=57) + Sort Key: count(disease.disease_name) + -> Aggregate (cost=2144261.59..2145659.27 rows=9318 width=57) + -> Group (cost=2144261.59..2145193.37 rows=93179 width=57) + -> Sort (cost=2144261.59..2144727.48 rows=93179 width=57) + Sort Key: disease.disease_name + -> Merge Join (cost=2122513.18..2128879.92 +rows=93179 width=57) + Merge Cond: ("outer".disease_id = +"inner".disease_id) + -> Index Scan using disease_pkey on disease + (cost=0.00..3388.03 rows=129923 width=37) + -> Sort (cost=2122513.18..2122979.08 +rows=93179 width=20) + Sort Key: disease_occurrences.disease_id + -> Merge Join +(cost=69145.63..2107131.52 rows=93179 width=20) + Merge Cond: ("outer".sentence_id += "inner".sentence_id) + -> Index Scan using +disease_occ_uni on disease_occurrences (cost=0.00..1960817.45 +rows=15079045 width=12) + -> Sort +(cost=69145.63..69434.47 rows=57768 width=8) + Sort Key: +gene_occurrences.sentence_id + -> Index Scan using +gene_occ_id_i on gene_occurrences (cost=0.00..60007.96 rows=57768 width=8) + Index Cond: (gene_id += 29877) +(18 rows) + +Most of the runtime is used up by the index scan to join the occurrences +tables, while the index scan for joining diesease and +disease_occurrences is fast. + + + + +At the moment my settings concering the query planner are: + +effective_cache_size = 80000 # typically 8KB each, default 1000 +random_page_cost = 1.5 # units are one sequential page fetch cost +cpu_tuple_cost = 0.01 # (same), default 0.01 +cpu_index_tuple_cost = 0.00001 # (same), default 0.001 +cpu_operator_cost = 0.005 # (same), default 0.0025 + + + +I am still having problems to read the output of explain, especially to +know which rows belong together, and what strategy applies to which +join. Is there some documentation that describes the format of explain, +other than the one in the main manual that comes with the postgres +installation? Just some short explanation or example on how to interpret +indents and arrows. + +Thank you for your help! +Chantal + + +From pgsql-performance-owner@postgresql.org Tue Feb 18 12:32:21 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 610CD47580B + for ; + Tue, 18 Feb 2003 12:32:20 -0500 (EST) +Received: from email02.aon.at (WARSL402PIP7.highway.telekom.at [195.3.96.94]) + by postgresql.org (Postfix) with SMTP id 7528E475458 + for ; + Tue, 18 Feb 2003 12:32:19 -0500 (EST) +Received: (qmail 325588 invoked from network); 18 Feb 2003 17:32:23 -0000 +Received: from m168p007.dipool.highway.telekom.at (HELO cantor) + ([62.46.10.231]) (envelope-sender ) + by qmail2rs.highway.telekom.at (qmail-ldap-1.03) with SMTP + for ; 18 Feb 2003 17:32:23 -0000 +From: Manfred Koizar +To: Chantal Ackermann +Cc: Josh Berkus , + pgsql-performance@postgresql.org, tgl@sss.pgh.pa.us +Subject: Re: cost and actual time +Date: Tue, 18 Feb 2003 18:31:48 +0100 +Message-ID: +References: <3E50BECC.9090107@biomax.de> + + <3E520AD8.2000304@biomax.de> +In-Reply-To: <3E520AD8.2000304@biomax.de> +X-Mailer: Forte Agent 1.8/32.548 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/115 +X-Sequence-Number: 1171 + +On Tue, 18 Feb 2003 11:28:40 +0100, Chantal Ackermann + wrote: +>1. the old query, leaving out the table gene and setting +>gene_occurrences.gene_id to a certain gene_id, or the function +>get_gene_id, respectively. (This is the query you suggested, Manfred.) + +This was Tom's suggestion. I might have ended up there in a day or +two :-) + +>What takes up most of the runtime the Nested Loop (for the join of +>disease and disease_occurrences, or rather for joining both occurrences +>tables? I'm not sure which rows belong together in the explain output). + +... for joining both occurrences: The "-> Nested Loop" takes two +tables (the "-> Index Scans") as input and produces one table as +output which is again used as input for the "-> Hash Join" above it. + +>2. The new query, same changes (gene left out, subselect replaced with +>get_gene_id): +> +>EXPLAIN ANALYZE +> SELECT disease.disease_name, count(disease.disease_name) AS cnt +> FROM +> ((SELECT gene_occurrences.sentence_id +> FROM gene_occurrences +> WHERE gene_occurrences.gene_id=get_gene_id('csf')) AS tmp +> JOIN disease_occurrences USING (sentence_id)) as tmp2 +> NATURAL JOIN disease +>GROUP BY disease.disease_name +>ORDER BY cnt DESC; + +There is no DISTINCT here. This is equvalent to your first query, iff +the following unique constraints are true: + (gene_id, sentence_id) in gene_occurrences + (disease_id, sentence_id) in disease_occurrences + (disease_id) in disease + +If they are, you don't need a sub-select (unless I'm missing +something, please double-check): + +EXPLAIN ANALYZE + SELECT disease.disease_name, count(*) AS cnt + FROM disease, gene_occurrences, disease_occurrences + WHERE gene_occurrences.sentence_id=disease_occurrences.sentence_id + AND gene_occurrences.gene_id=get_gene_id('igm') + AND disease.disease_id=disease_occurrences.disease_id + GROUP BY tmp.disease_name + ORDER BY cnt DESC; + +Anyway, your problem boils down to + +EXPLAIN ANALYZE + SELECT d.disease_id, d.sentence_id + FROM gene_occurrences g, disease_occurrences d + WHERE g.sentence_id = d.sentence_id + AND g.gene_id = 'some constant value'; + +Play with enable_xxxx to find out which join method provides the best +performance for various gene_ids. Then we can start to fiddle with +run-time parameters to help the optimizer choose the right plan. + +>Most of the runtime is used up by the index scan to join the occurrences +>tables [...] +> +>At the moment my settings concering the query planner are: +> +>effective_cache_size = 80000 # typically 8KB each, default 1000 +>random_page_cost = 1.5 # units are one sequential page fetch cost + +Usually you set a low random_page_cost value (the default is 4) if you +want to favour index scans where the optimizer tends to use sequential +scans. Was this your intention? + +>cpu_tuple_cost = 0.01 # (same), default 0.01 +>cpu_index_tuple_cost = 0.00001 # (same), default 0.001 +>cpu_operator_cost = 0.005 # (same), default 0.0025 + +Just out of curiosity: Are these settings based on prior experience? + +Servus + Manfred + +From pgsql-performance-owner@postgresql.org Tue Feb 18 12:38:17 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 86600475843; Tue, 18 Feb 2003 12:38:16 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP + id CEE6947580B; Tue, 18 Feb 2003 12:38:15 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2845476; Tue, 18 Feb 2003 09:38:27 -0800 +Content-Type: text/plain; + charset="us-ascii" +From: Josh Berkus +Organization: Aglio Database Solutions +To: pgsql-hackers@postgresql.org, pgsql-performance@postgresql.org +Subject: Re: Questions about indexes? +Date: Tue, 18 Feb 2003 09:37:20 -0800 +User-Agent: KMail/1.4.3 +Cc: rbradetich@uswest.net +MIME-Version: 1.0 +Message-Id: <200302180937.21001.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/116 +X-Sequence-Number: 1172 + +Ryan, + +I am crossing this discussion to the PGSQL-PERFORMANCE list, which is the= +=20 +proper place for it. Anyone interested, please follow us there! + +>>>Ryan Bradetich said: + > the table would look like: + > 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user x has an invalid shell. + > 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user y has an invalid shell. + > 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user y has expired password. + > 2 | Mon Feb 17 00:34:24 MST 2003 | f101 | file /foo has improper owner. + > etc... + >=20 + > So I do not need the anomaly to be part of the index, I only need it to= +=20 + >=20 + > I agree with you, that I would not normally add the anomally to the + > index, except for the unique row requirement. Thinking about it now, + > maybe I should guarentee unique rows via a check constraint... + >=20 + > Thanks for making me think about this in a different way! + +First off, I'm not clear on why a duplicate anominaly would be necessarily= +=20 +invalid, given the above. Not useful, certainly, but legitimate real data. + +I realize that you have performance considerations to work with. However, = +I=20 +must point out that your database design is not *at all* normalized ... and= +=20 +that normalizing it might solve some of your indexing problems. + +A normalized structure would look something like: + +TABLE operations=20 + id serial not null primary key, + host_id int not null, + timeoccurred timestamp not null default now(), + category varchar(5) not null, + constraint operations_unq unique (host_id, timeoccurred, category) + +TABLE anominalies + id serial not null primary key, + operation_id int not null references operations(id) on delete cascade, + anominaly text + +This structure would have two advantages for you: +1) the operations table would be *much* smaller than what you have now, as = +you=20 +would not be repeating rows for each anominaly.=20 +2) In neither table would you be including the anominaly text in an index .= +..=20 +thus reducing index size tremendously. + +As a warning, though: you may find that for insert speed the referential= +=20 +integrity key is better maintained at the middleware layer. We've had som= +e=20 +complaints about slow FK enforcement in Postgres. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-hackers-owner@postgresql.org Tue Feb 18 14:09:35 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 404E04759BD + for ; + Tue, 18 Feb 2003 14:09:35 -0500 (EST) +Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) + by postgresql.org (Postfix) with ESMTP id F1978475957 + for ; + Tue, 18 Feb 2003 14:09:33 -0500 (EST) +Received: (from pgman@localhost) + by candle.pha.pa.us (8.11.6/8.10.1) id h1IJ8Ge19074; + Tue, 18 Feb 2003 14:08:16 -0500 (EST) +From: Bruce Momjian +Message-Id: <200302181908.h1IJ8Ge19074@candle.pha.pa.us> +Subject: Re: WAL replay logic (was Re: [PERFORM] Mount options for +In-Reply-To: +To: Curt Sampson +Date: Tue, 18 Feb 2003 14:08:16 -0500 (EST) +Cc: 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 AMaViS new-20020517 +X-Archive-Number: 200302/989 +X-Sequence-Number: 35930 + + +Uh, not sure. Does it guard against corrupt WAL records? + +--------------------------------------------------------------------------- + +Curt Sampson wrote: +> On Tue, 18 Feb 2003, Bruce Momjian wrote: +> +> > +> > Added to TODO: +> > +> > * Allow WAL information to recover corrupted pg_controldata +> >... +> > > Using pg_control to get the checkpoint position speeds up the +> > > recovery process, but to handle possible corruption of pg_control, +> > > we should actually implement the reading of existing log segments +> > > in reverse order -- newest to oldest -- in order to find the last +> > > checkpoint. This has not been implemented, yet. +> +> So if you do this, do you still need to store that information in +> pg_control at all? +> +> cjs +> -- +> Curt Sampson +81 90 7737 2974 http://www.netbsd.org +> Don't you know, in this new Dark Age, we're all light. --XTC +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 5: Have you checked our extensive FAQ? +> +> http://www.postgresql.org/users-lounge/docs/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 Tue Feb 18 14:48:19 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 32324475925 + for ; + Tue, 18 Feb 2003 14:48:19 -0500 (EST) +Received: from hal.istation.com (hal.istation.com [65.120.151.132]) + by postgresql.org (Postfix) with ESMTP id B51C147592C + for ; + Tue, 18 Feb 2003 14:48:18 -0500 (EST) +Received: from sauron (sauron.istation.com [65.120.151.174]) (authenticated) + by hal.istation.com (8.11.6/8.11.6) with ESMTP id h1IJmHE20528 + for ; Tue, 18 Feb 2003 13:48:17 -0600 +Reply-To: +From: "Keith Bottner" +To: +Subject: Performance Baseline Script +Date: Tue, 18 Feb 2003 13:48:19 -0600 +Organization: istation.com +Message-ID: <001601c2d786$afd50d00$ae977841@istation.com> +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.3416 +In-reply-to: <200302180937.21001.josh@agliodbs.com> +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 +Importance: Normal +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/117 +X-Sequence-Number: 1173 + +Does there currently exist any kind of script that can be run on +Postgres to conduct a complete feature coverage test with varying +dataset sizes to compare performance between functionality changes? + +The interest of course is to get a baseline of performance and then to +see how manipulation of internal algorithms or vacuum frequency or WAL +logs being place on a separate physical disk affect the performance of +the various features with various dataset sizes. + +If not, how many people would be interested in such a script being +written? + +Keith Bottner +kbottner@istation.com + +"Vegetarian - that's an old Indian word meaning 'lousy hunter.'" - Andy +Rooney + + +From pgsql-performance-owner@postgresql.org Tue Feb 18 15:43:40 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 12BBC47580B + for ; + Tue, 18 Feb 2003 15:43:40 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 6BDB4475458 + for ; + Tue, 18 Feb 2003 15:43:39 -0500 (EST) +Received: from [216.135.165.74] (account ) + by davinci.ethosmedia.com (CommuniGate Pro WebUser 4.0.2) + with HTTP id 2845817; Tue, 18 Feb 2003 12:43:48 -0800 +From: "Josh Berkus" +Subject: Re: Performance Baseline Script +To: , +X-Mailer: CommuniGate Pro Web Mailer v.4.0.2 +Date: Tue, 18 Feb 2003 12:43:48 -0800 +Message-ID: +In-Reply-To: <001601c2d786$afd50d00$ae977841@istation.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset="ISO-8859-1" +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/118 +X-Sequence-Number: 1174 + +Keith, + +> Does there currently exist any kind of script that can be run on +> Postgres to conduct a complete feature coverage test with varying +> dataset sizes to compare performance between functionality changes? + +No. + +> If not, how many people would be interested in such a script being +> written? + + +Just about everyon on this list, as well as Advocacy and Hackers, to +judge by the current long-running thread on the topic, which has +meandered across several lists. + +-Josh Berkus + +From pgsql-performance-owner@postgresql.org Tue Feb 18 16:45:20 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 45E0C475A8D + for ; + Tue, 18 Feb 2003 16:45:19 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 9CB77475AA9 + for ; + Tue, 18 Feb 2003 16:45:18 -0500 (EST) +Received: from [216.135.165.74] (account ) + by davinci.ethosmedia.com (CommuniGate Pro WebUser 4.0.2) + with HTTP id 2845968 for ; + Tue, 18 Feb 2003 13:45:28 -0800 +From: "Josh Berkus" +Subject: Data write speed +To: pgsql-performance@postgresql.org +X-Mailer: CommuniGate Pro Web Mailer v.4.0.2 +Date: Tue, 18 Feb 2003 13:45:28 -0800 +Message-ID: +MIME-Version: 1.0 +Content-Type: text/plain; charset="ISO-8859-1" +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/119 +X-Sequence-Number: 1175 + +Folks, + +I have a new system with an Adaptec 2200S RAID controller. I've been +testing some massive data transformations on it, and data write speed +seems to top out at 3mb/second .... which seems slow to me for this +kind of hardware. As it is, I have RAM and CPU sitting idle while they +wait for the disks to finish. + +Thoughts, anyone? + +-Josh + +From pgsql-performance-owner@postgresql.org Tue Feb 18 17:22:53 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 9DD4B47580B + for ; + Tue, 18 Feb 2003 17:22:52 -0500 (EST) +Received: from fuji.krosing.net (unknown [194.204.44.118]) + by postgresql.org (Postfix) with ESMTP id 80358475458 + for ; + Tue, 18 Feb 2003 17:22:51 -0500 (EST) +Received: from fuji.krosing.net (lo [127.0.0.1]) + by fuji.krosing.net (8.12.5/8.12.5) with ESMTP id h1IMMYoW001538; + Wed, 19 Feb 2003 00:22:34 +0200 +Received: (from hannu@localhost) + by fuji.krosing.net (8.12.5/8.12.5/Submit) id h1IMMXpH001536; + Wed, 19 Feb 2003 00:22:33 +0200 +X-Authentication-Warning: fuji.krosing.net: hannu set sender to hannu@tm.ee + using -f +Subject: Re: Data write speed +From: Hannu Krosing +To: Josh Berkus +Cc: pgsql-performance@postgresql.org +In-Reply-To: +References: +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Organization: +Message-Id: <1045606953.1366.3.camel@fuji.krosing.net> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.2 +Date: 19 Feb 2003 00:22:33 +0200 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/120 +X-Sequence-Number: 1176 + +Josh Berkus kirjutas T, 18.02.2003 kell 23:45: +> Folks, +> +> I have a new system with an Adaptec 2200S RAID controller. + +RAID what (0,1,1+0,5,...) ? + +> I've been +> testing some massive data transformations on it, and data write speed +> seems to top out at 3mb/second .... which seems slow to me for this +> kind of hardware. As it is, I have RAM and CPU sitting idle while they +> wait for the disks to finish. +> +> Thoughts, anyone? + +How have you tested it ? + +What OS ? + +--------------- +Hannu + + + +From pgsql-performance-owner@postgresql.org Tue Feb 18 17:27:21 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 3E4C247580B + for ; + Tue, 18 Feb 2003 17:27:21 -0500 (EST) +Received: from filer (12-234-86-219.client.attbi.com [12.234.86.219]) + by postgresql.org (Postfix) with ESMTP id 9B2C3475458 + for ; + Tue, 18 Feb 2003 17:27:20 -0500 (EST) +Received: from localhost (localhost [127.0.0.1]) (uid 1000) + by filer with local; Tue, 18 Feb 2003 14:27:22 -0800 +Date: Tue, 18 Feb 2003 14:27:22 -0800 +From: Kevin Brown +To: pgsql-performance@postgresql.org +Subject: Re: Data write speed +Message-ID: <20030218222722.GC1847@filer> +Mail-Followup-To: Kevin Brown , + pgsql-performance@postgresql.org +References: +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +In-Reply-To: +User-Agent: Mutt/1.4i +Organization: Frobozzco International +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/121 +X-Sequence-Number: 1177 + +Josh Berkus wrote: +> Folks, +> +> I have a new system with an Adaptec 2200S RAID controller. I've been +> testing some massive data transformations on it, and data write speed +> seems to top out at 3mb/second .... which seems slow to me for this +> kind of hardware. As it is, I have RAM and CPU sitting idle while they +> wait for the disks to finish. +> +> Thoughts, anyone? + +That does seem low. What rate do you get with software RAID (of the +same type, of course) to the same disks (might have to be through a +standard SCSI controller to be meaningful) with roughly the same +disks/channel distribution? + + +My experience with hardware RAID (at least with the hardware available +a few years ago) versus software RAID is that software RAID is almost +always going to be faster because RAID speed seems to be very +dependent on the speed of the RAID controller's CPU. And computer +systems usually have a processor that's significantly faster than the +processor on a hardware RAID controller. It's rare that an +application will be as CPU intensive as it is I/O intensive (in +particular, there are relatively few applications that will be burning +CPU at the same time they're waiting for I/O to complete), so the +faster you can get your I/O completed, the higher the overall +throughput will be even if you have to use some CPU to do the I/O. + +That may have changed some since CPUs now are much faster than they +used to be, even on hardware RAID controllers, but to me that just +means that you can build a larger RAID system before saturating the +CPU. + + +The Adaptec 2200S has a 100MHz CPU. That's pretty weak. The typical +modern desktop system has a factor of 20 more CPU power than that. A +software RAID setup would have no trouble blowing the 2200S out of the +water, especially if the OS is able to make use of features such as +tagged queueing. + +Since the 2200S has a JBOD mode, you might consider testing a software +RAID setup across that, just to see how much of a difference doing the +RAID calculations on the host system makes. + + + + +-- +Kevin Brown kevin@sysexperts.com + +From pgsql-performance-owner@postgresql.org Tue Feb 18 18:51:28 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 46AAF475AD4 + for ; + Tue, 18 Feb 2003 18:51:27 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 9CD6A475AAC + for ; + Tue, 18 Feb 2003 18:51:26 -0500 (EST) +Received: from [216.135.165.74] (account ) + by davinci.ethosmedia.com (CommuniGate Pro WebUser 4.0.2) + with HTTP id 2846264; Tue, 18 Feb 2003 15:51:32 -0800 +From: "Josh Berkus" +Subject: Re: Data write speed +To: Kevin Brown , + pgsql-performance@postgresql.org +X-Mailer: CommuniGate Pro Web Mailer v.4.0.2 +Date: Tue, 18 Feb 2003 15:51:32 -0800 +Message-ID: +In-Reply-To: <20030218222722.GC1847@filer> +MIME-Version: 1.0 +Content-Type: text/plain; charset="ISO-8859-1" +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/122 +X-Sequence-Number: 1178 + +Kevin, + +> That does seem low. What rate do you get with software RAID (of the +> same type, of course) to the same disks (might have to be through a +> standard SCSI controller to be meaningful) with roughly the same +> disks/channel distribution? + +Unfortunately, I can't do this without blowing away all of my current +software setup. I noticed the performance problem *after* installing +Linux, PostgreSQL, Apache, PHP, pam_auth, NIS, and my database .... +and, of course, customized builds of the above. +=20 +> The Adaptec 2200S has a 100MHz CPU. That's pretty weak. The typical +> modern desktop system has a factor of 20 more CPU power than that. A +> software RAID setup would have no trouble blowing the 2200S out of +> the +> water, especially if the OS is able to make use of features such as +> tagged queueing. +>=20 +> Since the 2200S has a JBOD mode, you might consider testing a +> software +> RAID setup across that, just to see how much of a difference doing +> the +> RAID calculations on the host system makes. + +This isn't something I can do without blowing away my current software +setup, hey? + +-Josh + +From pgsql-performance-owner@postgresql.org Tue Feb 18 20:21:03 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id C9C6D47580B + for ; + Tue, 18 Feb 2003 20:21:01 -0500 (EST) +Received: from grunt21.ihug.com.au (grunt21.ihug.com.au [203.109.249.141]) + by postgresql.org (Postfix) with ESMTP id DD74D475458 + for ; + Tue, 18 Feb 2003 20:21:00 -0500 (EST) +Received: from p7-max1.adl.ihug.com.au (postgresql.org) [203.173.184.71] + by grunt21.ihug.com.au with esmtp (Exim 3.35 #1 (Debian)) + id 18lIuu-0001xI-00; Wed, 19 Feb 2003 12:21:01 +1100 +Message-ID: <3E52DC25.1040505@postgresql.org> +Date: Wed, 19 Feb 2003 11:51:41 +1030 +From: Justin Clift +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; + rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Josh Berkus +Cc: Kevin Brown , + pgsql-performance@postgresql.org +Subject: Re: Data write speed +References: +In-Reply-To: +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/123 +X-Sequence-Number: 1179 + +Josh Berkus wrote: + +> This isn't something I can do without blowing away my current software +> setup, hey? + +Hi Josh, + +Any chance that it's a hardware problem causing a SCSI level slowdown? + +i.e. termination accidentally turned on for a device that's not at the +end of a SCSI chain, or perhaps using a cable that's not of the right +spec? Stuff that will still let it work, but at a reduced rate. Maybe +even a setting in the Adaptec controller's BIOS? Might be worth looking +at dmesg and seeing what it reports the SCSI interface speed to be. + +:-) + +Regards and best wishes, + +Justin Clift + + +> -Josh + +-- +"My grandfather once told me that there are two kinds of people: those +who work and those who take the credit. He told me to try to be in the +first group; there was less competition there." +- Indira Gandhi + + +From pgsql-performance-owner@postgresql.org Tue Feb 18 23:50:26 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 9875047580B; Tue, 18 Feb 2003 23:50:21 -0500 (EST) +Received: from bradfordw2ks01.internal.jessgrove.co.uk + (network-249-50.adsl.as15758.net [212.103.249.50]) + by postgresql.org (Postfix) with ESMTP + id E30A6475458; Tue, 18 Feb 2003 23:50:19 -0500 (EST) +Received: from smtp0301.mail.yahoo.com ([212.56.157.100]) by + bradfordw2ks01.internal.jessgrove.co.uk with Microsoft + SMTPSVC(5.0.2195.2966); Wed, 19 Feb 2003 04:50:20 +0000 +Date: Wed, 19 Feb 2003 04:56:40 GMT +From: incomingforward@cs.com +X-Priority: 3 +To: pgsql-hackers-owner@hub.org +Subject: pgsql-hackers-owner, + LIVE FROM WALL STREET: VICC Test Results Are In.......... +Mime-Version: 1.0 +Content-Type: text/html; charset=us-ascii +Content-Transfer-Encoding: 7bit +Message-ID: + +X-OriginalArrivalTime: 19 Feb 2003 04:50:21.0359 (UTC) + FILETIME=[68596BF0:01C2D7D2] +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/124 +X-Sequence-Number: 1180 + +pgsql-hackers-owner@hub.org +

If you bought into our last recommendation (CIMG) early enough you had an excellent opportunity to make substantial gains (from .90 to 1.65 in just the first day). Now is your chance to do the same with our newest pick: VICC. To find out more go to Live From the Street.

+

+

If you no longer want to receive information from us just go to +tallrhe@cs.com.

+  + +From pgsql-performance-owner@postgresql.org Wed Feb 19 03:10:56 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id D1DAB47580B + for ; + Wed, 19 Feb 2003 03:10:54 -0500 (EST) +Received: from beavis.ybsoft.com (unknown [209.161.7.161]) + by postgresql.org (Postfix) with ESMTP id AC45F475458 + for ; + Wed, 19 Feb 2003 03:10:53 -0500 (EST) +Received: from beavis.ybsoft.com (beavis.ybsoft.com [10.0.0.2]) + by beavis.ybsoft.com (Postfix) with ESMTP + id 8EB3E2B0E7; Wed, 19 Feb 2003 01:10:53 -0700 (MST) +Subject: Re: Questions about indexes? +From: Ryan Bradetich +To: Josh Berkus +Cc: pgsql-performance@postgresql.org +In-Reply-To: <200302180937.21001.josh@agliodbs.com> +References: <200302180937.21001.josh@agliodbs.com> +Content-Type: text/plain +Organization: +Message-Id: <1045642252.17975.116.camel@beavis.ybsoft.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.2 +Date: 19 Feb 2003 01:10:53 -0700 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/125 +X-Sequence-Number: 1181 + +Josh, + +Posting to the performance list as requested :) The reason I orgionally +posted to the hackers list was I was curious about the contents of the +index and how they worked.... but now this thread is more about +performance, so this list is more appropriate. + + +On Tue, 2003-02-18 at 10:37, Josh Berkus wrote: +> Ryan, +> +> I am crossing this discussion to the PGSQL-PERFORMANCE list, which is the +> proper place for it. Anyone interested, please follow us there! +> +> >>>Ryan Bradetich said: +> > the table would look like: +> > 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user x has an invalid shell. +> > 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user y has an invalid shell. +> > 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user y has expired password. +> > 2 | Mon Feb 17 00:34:24 MST 2003 | f101 | file /foo has improper owner. +> > etc... +> > +> > So I do not need the anomaly to be part of the index, I only need it to +> > +> > I agree with you, that I would not normally add the anomally to the +> > index, except for the unique row requirement. Thinking about it now, +> > maybe I should guarentee unique rows via a check constraint... +> > +> > Thanks for making me think about this in a different way! +> +> First off, I'm not clear on why a duplicate anominaly would be necessarily +> invalid, given the above. Not useful, certainly, but legitimate real data. + +Duplicate anomalies are not invalid, they are only invalid if they are +for the same system, same category, from the same compliancy report. + +ie. This is bad: +1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user x has an invalid shell. +1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user x has an invalid shell. + +This is ok: +1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user x has an invalid shell. +1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user y has an invalid shell. + +The only reason the duplicate date would occur is if the same compliancy +report was entered into the database twice. (ie. The host did not +generate a new compliancy report, or a bug in the data stuffing script, +etc). Daniel Kalchev from the pgsql-hackers list had a good idea that I +am investigating, which is to have the archive script be responsible for +preventing duplicate entries into the database, thus the requirement for +an index to do this is eliminated. + +The whole reason I decided to not allow duplicte entries into the +architve table is so when I generate reports, I do not have to put the +distinct qualifier on the queries which eliminates the sort and speeds +up the queries. The entire purpose of the index was to maintain good +data integrity in the archive tables for reporting purposes. If I can +enforce the data integrity another way (ie, data stuffer scripts, index +on md5 hash of the data, etc) then I can drop this huge index and be +happy :) + +> I realize that you have performance considerations to work with. However, I +> must point out that your database design is not *at all* normalized ... and +> that normalizing it might solve some of your indexing problems. + +Please do point out these design errors! I am always interested in +learning more about normialization since I do not have any formal DBA +training, and most of my knowledge is from reading books, mailing lists, +and experimenting :) + + +> A normalized structure would look something like: +> +> TABLE operations +> id serial not null primary key, +> host_id int not null, +> timeoccurred timestamp not null default now(), +> category varchar(5) not null, +> constraint operations_unq unique (host_id, timeoccurred, category) +> +> TABLE anominalies +> id serial not null primary key, +> operation_id int not null references operations(id) on delete cascade, +> anominaly text +> +> This structure would have two advantages for you: +> 1) the operations table would be *much* smaller than what you have now, as you +> would not be repeating rows for each anominaly. + +I agree the operations table would be smaller, but you have also added +some data by breaking it up into 2 tables. You have an oid (8 bytes) + +operations.id (4 bytes) + anomalies.id (4 bytes) + operation_id (4 +bytes) + tuple overhead[2] (36 bytes). + +The anomalies.id and operation_id will be duplicated for all +~85 Millon rows[1], but we did remove the host_id (4 bytes), timestamp +(8 bytes) and category (~5 bytes) ... for a savings of 9 bytes / row. + +My quick estimation shows this saves ~ 730 MB in the table and the index +for a combined total of 1.46 GB (The reason the index savings in the +anomalies is not more is explain further in response to point 2.). + +So to gain any space savings from breaking the tables up, the total size +of the operations table + primary index + operatoins_unq index < 1.46 +GB. + +The operations table contains oid (8 bytes) + host_id (4 bytes) + +timestamp (8 bytes) + category (~5 bytes) + tuple overhead[2] (36 +bytes). Also since every category is duplicated in either the primary +index or the operations_unq index, the index sizes will be approximately +the size of the main table. + +So 730 MB / (61 bytes) == ~ 12.5 Million rows. + +A quick calculation of hosts * categories * data points show that we +could have a maximum of ~ 12 million entries[3] in the operation table, +so this would save some space :) + + +> 2) In neither table would you be including the anominaly text in an index ... +> thus reducing index size tremendously. + +Unless I impliment Daniel's method of verifying the uniqness at the data +insertion point, I will still need to guarentee the anomaly is unique +for the given operation_id. If I mis-read the table schema, would you +please point it out to me .. I'm probably being dense :) + +Also, I do not understand why the anomalies table need the id key for +the primary key. Wouldn't the operation_id and the anomaly form the +primary key? We could save 8 bytes (4 from table + 4 from index) * ~85 +Million rows by removing this column. + + +> As a warning, though: you may find that for insert speed the referential +> integrity key is better maintained at the middleware layer. We've had some +> complaints about slow FK enforcement in Postgres. + + +Thanks, I will keep this in mind. Although the inserts are usually done +in a batch job ... so interactive speed is generally not an issue ... +but faster is always better :) + +Also I am curious ... With the table more nomalized, I now need to +perform a join when selecting data.... I realize there will be fewer +pages to read from disk (which is good!) when doing this join, but I +will interested to see how the join affects the interactive performance +of the queries.... something to test :) + + +Thanks for looking at this, Josh, and providing input. Hopefully by +explaining my figuring and thinking you can see what am I looking at ... +and point out additional flaws in my methods :) Unfortunately I still +do not think I can remove the anomaly field from the index yet, even by +normalizing the tables like you did. + +I think Daniel has the correct answer by moving the unique constraint +check out into the stuffer script, or by performing some method of +indexing on a hash as I proposed at the beginning of the thread. + +I have figured out a way to reduce my md5 index size in 1/2 again, and +have deveoped a method for dealing with collisions too. I am planning +on running some bench marks against the current method, with the tables +normalized as Josh suggested, and using the md5 hash I am working on. My +benchmarks will be fairly simple ... average time to insert X number of +valid inserts and average time to insert X number of duplicate inserts +along with disk space usage. If anyone is interested I am willing to +post the results to this list ... and if anyone has some other benchmark +suggestions they would like to see, feel free to let me know. + +Thanks much for all the help and insight! + +- Ryan + +[1] select count(anomaly) from history; + count + ---------- + 85221799 + +[2] I grabed the 36 bytes overhead / tuple from this old FAQ I found + at http://www.guides.sk/postgresql_docs/faq-english.html + I did not look at what the current value is today. + +[3] This was a rough calculation of a maxium, I do not believe we are +at this maxium, so the space savings is most likely larger. + +-- +Ryan Bradetich + + +From pgsql-performance-owner@postgresql.org Wed Feb 19 04:39:34 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A278B47580B + for ; + Wed, 19 Feb 2003 04:39:32 -0500 (EST) +Received: from biomax.de (unknown [212.6.137.236]) + by postgresql.org (Postfix) with ESMTP id 4E0D3475458 + for ; + Wed, 19 Feb 2003 04:39:31 -0500 (EST) +Received: from biomax.de (guffert.biomax.de [192.168.3.166]) + by biomax.de (8.8.8/8.8.8) with ESMTP id KAA06825; + Wed, 19 Feb 2003 10:38:54 +0100 +Message-ID: <3E5350AE.7080408@biomax.de> +Date: Wed, 19 Feb 2003 10:38:54 +0100 +From: Chantal Ackermann +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Manfred Koizar +Cc: Josh Berkus , + pgsql-performance@postgresql.org, tgl@sss.pgh.pa.us +Subject: Re: cost and actual time +References: <3E50BECC.9090107@biomax.de> + + <3E520AD8.2000304@biomax.de> + +In-Reply-To: +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/126 +X-Sequence-Number: 1182 + +hello Manfred, + +> ... for joining both occurrences: The "-> Nested Loop" takes two +> tables (the "-> Index Scans") as input and produces one table as +> output which is again used as input for the "-> Hash Join" above it. + +as I am testing with the most frequent gene names (= the gene_ids that +are the most frequent in the occurrences tables) this is a very +expensive join. whenever I try a less frequent gene_id the runtime is +shorter (though I haven't tested especially with less frequent gene_ids, +yet. my focus is on making the searches for the most frequent genes +faster as these are probably the ones that are searched for a lot.) + +> There is no DISTINCT here. This is equvalent to your first query, iff +> the following unique constraints are true: +> (gene_id, sentence_id) in gene_occurrences +> (disease_id, sentence_id) in disease_occurrences +> (disease_id) in disease +> +> If they are, you don't need a sub-select (unless I'm missing +> something, please double-check): + +yeah, I noticed the difference between the two queries. actually, I am +afraid of dropping the distinct cause I had results with duplicate rows +(though I shall recheck when this is really the case). These are the +table declarations and constraints: + +relate=# \d gene + Table "public.gene" + Column | Type | Modifiers +-------------+---------+----------- + gene_id | integer | not null + gene_name | text | not null + gene_syn_id | integer | not null +Indexes: gene_pkey primary key btree (gene_id), + gene_name_uni unique btree (gene_name), + gene_uni unique btree (gene_name, gene_syn_id), + gene_syn_idx btree (gene_syn_id) + +(disease looks the same) + +relate_01=# \d gene_occurrences + Table "public.gene_occurrences" + Column | Type | Modifiers +-------------+---------+----------- + sentence_id | bigint | not null + gene_id | integer | not null + puid | integer | not null +Indexes: gene_occ_uni unique btree (sentence_id, gene_id), + gene_occ_id_i btree (gene_id) + +relate_01=# \d disease_occurrences +Table "public.disease_occurrences" + Column | Type | Modifiers +-------------+---------+----------- + sentence_id | bigint | not null + disease_id | integer | not null + puid | integer | not null +Indexes: disease_occ_uni unique btree (sentence_id, disease_id), + disease_occ_id_i btree (disease_id) + +sentence_id and gene/disease_id are connected in a n:m relation. +as sentence_id is the primary key of a table with more than 50 million +rows, we decided not to use a serial as primary key but to use a unique +combination of two existing values. as this combination is to long for +an ordinary int, we have to use bigint as type. is the join therefore +such expensive? + +we had a primary key occurrence_id on the occurrences tables but we +noticed that we don't use it, so we didn't recreate it in the new +database. is it possible that the postgres could work with it internally? + +> Play with enable_xxxx to find out which join method provides the best +> performance for various gene_ids. Then we can start to fiddle with +> run-time parameters to help the optimizer choose the right plan. + +this would be VERY helpful! :-) + +I played around and this is the result: + +EXPLAIN ANALYZE +SELECT d.disease_id, d.sentence_id + FROM gene_occurrences g, disease_occurrences d + WHERE g.sentence_id = d.sentence_id + AND g.gene_id = get_gene_id([different very frequent gene names]); + +choice of the planner: Nested Loop + Total runtime: 53508.86 msec + +set enable_nextloop to false; +Merge Join: Total runtime: 113066.81 msec + +set enable_mergejoin to false; +Hash Join: Total runtime: 439344.44 msec + +disabling the hash join results again in a Nested Loop with very high +cost but low runtime - I'm not sure if the latter is the consequence of +caching. I changed the gene name at every run to avoid the caching. + +So the Nested Loop is obiously the best way to go? + +For comparison: a less frequent gene (occurres 6717 times in +gene_occurrences) +outputs the following query plan: + + +QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------- +Nested Loop (cost=0.00..41658.69 rows=12119 width=20) (actual +time=87.01..19076.62 rows=1371 loops=1) + -> Index Scan using gene_occ_id_i on gene_occurrences g +(cost=0.00..10754.08 rows=7514 width=8) (actual time=35.89..10149.14 +rows=6717 loops=1) + Index Cond: (gene_id = 16338) + -> Index Scan using disease_occ_uni on disease_occurrences d +(cost=0.00..4.09 rows=2 width=12) (actual time=1.32..1.32 rows=0 loops=6717) + Index Cond: ("outer".sentence_id = d.sentence_id) + Total runtime: 19078.48 msec + +> Usually you set a low random_page_cost value (the default is 4) if you +> want to favour index scans where the optimizer tends to use sequential +> scans. Was this your intention? + +No, not really. I found a posting in the archives where one would +suggest reducing this parameter, so I tried it. I don't think it had any +perceptiple effect. + +>>cpu_tuple_cost = 0.01 # (same), default 0.01 +>>cpu_index_tuple_cost = 0.00001 # (same), default 0.001 +>>cpu_operator_cost = 0.005 # (same), default 0.0025 +> +> +> Just out of curiosity: Are these settings based on prior experience? + +Nope. Same as above. I changed these variables only two days ago for +what I recall. Untill than I had them at their default. + +Regards, +Chantal + + +From pgsql-performance-owner@postgresql.org Wed Feb 19 05:34:37 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E125947580B + for ; + Wed, 19 Feb 2003 05:34:35 -0500 (EST) +Received: from email04.aon.at (WARSL402PIP1.highway.telekom.at [195.3.96.90]) + by postgresql.org (Postfix) with SMTP id 0A44A475458 + for ; + Wed, 19 Feb 2003 05:34:35 -0500 (EST) +Received: (qmail 493298 invoked from network); 19 Feb 2003 10:34:35 -0000 +Received: from m148p005.dipool.highway.telekom.at (HELO cantor) + ([62.46.8.101]) (envelope-sender ) + by qmail4rs.highway.telekom.at (qmail-ldap-1.03) with SMTP + for ; 19 Feb 2003 10:34:35 -0000 +From: Manfred Koizar +To: Chantal Ackermann +Cc: Josh Berkus , + pgsql-performance@postgresql.org, tgl@sss.pgh.pa.us +Subject: Re: cost and actual time +Date: Wed, 19 Feb 2003 11:34:03 +0100 +Message-ID: +References: <3E50BECC.9090107@biomax.de> + + <3E520AD8.2000304@biomax.de> + + <3E5350AE.7080408@biomax.de> +In-Reply-To: <3E5350AE.7080408@biomax.de> +X-Mailer: Forte Agent 1.8/32.548 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/127 +X-Sequence-Number: 1183 + +Chantal, + +I'm short of time right now. So just a few quick notes and a request +for more information. Next round tomorrow ... + +On Wed, 19 Feb 2003 10:38:54 +0100, Chantal Ackermann + wrote: +>yeah, I noticed the difference between the two queries. actually, I am +>afraid of dropping the distinct cause I had results with duplicate rows +>(though I shall recheck when this is really the case). These are the +>table declarations and constraints: [...] + +AFAICS there's no way to get duplicates, so no need for DISTINCT. + +> we have to use bigint as type. is the join therefore +>such expensive? + +No. + +>we had a primary key occurrence_id on the occurrences tables but we +>noticed that we don't use it, so we didn't recreate it in the new +>database. is it possible that the postgres could work with it internally? + +No. + +> Nested Loop Total runtime: 53508.86 msec +>Merge Join: Total runtime: 113066.81 msec +>Hash Join: Total runtime: 439344.44 msec +>I changed the gene name at every run to avoid the caching. + +You can't compare the runtimes unless you query for the same data. +Either run each query twice to make sure everything is cached or do +something like + tar cf /dev/null /some/big/directory +before each query to empty your disk cache. BTW, what is your +shared_buffers setting. + +>disabling the hash join results again in a Nested Loop with very high +>cost but low runtime - I'm not sure if the latter is the consequence of +>caching. + +Please send EXPLAIN ANALYZE results for all queries. Send it to me +off-list if you think its too long. + +Servus + Manfred + +From pgsql-performance-owner@postgresql.org Wed Feb 19 10:03:48 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 3B15B475425 + for ; + Wed, 19 Feb 2003 10:03:46 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 131BE475AA9 + for ; + Wed, 19 Feb 2003 10:03:44 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1JF3f5u011200; + Wed, 19 Feb 2003 10:03:41 -0500 (EST) +To: "Josh Berkus" +Cc: kbottner@istation.com, pgsql-performance@postgresql.org +Subject: Re: Performance Baseline Script +In-reply-to: +References: +Comments: In-reply-to "Josh Berkus" + message dated "Tue, 18 Feb 2003 12:43:48 -0800" +Date: Wed, 19 Feb 2003 10:03:41 -0500 +Message-ID: <11199.1045667021@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/128 +X-Sequence-Number: 1184 + +"Josh Berkus" writes: +> Keith, +>> Does there currently exist any kind of script that can be run on +>> Postgres to conduct a complete feature coverage test with varying +>> dataset sizes to compare performance between functionality changes? + +> No. + +If you squint properly, OSDB (http://osdb.sourceforge.net/) might be +thought to do this, or at least be a starting point for it. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Wed Feb 19 10:14:00 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 5EB414759AF + for ; + Wed, 19 Feb 2003 10:13:58 -0500 (EST) +Received: from grunt25.ihug.com.au (grunt25.ihug.com.au [203.109.249.145]) + by postgresql.org (Postfix) with ESMTP id 84D96475843 + for ; + Wed, 19 Feb 2003 10:13:57 -0500 (EST) +Received: from p52-tnt2.adl.ihug.com.au (postgresql.org) [203.173.252.52] + by grunt25.ihug.com.au with esmtp (Exim 3.35 #1 (Debian)) + id 18lVuz-000513-00; Thu, 20 Feb 2003 02:13:54 +1100 +Message-ID: <3E539F8D.7040406@postgresql.org> +Date: Thu, 20 Feb 2003 01:45:25 +1030 +From: Justin Clift +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; + rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Tom Lane +Cc: Josh Berkus , kbottner@istation.com, + pgsql-performance@postgresql.org +Subject: Re: Performance Baseline Script +References: + <11199.1045667021@sss.pgh.pa.us> +In-Reply-To: <11199.1045667021@sss.pgh.pa.us> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/129 +X-Sequence-Number: 1185 + +Tom Lane wrote: +> "Josh Berkus" writes: +> +>>Keith, +>> +>>>Does there currently exist any kind of script that can be run on +>>>Postgres to conduct a complete feature coverage test with varying +>>>dataset sizes to compare performance between functionality changes? +> +>>No. +> +> If you squint properly, OSDB (http://osdb.sourceforge.net/) might be +> thought to do this, or at least be a starting point for it. + +As a side thought, just today found out that the TPC organisation +provides all kinds of code freely for building/running the TPC-x tests. + Didn't know that before. + +Sure, we can't submit results yet, but we might at least be able to run +the tests and see if anything interesting turns up. People have talked +about the TPC tests before, but not sure if anyone has really looked at +making them runnable on PostgreSQL for everyone yet. + +Regards and best wishes, + +Justin Clift + + +> regards, tom lane + +-- +"My grandfather once told me that there are two kinds of people: those +who work and those who take the credit. He told me to try to be in the +first group; there was less competition there." +- Indira Gandhi + + +From pgsql-performance-owner@postgresql.org Wed Feb 19 10:42:52 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A3A304758C9 + for ; + Wed, 19 Feb 2003 10:42:47 -0500 (EST) +Received: from mail.libertyrms.com (unknown [209.167.124.227]) + by postgresql.org (Postfix) with ESMTP id E1634475843 + for ; + Wed, 19 Feb 2003 10:42:46 -0500 (EST) +Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 + (Debian)) + id 18lWN1-0000Cb-00 + for ; Wed, 19 Feb 2003 10:42:51 -0500 +Date: Wed, 19 Feb 2003 10:42:51 -0500 +From: Andrew Sullivan +To: pgsql-performance@postgresql.org +Subject: Re: Performance Baseline Script +Message-ID: <20030219104251.E24136@mail.libertyrms.com> +Mail-Followup-To: Andrew Sullivan , + pgsql-performance@postgresql.org +References: + <11199.1045667021@sss.pgh.pa.us> <3E539F8D.7040406@postgresql.org> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.2.5i +In-Reply-To: <3E539F8D.7040406@postgresql.org>; + from justin@postgresql.org on Thu, Feb 20, 2003 at 01:45:25AM + +1030 +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/130 +X-Sequence-Number: 1186 + +On Thu, Feb 20, 2003 at 01:45:25AM +1030, Justin Clift wrote: + +> As a side thought, just today found out that the TPC organisation +> provides all kinds of code freely for building/running the TPC-x tests. + +Yes, but be careful what you mean there. + +It is _not_ a TPC test unless it is run under tightly-controlled and +-audited conditions as specified by TPC. And that effectively means +you have to pay them. In other words, it's not a TPC test unless you +can get it published by them. + +That doesn't mean you can't run a test "based on the documents +provided by the TPC for test definition _x_". Just make sure you +walk on the correct side of the intellectual property line, or you'll +be hearing from their lawyers. + +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 Feb 19 12:52:23 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B72F7475925 + for ; + Wed, 19 Feb 2003 12:51:45 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id D55A847592C + for ; + Wed, 19 Feb 2003 12:51:44 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2847396; Wed, 19 Feb 2003 09:51:58 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: Ryan Bradetich +Subject: Re: Questions about indexes? +Date: Wed, 19 Feb 2003 09:50:42 -0800 +User-Agent: KMail/1.4.3 +Cc: pgsql-performance@postgresql.org +References: <200302180937.21001.josh@agliodbs.com> + <1045642252.17975.116.camel@beavis.ybsoft.com> +In-Reply-To: <1045642252.17975.116.camel@beavis.ybsoft.com> +MIME-Version: 1.0 +Message-Id: <200302190950.42446.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by AMaViS new-20020517 +X-Archive-Number: 200302/131 +X-Sequence-Number: 1187 + +Ryan, + +> Posting to the performance list as requested :) The reason I orgionally +> posted to the hackers list was I was curious about the contents of the +> index and how they worked.... but now this thread is more about +> performance, so this list is more appropriate. + +*shrug* I just figured that you didn't know about the performance list ...= +=20=20 +also, I'm doing my bit to reduce traffic on -hackers. + +> Duplicate anomalies are not invalid, they are only invalid if they are +> for the same system, same category, from the same compliancy report. +> +> ie. This is bad: +> 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user x has an invalid shell. +> 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user x has an invalid shell. +> +> This is ok: +> 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user x has an invalid shell. +> 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user y has an invalid shell. + +OK. Given the necessity of verifying anominaly uniqueness, my suggestions= +=20 +below change somewhat. + +> Please do point out these design errors! I am always interested in +> learning more about normialization since I do not have any formal DBA +> training, and most of my knowledge is from reading books, mailing lists, +> and experimenting :) + +"Practical Issues in Database Management" and "Database Design for Mere=20 +Mortals" are useful. Me, I learned through 5 years of doing the wrong thin= +g=20 +and finding out why it was wrong ... + +> I agree the operations table would be smaller, but you have also added +> some data by breaking it up into 2 tables. You have an oid (8 bytes) + +> operations.id (4 bytes) + anomalies.id (4 bytes) + operation_id (4 +> bytes) + tuple overhead[2] (36 bytes). + +Yes, and given your level of traffic, you might have to use 8byte id fields= +.=20=20 +But if disk space is your main issue, then I'd suggest swaping the category= +=20 +code to a "categories" table, allowing you to use an int4 or even and int2 = +as=20 +the category_id in the Operations table. This would save you 6-8 bytes pe= +r=20 +row in Operations. + +> > 2) In neither table would you be including the anominaly text in an ind= +ex +> > ... thus reducing index size tremendously. +> +> Unless I impliment Daniel's method of verifying the uniqness at the data +> insertion point, I will still need to guarentee the anomaly is unique +> for the given operation_id. If I mis-read the table schema, would you +> please point it out to me .. I'm probably being dense :) +> +> Also, I do not understand why the anomalies table need the id key for +> the primary key. Wouldn't the operation_id and the anomaly form the +> primary key? We could save 8 bytes (4 from table + 4 from index) * ~85 +> Million rows by removing this column. + +As I said above, I didn't understand why you needed to check anominaly=20 +uniqueness. Given that you do, I'd suggest that you do the above. + +Of course, you also have another option. You could check uniqueness on the= +=20 +operation_id and the md5 of the anominaly field. This would be somewhat=20 +awkward, and would still require that you have a seperate primary key for t= +he=20 +anominalies table. But the difference between an index on an up-to-1024= +=20 +character field and a md5 string might make it worth it, particularly when = +it=20 +comes to inserting new rows. + +In other words, test: +1) drop the anominaly_id as suggested, above. +2) adding an anominaly_md5 column to the anominalies table. +3) make operation_id, anominaly_md5 your primary key +4) write a BEFORE trigger that caclulates the md5 of any incoming anominali= +es=20 +and adds it to that column. + +It's worth testing, since a unique index on a 1024-character field for 85= +=20 +million records could be very slow. + +> Thanks, I will keep this in mind. Although the inserts are usually done +> in a batch job ... so interactive speed is generally not an issue ... +> but faster is always better :) + +In a transaction, I hope. + +> Also I am curious ... With the table more nomalized, I now need to +> perform a join when selecting data.... I realize there will be fewer +> pages to read from disk (which is good!) when doing this join, but I +> will interested to see how the join affects the interactive performance +> of the queries.... something to test :) + +I'll look forward to seeing the results of your test. + +> If anyone is interested I am willing to +> post the results to this list ... and if anyone has some other benchmark +> suggestions they would like to see, feel free to let me know. + +We're always interested in benchmarks. + + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-hackers-owner@postgresql.org Wed Feb 19 18:32:26 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 96AA8475F2C + for ; + Wed, 19 Feb 2003 18:32:24 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 80968-04 for ; + Wed, 19 Feb 2003 18:32:10 -0500 (EST) +Received: from post.webmailer.de (natsmtp01.webmailer.de [192.67.198.81]) + by postgresql.org (Postfix) with ESMTP id C1759476226 + for ; + Wed, 19 Feb 2003 17:21:18 -0500 (EST) +Received: from dell (p50916431.dip.t-dialin.net [80.145.100.49]) + by post.webmailer.de (8.9.3/8.8.7) with ESMTP id XAA09425; + Wed, 19 Feb 2003 23:21:14 +0100 (MET) +Content-Type: text/plain; + charset="iso-8859-1" +From: Tilo Schwarz +To: Bruce Momjian +Subject: Re: Changing the default configuration (was Re: [pgsql-advocacy] +Date: Wed, 19 Feb 2003 23:22:44 +0100 +User-Agent: KMail/1.4.3 +References: <200302180249.h1I2nVW06457@candle.pha.pa.us> +In-Reply-To: <200302180249.h1I2nVW06457@candle.pha.pa.us> +Cc: +MIME-Version: 1.0 +Content-Transfer-Encoding: quoted-printable +Message-Id: <200302192322.44593.mail@tilo-schwarz.de> +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/1050 +X-Sequence-Number: 35991 + +Bruce Momjian writes: +> People seemed to like the idea: +> +> Add a script to ask system configuration questions and tune +> postgresql.conf. +> + +Definitely! But it should have some sort of "This is my first database=20 +installation"-mode, which means, that either only some very basic questions= +=20 +(or none at all) are asked, or each question is followed by a reasonable=20 +default value and a "if unsure, press " message. Otherwise the first= +=20 +time user might get scared of all those questions... + +Tilo + +From pgsql-performance-owner@postgresql.org Wed Feb 19 21:38:12 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id ECB88474E61 + for ; + Wed, 19 Feb 2003 21:36:46 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 27909-04 for ; + Wed, 19 Feb 2003 21:36:36 -0500 (EST) +Received: from grunt21.ihug.com.au (grunt21.ihug.com.au [203.109.249.141]) + by postgresql.org (Postfix) with ESMTP id 07E84474E4F + for ; + Wed, 19 Feb 2003 21:36:36 -0500 (EST) +Received: from p68-tnt2.adl.ihug.com.au (postgresql.org) [203.173.252.68] + by grunt21.ihug.com.au with esmtp (Exim 3.35 #1 (Debian)) + id 18lgZh-0003ir-00; Thu, 20 Feb 2003 13:36:38 +1100 +Message-ID: <3E543ABC.20806@postgresql.org> +Date: Thu, 20 Feb 2003 12:47:32 +1030 +From: Justin Clift +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; + rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Andrew Sullivan +Cc: pgsql-performance@postgresql.org +Subject: Re: Performance Baseline Script +References: + <11199.1045667021@sss.pgh.pa.us> <3E539F8D.7040406@postgresql.org> + <20030219104251.E24136@mail.libertyrms.com> +In-Reply-To: <20030219104251.E24136@mail.libertyrms.com> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/132 +X-Sequence-Number: 1188 + +Andrew Sullivan wrote: +> On Thu, Feb 20, 2003 at 01:45:25AM +1030, Justin Clift wrote: +> +>>As a side thought, just today found out that the TPC organisation +>>provides all kinds of code freely for building/running the TPC-x tests. +> +> Yes, but be careful what you mean there. +> +> It is _not_ a TPC test unless it is run under tightly-controlled and +> -audited conditions as specified by TPC. And that effectively means +> you have to pay them. In other words, it's not a TPC test unless you +> can get it published by them. +> +> That doesn't mean you can't run a test "based on the documents +> provided by the TPC for test definition _x_". Just make sure you +> walk on the correct side of the intellectual property line, or you'll +> be hearing from their lawyers. + +Good point. + +What I was thinking about was that we could likely get the "test suite" +of code that the TPC publishes and ensure that it works with PostgreSQL. + +The reason I'm thinking of is that if any of the existing PostgreSQL +support companies (or an alliance of them), decided to become a member +of the TPC in order to submit results then the difficuly of entry would +be that bit lower, and there would be people around at that stage who'd +already gained good experience with the test suite(s). + +:-) + +Regards and best wishes, + +Justin Clift + +> A + + +-- +"My grandfather once told me that there are two kinds of people: those +who work and those who take the credit. He told me to try to be in the +first group; there was less competition there." +- Indira Gandhi + + + +From pgsql-performance-owner@postgresql.org Thu Feb 20 01:19:13 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 43E35475B8F + for ; + Thu, 20 Feb 2003 01:19:11 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 66438-08 for ; + Thu, 20 Feb 2003 01:19:00 -0500 (EST) +Received: from out-mta1.plasa.com (out-mta3.plasa.com [202.134.0.69]) + by postgresql.org (Postfix) with ESMTP id A1A6047592C + for ; + Thu, 20 Feb 2003 01:18:58 -0500 (EST) +Received: from exim by out-mta1.plasa.com with spam-scanned (Exim 4.12) + id 18lk2i-0002V4-00 + for pgsql-performance@postgresql.org; Thu, 20 Feb 2003 13:18:54 +0700 +Received: from exim by out-mta1.plasa.com with signature-added (Exim 4.12) + id 18lk2h-0002UH-00 + for pgsql-performance@postgresql.org; Thu, 20 Feb 2003 13:18:47 +0700 +Received: from [61.5.41.28] (helo=aa_haq2) + by out-mta1.plasa.com with smtp (Exim 4.12) id 18lk2d-00027u-00 + for pgsql-performance@postgresql.org; Thu, 20 Feb 2003 13:18:43 +0700 +From: Ahmad Abdul Haq +To: pgsql-performance@postgresql.org +Subject: Peluang Usaha yang Luar Biasa +X-Mailer: Microsoft Outlook Express 6.00.2600.0000 +Reply-To: aa_haq2@telkom.net +Date: Thu, 20 Feb 2003 13:24:11 +0700 +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Message-Id: +X-Bogosity: No, tests=bogofilter, spamicity=0.461719, version=0.10.0 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/133 +X-Sequence-Number: 1189 + + +http://www.sndfocus.biz/go.cgi/foryou +http://www.foreverstore.cjb.net + +Terima kasih atas waktu yang Anda luangkan untuk membaca email ini. Siapa +tahu, ini akan mengubah kehidupan anda. + +Dalam kesempatan ini saya ingin memperkenalkan kepada Anda sebuah usaha +sampingan yang bila Anda lakukan sesuai dengan sistem, bisa memberikan +penghasilan utama buat Anda dan keluarga Anda. Dengan usaha sampingan ini +Anda juga bisa membentu program pemerintah untuk memerangi kemiskinan dan +pengangguran. + +Bisnis yang saya perkenalkan ini adalah multilevel marketing (MLM). MLM yang +saya perkenalkan ini adalah MLM murni dan bukan money game yaitu Forever +Young Indonesia (FYI) yang telah berdiri sejak 1989 di Indonesia. FYI adalah +murni milik bangsa Indonesia. Untuk menjalankannya Anda telah disediakan +sistem, produk, cara kerja, dan alat. Yang Anda perlu sediakan sendiri +adalah modal yang relatif kecil sebagai uang pendaftaran yaitu Rp 55.000,00 +serta ongkos kirim business kit Rp 10.000,- Sedangkan biaya bulanan untuk +pembelian produk berkisar Rp 162.000 - 250.000,00. + +SISTEM + +Sistem yang Anda perlukan telah dirancang oleh para founder bisnis MLM FYI. +Anda bisa melihat bisnis ini secara langsung di www.foreveryoung.co.id. Di +dalamnya Anda juga bisa melihat legalitas bisnis ini. + +PRODUK + +Produk yang dipasarkan adalah produk yang setiap hari kita perlukan. Produk +FYI berupa minuman kesehatan, makanan kesehatan, perlengkapan mandi dan +cuci, kosmetik serta pupuk untuk tumbuhan dan ternak. Harganya sangat +terjangkau. Produk FYI yang paling mahal saat ini adalah Adaplex, vitamin +untuk anak-anak seharga Rp 236.500,00 (harga distributor untuk Pulau +Jawa-Bali-Sumatera, berlaku sejak 1 Desember 2002). Sedangkan harga-harga +lainnya seperti minuman kesehatan, makanan kesehatan, perlengkapan mandi dan +cuci serta kosmetik relatif sama dengan produk yang lain di pasaran, tetapi +kualitasnya jauh lebih baik. Beberapa produk makanan dan minuman kesehatan +terbukti dapat mengatasi berbagai problem kesehatan sebagai pengobatan +alternatif. + +CARA KERJA DAN ALAT + +Setelah Anda menjadi member secara resmi, Anda harus membeli produk FYI baik +untuk Anda gunakan sendiri dan atau dijual lagi kepada orang lain. +Seandainya Anda tidak mempunyai kepandaian untuk menjual, Anda bisa +menggunakan produknya untuk keperluan Anda sendiri. + +Dalam bisnis ini syarat untuk mendapatkan bonus, Anda harus memiliki poin +atas pembelian yang Anda lakukan. Minimal tiap bulan Anda harus memiliki +Poin 120 PV, apabila dirupiahkan berkisar Rp 162.000,00 s.d. Rp 300.000,- +tergantung pada produk yang Anda beli. + +Cara kerja berikutnya adalah mengembangkan jaringan agar Perolehan Poin Anda +semakin meningkat. Dalam mengembangkan jaringan, tentu saja Anda harus +menawarkan bisnis ini kepada orang lain, baik yang ada di sekitar Anda atau +orang yang belum Anda kenal sama sekali, yaitu melalui internet, seperti apa +yang saya lakukan saat ini. Apabila Anda tertarik untuk lebih mendalami +bisnis ini, silakan Anda klik website saya +http://www.sndfocus.biz/go.cgi/foryou yang diberikan oleh jaringan FYI. +Website ini selain berisi data pribadi saya juga berisi tentang hal-hal yang +perlu Anda ketahui tentang bisnis ini. Website ini adalah salah satu +fasilitas yang juga bisa Anda miliki secara gratis apabila Anda bergabung +dalam jaringan kami. Dalam website tersebut Anda bisa melihat potensi +penghasilan, display produk dan harga produk, serta legalitas dari bisnis +ini serta kelebihan bisnis ini di bandingkan dengan bisnis yang lain. + +Apabila Anda tertarik untuk menjalankan bisnis ini, silakan Anda klik di +http://www.sndfocus.biz/go.cgi/foryou dan silakan Anda klik pada Join Now +atau Sign Up. Setelah Anda mendapatkan konfirmasi alamat website Anda, +silakan klik website Anda dan lakukan Up Grade dengan cara Klik pada Up +Grade dan isikan data-data Anda dengan benar dan hati-hati. Sampai pada +langkah Up Grade ini Anda tidak dipungut biaya apa pun, karena Anda belum +terdaftar secara resmi. Setelah Anda melakukan pengisian formulir Up Grade +silakan Anda menghubungi saya via e-mail aa_haq@telkom.net untuk memberi +konfirmasi kepada saya tentang alamat pengiriman Business Kit. Saya akan +mengirimkan Business Kit tersebut, dan setelah tiba di alamat Anda, barulah +Anda mengirimkan uang pendaftaran beserta penggantian ongkos kirim Business +Kit tersebut yang jumlah seluruhnya Rp 65.000,00. + +MENGAPA SAYA MENJALANKAN BISNIS INI? + +Mungkin Anda bertanya, kenapa Anda harus menjalankan bisnis ini? Atau kenapa +saya menjalankan bisnis ini? Alasan saya menjalankan bisnis ini adalah saya +ingin memiliki penghasilan tambahan yang jumlahnya cukup lumayan untuk masa +depan keluarga saya. Coba Anda bayangkan, dua tahun setelah saya menjalankan +bisnis ini secara benar dan sesuai dengan sistem, saya bisa mendapatkan +penghasilan tambahan sebesar Rp 20 juta minimal per bulan. Ini bukan omong +kosong, karena sudah ada yang mendapatkannya, dan kesempatan bagi saya masih +sangat-sangat luas. Apakah Anda tertarik? Saya yakin Anda sangat tertarik +dan ingin membuktikannya. + +Apa yang harus Anda lakukan apabila Anda sudah terdaftar secara resmi dan +ingin sukses dalam bisnis seperti ini: + +1. Menggunakan produk Forever Young Indonesia (mengganti merek produk yang +selama ini Anda pakai). Apabila memungkinkan Anda bisa juga menjualnya +kepada orang lain. Setiap bulan Anda harus mempunyai poin 120 atas pembelian +produk untuk keluarga Anda atau untuk dijual kepada orang lain. + +2. Mengajak orang lain baik secara off line (langsung) maupun secara on line +(menggunakan internet). Ini sangat berguna untuk memperbesar jaringan Anda. +Sebagai awalnya Anda cukup memiliki dua orang "frontline" (downline +langsung). Apabila ada lagi orang yang bergabung, letakkan dia di bawah +downline Anda, agar jaringan Anda semakin besar. Dalam mengembangkan +jaringan, Anda bisa banyak berkonsultasi dengan upline Anda, baik upline +langsung maupun upline tidak langsung. Anda juga bisa berkonsultasi dengan +pemilik Stockiest dan DC (distribution center), yakni penyedia produk-produk +FYI yang tersebar di seluruh Indonesia. + +3. Mengikuti beberapa Training untuk lebih lancar menjalankan usaha ini. + +Selain Anda harus mengunjungi situs http://www.sndfocus.biz/go.cgi/foryou, +jangan lewatkan juga toko online saya di http://www.foreverstore.cjb.net +yang berisi keterangan lengkap mengenai bisnis ini. + +Berikut data pribadi saya agar Anda lebih kenal dengan saya: + +Nama: + Ahmad Abdul Haq +No. Distributor FYI: + I-700654 +Alamat Rumah: + Jalan Bukit Flamboyan VI No. 286 + Perumnas Bukit Sendang Mulyo + Semarang 50272 +Telepon Rumah: + 0815-663-2571 +Alamat Kantor: + Kanwil XIII Ditjen Anggaran Semarang + Jalan Pemuda No. 2, Semarang 50138 +Telepon Kantor: + 024-3515989 pesawat 215 +Faksimili Kantor: + 024-3545877 +Alamat E-mail: + aa_haq@telkom.net + + +Salam Hormat + + + +Ahmad Abdul Haq +http://www.sndfocus.biz/go.cgi/foryou +http://www.foreverstore.cjb.net + +---------------------------------------------------------------------------- + Ikuti polling TELKOM Memo 166 di www.plasa.com dan menangkan hadiah masing-masing Rp 250.000 tunai + ---------------------------------------------------------------------------- + +From pgsql-performance-owner@postgresql.org Thu Feb 20 03:42:48 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 2034547580B + for ; + Thu, 20 Feb 2003 03:42:46 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 95390-05 for ; + Thu, 20 Feb 2003 03:42:35 -0500 (EST) +Received: from mailserver1.hrz.tu-darmstadt.de + (mailserver1.hrz.tu-darmstadt.de [130.83.126.41]) + by postgresql.org (Postfix) with ESMTP id 04D1B475B85 + for ; + Thu, 20 Feb 2003 03:42:28 -0500 (EST) +Received: from paris (paris.dvs1.informatik.tu-darmstadt.de [130.83.27.43]) + by mailserver1.hrz.tu-darmstadt.de (8.12.1/8.12.1) with ESMTP id + h1K8g2nc018614 + for ; Thu, 20 Feb 2003 09:42:02 +0100 +Received: from dvs1.informatik.tu-darmstadt.de (bali [130.83.27.100]) + by paris (Postfix) with ESMTP id 2EB4BFF05 + for ; + Thu, 20 Feb 2003 09:42:02 +0100 (MET) +Message-ID: <3E5494DA.20003@dvs1.informatik.tu-darmstadt.de> +Date: Thu, 20 Feb 2003 09:42:02 +0100 +From: Matthias Meixner +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 +X-Accept-Language: de, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Write ahead logging +X-Enigmail-Version: 0.71.0.0 +X-Enigmail-Supports: pgp-inline, pgp-mime +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +X-MailScanner: Found to be clean +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/134 +X-Sequence-Number: 1190 + +Hi + +I am doing some performance testing using postgresql. When measuring the +latency of commit I got some results, which make me doubt, if the logging +data is written to disk in time: + +Using a slow disk (5400rpm) I measured about 3-5 ms for a commit. But +average rotational delay is already higher for that disk (5.5ms). +So the question is: has anybody verified, that the log is written to disk +before returning from commit? + +System used was: + +Linux 2.4.20 +filesystem: ext3 +postgresql postgresql-7.2 + +Regards, + + Matthias Meixner + +--=20 +Matthias Meixner meixner@informatik.tu-darmstadt.de +Technische Universit=E4t Darmstadt +Datenbanken und Verteilte Systeme Telefon (+49) 6151 16 6232 +Wilhelminenstra=DFe 7, D-64283 Darmstadt, Germany Fax (+49) 6151 16 6229 + + +From pgsql-performance-owner@postgresql.org Thu Feb 20 04:19:31 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 694C6474E4F + for ; + Thu, 20 Feb 2003 04:18:36 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 12055-07 for ; + Thu, 20 Feb 2003 04:18:25 -0500 (EST) +Received: from email02.aon.at (WARSL402PIP7.highway.telekom.at [195.3.96.94]) + by postgresql.org (Postfix) with SMTP id 2D926475458 + for ; + Thu, 20 Feb 2003 04:18:25 -0500 (EST) +Received: (qmail 149680 invoked from network); 20 Feb 2003 09:18:01 -0000 +Received: from m169p001.dipool.highway.telekom.at (HELO cantor) ([62.46.11.1]) + (envelope-sender ) + by qmail2rs.highway.telekom.at (qmail-ldap-1.03) with SMTP + for ; + 20 Feb 2003 09:18:01 -0000 +From: Manfred Koizar +To: Matthias Meixner +Cc: pgsql-performance@postgresql.org +Subject: Re: Write ahead logging +Date: Thu, 20 Feb 2003 10:17:31 +0100 +Message-ID: +References: <3E5494DA.20003@dvs1.informatik.tu-darmstadt.de> +In-Reply-To: <3E5494DA.20003@dvs1.informatik.tu-darmstadt.de> +X-Mailer: Forte Agent 1.8/32.548 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/135 +X-Sequence-Number: 1191 + +On Thu, 20 Feb 2003 09:42:02 +0100, Matthias Meixner + wrote: +>Using a slow disk (5400rpm) I measured about 3-5 ms for a commit. But +>average rotational delay is already higher for that disk (5.5ms). +>So the question is: has anybody verified, that the log is written to disk +>before returning from commit? + +Some (or all?) IDE disks are known to lie: they report success as +soon as the data have reached the drive's RAM. + +Servus + Manfred + +From pgsql-performance-owner@postgresql.org Thu Feb 20 04:36:12 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 24A91474E61 + for ; + Thu, 20 Feb 2003 04:32:23 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 19934-07 for ; + Thu, 20 Feb 2003 04:32:12 -0500 (EST) +Received: from relay12.austria.eu.net (relay12.Austria.eu.net + [193.154.160.116]) + by postgresql.org (Postfix) with ESMTP id 48FDB474E5C + for ; + Thu, 20 Feb 2003 04:32:12 -0500 (EST) +Received: from relay2.austria.eu.net (endjinn.austria.eu.net [193.81.13.2]) + by relay12.austria.eu.net (Postfix) with ESMTP + id D581DC561F; Thu, 20 Feb 2003 10:32:07 +0100 (CET) +Received: from ICOMWE (office.icomedias.com [62.99.232.80] (may be forged)) + by relay2.austria.eu.net (8.12.6/8.12.6) with SMTP id h1K9Th3V003367; + Thu, 20 Feb 2003 10:30:07 +0100 (MET) +Message-ID: <000b01c2d8c2$54008350$8f01c00a@icomedias.com> +From: "Mario Weilguni" +To: "Manfred Koizar" , + "Matthias Meixner" +Cc: +References: <3E5494DA.20003@dvs1.informatik.tu-darmstadt.de> + +Subject: Re: Write ahead logging +Date: Thu, 20 Feb 2003 10:27:46 +0100 +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 +X-Archive-Number: 200302/136 +X-Sequence-Number: 1192 + +> >So the question is: has anybody verified, that the log is written to disk +> >before returning from commit? +> +> Some (or all?) IDE disks are known to lie: they report success as +> soon as the data have reached the drive's RAM. + +under linux, hdparm -W can turn off the write cache of IDE disk, maybe you +should try with write-caching turned off. + +best regards, + mario weilguni + + + +From pgsql-performance-owner@postgresql.org Thu Feb 20 05:01:58 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id BF158474E5C + for ; + Thu, 20 Feb 2003 05:01:00 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 27411-04 for ; + Thu, 20 Feb 2003 05:00:49 -0500 (EST) +Received: from email03.aon.at (unknown [195.3.96.93]) + by postgresql.org (Postfix) with SMTP id 69E14474E4F + for ; + Thu, 20 Feb 2003 05:00:49 -0500 (EST) +Received: (qmail 105588 invoked from network); 20 Feb 2003 10:00:49 -0000 +Received: from m169p001.dipool.highway.telekom.at (HELO cantor) ([62.46.11.1]) + (envelope-sender ) + by qmail3rs.highway.telekom.at (qmail-ldap-1.03) with SMTP + for ; 20 Feb 2003 10:00:49 -0000 +From: Manfred Koizar +To: Chantal Ackermann +Cc: Josh Berkus , + pgsql-performance@postgresql.org, tgl@sss.pgh.pa.us +Subject: Re: cost and actual time +Date: Thu, 20 Feb 2003 11:00:19 +0100 +Message-ID: <94095vcb2p7db03jmbhnu1agh3k2iqrodf@4ax.com> +References: <3E50BECC.9090107@biomax.de> + + <3E520AD8.2000304@biomax.de> + + <3E5350AE.7080408@biomax.de> +In-Reply-To: <3E5350AE.7080408@biomax.de> +X-Mailer: Forte Agent 1.8/32.548 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/137 +X-Sequence-Number: 1193 + +On Wed, 19 Feb 2003 10:38:54 +0100, Chantal Ackermann + wrote: +>Nested Loop: 53508.86 msec +>Merge Join: 113066.81 msec +>Hash Join: 439344.44 msec + +Chantal, + +you might have reached the limit of what Postgres (or any other +database?) can do for you with these data structures. Time for +something completely different: Try calculating the counts in +advance. + + CREATE TABLE occ_stat ( + did INT NOT NULL, + gid INT NOT NULL, + cnt INT NOT NULL + ) WITHOUT OIDS; + + CREATE INDEX occ_stat_dg ON occ_stat(did, gid); + CREATE INDEX occ_stat_gd ON occ_stat(gid, did); + +There is *no* UNIQUE constraint on (did, gid). You get the numbers +you're after by + SELECT did, sum(cnt) AS cnt + FROM occ_stat + WHERE gid = 'whatever' + GROUP BY did + ORDER BY cnt DESC; + +occ_stat is initially loaded by + + INSERT INTO occ_stat + SELECT did, gid, count(*) + FROM g_o INNER JOIN d_o ON (g_o.sid = d_o.sid) + GROUP BY did, gid; + +Doing it in chunks + WHERE sid BETWEEN a::bigint AND b::bigint +might be faster. + +You have to block any INSERT/UPDATE/DELETE activity on d_o and g_o +while you do the initial load. If it takes too long, see below for +how to do it in the background; hopefully the load task will catch up +some day :-) + +Keeping occ_stat current: + + CREATE RULE d_o_i AS ON INSERT + TO d_o DO ( + INSERT INTO occ_stat + SELECT NEW.did, g_o.gid, 1 + FROM g_o + WHERE g_o.sid = NEW.sid); + + CREATE RULE d_o_d AS ON DELETE + TO d_o DO ( + INSERT INTO occ_stat + SELECT OLD.did, g_o.gid, -1 + FROM g_o + WHERE g_o.sid = OLD.sid); + +On UPDATE do both. Create a set of similar rules for g_o. + +These rules will create a lot of duplicates on (did, gid) in occ_stat. +Updating existing rows and inserting only new combinations might seem +obvious, but this method has concurrency problems (cf. the thread +"Hard problem with concurrency" on -hackers). So occ_stat calls for +reorganisation from time to time: + + BEGIN; + SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + CREATE TEMP TABLE t (did INT, gid INT, cnt INT) WITHOUT OIDS; + + INSERT INTO t + SELECT did, gid, sum(cnt) + FROM occ_stat + GROUP BY did, gid + HAVING count(*) > 1; + + DELETE FROM occ_stat + WHERE t.did = occ_stat.did + AND t.gid = occ_stat.gid; + + INSERT INTO occ_stat SELECT * FROM t; + + DROP TABLE t; + COMMIT; + VACUUM ANALYZE occ_stat; -- very important!! + +Now this should work, but the rules could kill INSERT/UPDATE/DELETE +performance. Depending on your rate of modifications you might be +forced to push the statistics calculation to the background. + + CREATE TABLE d_o_change ( + sid BIGINT NOT NULL, + did INT NOT NULL, + cnt INT NOT NULL + ) WITHOUT OIDS; + + ... ON INSERT TO d_o DO ( + INSERT INTO d_o_change VALUES (NEW.sid, NEW.did, 1)); + + ... ON DELETE TO d_o DO ( + INSERT INTO d_o_change VALUES (OLD.sid, OLD.did, -1)); + + ... ON UPDATE TO d_o + WHERE OLD.sid != NEW.sid OR OLD.did != NEW.did + DO both + +And the same for g_o. + +You need a task that periodically scans [dg]_o_change and does ... + + BEGIN; + SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; + SELECT ; + INSERT INTO occ_stat ; + DELETE ; + COMMIT; + +Don't forget to VACUUM! + +If you invest a little more work, I guess you can combine the +reorganisation into the loader task ... + +I have no idea whether this approach is better than what you have now. +With a high INSERT/UPDATE/DELETE rate it may lead to a complete +performance disaster. You have to try ... + +Servus + Manfred + +From pgsql-performance-owner@postgresql.org Thu Feb 20 05:06:58 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 1D984474E5C + for ; + Thu, 20 Feb 2003 05:06:54 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 30600-01 for ; + Thu, 20 Feb 2003 05:06:42 -0500 (EST) +Received: from mta03ps.bigpond.com (mta03ps.bigpond.com [144.135.25.135]) + by postgresql.org (Postfix) with ESMTP id CC1BD475B47 + for ; + Thu, 20 Feb 2003 05:05:37 -0500 (EST) +Received: from mudshark.poodle.dog ([144.135.25.69]) by + mta03ps.bigpond.com (Netscape Messaging Server 4.15 mta03ps Jul + 16 2002 22:47:55) with SMTP id HALQPC00.CND for + ; Thu, 20 Feb 2003 20:05:36 +1000 +Received: from CPE-144-132-182-167.nsw.bigpond.net.au ([144.132.182.167]) by + psmam01bpa.bigpond.com(MailRouter V3.0n 71/4716437); + 20 Feb 2003 20:05:36 +Subject: Re: Peluang Usaha yang Luar Biasa +From: Mike Nielsen +Cc: Postgresql performance +In-Reply-To: +References: +Content-Type: multipart/alternative; boundary="=-csV1wqswsuOXUWmbacSD" +Organization: M. Nielsen & Associates Pty Ltd +Message-Id: <1045735532.8649.72.camel@mudshark.poodle.dog> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.2 +Date: 20 Feb 2003 21:05:32 +1100 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/138 +X-Sequence-Number: 1194 + +--=-csV1wqswsuOXUWmbacSD +Content-Type: text/plain +Content-Transfer-Encoding: 7bit + +Could you send us the results of an EXPLAIN ANALYZE? It may make it +easier to follow your problem. + + +On Thu, 2003-02-20 at 17:24, Ahmad Abdul Haq wrote: + +> http://www.sndfocus.biz/go.cgi/foryou +> http://www.foreverstore.cjb.net +> +> Terima kasih atas waktu yang Anda luangkan untuk membaca email ini. Siapa +> tahu, ini akan mengubah kehidupan anda. +> +> Dalam kesempatan ini saya ingin memperkenalkan kepada Anda sebuah usaha +> sampingan yang bila Anda lakukan sesuai dengan sistem, bisa memberikan +> penghasilan utama buat Anda dan keluarga Anda. Dengan usaha sampingan ini +> Anda juga bisa membentu program pemerintah untuk memerangi kemiskinan dan +> pengangguran. +> +> Bisnis yang saya perkenalkan ini adalah multilevel marketing (MLM). MLM yang +> saya perkenalkan ini adalah MLM murni dan bukan money game yaitu Forever +> Young Indonesia (FYI) yang telah berdiri sejak 1989 di Indonesia. FYI adalah +> murni milik bangsa Indonesia. Untuk menjalankannya Anda telah disediakan +> sistem, produk, cara kerja, dan alat. Yang Anda perlu sediakan sendiri +> adalah modal yang relatif kecil sebagai uang pendaftaran yaitu Rp 55.000,00 +> serta ongkos kirim business kit Rp 10.000,- Sedangkan biaya bulanan untuk +> pembelian produk berkisar Rp 162.000 - 250.000,00. +> +> SISTEM +> +> Sistem yang Anda perlukan telah dirancang oleh para founder bisnis MLM FYI. +> Anda bisa melihat bisnis ini secara langsung di www.foreveryoung.co.id. Di +> dalamnya Anda juga bisa melihat legalitas bisnis ini. +> +> PRODUK +> +> Produk yang dipasarkan adalah produk yang setiap hari kita perlukan. Produk +> FYI berupa minuman kesehatan, makanan kesehatan, perlengkapan mandi dan +> cuci, kosmetik serta pupuk untuk tumbuhan dan ternak. Harganya sangat +> terjangkau. Produk FYI yang paling mahal saat ini adalah Adaplex, vitamin +> untuk anak-anak seharga Rp 236.500,00 (harga distributor untuk Pulau +> Jawa-Bali-Sumatera, berlaku sejak 1 Desember 2002). Sedangkan harga-harga +> lainnya seperti minuman kesehatan, makanan kesehatan, perlengkapan mandi dan +> cuci serta kosmetik relatif sama dengan produk yang lain di pasaran, tetapi +> kualitasnya jauh lebih baik. Beberapa produk makanan dan minuman kesehatan +> terbukti dapat mengatasi berbagai problem kesehatan sebagai pengobatan +> alternatif. +> +> CARA KERJA DAN ALAT +> +> Setelah Anda menjadi member secara resmi, Anda harus membeli produk FYI baik +> untuk Anda gunakan sendiri dan atau dijual lagi kepada orang lain. +> Seandainya Anda tidak mempunyai kepandaian untuk menjual, Anda bisa +> menggunakan produknya untuk keperluan Anda sendiri. +> +> Dalam bisnis ini syarat untuk mendapatkan bonus, Anda harus memiliki poin +> atas pembelian yang Anda lakukan. Minimal tiap bulan Anda harus memiliki +> Poin 120 PV, apabila dirupiahkan berkisar Rp 162.000,00 s.d. Rp 300.000,- +> tergantung pada produk yang Anda beli. +> +> Cara kerja berikutnya adalah mengembangkan jaringan agar Perolehan Poin Anda +> semakin meningkat. Dalam mengembangkan jaringan, tentu saja Anda harus +> menawarkan bisnis ini kepada orang lain, baik yang ada di sekitar Anda atau +> orang yang belum Anda kenal sama sekali, yaitu melalui internet, seperti apa +> yang saya lakukan saat ini. Apabila Anda tertarik untuk lebih mendalami +> bisnis ini, silakan Anda klik website saya +> http://www.sndfocus.biz/go.cgi/foryou yang diberikan oleh jaringan FYI. +> Website ini selain berisi data pribadi saya juga berisi tentang hal-hal yang +> perlu Anda ketahui tentang bisnis ini. Website ini adalah salah satu +> fasilitas yang juga bisa Anda miliki secara gratis apabila Anda bergabung +> dalam jaringan kami. Dalam website tersebut Anda bisa melihat potensi +> penghasilan, display produk dan harga produk, serta legalitas dari bisnis +> ini serta kelebihan bisnis ini di bandingkan dengan bisnis yang lain. +> +> Apabila Anda tertarik untuk menjalankan bisnis ini, silakan Anda klik di +> http://www.sndfocus.biz/go.cgi/foryou dan silakan Anda klik pada Join Now +> atau Sign Up. Setelah Anda mendapatkan konfirmasi alamat website Anda, +> silakan klik website Anda dan lakukan Up Grade dengan cara Klik pada Up +> Grade dan isikan data-data Anda dengan benar dan hati-hati. Sampai pada +> langkah Up Grade ini Anda tidak dipungut biaya apa pun, karena Anda belum +> terdaftar secara resmi. Setelah Anda melakukan pengisian formulir Up Grade +> silakan Anda menghubungi saya via e-mail aa_haq@telkom.net untuk memberi +> konfirmasi kepada saya tentang alamat pengiriman Business Kit. Saya akan +> mengirimkan Business Kit tersebut, dan setelah tiba di alamat Anda, barulah +> Anda mengirimkan uang pendaftaran beserta penggantian ongkos kirim Business +> Kit tersebut yang jumlah seluruhnya Rp 65.000,00. +> +> MENGAPA SAYA MENJALANKAN BISNIS INI? +> +> Mungkin Anda bertanya, kenapa Anda harus menjalankan bisnis ini? Atau kenapa +> saya menjalankan bisnis ini? Alasan saya menjalankan bisnis ini adalah saya +> ingin memiliki penghasilan tambahan yang jumlahnya cukup lumayan untuk masa +> depan keluarga saya. Coba Anda bayangkan, dua tahun setelah saya menjalankan +> bisnis ini secara benar dan sesuai dengan sistem, saya bisa mendapatkan +> penghasilan tambahan sebesar Rp 20 juta minimal per bulan. Ini bukan omong +> kosong, karena sudah ada yang mendapatkannya, dan kesempatan bagi saya masih +> sangat-sangat luas. Apakah Anda tertarik? Saya yakin Anda sangat tertarik +> dan ingin membuktikannya. +> +> Apa yang harus Anda lakukan apabila Anda sudah terdaftar secara resmi dan +> ingin sukses dalam bisnis seperti ini: +> +> 1. Menggunakan produk Forever Young Indonesia (mengganti merek produk yang +> selama ini Anda pakai). Apabila memungkinkan Anda bisa juga menjualnya +> kepada orang lain. Setiap bulan Anda harus mempunyai poin 120 atas pembelian +> produk untuk keluarga Anda atau untuk dijual kepada orang lain. +> +> 2. Mengajak orang lain baik secara off line (langsung) maupun secara on line +> (menggunakan internet). Ini sangat berguna untuk memperbesar jaringan Anda. +> Sebagai awalnya Anda cukup memiliki dua orang "frontline" (downline +> langsung). Apabila ada lagi orang yang bergabung, letakkan dia di bawah +> downline Anda, agar jaringan Anda semakin besar. Dalam mengembangkan +> jaringan, Anda bisa banyak berkonsultasi dengan upline Anda, baik upline +> langsung maupun upline tidak langsung. Anda juga bisa berkonsultasi dengan +> pemilik Stockiest dan DC (distribution center), yakni penyedia produk-produk +> FYI yang tersebar di seluruh Indonesia. +> +> 3. Mengikuti beberapa Training untuk lebih lancar menjalankan usaha ini. +> +> Selain Anda harus mengunjungi situs http://www.sndfocus.biz/go.cgi/foryou, +> jangan lewatkan juga toko online saya di http://www.foreverstore.cjb.net +> yang berisi keterangan lengkap mengenai bisnis ini. +> +> Berikut data pribadi saya agar Anda lebih kenal dengan saya: +> +> Nama: +> Ahmad Abdul Haq +> No. Distributor FYI: +> I-700654 +> Alamat Rumah: +> Jalan Bukit Flamboyan VI No. 286 +> Perumnas Bukit Sendang Mulyo +> Semarang 50272 +> Telepon Rumah: +> 0815-663-2571 +> Alamat Kantor: +> Kanwil XIII Ditjen Anggaran Semarang +> Jalan Pemuda No. 2, Semarang 50138 +> Telepon Kantor: +> 024-3515989 pesawat 215 +> Faksimili Kantor: +> 024-3545877 +> Alamat E-mail: +> aa_haq@telkom.net +> +> +> Salam Hormat +> +> +> +> Ahmad Abdul Haq +> http://www.sndfocus.biz/go.cgi/foryou +> http://www.foreverstore.cjb.net +> +> ---------------------------------------------------------------------------- +> Ikuti polling TELKOM Memo 166 di www.plasa.com dan menangkan hadiah masing-masing Rp 250.000 tunai +> ---------------------------------------------------------------------------- +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 6: Have you searched our list archives? +> +> http://archives.postgresql.org + + + +--=-csV1wqswsuOXUWmbacSD +Content-Type: text/html; charset=utf-8 +Content-Transfer-Encoding: 7bit + + + + + + + + +Could you send us the results of an EXPLAIN ANALYZE?  It may make it easier to follow your problem.
+
+
+On Thu, 2003-02-20 at 17:24, Ahmad Abdul Haq wrote: +

+
http://www.sndfocus.biz/go.cgi/foryou
+http://www.foreverstore.cjb.net
+
+Terima kasih atas waktu yang Anda luangkan untuk membaca email ini. Siapa
+tahu, ini akan mengubah kehidupan anda.
+
+Dalam kesempatan ini saya ingin memperkenalkan kepada Anda sebuah usaha
+sampingan yang bila Anda lakukan sesuai dengan sistem, bisa memberikan
+penghasilan utama buat Anda dan keluarga Anda. Dengan usaha sampingan ini
+Anda juga bisa membentu program pemerintah untuk memerangi kemiskinan dan
+pengangguran.
+
+Bisnis yang saya perkenalkan ini adalah multilevel marketing (MLM). MLM yang
+saya perkenalkan ini adalah MLM murni dan bukan money game yaitu Forever
+Young Indonesia (FYI) yang telah berdiri sejak 1989 di Indonesia. FYI adalah
+murni milik bangsa Indonesia. Untuk menjalankannya Anda telah disediakan
+sistem, produk, cara kerja, dan alat. Yang Anda perlu sediakan sendiri
+adalah modal yang relatif kecil sebagai uang pendaftaran yaitu Rp 55.000,00
+serta ongkos kirim business kit Rp 10.000,- Sedangkan biaya bulanan untuk
+pembelian produk berkisar Rp 162.000 - 250.000,00.
+
+SISTEM
+
+Sistem yang Anda perlukan telah dirancang oleh para founder bisnis MLM FYI.
+Anda bisa melihat bisnis ini secara langsung di www.foreveryoung.co.id. Di
+dalamnya Anda juga bisa melihat legalitas bisnis ini.
+
+PRODUK
+
+Produk yang dipasarkan adalah produk yang setiap hari kita perlukan. Produk
+FYI berupa minuman kesehatan, makanan kesehatan, perlengkapan mandi dan
+cuci, kosmetik serta pupuk untuk tumbuhan dan ternak. Harganya sangat
+terjangkau. Produk FYI yang paling mahal saat ini adalah Adaplex, vitamin
+untuk anak-anak seharga Rp 236.500,00 (harga distributor untuk Pulau
+Jawa-Bali-Sumatera, berlaku sejak 1 Desember 2002). Sedangkan harga-harga
+lainnya seperti minuman kesehatan, makanan kesehatan, perlengkapan mandi dan
+cuci serta kosmetik relatif sama dengan produk yang lain di pasaran, tetapi
+kualitasnya jauh lebih baik. Beberapa produk makanan dan minuman kesehatan
+terbukti dapat mengatasi berbagai problem kesehatan sebagai pengobatan
+alternatif.
+
+CARA KERJA DAN ALAT
+
+Setelah Anda menjadi member secara resmi, Anda harus membeli produk FYI baik
+untuk Anda gunakan sendiri dan atau dijual lagi kepada orang lain.
+Seandainya Anda tidak mempunyai kepandaian untuk menjual, Anda bisa
+menggunakan produknya untuk keperluan Anda sendiri.
+
+Dalam bisnis ini syarat untuk mendapatkan bonus, Anda harus memiliki poin
+atas pembelian yang Anda lakukan. Minimal tiap bulan Anda harus memiliki
+Poin 120 PV, apabila dirupiahkan berkisar Rp 162.000,00 s.d. Rp 300.000,-
+tergantung pada produk yang Anda beli.
+
+Cara kerja berikutnya adalah mengembangkan jaringan agar Perolehan Poin Anda
+semakin meningkat. Dalam mengembangkan jaringan, tentu saja Anda harus
+menawarkan bisnis ini kepada orang lain, baik yang ada di sekitar Anda atau
+orang yang belum Anda kenal sama sekali, yaitu melalui internet, seperti apa
+yang saya lakukan saat ini. Apabila Anda tertarik untuk lebih mendalami
+bisnis ini, silakan Anda klik website saya
+http://www.sndfocus.biz/go.cgi/foryou yang diberikan oleh jaringan FYI.
+Website ini selain berisi data pribadi saya juga berisi tentang hal-hal yang
+perlu Anda ketahui tentang bisnis ini. Website ini adalah salah satu
+fasilitas yang juga bisa Anda miliki secara gratis apabila Anda bergabung
+dalam jaringan kami. Dalam website tersebut Anda bisa melihat potensi
+penghasilan, display produk dan harga produk, serta legalitas dari bisnis
+ini serta kelebihan bisnis ini di bandingkan dengan bisnis yang lain.
+
+Apabila Anda tertarik untuk menjalankan bisnis ini, silakan Anda klik di
+http://www.sndfocus.biz/go.cgi/foryou dan silakan Anda klik pada Join Now
+atau Sign Up. Setelah Anda mendapatkan konfirmasi alamat website Anda,
+silakan klik website Anda dan lakukan Up Grade dengan cara Klik pada Up
+Grade dan isikan data-data Anda dengan benar dan hati-hati. Sampai pada
+langkah Up Grade ini Anda tidak dipungut biaya apa pun, karena Anda belum
+terdaftar secara resmi. Setelah Anda melakukan pengisian formulir Up Grade
+silakan Anda menghubungi saya via e-mail aa_haq@telkom.net untuk memberi
+konfirmasi kepada saya tentang alamat pengiriman Business Kit. Saya akan
+mengirimkan Business Kit tersebut, dan setelah tiba di alamat Anda, barulah
+Anda mengirimkan uang pendaftaran beserta penggantian ongkos kirim Business
+Kit tersebut yang jumlah seluruhnya Rp 65.000,00.
+
+MENGAPA SAYA MENJALANKAN BISNIS INI?
+
+Mungkin Anda bertanya, kenapa Anda harus menjalankan bisnis ini? Atau kenapa
+saya menjalankan bisnis ini? Alasan saya menjalankan bisnis ini adalah saya
+ingin memiliki penghasilan tambahan yang jumlahnya cukup lumayan untuk masa
+depan keluarga saya. Coba Anda bayangkan, dua tahun setelah saya menjalankan
+bisnis ini secara benar dan sesuai dengan sistem, saya bisa mendapatkan
+penghasilan tambahan sebesar Rp 20 juta minimal per bulan. Ini bukan omong
+kosong, karena sudah ada yang mendapatkannya, dan kesempatan bagi saya masih
+sangat-sangat luas. Apakah Anda tertarik? Saya yakin Anda sangat tertarik
+dan ingin membuktikannya.
+
+Apa yang harus Anda lakukan apabila Anda sudah terdaftar secara resmi dan
+ingin sukses dalam bisnis seperti ini:
+
+1. Menggunakan produk Forever Young Indonesia (mengganti merek produk yang
+selama ini Anda pakai). Apabila memungkinkan Anda bisa juga menjualnya
+kepada orang lain. Setiap bulan Anda harus mempunyai poin 120 atas pembelian
+produk untuk keluarga Anda atau untuk dijual kepada orang lain.
+
+2. Mengajak orang lain baik secara off line (langsung) maupun secara on line
+(menggunakan internet). Ini sangat berguna untuk memperbesar jaringan Anda.
+Sebagai awalnya Anda cukup memiliki dua orang "frontline" (downline
+langsung). Apabila ada lagi orang yang bergabung, letakkan dia di bawah
+downline Anda, agar jaringan Anda semakin besar. Dalam mengembangkan
+jaringan, Anda bisa banyak berkonsultasi dengan upline Anda, baik upline
+langsung maupun upline tidak langsung. Anda juga bisa berkonsultasi dengan
+pemilik Stockiest dan DC (distribution center), yakni penyedia produk-produk
+FYI yang tersebar di seluruh Indonesia.
+
+3. Mengikuti beberapa Training untuk lebih lancar menjalankan usaha ini.
+
+Selain Anda harus mengunjungi situs http://www.sndfocus.biz/go.cgi/foryou,
+jangan lewatkan juga toko online saya di http://www.foreverstore.cjb.net
+yang berisi keterangan lengkap mengenai bisnis ini.
+
+Berikut data pribadi saya agar Anda lebih kenal dengan saya:
+
+Nama:
+     Ahmad Abdul Haq
+No. Distributor FYI:
+     I-700654
+Alamat Rumah:
+     Jalan Bukit Flamboyan VI No. 286
+     Perumnas Bukit Sendang Mulyo
+     Semarang 50272
+Telepon Rumah:
+     0815-663-2571
+Alamat Kantor:
+     Kanwil XIII Ditjen Anggaran Semarang
+     Jalan Pemuda No. 2, Semarang 50138
+Telepon Kantor:
+     024-3515989 pesawat 215
+Faksimili Kantor:
+     024-3545877
+Alamat E-mail:
+     aa_haq@telkom.net
+
+
+Salam Hormat
+
+
+
+Ahmad Abdul Haq
+http://www.sndfocus.biz/go.cgi/foryou
+http://www.foreverstore.cjb.net
+
+----------------------------------------------------------------------------
+ Ikuti polling TELKOM Memo 166 di www.plasa.com dan menangkan hadiah masing-masing Rp 250.000 tunai
+ ----------------------------------------------------------------------------
+
+---------------------------(end of broadcast)---------------------------
+TIP 6: Have you searched our list archives?
+
+http://archives.postgresql.org
+
+

+
+
+
+
+
+
+
+ + + +--=-csV1wqswsuOXUWmbacSD-- + + +From pgsql-performance-owner@postgresql.org Thu Feb 20 06:32:23 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 74409475AD4 + for ; + Thu, 20 Feb 2003 06:31:47 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 54144-01 for ; + Thu, 20 Feb 2003 06:31:36 -0500 (EST) +Received: from platonic.cynic.net (platonic.cynic.net [204.80.150.245]) + by postgresql.org (Postfix) with ESMTP id E7916474E61 + for ; + Thu, 20 Feb 2003 06:30:51 -0500 (EST) +Received: from angelic.cynic.net (angelic-platonic.cvpn.cynic.net + [198.73.220.226]) by platonic.cynic.net (Postfix) with ESMTP + id D0C3ABFF8; Thu, 20 Feb 2003 11:30:52 +0000 (UTC) +Received: from localhost (localhost [127.0.0.1]) + by angelic.cynic.net (Postfix) with ESMTP + id AF7488736; Thu, 20 Feb 2003 20:30:50 +0900 (JST) +Date: Thu, 20 Feb 2003 20:30:50 +0900 (JST) +From: Curt Sampson +X-X-Sender: cjs@angelic-vtfw.cvpn.cynic.net +To: Ryan Bradetich +Cc: Josh Berkus , pgsql-performance@postgresql.org +Subject: Re: Questions about indexes? +In-Reply-To: <1045642252.17975.116.camel@beavis.ybsoft.com> +Message-ID: +References: <200302180937.21001.josh@agliodbs.com> + <1045642252.17975.116.camel@beavis.ybsoft.com> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/139 +X-Sequence-Number: 1195 + +On Wed, 19 Feb 2003, Ryan Bradetich wrote: + +> 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user x has an invalid shell. +> 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user y has an invalid shell. +> 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | user y has expired password. +> 2 | Mon Feb 17 00:34:24 MST 2003 | f101 | file /foo has improper owner. + +If you're going to normalize this a bit, you should start looking at +the data that are repeated and trying to get rid of the repititions. +First of all, the timestamp is repeated a lot, you might move that to a +separate table and just use a key into that table. But you might even +do better with multiple columns: combine the timestamp and host ID into +one table to get a "host report instance" and replace both those columns +with just that. If host-id/timestamp/category triplets are frequently +repeated, you might even consider combining the three into another +table, and just using an ID from that table with each anomaly. + +But the biggest space and time savings would come from normalizing your +anomalys themselves, because there's a huge amount repeated there. If you're +able to change the format to something like: + + invalid shell for user: x + invalid shell for user: y + expired password for user: y + improper owner for file: /foo + +You can split those error messages off into another table: + + anomaly_id | anomaly + -----------+------------------------------------------------ + 1 | invalid shell for user + 2 | expired password for user + 3 | improper owner for file + +And now your main table looks like this: + + host_id | timestamp | ctgr | anomaly_id | datum + --------+------------------------------+------+------------+------ + 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | 1 | x + 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | 1 | y + 1 | Mon Feb 17 00:34:24 MST 2003 | p101 | 2 | y + 2 | Mon Feb 17 00:34:24 MST 2003 | f101 | 3 | /foo + +cjs +-- +Curt Sampson +81 90 7737 2974 http://www.netbsd.org + Don't you know, in this new Dark Age, we're all light. --XTC + +From pgsql-performance-owner@postgresql.org Thu Feb 20 18:01:37 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 88F84475E6F + for ; + Thu, 20 Feb 2003 18:01:14 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 44813-05 for ; + Thu, 20 Feb 2003 18:01:03 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 8FE16475C14 + for ; + Thu, 20 Feb 2003 17:33:23 -0500 (EST) +Received: from [66.219.92.2] (HELO chocolate-mousse) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2849910; Thu, 20 Feb 2003 14:33:33 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Reply-To: josh@agliodbs.com +Organization: Aglio Database Solutions +To: Robert Treat +Subject: Re: Tuning scenarios (was Changing the default configuration) +Date: Thu, 20 Feb 2003 14:33:02 -0800 +X-Mailer: KMail [version 1.4] +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <200302140936.02011.josh@agliodbs.com> + <1045778701.14518.81.camel@camel> +In-Reply-To: <1045778701.14518.81.camel@camel> +Cc: pgsql-performance@postgresql.org +MIME-Version: 1.0 +Content-Transfer-Encoding: quoted-printable +Message-Id: <200302201433.02654.josh@agliodbs.com> +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/140 +X-Sequence-Number: 1196 + + +Robert, + +> > 1) Location of the pg_xlog for heavy-update databases. +>=20 +> I see you put this up pretty high on the list. Do you feel this is the +> most important thing you can do? For example, if you had a two drive +> installation, would you load the OS and main database files on 1 disk +> and put the pg_xlog on the second disk above all other configurations?= +=20 + +Yes, actually. On machines with 2 IDE disks, I've found that this can mak= +e=20 +as much as 30% difference in speed of serial/large UPDATE statements. + +> Ideally I recommend 3 disks, one for os, one for data, one for xlog; but +> if you only had 2 would the added speed benefits be worth the additional +> recovery complexity (if you data/xlog are on the same disk, you have 1 +> point of failure, one disk for backing up) + +On the other hand, with the xlog on a seperate disk, the xlog and the datab= +ase=20 +disks are unlikely to fail at the same time. So I don't personally see it = +as=20 +a recovery problem, but a benefit. + +--=20 +-Josh Berkus + Aglio Database Solutions + San Francisco + + +From pgsql-performance-owner@postgresql.org Thu Feb 20 18:44:02 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 3B5AF475CCE + for ; + Thu, 20 Feb 2003 18:43:59 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 56645-07 for ; + Thu, 20 Feb 2003 18:43:48 -0500 (EST) +Received: from localhost.localdomain (unknown [65.217.53.66]) + by postgresql.org (Postfix) with ESMTP id 4661D475AAC + for ; + Thu, 20 Feb 2003 18:36:00 -0500 (EST) +Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) + by localhost.localdomain (8.12.5/8.12.5) with ESMTP id h1L02w6P008714; + Thu, 20 Feb 2003 19:02:59 -0500 +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 h1KNZip17942; + Thu, 20 Feb 2003 18:35:44 -0500 +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 CWVL16WQ; Thu, 20 Feb 2003 18:35:29 -0500 +Subject: Re: Tuning scenarios (was Changing the default +From: Robert Treat +To: Josh Berkus +Cc: pgsql-performance@postgresql.org +In-Reply-To: <200302201433.02654.josh@agliodbs.com> +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <200302140936.02011.josh@agliodbs.com> + <1045778701.14518.81.camel@camel> + <200302201433.02654.josh@agliodbs.com> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +X-Mailer: Ximian Evolution 1.0.8 +Date: 20 Feb 2003 18:35:44 -0500 +Message-Id: <1045784144.15881.92.camel@camel> +Mime-Version: 1.0 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/141 +X-Sequence-Number: 1197 + +On Thu, 2003-02-20 at 17:33, Josh Berkus wrote: +> +> Robert, +> +> > > 1) Location of the pg_xlog for heavy-update databases. +> > +> > I see you put this up pretty high on the list. Do you feel this is the +> > most important thing you can do? For example, if you had a two drive +> > installation, would you load the OS and main database files on 1 disk +> > and put the pg_xlog on the second disk above all other configurations? +> +> Yes, actually. On machines with 2 IDE disks, I've found that this can make +> as much as 30% difference in speed of serial/large UPDATE statements. + +Do you know how well those numbers hold up under scsi and/ or raid based +system? (I'd assume anyone doing serious work would run scsi) + +> +> > Ideally I recommend 3 disks, one for os, one for data, one for xlog; but +> > if you only had 2 would the added speed benefits be worth the additional +> > recovery complexity (if you data/xlog are on the same disk, you have 1 +> > point of failure, one disk for backing up) +> +> On the other hand, with the xlog on a seperate disk, the xlog and the database +> disks are unlikely to fail at the same time. So I don't personally see it as +> a recovery problem, but a benefit. +> + +ok (playing a bit of devil's advocate here), but you have two possible +points of failure, the data disk and the xlog disk. If either one goes, +your in trouble. OTOH if you put the OS disk on one drive and it goes, +your database and xlog are still safe on the other drive. + +Robert Treat + + +From pgsql-performance-owner@postgresql.org Thu Feb 20 18:55:29 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 1B8AB474E5C + for ; + Thu, 20 Feb 2003 18:55:28 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 60950-03 for ; + Thu, 20 Feb 2003 18:55:17 -0500 (EST) +Received: from mail.libertyrms.com (unknown [209.167.124.227]) + by postgresql.org (Postfix) with ESMTP id 6A353475B8C + for ; + Thu, 20 Feb 2003 18:49:25 -0500 (EST) +Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 + (Debian)) + id 18m0RU-0000rf-00 + for ; Thu, 20 Feb 2003 18:49:28 -0500 +Date: Thu, 20 Feb 2003 18:49:28 -0500 +From: Andrew Sullivan +To: pgsql-performance@postgresql.org +Subject: Re: Tuning scenarios (was Changing the default +Message-ID: <20030220184928.D30080@mail.libertyrms.com> +Mail-Followup-To: Andrew Sullivan , + pgsql-performance@postgresql.org +References: <303E00EBDD07B943924382E153890E5434A909@cuthbert.rcsinc.local> + <200302140936.02011.josh@agliodbs.com> + <1045778701.14518.81.camel@camel> + <200302201433.02654.josh@agliodbs.com> + <1045784144.15881.92.camel@camel> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.2.5i +In-Reply-To: <1045784144.15881.92.camel@camel>; + from xzilla@users.sourceforge.net on Thu, Feb 20, 2003 at + 06:35:44PM -0500 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/142 +X-Sequence-Number: 1198 + +On Thu, Feb 20, 2003 at 06:35:44PM -0500, Robert Treat wrote: +> Do you know how well those numbers hold up under scsi and/ or raid based +> system? (I'd assume anyone doing serious work would run scsi) + +On some Sun E450s we have used, the machines are unusable for any +load with xlog on the same disk (in the case I'm remembering, these +are older 5400 RPM drives). Moving the xlog changed us for +something like 10tps to something like 30tps +in one seat-of-the-pants case. Sorry I can't be more specific. + +> ok (playing a bit of devil's advocate here), but you have two possible +> points of failure, the data disk and the xlog disk. If either one goes, +> your in trouble. OTOH if you put the OS disk on one drive and it goes, +> your database and xlog are still safe on the other drive. + +If you're really worried about that, use RAID 1+0. + +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 Feb 21 14:51:02 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 25FED475A71 + for ; + Thu, 20 Feb 2003 20:45:22 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 78776-07 for ; + Thu, 20 Feb 2003 20:45:11 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 4C80047580B + for ; + Thu, 20 Feb 2003 20:45:08 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1L1jAW39236 + for pgsql-performance@postgresql.org; + Fri, 21 Feb 2003 09:45:10 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1L1j5739005; + Fri, 21 Feb 2003 09:45:05 +0800 (WST) +Message-ID: <07e301c2d94a$e6eec450$6500a8c0@fhp.internal> +From: "Christopher Kings-Lynne" +To: "Manfred Koizar" , + "Chantal Ackermann" +Cc: "Josh Berkus" , + , +References: <3E50BECC.9090107@biomax.de> + + <3E520AD8.2000304@biomax.de> + + <3E5350AE.7080408@biomax.de> + <94095vcb2p7db03jmbhnu1agh3k2iqrodf@4ax.com> +Subject: Re: cost and actual time +Date: Fri, 21 Feb 2003 09:45:24 +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.2720.3000 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/161 +X-Sequence-Number: 1217 + +I nominate Manfred for support response award of the week! + +Chris + +----- Original Message ----- +From: "Manfred Koizar" +To: "Chantal Ackermann" +Cc: "Josh Berkus" ; ; + +Sent: Thursday, February 20, 2003 6:00 PM +Subject: Re: [PERFORM] cost and actual time + + +> On Wed, 19 Feb 2003 10:38:54 +0100, Chantal Ackermann +> wrote: +> >Nested Loop: 53508.86 msec +> >Merge Join: 113066.81 msec +> >Hash Join: 439344.44 msec +> +> Chantal, +> +> you might have reached the limit of what Postgres (or any other +> database?) can do for you with these data structures. Time for +> something completely different: Try calculating the counts in +> advance. +> +> CREATE TABLE occ_stat ( +> did INT NOT NULL, +> gid INT NOT NULL, +> cnt INT NOT NULL +> ) WITHOUT OIDS; +> +> CREATE INDEX occ_stat_dg ON occ_stat(did, gid); +> CREATE INDEX occ_stat_gd ON occ_stat(gid, did); +> +> There is *no* UNIQUE constraint on (did, gid). You get the numbers +> you're after by +> SELECT did, sum(cnt) AS cnt +> FROM occ_stat +> WHERE gid = 'whatever' +> GROUP BY did +> ORDER BY cnt DESC; +> +> occ_stat is initially loaded by +> +> INSERT INTO occ_stat +> SELECT did, gid, count(*) +> FROM g_o INNER JOIN d_o ON (g_o.sid = d_o.sid) +> GROUP BY did, gid; +> +> Doing it in chunks +> WHERE sid BETWEEN a::bigint AND b::bigint +> might be faster. +> +> You have to block any INSERT/UPDATE/DELETE activity on d_o and g_o +> while you do the initial load. If it takes too long, see below for +> how to do it in the background; hopefully the load task will catch up +> some day :-) +> +> Keeping occ_stat current: +> +> CREATE RULE d_o_i AS ON INSERT +> TO d_o DO ( +> INSERT INTO occ_stat +> SELECT NEW.did, g_o.gid, 1 +> FROM g_o +> WHERE g_o.sid = NEW.sid); +> +> CREATE RULE d_o_d AS ON DELETE +> TO d_o DO ( +> INSERT INTO occ_stat +> SELECT OLD.did, g_o.gid, -1 +> FROM g_o +> WHERE g_o.sid = OLD.sid); +> +> On UPDATE do both. Create a set of similar rules for g_o. +> +> These rules will create a lot of duplicates on (did, gid) in occ_stat. +> Updating existing rows and inserting only new combinations might seem +> obvious, but this method has concurrency problems (cf. the thread +> "Hard problem with concurrency" on -hackers). So occ_stat calls for +> reorganisation from time to time: +> +> BEGIN; +> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; +> CREATE TEMP TABLE t (did INT, gid INT, cnt INT) WITHOUT OIDS; +> +> INSERT INTO t +> SELECT did, gid, sum(cnt) +> FROM occ_stat +> GROUP BY did, gid +> HAVING count(*) > 1; +> +> DELETE FROM occ_stat +> WHERE t.did = occ_stat.did +> AND t.gid = occ_stat.gid; +> +> INSERT INTO occ_stat SELECT * FROM t; +> +> DROP TABLE t; +> COMMIT; +> VACUUM ANALYZE occ_stat; -- very important!! +> +> Now this should work, but the rules could kill INSERT/UPDATE/DELETE +> performance. Depending on your rate of modifications you might be +> forced to push the statistics calculation to the background. +> +> CREATE TABLE d_o_change ( +> sid BIGINT NOT NULL, +> did INT NOT NULL, +> cnt INT NOT NULL +> ) WITHOUT OIDS; +> +> ... ON INSERT TO d_o DO ( +> INSERT INTO d_o_change VALUES (NEW.sid, NEW.did, 1)); +> +> ... ON DELETE TO d_o DO ( +> INSERT INTO d_o_change VALUES (OLD.sid, OLD.did, -1)); +> +> ... ON UPDATE TO d_o +> WHERE OLD.sid != NEW.sid OR OLD.did != NEW.did +> DO both +> +> And the same for g_o. +> +> You need a task that periodically scans [dg]_o_change and does ... +> +> BEGIN; +> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; +> SELECT ; +> INSERT INTO occ_stat ; +> DELETE ; +> COMMIT; +> +> Don't forget to VACUUM! +> +> If you invest a little more work, I guess you can combine the +> reorganisation into the loader task ... +> +> I have no idea whether this approach is better than what you have now. +> With a high INSERT/UPDATE/DELETE rate it may lead to a complete +> performance disaster. You have to try ... +> +> Servus +> Manfred +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 3: if posting/reading through Usenet, please send an appropriate +> subscribe-nomail command to majordomo@postgresql.org so that your +> message can get through to the mailing list cleanly +> + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 02:45:48 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 2F641475B8F + for ; + Fri, 21 Feb 2003 02:45:47 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 38253-03 for ; + Fri, 21 Feb 2003 02:45:36 -0500 (EST) +Received: from saturn.hiddenservers.com (saturn.hiddenservers.com + [209.123.207.12]) + by postgresql.org (Postfix) with ESMTP id AE0CA475C85 + for ; + Fri, 21 Feb 2003 02:43:03 -0500 (EST) +Received: from [213.154.101.33] (helo=new) + by saturn.hiddenservers.com with smtp (Exim 3.36 #1) + id 18m7q2-0001Xr-00 + for pgsql-performance@postgresql.org; Fri, 21 Feb 2003 02:43:18 -0500 +Message-ID: <004501c2d97d$98927670$0900000a@new> +From: "Jakab Laszlo" +To: +Subject: performance issues for processing more then 150000 records / day. +Date: Fri, 21 Feb 2003 09:48:16 +0200 +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_0042_01C2D98E.5B627DC0" +X-Priority: 3 +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook Express 5.00.2919.6700 +X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 +X-AntiAbuse: This header was added to track abuse, + please include it with any abuse report +X-AntiAbuse: Primary Hostname - saturn.hiddenservers.com +X-AntiAbuse: Original Domain - postgresql.org +X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [0 0] +X-AntiAbuse: Sender Address Domain - sofasoft.ro +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/143 +X-Sequence-Number: 1199 + +This is a multi-part message in MIME format. + +------=_NextPart_000_0042_01C2D98E.5B627DC0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +Hello, + +We would like to use PostgreSQL for one project. +This project would need to handle some of 150000 - 200000 (thousands record= +s) per day. + +Is there somebody having experience with Postgresql in this kind of environ= +ment. +Can anybody advice us regarding specific PostgreSQL issues for such kind of= + datamanipulation ? + +Best Regards, +Jaki + +------=_NextPart_000_0042_01C2D98E.5B627DC0 +Content-Type: text/html; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + + + + + + + + +
Hello,
+
 
+
We would like to use PostgreSQL for one=20 +project.
+
This project would need to handle some of = +150000 -=20 +200000 (thousands records) per day.
+
 
+
Is there somebody having experience with P= +ostgresql=20 +in this kind of environment.
+
Can anybody advice us regarding specific P= +ostgreSQL=20 +issues for such kind of datamanipulation ?
+
 
+
Best Regards,
+
Jaki
+ +------=_NextPart_000_0042_01C2D98E.5B627DC0-- + + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 03:04:54 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 82AB0474E4F + for ; + Fri, 21 Feb 2003 03:04:51 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 39084-05 for ; + Fri, 21 Feb 2003 03:04:40 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id D5742474E61 + for ; + Fri, 21 Feb 2003 03:04:36 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1L84aA55003 + for pgsql-performance@postgresql.org; + Fri, 21 Feb 2003 16:04:36 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1L84X754913; + Fri, 21 Feb 2003 16:04:33 +0800 (WST) +Message-ID: <0a6901c2d97f$ea1369d0$6500a8c0@fhp.internal> +From: "Christopher Kings-Lynne" +To: "Jakab Laszlo" , + +References: <004501c2d97d$98927670$0900000a@new> +Subject: Re: performance issues for processing more then 150000 records / day. +Date: Fri, 21 Feb 2003 16:04:52 +0800 +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_0A66_01C2D9C2.F8169EB0" +X-Priority: 3 +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook Express 6.00.2720.3000 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/144 +X-Sequence-Number: 1200 + +This is a multi-part message in MIME format. + +------=_NextPart_000_0A66_01C2D9C2.F8169EB0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +Hi Jakab, + +I don't see why postgresql wouldn't be able to handle that - it's a relativ= +ely small amount of data. + +When you say 150000 records/day, do you mean: + +1. 150000 inserts/day (ie. database grows constantly, quickly) +2. 150000 updates/deletes/day +3. 150000 transactions/select/day + +If you give us a little more information, we'll be able to help you tune yo= +ur postgres for your application. + +Regards, + +Chris + + ----- Original Message -----=20 + From: Jakab Laszlo=20 + To: pgsql-performance@postgresql.org=20 + Sent: Friday, February 21, 2003 3:48 PM + Subject: [PERFORM] performance issues for processing more then 150000 rec= +ords / day. + + + Hello, + + We would like to use PostgreSQL for one project. + This project would need to handle some of 150000 - 200000 (thousands reco= +rds) per day. + + Is there somebody having experience with Postgresql in this kind of envir= +onment. + Can anybody advice us regarding specific PostgreSQL issues for such kind = +of datamanipulation ? + + Best Regards, + Jaki + +------=_NextPart_000_0A66_01C2D9C2.F8169EB0 +Content-Type: text/html; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + + + + + + + + +
Hi Jakab,
+
 
+
I don't see why postgresql wouldn't be abl= +e to=20 +handle that - it's a relatively small amount of data.
+
 
+
When you say 150000 records/day, do you=20 +mean:
+
 
+
1. 150000 inserts/day (ie. database grows= +=20 +constantly, quickly)
+
2. 150000 updates/deletes/day
+
3. 150000 transactions/select/day +
 
+
If you give us a little more information, = +we'll be=20 +able to help you tune your postgres for your application.
+
 
+
Regards,
+
 
+
Chris
+
 
+
+
----- Original Message -----
+ Fro= +m:=20 + Jakab=20 + Laszlo
+
To: pgsql-performance@postgr= +esql.org=20 +
+
Sent: Friday, February 21, 2003 3:= +48=20 + PM
+
Subject: [PERFORM] performance iss= +ues for=20 + processing more then 150000 records / day.
+

+
Hello,
+
 
+
We would like to use PostgreSQL for one= +=20 + project.
+
This project would need to handle some o= +f 150000=20 + - 200000 (thousands records) per day.
+
 
+
Is there somebody having experience with= +=20 + Postgresql in this kind of environment.
+
Can anybody advice us regarding specific= +=20 + PostgreSQL issues for such kind of datamanipulation ?
+
 
+
Best Regards,
+
Jaki
+ +------=_NextPart_000_0A66_01C2D9C2.F8169EB0-- + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 03:37:28 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id D0789475AEC + for ; + Fri, 21 Feb 2003 03:30:16 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 48857-03 for ; + Fri, 21 Feb 2003 03:30:05 -0500 (EST) +Received: from saturn.hiddenservers.com (saturn.hiddenservers.com + [209.123.207.12]) + by postgresql.org (Postfix) with ESMTP id A6BAA474E61 + for ; + Fri, 21 Feb 2003 03:28:45 -0500 (EST) +Received: from [213.154.101.33] (helo=new) + by saturn.hiddenservers.com with smtp (Exim 3.36 #1) + id 18m8Y5-0000vv-00; Fri, 21 Feb 2003 03:28:49 -0500 +Message-ID: <007c01c2d983$f3d60d70$0900000a@new> +From: "Jakab Laszlo" +To: "Christopher Kings-Lynne" , + +References: <004501c2d97d$98927670$0900000a@new> + <0a6901c2d97f$ea1369d0$6500a8c0@fhp.internal> +Subject: Re: performance issues for processing more then 150000 records / day. +Date: Fri, 21 Feb 2003 10:33:42 +0200 +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_0079_01C2D994.B49FE480" +X-Priority: 3 +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook Express 5.00.2919.6700 +X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 +X-AntiAbuse: This header was added to track abuse, + please include it with any abuse report +X-AntiAbuse: Primary Hostname - saturn.hiddenservers.com +X-AntiAbuse: Original Domain - postgresql.org +X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [0 0] +X-AntiAbuse: Sender Address Domain - sofasoft.ro +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/145 +X-Sequence-Number: 1201 + +This is a multi-part message in MIME format. + +------=_NextPart_000_0079_01C2D994.B49FE480 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +Hello Chris, + +I mean here 150000 inserts/day ( quickly grows constantly )... - with tran= +sactions and on the same table ... maybe after one significant amount of ti= +me we can move the records of one year to one archive table ... +And some 2-3 millions of selects / day ...=20 + +I would like to know also some hardware related advice. + +thanks, +Jaki + ----- Original Message -----=20 + From: Christopher Kings-Lynne=20 + To: Jakab Laszlo ; pgsql-performance@postgresql.org=20 + Sent: Friday, February 21, 2003 10:04 AM + Subject: Re: [PERFORM] performance issues for processing more then 150000= + records / day. + + + Hi Jakab, +=20=20=20 + I don't see why postgresql wouldn't be able to handle that - it's a relat= +ively small amount of data. +=20=20=20 + When you say 150000 records/day, do you mean: +=20=20=20 + 1. 150000 inserts/day (ie. database grows constantly, quickly) + 2. 150000 updates/deletes/day + 3. 150000 transactions/select/day +=20=20=20 + If you give us a little more information, we'll be able to help you tune = +your postgres for your application. +=20=20=20 + Regards, +=20=20=20 + Chris + + ----- Original Message -----=20 + From: Jakab Laszlo=20 + To: pgsql-performance@postgresql.org=20 + Sent: Friday, February 21, 2003 3:48 PM + Subject: [PERFORM] performance issues for processing more then 150000 r= +ecords / day. + + + Hello, + + We would like to use PostgreSQL for one project. + This project would need to handle some of 150000 - 200000 (thousands re= +cords) per day. + + Is there somebody having experience with Postgresql in this kind of env= +ironment. + Can anybody advice us regarding specific PostgreSQL issues for such kin= +d of datamanipulation ? + + Best Regards, + Jaki + +------=_NextPart_000_0079_01C2D994.B49FE480 +Content-Type: text/html; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + + + + + + + + +
Hello Chris,
+
 
+
I mean here 150000 inserts/day ( quickly g= +rows=20 +constantly )...  - with transactions and on the same table ... maybe a= +fter=20 +one significant amount of time we can move the records of one year to = +one=20 +archive table ...
+
And some 2-3 millions of selects / da= +y ...=20 +
+
 
+
I would like to know also some hardware re= +lated=20 +advice.
+
 
+
thanks,
+
Jaki
+
+
----- Original Message -----
+ Fro= +m:=20 + Christopher Kings-Lynne +
To: J= +akab=20 + Laszlo ; pgsql-performance@postgresql.org= +=20 +
+
Sent: Friday, February 21, 2003 10= +:04=20 + AM
+
Subject: Re: [PERFORM] performance= + issues=20 + for processing more then 150000 records / day.
+

+
Hi Jakab,
+
 
+
I don't see why postgresql wouldn't be a= +ble to=20 + handle that - it's a relatively small amount of data.
+
 
+
When you say 150000 records/day, do you= +=20 + mean:
+
 
+
1. 150000 inserts/day (ie. database grow= +s=20 + constantly, quickly)
+
2. 150000 updates/deletes/day +
3. 150000 transactions/select/day= +
+
 
+
If you give us a little more information= +, we'll=20 + be able to help you tune your postgres for your application.
+
 
+
Regards,
+
 
+
Chris
+
 
+
+
----- Original Message -----
+ F= +rom:=20 + Jakab=20 + Laszlo
+
To: pgsql-performance@postgresql.o= +rg=20 +
+
Sent: Friday, February 21, 2003 = +3:48=20 + PM
+
Subject: [PERFORM] performance i= +ssues=20 + for processing more then 150000 records / day.
+

+
Hello,
+
 
+
We would like to use PostgreSQL for on= +e=20 + project.
+
This project would need to handle some= + of=20 + 150000 - 200000 (thousands records) per day.
+
 
+
Is there somebody having experience wi= +th=20 + Postgresql in this kind of environment.
+
Can anybody advice us regarding specif= +ic=20 + PostgreSQL issues for such kind of datamanipulation ?
+
 
+
Best Regards,
+
Jaki
+ +------=_NextPart_000_0079_01C2D994.B49FE480-- + + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 03:45:10 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 7F1D4475C45 + for ; + Fri, 21 Feb 2003 03:44:33 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 50184-08 for ; + Fri, 21 Feb 2003 03:44:22 -0500 (EST) +Received: from www.pspl.co.in (www.pspl.co.in [202.54.11.65]) + by postgresql.org (Postfix) with ESMTP id 4F8C547592C + for ; + Fri, 21 Feb 2003 03:41:45 -0500 (EST) +Received: (from root@localhost) + by www.pspl.co.in (8.11.6/8.11.6) id h1L8fj425011 + for ; Fri, 21 Feb 2003 14:11:45 +0530 +Received: from daithan (daithan.intranet.pspl.co.in [192.168.7.161]) + by www.pspl.co.in (8.11.6/8.11.0) with ESMTP id h1L8fjt25006 + for ; Fri, 21 Feb 2003 14:11:45 +0530 +From: "Shridhar Daithankar" +To: +Date: Fri, 21 Feb 2003 14:12:25 +0530 +MIME-Version: 1.0 +Subject: Re: performance issues for processing more then 150000 records / day. +Reply-To: shridhar_daithankar@persistent.co.in +Message-ID: <3E5633C9.27527.439F17A@localhost> +In-reply-to: <007c01c2d983$f3d60d70$0900000a@new> +X-mailer: Pegasus Mail for Windows (v4.02) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/146 +X-Sequence-Number: 1202 + +On 21 Feb 2003 at 10:33, Jakab Laszlo wrote: + +> +> Hello Chris, +> +> I mean here 150000 inserts/day ( quickly grows constantly )... - with +> transactions and on the same table ... maybe after onesignificant amount of +> time we can move the records of one year to one archivetable ... +> Andsome 2-3 millions of selects / day ... +> +> I would like to know also some hardware related advice. + +Use a 64 bit machine with SCSI, preferrably RAID to start with. You can search +list archives for similar problems and solutions. + +HTH + +Bye + Shridhar + +-- +Fog Lamps, n.: Excessively (often obnoxiously) bright lamps mounted on the +fronts of automobiles; used on dry, clear nights to indicate that the driver's +brain is in a fog. See also "Idiot Lights". + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 09:27:59 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 4EEA4475A71 + for ; + Fri, 21 Feb 2003 09:27:44 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 93062-03 for ; + Fri, 21 Feb 2003 09:27:33 -0500 (EST) +Received: from mailserver1.hrz.tu-darmstadt.de + (mailserver1.hrz.tu-darmstadt.de [130.83.126.41]) + by postgresql.org (Postfix) with ESMTP id 84F1A474E5C + for ; + Fri, 21 Feb 2003 09:27:23 -0500 (EST) +Received: from paris (paris.dvs1.informatik.tu-darmstadt.de [130.83.27.43]) + by mailserver1.hrz.tu-darmstadt.de (8.12.1/8.12.1) with ESMTP id + h1L8qowY014076; Fri, 21 Feb 2003 09:52:55 +0100 +Received: from dvs1.informatik.tu-darmstadt.de (bali [130.83.27.100]) + by paris (Postfix) with ESMTP + id 061DCFEFF; Fri, 21 Feb 2003 09:52:48 +0100 (MET) +Message-ID: <3E55E8E0.60201@dvs1.informatik.tu-darmstadt.de> +Date: Fri, 21 Feb 2003 09:52:48 +0100 +From: Matthias Meixner +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 +X-Accept-Language: de, en +MIME-Version: 1.0 +To: Mario Weilguni +Cc: Manfred Koizar , pgsql-performance@postgresql.org +Subject: Re: Write ahead logging +References: <3E5494DA.20003@dvs1.informatik.tu-darmstadt.de> + + <000b01c2d8c2$54008350$8f01c00a@icomedias.com> +In-Reply-To: <000b01c2d8c2$54008350$8f01c00a@icomedias.com> +X-Enigmail-Version: 0.71.0.0 +X-Enigmail-Supports: pgp-inline, pgp-mime +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/150 +X-Sequence-Number: 1206 + +Mario Weilguni wrote: +>>>So the question is: has anybody verified, that the log is written to disk +>>>before returning from commit? +>> +>>Some (or all?) IDE disks are known to lie: they report success as +>>soon as the data have reached the drive's RAM. +>=20 +>=20 +> under linux, hdparm -W can turn off the write cache of IDE disk, maybe you +> should try with write-caching turned off. + +Yes, that made a big difference. Latency went up to 25-95ms. + +Regards, + + Matthias Meixner + +--=20 +Matthias Meixner meixner@informatik.tu-darmstadt.de +Technische Universit=E4t Darmstadt +Datenbanken und Verteilte Systeme Telefon (+49) 6151 16 6232 +Wilhelminenstra=DFe 7, D-64283 Darmstadt, Germany Fax (+49) 6151 16 6229 + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 04:16:32 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 4FFDD474E5C + for ; + Fri, 21 Feb 2003 04:14:50 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 64493-01 for ; + Fri, 21 Feb 2003 04:14:39 -0500 (EST) +Received: from grunt26.ihug.com.au (grunt26.ihug.com.au [203.109.249.146]) + by postgresql.org (Postfix) with ESMTP id 5AEC8474E4F + for ; + Fri, 21 Feb 2003 04:14:39 -0500 (EST) +Received: from p148-tnt1.adl.ihug.com.au (postgresql.org) [203.173.248.148] + by grunt26.ihug.com.au with esmtp (Exim 3.35 #1 (Debian)) + id 18m9GP-0007hx-00; Fri, 21 Feb 2003 20:14:38 +1100 +Message-ID: <3E55EE62.6010909@postgresql.org> +Date: Fri, 21 Feb 2003 19:46:18 +1030 +From: Justin Clift +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; + rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Jakab Laszlo +Cc: Christopher Kings-Lynne , + pgsql-performance@postgresql.org +Subject: Re: performance issues for processing more then 150000 +References: <004501c2d97d$98927670$0900000a@new> + <0a6901c2d97f$ea1369d0$6500a8c0@fhp.internal> + <007c01c2d983$f3d60d70$0900000a@new> +In-Reply-To: <007c01c2d983$f3d60d70$0900000a@new> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/147 +X-Sequence-Number: 1203 + +Jakab Laszlo wrote: +> Hello Chris, +> +> I mean here 150000 inserts/day ( quickly grows constantly )... - with +> transactions and on the same table ... maybe after one significant +> amount of time we can move the records of one year to one archive table ... +> And some 2-3 millions of selects / day ... + +That's no problem at all, depending on: + + + How complex are the queries you're intending on running? + + + How will the data be spread between the tables? + + + The amount of data per row also makes a difference, if it is +extremely large. + + +> I would like to know also some hardware related advice. + +You're almost definitely going to be needing a SCSI or better RAID +array, plus a server with quite a few GB's of ECC memory. + +If you need to get specific about hardware to the point of knowing +exactly what you're needing, you're likely best to pay a good PostgreSQL +consultant to study your proposal in depth. + +Hope this helps. + +Regards and best wishes, + +Justin Clift + + +> thanks, +> Jaki + +-- +"My grandfather once told me that there are two kinds of people: those +who work and those who take the credit. He told me to try to be in the +first group; there was less competition there." +- Indira Gandhi + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 04:54:25 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id 31CC747580B; Fri, 21 Feb 2003 04:54:23 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 72194-04; Fri, 21 Feb 2003 04:54:12 -0500 (EST) +Received: from saturn.hiddenservers.com (saturn.hiddenservers.com + [209.123.207.12]) by postgresql.org (Postfix) with ESMTP + id 6B917474E61; Fri, 21 Feb 2003 04:54:12 -0500 (EST) +Received: from [213.154.101.33] (helo=new) + by saturn.hiddenservers.com with smtp (Exim 3.36 #1) + id 18m9sj-0003zr-00; Fri, 21 Feb 2003 04:54:13 -0500 +Message-ID: <00e101c2d98f$ea9a32c0$0900000a@new> +From: "Jakab Laszlo" +To: "Justin Clift" +Cc: +References: <004501c2d97d$98927670$0900000a@new> + <0a6901c2d97f$ea1369d0$6500a8c0@fhp.internal> + <007c01c2d983$f3d60d70$0900000a@new> + <3E55EE62.6010909@postgresql.org> +Subject: Re: performance issues for processing more then 150000 +Date: Fri, 21 Feb 2003 11:59: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 5.00.2919.6700 +X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 +X-AntiAbuse: This header was added to track abuse, + please include it with any abuse report +X-AntiAbuse: Primary Hostname - saturn.hiddenservers.com +X-AntiAbuse: Original Domain - postgresql.org +X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [0 0] +X-AntiAbuse: Sender Address Domain - sofasoft.ro +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/148 +X-Sequence-Number: 1204 + + +> Jakab Laszlo wrote: +> > Hello Chris, +> > +> > I mean here 150000 inserts/day ( quickly grows constantly )... - with +> > transactions and on the same table ... maybe after one significant +> > amount of time we can move the records of one year to one archive table +... +> > And some 2-3 millions of selects / day ... +> +> That's no problem at all, depending on: +> +> + How complex are the queries you're intending on running? +> + How will the data be spread between the tables? +> +> + The amount of data per row also makes a difference, if it is +> extremely large. +> + +The main information is a barcode. The big table will have aprox 3 fields +(just id type fields). +Not so complex there will be mainly about 50 tables with all the info +totally normalized and with some around 10-20 tables which make the links +between them. Usually the join is starting form one much smaller table and +with left join goes trough the big table (barcodes) and maybe also on other +tables. +And then this table with barcode (this is the bigone with 150000 +records/day) linked to other smaller tables. ( 1 bigger with aprox 7000 +inserts/day). + +> > I would like to know also some hardware related advice. +> +> You're almost definitely going to be needing a SCSI or better RAID +> array, plus a server with quite a few GB's of ECC memory. + +Unfortunatelly the hardware budget should be keept as low as possible. +I was thinking is there could be reliable solution based on dual processor +and ATA 133 raid mirroring normally with some gigs of memory. + +Thanks, +Jaki + + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 05:32:53 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 24A7747580B + for ; + Fri, 21 Feb 2003 05:32:41 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 76163-06 for ; + Fri, 21 Feb 2003 05:32:30 -0500 (EST) +Received: from www.pspl.co.in (www.pspl.co.in [202.54.11.65]) + by postgresql.org (Postfix) with ESMTP id 8C7324758FE + for ; + Fri, 21 Feb 2003 05:31:45 -0500 (EST) +Received: (from root@localhost) + by www.pspl.co.in (8.11.6/8.11.6) id h1LAVlG07198 + for ; Fri, 21 Feb 2003 16:01:47 +0530 +Received: from daithan (daithan.intranet.pspl.co.in [192.168.7.161]) + by www.pspl.co.in (8.11.6/8.11.0) with ESMTP id h1LAVlt07192 + for ; Fri, 21 Feb 2003 16:01:47 +0530 +From: "Shridhar Daithankar" +To: +Date: Fri, 21 Feb 2003 16:02:26 +0530 +MIME-Version: 1.0 +Subject: Re: performance issues for processing more then 150000 +Reply-To: shridhar_daithankar@persistent.co.in +Message-ID: <3E564D92.8962.49EAB1F@localhost> +In-reply-to: <00e101c2d98f$ea9a32c0$0900000a@new> +X-mailer: Pegasus Mail for Windows (v4.02) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/149 +X-Sequence-Number: 1205 + +On 21 Feb 2003 at 11:59, Jakab Laszlo wrote: +> Unfortunatelly the hardware budget should be keept as low as possible. +> I was thinking is there could be reliable solution based on dual processor +> and ATA 133 raid mirroring normally with some gigs of memory. + +Gigs of memory are not as much important as much badnwidth you have. For these +kind of databases, a gig or two would not make as much difference as much +faster disks would do. + +If you are hell bent on budget, I suggest you write a custom layer that +consolidates results of query from two boxes and throw two intel boxes at it. +Essentially partitioning the data. + +If your queries are simple enough to split and consolidate, try it. It might +give you best performance.. + + +Bye + Shridhar + +-- +Blutarsky's Axiom: Nothing is impossible for the man who will not listen to +reason. + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 10:34:18 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 5385D475C45 + for ; + Fri, 21 Feb 2003 10:34:16 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 05702-03 for ; + Fri, 21 Feb 2003 10:34:05 -0500 (EST) +Received: from maverick.digital-ics.com (maverick.digital-ics.com + [63.239.101.196]) + by postgresql.org (Postfix) with ESMTP id 117E74758FE + for ; + Fri, 21 Feb 2003 10:32:33 -0500 (EST) +Received: from digital-ics.com (gremlin.ics.digital-ics.com [192.168.2.52]) + by maverick.digital-ics.com (8.12.6/8.12.6) with ESMTP id + h1LFWbhm000889 for ; + Fri, 21 Feb 2003 10:32:37 -0500 (EST) +Message-ID: <3E564695.7030906@digital-ics.com> +Date: Fri, 21 Feb 2003 10:32:37 -0500 +From: Kevin White +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Really bad insert performance: what did I do wrong? +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/151 +X-Sequence-Number: 1207 + +I've use PostgreSQL for some pretty amazing things, and was a proponent +of using it here. I set up 7.3.1 on my development RedHat 8 box, and it +was fine. I need to load about 700,000 rows into one table, the rows +only having 6 columns, and the load on my box happens in just a couple +of minutes (there's some calculation while the data is loading, and that +time was acceptable to me). + +My box, however, isn't a production server, so I attempted to create the +database again on a Sun Blade: + +SunOS trident 5.8 Generic_108528-17 sun4u sparc SUNW,UltraAX-i2 +Status of processor 0 as of: 02/21/03 10:10:10 + Processor has been on-line since 01/13/03 13:53:51. + The sparcv9 processor operates at 500 MHz, + and has a sparcv9 floating point processor. + +It isn't the world's fastest box, but should be fast enough for this. + +However... + +It took almost 2 days to load the table on this box. The postgresql +process was constantly eating up all of the CPU time it could get, while +loading, at times, less than 1 row a second. + +Now, I KNOW something is wrong, and it probably isn't postgres. :) + +I turned off the index on the table (there was only one, on three +fields) and made the whole load happen in a transaction. The 2 day +result was after those changes were made. + +I compiled postgres myself, using the gcc 3.2.2 package from sunfreeware. + +Any thoughts? I know that postgres should be more than capable of +loading this data quickly on this box...I figured it could possibly take +twice as long...and I thought my problem would be i/o related, not CPU. + +Thanks! + +Kevin + + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 10:49:27 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 74AF7475A71 + for ; + Fri, 21 Feb 2003 10:48:06 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 08951-02 for ; + Fri, 21 Feb 2003 10:47:55 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 8C993475C26 + for ; + Fri, 21 Feb 2003 10:45:00 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1LFj35u015035; + Fri, 21 Feb 2003 10:45:03 -0500 (EST) +To: Kevin White +Cc: pgsql-performance@postgresql.org +Subject: Re: Really bad insert performance: what did I do wrong? +In-reply-to: <3E564695.7030906@digital-ics.com> +References: <3E564695.7030906@digital-ics.com> +Comments: In-reply-to Kevin White + message dated "Fri, 21 Feb 2003 10:32:37 -0500" +Date: Fri, 21 Feb 2003 10:45:03 -0500 +Message-ID: <15034.1045842303@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/153 +X-Sequence-Number: 1209 + +Kevin White writes: +> My box, however, isn't a production server, so I attempted to create the +> database again on a Sun Blade: +> ... +> It took almost 2 days to load the table on this box. + +Yipes. We found awhile ago that Solaris' standard qsort() really sucks, +but 7.3 should work around that --- and I don't think qsort would be +invoked during data load anyway. + +Do you want to rebuild Postgres with profiling enabled, and get a gprof +trace so we can see where the time is going? You don't need to run it +for two days --- a few minutes' worth of runtime should be plenty. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Fri Feb 21 10:49:16 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 778D94758E6 + for ; + Fri, 21 Feb 2003 10:48:50 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 08951-04 for ; + Fri, 21 Feb 2003 10:48:39 -0500 (EST) +Received: from maverick.digital-ics.com (maverick.digital-ics.com + [63.239.101.196]) + by postgresql.org (Postfix) with ESMTP id 0CFBE475B47 + for ; + Fri, 21 Feb 2003 10:47:14 -0500 (EST) +Received: from digital-ics.com (gremlin.ics.digital-ics.com [192.168.2.52]) + by maverick.digital-ics.com (8.12.6/8.12.6) with ESMTP id + h1LFlIhm000978; Fri, 21 Feb 2003 10:47:18 -0500 (EST) +Message-ID: <3E564A06.8070809@digital-ics.com> +Date: Fri, 21 Feb 2003 10:47:18 -0500 +From: Kevin White +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Tom Lane +Cc: pgsql-performance@postgresql.org +Subject: Re: Really bad insert performance: what did I do wrong? +References: <3E564695.7030906@digital-ics.com> + <15034.1045842303@sss.pgh.pa.us> +In-Reply-To: <15034.1045842303@sss.pgh.pa.us> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/152 +X-Sequence-Number: 1208 + + > Yipes. We found awhile ago that Solaris' standard qsort() really sucks, +> but 7.3 should work around that --- and I don't think qsort would be +> invoked during data load anyway. +> +> Do you want to rebuild Postgres with profiling enabled, and get a gprof +> trace so we can see where the time is going? You don't need to run it +> for two days --- a few minutes' worth of runtime should be plenty. + +Great...I'd love to...as I've never had a problem with Postgres like +this, I didn't even know where to start...I'll look for how to do that. + +Kevin + + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 10:53:21 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 83699475ADE + for ; + Fri, 21 Feb 2003 10:53:19 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 09602-03 for ; + Fri, 21 Feb 2003 10:53:09 -0500 (EST) +Received: from www.pspl.co.in (www.pspl.co.in [202.54.11.65]) + by postgresql.org (Postfix) with ESMTP id 70E6147580B + for ; + Fri, 21 Feb 2003 10:51:12 -0500 (EST) +Received: (from root@localhost) + by www.pspl.co.in (8.11.6/8.11.6) id h1LFpHG07621 + for ; Fri, 21 Feb 2003 21:21:17 +0530 +Received: from daithan.intranet.pspl.co.in (daithan.intranet.pspl.co.in + [192.168.7.161]) + by www.pspl.co.in (8.11.6/8.11.0) with ESMTP id h1LFpGt07616 + for ; Fri, 21 Feb 2003 21:21:17 +0530 +From: "Shridhar Daithankar" + +To: pgsql-performance@postgresql.org +Subject: Re: Really bad insert performance: what did I do wrong? +Date: Fri, 21 Feb 2003 21:21:55 +0530 +User-Agent: KMail/1.5 +References: <3E564695.7030906@digital-ics.com> +In-Reply-To: <3E564695.7030906@digital-ics.com> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +Message-Id: <200302212121.55483.shridhar_daithankar@persistent.co.in> +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/154 +X-Sequence-Number: 1210 + +On Friday 21 Feb 2003 9:02 pm, you wrote: +> Any thoughts? I know that postgres should be more than capable of +> loading this data quickly on this box...I figured it could possibly take +> twice as long...and I thought my problem would be i/o related, not CPU. + +First, check vmstat or similar on SunOS. See what is maxing out. Second tunr +postgresql trace on and see where it is specnding most of the CPU. + +Needless to say, did you tune shared buffers? + + Shridhar + +From pgsql-performance-owner@postgresql.org Fri Feb 21 11:28:02 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 27582475A6D + for ; + Fri, 21 Feb 2003 11:27:56 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 15091-10 for ; + Fri, 21 Feb 2003 11:27:45 -0500 (EST) +Received: from Mail (mail.waterford.org [205.124.117.40]) + by postgresql.org (Postfix) with ESMTP id D295B47580B + for ; + Fri, 21 Feb 2003 11:27:42 -0500 (EST) +Received: by Mail + with XWall v3.25 ; + Fri, 21 Feb 2003 09:27:47 -0700 +From: Oleg Lebedev +To: "pgsql-performance@postgresql.org" +Subject: slow query +Date: Fri, 21 Feb 2003 09:30:53 -0700 +X-Assembled-By: XWall v3.25 +Message-ID: <993DBE5B4D02194382EC8DF8554A5273033583@postoffice.waterford.org> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/155 +X-Sequence-Number: 1211 + +Hi, +I am having problems with my master database now. It used to work +extremely good just two days ago, but then I started playing with +adding/dropping schemas and added another database and performance went +down. + +I also have a replica database on the same server and when I run the +same query on it, it runs good. +Interestingly the planner statistics for this query are the same on the +master and replica databases. +However, query execution on the master database is about 4min. and on +the replica database is 6 sec.! + +I VACUUM ANALYZED both databases and made sure they have same indexes on +the tables. +I don't know where else to look, but here are the schemas I have on the +master and replica database. The temp schemas must be the ones that I +created and then dropped. +master=3D# select * from pg_namespace; +nspname | nspowner | nspacl +------------+----------+-------- +pg_catalog | 1 | {=3DU} +pg_toast | 1 | {=3D} +public | 1 | {=3DUC} +pg_temp_1 | 1 |=20 +pg_temp_3 | 1 |=20 +pg_temp_10 | 1 |=20 +pg_temp_28 | 1 |=20 +replica=3D> select * from pg_namespace; +nspname | nspowner | nspacl=20 +------------+----------+-------- +pg_catalog | 1 | {=3DU} +pg_toast | 1 | {=3D} +public | 1 | {=3DUC} +pg_temp_1 | 1 |=20 +pg_temp_39 | 1 |=20 +india | 105 |=20 + +Here is the query: +SELECT * FROM media m, speccharacter c=20 +WHERE m.mediatype IN (SELECT objectid FROM mediatype WHERE +medianame=3D'Audio')=20 +AND m.mediachar =3D c.objectid=20 +AND (m.activity=3D'178746'=20 + OR=20 + (EXISTS (SELECT ism.objectid=20 + FROM intsetmedia ism, set s=20 + WHERE ism.set =3D s.objectid=20 + AND ism.media =3D m.objectid AND s.activity=3D'178746' ) + )=20 + OR=20 + (EXISTS (SELECT dtrm.objectid=20 + FROM dtrowmedia dtrm, dtrow dtr, dtcol dtc, datatable dt + + WHERE dtrm.dtrow =3D dtr.objectid=20 + AND dtrm.media =3D m.objectid=20 + AND dtr.dtcol =3D dtc.objectid=20 + AND dtc.datatable =3D dt.objectid=20 + AND dt.activity =3D '178746') + ) + )=20 +ORDER BY medianame ASC, status DESC; + +************************************* + +This email may contain privileged or confidential material intended for the= + named recipient only. +If you are not the named recipient, delete this message and all attachments= +.=20=20 +Any review, copying, printing, disclosure or other use is prohibited. +We reserve the right to monitor email sent through our network. + +************************************* + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 11:59:24 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0B08F474E5C + for ; + Fri, 21 Feb 2003 11:59:23 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 19896-05 for ; + Fri, 21 Feb 2003 11:59:12 -0500 (EST) +Received: from mail.libertyrms.com (unknown [209.167.124.227]) + by postgresql.org (Postfix) with ESMTP id 4217A474E4F + for ; + Fri, 21 Feb 2003 11:59:12 -0500 (EST) +Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 + (Debian)) + id 18mGW5-0006F1-00 + for ; Fri, 21 Feb 2003 11:59:17 -0500 +Date: Fri, 21 Feb 2003 11:59:17 -0500 +From: Andrew Sullivan +To: pgsql-performance@postgresql.org +Subject: Re: Really bad insert performance: what did I do wrong? +Message-ID: <20030221115917.A16866@mail.libertyrms.com> +Mail-Followup-To: Andrew Sullivan , + pgsql-performance@postgresql.org +References: <3E564695.7030906@digital-ics.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.2.5i +In-Reply-To: <3E564695.7030906@digital-ics.com>; + from kwhite@digital-ics.com on Fri, Feb 21, 2003 at 10:32:37AM + -0500 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/156 +X-Sequence-Number: 1212 + +On Fri, Feb 21, 2003 at 10:32:37AM -0500, Kevin White wrote: +> I've use PostgreSQL for some pretty amazing things, and was a proponent +> of using it here. I set up 7.3.1 on my development RedHat 8 box, and it +> was fine. I need to load about 700,000 rows into one table, the rows +> only having 6 columns, and the load on my box happens in just a couple +> of minutes (there's some calculation while the data is loading, and that +> time was acceptable to me). +> +> My box, however, isn't a production server, so I attempted to create the +> database again on a Sun Blade: +> +> SunOS trident 5.8 Generic_108528-17 sun4u sparc SUNW,UltraAX-i2 +> Status of processor 0 as of: 02/21/03 10:10:10 +> Processor has been on-line since 01/13/03 13:53:51. +> The sparcv9 processor operates at 500 MHz, +> and has a sparcv9 floating point processor. +> +> It isn't the world's fastest box, but should be fast enough for this. + + +What's the disk subsystem? Is fsync turned on in both cases? And is +your IDE drive lying to you about what it's doing. + +My experiences in moving from a Linux box to a low-end Sun is pretty +similar. The problem usually turns out to be a combination of +overhead on fsync (which shows up as processor load instead of i/o, +oddly); and memory contention, especially in case there are too-large +numbers of shared buffers (on a 16 Gig box, we find that 2 Gig of +shared buffers is too large -- the shared memory management is +crummy). + +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 Feb 21 12:22:08 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id BFEDB475ADE + for ; + Fri, 21 Feb 2003 12:22:06 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 22631-01 for ; + Fri, 21 Feb 2003 12:21:55 -0500 (EST) +Received: from maverick.digital-ics.com (maverick.digital-ics.com + [63.239.101.196]) + by postgresql.org (Postfix) with ESMTP id C66E14758F1 + for ; + Fri, 21 Feb 2003 12:21:33 -0500 (EST) +Received: from digital-ics.com (gremlin.ics.digital-ics.com [192.168.2.52]) + by maverick.digital-ics.com (8.12.6/8.12.6) with ESMTP id + h1LHLchm001552; Fri, 21 Feb 2003 12:21:38 -0500 (EST) +Message-ID: <3E566022.5010200@digital-ics.com> +Date: Fri, 21 Feb 2003 12:21:38 -0500 +From: Kevin White +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Andrew Sullivan +Cc: pgsql-performance@postgresql.org +Subject: Re: Really bad insert performance: what did I do wrong? +References: <3E564695.7030906@digital-ics.com> + <20030221115917.A16866@mail.libertyrms.com> +In-Reply-To: <20030221115917.A16866@mail.libertyrms.com> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/157 +X-Sequence-Number: 1213 + +Andrew Sullivan wrote: +> What's the disk subsystem? Is fsync turned on in both cases? And is +> your IDE drive lying to you about what it's doing. + +It is IDE. How do I turn fsync on or off? (All I can find in the man +is a function call to fsync...is there something else?) + +> My experiences in moving from a Linux box to a low-end Sun is pretty +> similar. The problem usually turns out to be a combination of +> overhead on fsync (which shows up as processor load instead of i/o, +> oddly); and memory contention, especially in case there are too-large +> numbers of shared buffers + +This box only has 1 gig, and I've only set up 200 shared buffers...at +this point, it is only me hitting it. Increasing the shared buffers +might help, but I haven't yet found the info I need to do that +intelligently. + +Shridhar Daithankar wrote: + > First, check vmstat or similar on SunOS. See what is maxing out. +Second tunr + > postgresql trace on and see where it is specnding most of the CPU. + +Do you mean turning on the statistics generators, or gprof? + + > Needless to say, did you tune shared buffers? + +Like I mentioned above, I haven't yet found good info on what to do to +actually tune shared buffers...I know how to change them, but that's +about it. I'll poke around some more. + + +Tom Lane wrote: + > You should be able to find details in the archives, but the key point + > is to do + > cd .../src/backend + > gmake clean + > gmake PROFILE="-pg" all + > to build a profile-enabled backend. You may need a more complex + > incantation than -pg on Solaris, but it works on other platforms. + +I did this, but my gmon.out doesn't appear to have much data from the +actual child postgres process, just the parent. I might be wrong, and +I'm letting some stats generate. + +However, to everyone, I DID find a problem in my code that was making it +take super forever long....the code doesn't just insert. It is also +written to do updates if it needs to, and because of what I'm doing, I +end up doing selects back against the table during the load to find +previously loaded rows. In this case, there aren't any, because the +table's been trunced, but...having turned the indexes off, those selects +were really really slow. Using the stats tools told me that. + +So, that may have been a large part of my problem. I'm still seeing the +process just SIT there, though, for seconds at a time, so there's +probably something else that I can fix. Maybe I should just randomly +try a larger buffers setting... + +Being able to analyze the output of gmon would be nice, but as I said +before, it doesn't appear to actually change much... + +Right now, the load has been running continuously for several minutes. +It is 12:20pm, but the time on the gmon.out file is 12:18pm. I should +be able to let the load finish while I'm at lunch, and I might be able +to get something out of gmon when it is done...maybe writing to gmon +just doesn't happen constantly. + +Thanks all... + +Kevin + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 12:52:52 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E73764753A1 + for ; + Fri, 21 Feb 2003 12:37:24 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 22270-06 for ; + Fri, 21 Feb 2003 12:37:13 -0500 (EST) +Received: from mail.libertyrms.com (unknown [209.167.124.227]) + by postgresql.org (Postfix) with ESMTP id D6A2B474E5C + for ; + Fri, 21 Feb 2003 12:37:13 -0500 (EST) +Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 + (Debian)) + id 18mH6t-0006rP-00 + for ; Fri, 21 Feb 2003 12:37:19 -0500 +Date: Fri, 21 Feb 2003 12:37:19 -0500 +From: Andrew Sullivan +To: pgsql-performance@postgresql.org +Subject: Re: Really bad insert performance: what did I do wrong? +Message-ID: <20030221123719.C16866@mail.libertyrms.com> +Mail-Followup-To: Andrew Sullivan , + pgsql-performance@postgresql.org +References: <3E564695.7030906@digital-ics.com> + <20030221115917.A16866@mail.libertyrms.com> + <3E566022.5010200@digital-ics.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.2.5i +In-Reply-To: <3E566022.5010200@digital-ics.com>; + from kwhite@digital-ics.com on Fri, Feb 21, 2003 at 12:21:38PM + -0500 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/158 +X-Sequence-Number: 1214 + +On Fri, Feb 21, 2003 at 12:21:38PM -0500, Kevin White wrote: +> Andrew Sullivan wrote: +> > What's the disk subsystem? Is fsync turned on in both cases? And is +> > your IDE drive lying to you about what it's doing. +> +> It is IDE. How do I turn fsync on or off? (All I can find in the man +> is a function call to fsync...is there something else?) + +By default, Postgres calls fsync() at every COMMIT. Lots of IDE +drives lie about whether the fsync() succeeded, so you get better +performance than you do with SCSI drives; but you're not really +getting that performance, because the fsync isn't effectve. + +On Linux, I think you can use hdparm to fix this. I believe the +write caching is turned off under Solaris, but I'm not sure. + +Anyway, you can adjust your postgresql.conf file to turn off fsync. + +> This box only has 1 gig, and I've only set up 200 shared buffers...at +> this point, it is only me hitting it. Increasing the shared buffers +> might help, but I haven't yet found the info I need to do that +> intelligently. + +For stright inserts, it shouldn't matter, and that seems low enough +that it shouldn't be a problem. + +You should put WAL on another disk, as well, if you can. + +Also, try using truss to see what the backend is doing. (truss -c +gives you a count and gives some time info.) + +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 Feb 21 13:09:21 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A0D58475BC3 + for ; + Fri, 21 Feb 2003 13:09:19 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 28446-08 for ; + Fri, 21 Feb 2003 13:09:08 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id C7465475CEE + for ; + Fri, 21 Feb 2003 13:06:25 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h1LI4wwN024302; + Fri, 21 Feb 2003 11:04:58 -0700 (MST) +Date: Fri, 21 Feb 2003 10:55:41 -0700 (MST) +From: "scott.marlowe" +To: Kevin White +Cc: +Subject: Re: Really bad insert performance: what did I do wrong? +In-Reply-To: <3E566022.5010200@digital-ics.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 +X-Archive-Number: 200302/159 +X-Sequence-Number: 1215 + +OK, I'm gonna make a couple of observations here that may help out. + +1: sun's performance on IDE hardware is abysmal. Both Solaris X86 and +Solaris Sparc are utter dogs at IDE, even when you do get DMA and prefetch +setup and running. Linux or BSD are much much better at handling IDE +interfaces. + +2: Postgresql under Solaris on Sparc is about 1/2 as fast as Postgresql +under Linux on Sparc, all other things being equal. On 32 bith Sparc the +chasm widens even more. + +3: Inserting ALL 700,000 rows in one transaction is probably not optimal. +Try putting a test in every 1,000 or 10,000 rows to toss a "commit;begin;" +pair at the database while loading. Inserting all 700,000 rows at once +means postgresql can't recycle the transaction logs, so you'll have +700,000 rows worth of data in the transaction logs waiting for you to +commit at the end. That's a fair bit of space, and a large set of files +to keep track of. My experience has been that anything over 1,000 inserts +in a transaction gains little. + +4: If you want to make sure you don't insert any duplicates, it's +probably faster to use a unique multi-column key on all your columns +(there's a limit on columns in an index depending on which flavor of +postgresql you are running, but I think it's 16 on 7.2 and before and 32 +on 7.3 and up. I could be off by a factor of two there. + + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 14:25:45 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 504F24758E6 + for ; + Fri, 21 Feb 2003 14:25:43 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 43938-05 for ; + Fri, 21 Feb 2003 14:25:32 -0500 (EST) +Received: from maverick.digital-ics.com (maverick.digital-ics.com + [63.239.101.196]) + by postgresql.org (Postfix) with ESMTP id B72DF475BEC + for ; + Fri, 21 Feb 2003 14:18:15 -0500 (EST) +Received: from digital-ics.com (gremlin.ics.digital-ics.com [192.168.2.52]) + by maverick.digital-ics.com (8.12.6/8.12.6) with ESMTP id + h1LJIDhm002069; Fri, 21 Feb 2003 14:18:13 -0500 (EST) +Message-ID: <3E567B74.5030807@digital-ics.com> +Date: Fri, 21 Feb 2003 14:18:12 -0500 +From: Kevin White +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: "scott.marlowe" +Cc: pgsql-performance@postgresql.org +Subject: Re: Really bad insert performance: what did I do wrong? +References: +In-Reply-To: +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/160 +X-Sequence-Number: 1216 + +> 1: sun's performance on IDE hardware is abysmal. + +OK, good to know. This box won't always be the production server: an +x86 Dell server with Linux will happen...thanks for the info. + +> 2: Postgresql under Solaris on Sparc is about 1/2 as fast as Postgresql +> under Linux on Sparc, all other things being equal. On 32 bith Sparc the +> chasm widens even more. + +Wow... + +> 3: Inserting ALL 700,000 rows in one transaction is probably not optimal. +> Try putting a test in every 1,000 or 10,000 rows to toss a "commit;begin;" +> pair at the database while loading. + +My original test was 700,000 at once...for today's, I realized that was, +um, dumb :) so I fixed it...it commits every 1,000 now... + +> 4: If you want to make sure you don't insert any duplicates, it's +> probably faster to use a unique multi-column key on all your columns + +The problem isn't inserting the dupes, but at times I need to update the +data, rather than load a new batch of it...and the rows have a "rank" +(by price)...so when one group of say 5 gets an updated row, it could +change the rank of the other 4 so all 5 need updated...so I have to do +the select first to find the other values so I can calculate the rank. + +In THIS specific case, with the table empty, I don't need to do that, +but the code had been changed to do it, because normally, my table won't +be empty. This is just the initial setup of a new server... + +Thanks for all the help... + +It looks like the load finished...I might try turning the sync off. + +Kevin + + +From pgsql-performance-owner@postgresql.org Fri Feb 21 21:47:21 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 5CA2C475AFF + for ; + Fri, 21 Feb 2003 21:47:19 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 30079-05 for ; + Fri, 21 Feb 2003 21:46:50 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 959DE475D70 + for ; + Fri, 21 Feb 2003 21:20:36 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1M2Ke5u002051; + Fri, 21 Feb 2003 21:20:40 -0500 (EST) +To: Oleg Lebedev +Cc: "pgsql-performance@postgresql.org" +Subject: Re: slow query +In-reply-to: <993DBE5B4D02194382EC8DF8554A5273033583@postoffice.waterford.org> +References: <993DBE5B4D02194382EC8DF8554A5273033583@postoffice.waterford.org> +Comments: In-reply-to Oleg Lebedev + message dated "Fri, 21 Feb 2003 09:30:53 -0700" +Date: Fri, 21 Feb 2003 21:20:39 -0500 +Message-ID: <2050.1045880439@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/162 +X-Sequence-Number: 1218 + +Oleg Lebedev writes: +> Interestingly the planner statistics for this query are the same on the +> master and replica databases. +> However, query execution on the master database is about 4min. and on +> the replica database is 6 sec.! + +What does EXPLAIN ANALYZE show in each case? + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Fri Feb 21 21:50:38 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id C0511475CC4 + for ; + Fri, 21 Feb 2003 21:50:35 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 30206-05 for ; + Fri, 21 Feb 2003 21:50:08 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 6D1D7475DD7 + for ; + Fri, 21 Feb 2003 21:24:38 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1M2Od5u002074; + Fri, 21 Feb 2003 21:24:39 -0500 (EST) +To: Kevin White +Cc: pgsql-performance@postgresql.org +Subject: Re: Really bad insert performance: what did I do wrong? +In-reply-to: <3E566022.5010200@digital-ics.com> +References: <3E564695.7030906@digital-ics.com> + <20030221115917.A16866@mail.libertyrms.com> + <3E566022.5010200@digital-ics.com> +Comments: In-reply-to Kevin White + message dated "Fri, 21 Feb 2003 12:21:38 -0500" +Date: Fri, 21 Feb 2003 21:24:39 -0500 +Message-ID: <2073.1045880679@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/163 +X-Sequence-Number: 1219 + +Kevin White writes: +> I did this, but my gmon.out doesn't appear to have much data from the +> actual child postgres process, just the parent. + +Are you looking in the right place? Child processes will dump gmon.out +into $PGDATA/base/yourdbnum/, which is not where the parent process +does. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Sat Feb 22 01:59:20 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 4A738475E9D + for ; + Sat, 22 Feb 2003 01:47:41 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 69142-06 for ; + Sat, 22 Feb 2003 01:47:30 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 13A47476067 + for ; + Fri, 21 Feb 2003 23:23:48 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1M4Nl5u002704; + Fri, 21 Feb 2003 23:23:48 -0500 (EST) +To: "scott.marlowe" +Cc: Kevin White , + pgsql-performance@postgresql.org +Subject: Re: Really bad insert performance: what did I do wrong? +In-reply-to: +References: +Comments: In-reply-to "scott.marlowe" + message dated "Fri, 21 Feb 2003 10:55:41 -0700" +Date: Fri, 21 Feb 2003 23:23:47 -0500 +Message-ID: <2703.1045887827@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/164 +X-Sequence-Number: 1220 + +"scott.marlowe" writes: +> 3: Inserting ALL 700,000 rows in one transaction is probably not optimal. +> Try putting a test in every 1,000 or 10,000 rows to toss a "commit;begin;" +> pair at the database while loading. Inserting all 700,000 rows at once +> means postgresql can't recycle the transaction logs, so you'll have +> 700,000 rows worth of data in the transaction logs waiting for you to +> commit at the end. + +That was true in 7.1.0, but we got rid of that behavior *very* quickly +(by 7.1.3, according to the release notes). Long transactions do not +currently stress the WAL storage any more than the same amount of work +in short transactions. + +Which is not to say that there's anything wrong with divvying the work +into 1000-row-or-so transactions. I agree that that's enough to push +the per-transaction overhead down into the noise. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Sun Feb 23 15:49:00 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP + id C96DD475921; Sun, 23 Feb 2003 15:46:29 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 18958-05; Sun, 23 Feb 2003 15:46:19 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP + id 992D947590C; Sun, 23 Feb 2003 15:44:50 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2853792; Sun, 23 Feb 2003 12:44:50 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: "Jakab Laszlo" , + "Justin Clift" +Subject: Re: performance issues for processing more then 150000 +Date: Sun, 23 Feb 2003 12:44:06 -0800 +User-Agent: KMail/1.4.3 +Cc: +References: <004501c2d97d$98927670$0900000a@new> + <3E55EE62.6010909@postgresql.org> + <00e101c2d98f$ea9a32c0$0900000a@new> +In-Reply-To: <00e101c2d98f$ea9a32c0$0900000a@new> +MIME-Version: 1.0 +Message-Id: <200302231244.06242.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/165 +X-Sequence-Number: 1221 + +Jakab, + +Some simple tips, which is what I thing you were really asking for: + +Are you adding the records in a single overnight or downtime load batch? I= +f=20 +so, the fastest way by far is to: +1) disable all triggers and constraints on the table temporarily, and some = +or=20 +all of the indexes +2) put all the data into a COPY file (tab-delimited text; see COPY docs) +3) load the data through a COPY statement +4) re-enable the trigger and constraints and re-build the indexes +The degree to which you need to do 1) and 4) depends on how much punishment= +=20 +your system can take; start out by dropping and rebuilding just the trigger= +s=20 +and move up from there until the load finishes in a satisfactory time. + +If the records are being added on a continuous basis and not in a big batch= +,=20 +then take the following precautions: +1) put as many inserts as possible into transaction batches +2) minimize your use of constraints, triggers, and indexes on the tables be= +ing=20 +loaded +3) consdier using a "buffer table" to hold records about to be loaded while= +=20 +data integrity checks and similar are performed. + +> Unfortunatelly the hardware budget should be keept as low as possible. +> I was thinking is there could be reliable solution based on dual processor +> and ATA 133 raid mirroring normally with some gigs of memory. + +1 gig of RAM may be plenty. Your main bottleneck will be your disk channel= +.=20=20 +If I were setting up your server, I might do something like: + +1) buy a motherboard with 4 ATA controllers. +2) put disks like: + channel 0: 1 matched pair disks + channel 1 + 2: 1 matched quartet of disks + channel 3: single ATA disk + (for Postgresql, more, smaller disks is almost always better than a few bi= +g=20 +ones.) (alternately, set up everythin in one big RAID 5 array with at least= + 6=20 +disks. There is argument about which is better) +3) Format the above as a RAID 1 pair on channel 0 and a RAID 1+0 double pai= +r=20 +on channel 1 using Linux software RAID +4) Put Linux OS + swap on channel 0. Put the database on channel 1+2. Put= +=20 +the pg_xlog (the transaction log) on channel 3. Make sure to use a version= +=20 +of Linux with kernel 2.4.19 or greater! + +That's just one configuration of several possible, of course, but may serve= +=20 +your purposes admirably and relatively cheaply. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Sun Feb 23 15:53:27 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 82E86474E53 + for ; + Sun, 23 Feb 2003 15:53:25 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 23263-04 for ; + Sun, 23 Feb 2003 15:53:14 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id A5737474E42 + for ; + Sun, 23 Feb 2003 15:53:14 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2853807; Sun, 23 Feb 2003 12:53:15 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: Oleg Lebedev , + "pgsql-performance@postgresql.org" +Subject: Re: slow query +Date: Sun, 23 Feb 2003 12:52:30 -0800 +User-Agent: KMail/1.4.3 +References: <993DBE5B4D02194382EC8DF8554A5273033583@postoffice.waterford.org> +In-Reply-To: <993DBE5B4D02194382EC8DF8554A5273033583@postoffice.waterford.org> +MIME-Version: 1.0 +Message-Id: <200302231252.30681.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/166 +X-Sequence-Number: 1222 + +Oleg, + +> I VACUUM ANALYZED both databases and made sure they have same indexes on +> the tables. + +Have you VACUUM FULL the main database? And how about REINDEX?=20=20 + +> Here is the query: +> SELECT * FROM media m, speccharacter c +> WHERE m.mediatype IN (SELECT objectid FROM mediatype WHERE +> medianame=3D'Audio') + +The above should use an EXISTS clause, not IN, unless you are absolutely su= +re=20 +that the subquery will never return more than 12 rows. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Sun Feb 23 16:05:57 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 73110474E4F + for ; + Sun, 23 Feb 2003 16:05:55 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 24315-01 for ; + Sun, 23 Feb 2003 16:05:44 -0500 (EST) +Received: from beavis.ybsoft.com (unknown [209.161.7.161]) + by postgresql.org (Postfix) with ESMTP id AFE46474E42 + for ; + Sun, 23 Feb 2003 16:05:44 -0500 (EST) +Received: from ns1.ybsoft.com (beavis.ybsoft.com [10.0.0.2]) + by beavis.ybsoft.com (Postfix) with ESMTP + id 1B3C72B10D; Sun, 23 Feb 2003 14:05:35 -0700 (MST) +Subject: Re: slow query +From: Ryan Bradetich +To: Josh Berkus +Cc: Oleg Lebedev , + "pgsql-performance@postgresql.org" +In-Reply-To: <200302231252.30681.josh@agliodbs.com> +References: <993DBE5B4D02194382EC8DF8554A5273033583@postoffice.waterford.org> + <200302231252.30681.josh@agliodbs.com> +Content-Type: text/plain +Organization: +Message-Id: <1046034334.13010.3.camel@beavis.ybsoft.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.2 +Date: 23 Feb 2003 14:05:34 -0700 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/167 +X-Sequence-Number: 1223 + +On Sun, 2003-02-23 at 13:52, Josh Berkus wrote: +> Oleg, +> +> > I VACUUM ANALYZED both databases and made sure they have same indexes on +> > the tables. +> +> Have you VACUUM FULL the main database? And how about REINDEX? +> +> > Here is the query: +> > SELECT * FROM media m, speccharacter c +> > WHERE m.mediatype IN (SELECT objectid FROM mediatype WHERE +> > medianame='Audio') +> +> The above should use an EXISTS clause, not IN, unless you are absolutely sure +> that the subquery will never return more than 12 rows. + +I am assuming you said this because EXISTS is faster for > 12 rows? +Interesting :) + +thanks, + +- Ryan + + +-- +Ryan Bradetich + + +From pgsql-performance-owner@postgresql.org Sun Feb 23 16:49:24 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 7BB1B4758DC + for ; + Sun, 23 Feb 2003 16:49:21 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 26949-09 for ; + Sun, 23 Feb 2003 16:49:10 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id EFFF447590C + for ; + Sun, 23 Feb 2003 16:48:42 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2853849; Sun, 23 Feb 2003 13:48:43 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: Ryan Bradetich +Subject: Re: slow query +Date: Sun, 23 Feb 2003 13:47:58 -0800 +User-Agent: KMail/1.4.3 +Cc: Oleg Lebedev , + "pgsql-performance@postgresql.org" +References: <993DBE5B4D02194382EC8DF8554A5273033583@postoffice.waterford.org> + <200302231252.30681.josh@agliodbs.com> + <1046034334.13010.3.camel@beavis.ybsoft.com> +In-Reply-To: <1046034334.13010.3.camel@beavis.ybsoft.com> +MIME-Version: 1.0 +Message-Id: <200302231347.58960.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/168 +X-Sequence-Number: 1224 + +Ryan, + +> > The above should use an EXISTS clause, not IN, unless you are absolutely +> > sure that the subquery will never return more than 12 rows. +> +> I am assuming you said this because EXISTS is faster for > 12 rows? +> Interesting :) + +That's my rule of thumb, *NOT* any kind of relational-calculus-based truth. + +Basically, one should only use IN for a subquery when one is *absolutely* s= +ure=20 +that the subquery will only return a handful of records, *and* the subquery= +=20 +doesn't have to do an complex work like aggregating or custom function=20 +evaluation.=20=20 + +You're safer using EXISTS for all subqueries, really. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Sun Feb 23 21:46:49 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 46DA6474E5C + for ; + Sun, 23 Feb 2003 21:29:04 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 68077-04 for ; + Sun, 23 Feb 2003 21:28:53 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 59507474E53 + for ; + Sun, 23 Feb 2003 21:28:53 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1O2Ss5u021155; + Sun, 23 Feb 2003 21:28:57 -0500 (EST) +To: Josh Berkus +Cc: Ryan Bradetich , + Oleg Lebedev , + "pgsql-performance@postgresql.org" +Subject: Re: slow query +In-reply-to: <200302231347.58960.josh@agliodbs.com> +References: <993DBE5B4D02194382EC8DF8554A5273033583@postoffice.waterford.org> + <200302231252.30681.josh@agliodbs.com> + <1046034334.13010.3.camel@beavis.ybsoft.com> + <200302231347.58960.josh@agliodbs.com> +Comments: In-reply-to Josh Berkus + message dated "Sun, 23 Feb 2003 13:47:58 -0800" +Date: Sun, 23 Feb 2003 21:28:54 -0500 +Message-ID: <21154.1046053734@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/169 +X-Sequence-Number: 1225 + +Josh Berkus writes: +>> I am assuming you said this because EXISTS is faster for > 12 rows? + +> That's my rule of thumb, *NOT* any kind of relational-calculus-based truth. + +Keep in mind also that the tradeoffs will change quite a lot when PG 7.4 +hits the streets, because the optimizer has gotten a lot smarter about +how to handle IN, but no smarter about EXISTS. Here's one rather silly +example using CVS tip: + +regression=# explain analyze select * from tenk1 a where +regression-# unique1 in (select hundred from tenk1 b); + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------- + Merge Join (cost=486.32..504.11 rows=100 width=248) (actual time=453.19..468.86 rows=100 loops=1) + Merge Cond: ("outer".unique1 = "inner".hundred) + -> Index Scan using tenk1_unique1 on tenk1 a (cost=0.00..1571.87 rows=10000 width=244) (actual time=0.12..5.25 rows=101 loops=1) + -> Sort (cost=486.32..486.57 rows=100 width=4) (actual time=452.91..453.83 rows=100 loops=1) + Sort Key: b.hundred + -> HashAggregate (cost=483.00..483.00 rows=100 width=4) (actual time=447.59..449.80 rows=100 loops=1) + -> Seq Scan on tenk1 b (cost=0.00..458.00 rows=10000 width=4) (actual time=0.06..276.47 rows=10000 loops=1) + Total runtime: 472.06 msec +(8 rows) + +regression=# explain analyze select * from tenk1 a where +regression-# exists (select 1 from tenk1 b where b.hundred = a.unique1); + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------- + Seq Scan on tenk1 a (cost=0.00..35889.66 rows=5000 width=244) (actual time=3.69..1591.78 rows=100 loops=1) + Filter: (subplan) + SubPlan + -> Index Scan using tenk1_hundred on tenk1 b (cost=0.00..354.32 rows=100 width=0) (actual time=0.10..0.10 rows=0 loops=10000) + Index Cond: (hundred = $0) + Total runtime: 1593.88 msec +(6 rows) + +The EXISTS case takes about the same time in 7.3, but the IN case is off +the charts (I got bored of waiting after 25 minutes...) + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Mon Feb 24 04:59:19 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id AEA114758DC + for ; + Mon, 24 Feb 2003 04:53:14 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 49481-08 for ; + Mon, 24 Feb 2003 04:53:03 -0500 (EST) +Received: from mail.dd-v.de (mail.dd-v.de [80.243.40.126]) + by postgresql.org (Postfix) with SMTP id 674E64758BD + for ; + Mon, 24 Feb 2003 04:53:02 -0500 (EST) +Received: (qmail 1612 invoked from network); 24 Feb 2003 10:00:36 -0000 +Received: from unknown (HELO oskar.ddv.int) (172.25.10.3) + by 172.25.10.60 with SMTP; 24 Feb 2003 10:00:36 -0000 +Received: by DDV_EXCH with Internet Mail Service (5.5.2655.55) + id ; Mon, 24 Feb 2003 10:52:59 +0100 +Message-ID: <5187C8401CB1D211AB6E00A0C9929D06018326C5@DDV_EXCH> +From: "Schaefer, Mario" +To: "'pgsql-performance@postgresql.org'" +Subject: partitioning os swap data log tempdb +Date: Mon, 24 Feb 2003 10:52:55 +0100 +MIME-Version: 1.0 +X-Mailer: Internet Mail Service (5.5.2655.55) +Content-Type: text/plain; + charset="iso-8859-1" +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/170 +X-Sequence-Number: 1226 + +Hi, + +we want to migrate from MS SQL Server (windows2000) +to PostgreSQL (Linux) :-)) +and we want to use the old MSSQL Hardware. + +Dual Pentium III 800 +1 GB RAM +2 IDE 10 GB +2 RAID Controller (RAID 0,1 aviable) with 2 9GB SCSI HDD +1 RAID Controller (RAID 0,1,5 aviable) with 3 18GB SCSI HDD + +The configuration for MS-SQL was this: +OS on the 2 IDE Harddisks with Software-RAID1 +SQL-Data on RAID-Controller with RAID-5 (3 x 18GB SCSI Harddisks) +SQL-TempDB on RAID-Controller with RAID-1 (2 x 9GB SCSI Harddisk) +SQL-TransactionLog on RAID-Controller with RAID-1 (2 x 9GB SCSI Harddisk) + +Can i make a similar configuration with PostgreSQL? +Or what is the prefered fragmentation for +operatingsystem, swap-partition, data, indexes, tempdb and transactionlog? + +What is pg_xlog and how important is it? + +What ist the prefered filesystem (ext2, ext3 or raiserfs)? + +We want to use about 20 databases with varios size from 5 MB to 500MB per +database +and more selects than inserts (insert/select ratio about 1/10) for fast +webaccess. + +Thank you for your hints! + +Bye, +Mario + +From pgsql-performance-owner@postgresql.org Mon Feb 24 05:31:55 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 3D6D54758E6 + for ; + Mon, 24 Feb 2003 05:31:52 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 57565-05 for ; + Mon, 24 Feb 2003 05:31:41 -0500 (EST) +Received: from www.pspl.co.in (www.pspl.co.in [202.54.11.65]) + by postgresql.org (Postfix) with ESMTP id CEEA4474E5C + for ; + Mon, 24 Feb 2003 05:31:35 -0500 (EST) +Received: (from root@localhost) + by www.pspl.co.in (8.11.6/8.11.6) id h1OAVba29545 + for ; Mon, 24 Feb 2003 16:01:37 +0530 +Received: from daithan (daithan.intranet.pspl.co.in [192.168.7.161]) + by www.pspl.co.in (8.11.6/8.11.0) with ESMTP id h1OAVat29539 + for ; Mon, 24 Feb 2003 16:01:37 +0530 +From: "Shridhar Daithankar" +To: "'pgsql-performance@postgresql.org'" +Date: Mon, 24 Feb 2003 16:02:17 +0530 +MIME-Version: 1.0 +Subject: Re: partitioning os swap data log tempdb +Reply-To: shridhar_daithankar@persistent.co.in +Message-ID: <3E5A4209.14763.368CC8@localhost> +In-reply-to: <5187C8401CB1D211AB6E00A0C9929D06018326C5@DDV_EXCH> +X-mailer: Pegasus Mail for Windows (v4.02) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/171 +X-Sequence-Number: 1227 + +On 24 Feb 2003 at 10:52, Schaefer, Mario wrote: + +> Hi, +> +> we want to migrate from MS SQL Server (windows2000) +> to PostgreSQL (Linux) :-)) +> and we want to use the old MSSQL Hardware. +> +> Dual Pentium III 800 +> 1 GB RAM +> 2 IDE 10 GB +> 2 RAID Controller (RAID 0,1 aviable) with 2 9GB SCSI HDD +> 1 RAID Controller (RAID 0,1,5 aviable) with 3 18GB SCSI HDD +> +> The configuration for MS-SQL was this: +> OS on the 2 IDE Harddisks with Software-RAID1 +> SQL-Data on RAID-Controller with RAID-5 (3 x 18GB SCSI Harddisks) +> SQL-TempDB on RAID-Controller with RAID-1 (2 x 9GB SCSI Harddisk) +> SQL-TransactionLog on RAID-Controller with RAID-1 (2 x 9GB SCSI Harddisk) +> +> Can i make a similar configuration with PostgreSQL? +> Or what is the prefered fragmentation for +> operatingsystem, swap-partition, data, indexes, tempdb and transactionlog? + +Hmm.. You can put your OS on IDE and databases on 3x18GB SCSI. Postgresql can +not split data/indexes/tempdb etc. So they will be on one drive. You don't have +much of a choice here. + +> What is pg_xlog and how important is it? + +It is transaction log. It is hit every now and then for insert/update/deletes. +Symlinking it to a separate drive would be a great performance boost. Put it on +the other SCSI disk. AFAIK, it is a single file. I suggest you put WAL and xlog +on other 2x9GB SCSI drive. You need to shut down postgresql after schema +creation and symlink the necessary files by hand. If postgresql ever recreates +these files/directories by hand, it will drop the symlinks and recreate the +files. In that case you need to redo the exercise of symlinkg. + + +> What ist the prefered filesystem (ext2, ext3 or raiserfs)? + +reiserfs or XFS. + +> We want to use about 20 databases with varios size from 5 MB to 500MB per +> database +> and more selects than inserts (insert/select ratio about 1/10) for fast +> webaccess. + +shouldn't be a problem. Tune shared_buffers around 150-250MB. Beef up FSM +entries, sort mem and vacuum regularly. + +HTH +Bye + Shridhar + +-- +Slous' Contention: If you do a job too well, you'll get stuck with it. + + +From pgsql-performance-owner@postgresql.org Mon Feb 24 07:18:16 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id EAE3647592C + for ; + Mon, 24 Feb 2003 07:18:11 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 75450-04 for ; + Mon, 24 Feb 2003 07:18:01 -0500 (EST) +Received: from mail.libertyrms.com (unknown [209.167.124.227]) + by postgresql.org (Postfix) with ESMTP id 67D51475B8A + for ; + Mon, 24 Feb 2003 07:14:57 -0500 (EST) +Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 + (Debian)) + id 18nHVc-0006V4-00 + for ; Mon, 24 Feb 2003 07:15:00 -0500 +Date: Mon, 24 Feb 2003 07:15:00 -0500 +From: Andrew Sullivan +To: "'pgsql-performance@postgresql.org'" +Subject: Re: partitioning os swap data log tempdb +Message-ID: <20030224071500.C20792@mail.libertyrms.com> +Mail-Followup-To: Andrew Sullivan , + "'pgsql-performance@postgresql.org'" +References: <5187C8401CB1D211AB6E00A0C9929D06018326C5@DDV_EXCH> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.2.5i +In-Reply-To: <5187C8401CB1D211AB6E00A0C9929D06018326C5@DDV_EXCH>; + from Schaefer.Mario@dd-v.de on Mon, Feb 24, 2003 at 10:52:55AM + +0100 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/172 +X-Sequence-Number: 1228 + +On Mon, Feb 24, 2003 at 10:52:55AM +0100, Schaefer, Mario wrote: +> Can i make a similar configuration with PostgreSQL? + +Sort of. PostgreSQL currently does not have a convenient way to +specify where this or that part of the database lives. As a result, +your best bet is to use RAID 1+0 for the data area, and get the speed +that way. If you must do it without more hardware, however, you can +manually move some files to other drives and symlink them. You +_must_ do this while offline, and if the file grows above 1G, the +advantage will be lost. + +It is nevertheless a good idea to put your OS, data directory, and +write head log (WAL) on separate disks. Also, you should make sure +your PostgreSQL logs don't interfere with the database I/O (the OS +disk is probably a good place for them, but make sure you use some +sort of log rotator. Syslog is helpful here). + +> What is pg_xlog and how important is it? + +It's the write ahead log. Put it on a separate RAID. + +> What ist the prefered filesystem (ext2, ext3 or raiserfs)? + +Certainly ext2 is not crash-safe. There've been some reports of +corruption under reiserfs, but I've never had it happen. There have +been complaints about performance with ext3. You might want to +investigate XFS, as it was designed for this sort of task. + +> We want to use about 20 databases with varios size from 5 MB to 500MB per +> database +> and more selects than inserts (insert/select ratio about 1/10) for fast +> webaccess. + +The WAL is less critical in this case, because it is only extended +when you change the data, not when you select. + +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 Mon Feb 24 10:57:41 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A9B24474E4F + for ; + Mon, 24 Feb 2003 10:57:04 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 91491-09 for ; + Mon, 24 Feb 2003 10:56:53 -0500 (EST) +Received: from Mail (mail.waterford.org [205.124.117.40]) + by postgresql.org (Postfix) with ESMTP id E80F4475AA1 + for ; + Mon, 24 Feb 2003 10:56:02 -0500 (EST) +Received: by Mail + with XWall v3.25 ; + Mon, 24 Feb 2003 08:55:59 -0700 +From: Oleg Lebedev +To: Josh Berkus , + "pgsql-performance@postgresql.org" +Subject: Re: slow query +Date: Mon, 24 Feb 2003 08:59:11 -0700 +X-Assembled-By: XWall v3.25 +Message-ID: <993DBE5B4D02194382EC8DF8554A5273033587@postoffice.waterford.org> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/173 +X-Sequence-Number: 1229 + +Thanks everybody for your help. +VACUUM FULL did the job, and now the query performance is the same in +both databases. I am surprised that FULL option makes such a dramatic +change to the query performance: from 4min. to 5sec.!!! It also changed +planner stats from ~9 sec to ~8sec. +I haven't tried to REINDEX yet, though. +Regarding IN vs. EXISTS. The sub-query in the IN clause will always +return fewer records than 12. I tried using EXISTS instead of IN with +Postgres7.2.1 and it slowed down query performance. With postgres 7.3, +when I use EXISTS instead of IN the planner returns the same stats and +query performance does not improve. However, if I use=20 +m.mediatype=3D(SELECT objectid FROM mediatype WHERE medianame=3D'Audio') +the planner returns ~7 sec., which is the same as if I the query is +changed like this: +SELECT * FROM media m, speccharacter c, mediatype mt +WHERE mt.objectid=3Dm.mediatype and mt.medianame=3D'Audio' +... +So, using JOIN and =3D(SELECT ...) is better than using IN and EXISTS in +this case. +Thanks. + +Oleg + + +-----Original Message----- +From: Josh Berkus [mailto:josh@agliodbs.com]=20 +Sent: Sunday, February 23, 2003 1:53 PM +To: Oleg Lebedev; pgsql-performance@postgresql.org +Subject: Re: [PERFORM] slow query +Importance: Low + + +Oleg, + +> I VACUUM ANALYZED both databases and made sure they have same indexes=20 +> on the tables. + +Have you VACUUM FULL the main database? And how about REINDEX?=20=20 + +> Here is the query: +> SELECT * FROM media m, speccharacter c +> WHERE m.mediatype IN (SELECT objectid FROM mediatype WHERE +> medianame=3D'Audio') + +The above should use an EXISTS clause, not IN, unless you are absolutely +sure=20 +that the subquery will never return more than 12 rows. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +---------------------------(end of broadcast)--------------------------- +TIP 4: Don't 'kill -9' the postmaster + + +************************************* + +This email may contain privileged or confidential material intended for the= + named recipient only. +If you are not the named recipient, delete this message and all attachments= +.=20=20 +Any review, copying, printing, disclosure or other use is prohibited. +We reserve the right to monitor email sent through our network. + +************************************* + + +From pgsql-performance-owner@postgresql.org Mon Feb 24 12:20:55 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 544B4475DBC + for ; + Mon, 24 Feb 2003 12:20:34 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 13945-10 for ; + Mon, 24 Feb 2003 12:20:23 -0500 (EST) +Received: from localhost.localdomain (unknown [65.217.53.66]) + by postgresql.org (Postfix) with ESMTP id 83EC6475E1F + for ; + Mon, 24 Feb 2003 11:58:44 -0500 (EST) +Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) + by localhost.localdomain (8.12.5/8.12.5) with ESMTP id h1OHQj6P021455; + Mon, 24 Feb 2003 12:26:45 -0500 +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 h1OGwXp26234; + Mon, 24 Feb 2003 11:58:33 -0500 +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 F3HTHC59; Mon, 24 Feb 2003 11:58:32 -0500 +Subject: Re: slow query +From: Robert Treat +To: Oleg Lebedev +Cc: Josh Berkus , + "pgsql-performance@postgresql.org" +In-Reply-To: <993DBE5B4D02194382EC8DF8554A5273033587@postoffice.waterford.org> +References: <993DBE5B4D02194382EC8DF8554A5273033587@postoffice.waterford.org> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +X-Mailer: Ximian Evolution 1.0.8 +Date: 24 Feb 2003 11:58:33 -0500 +Message-Id: <1046105913.1014.66.camel@camel> +Mime-Version: 1.0 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/174 +X-Sequence-Number: 1230 + +On Mon, 2003-02-24 at 10:59, Oleg Lebedev wrote: +> Thanks everybody for your help. +> VACUUM FULL did the job, and now the query performance is the same in +> both databases. I am surprised that FULL option makes such a dramatic +> change to the query performance: from 4min. to 5sec.!!! It also changed +> planner stats from ~9 sec to ~8sec. + +If your seeing wildly dramatic improvments from vacuum full, you might +want to look into running regular vacuums more often (especially for +high turnover tables), increase your max_fsm_relations to 1000, and +increasing your max_fsm_pages. + +Robert Treat + + + +From pgsql-performance-owner@postgresql.org Mon Feb 24 12:26:55 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 87D244760E2 + for ; + Mon, 24 Feb 2003 12:26:52 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 15379-10 for ; + Mon, 24 Feb 2003 12:26:41 -0500 (EST) +Received: from Mail (mail.waterford.org [205.124.117.40]) + by postgresql.org (Postfix) with ESMTP id 48CDF475E30 + for ; + Mon, 24 Feb 2003 12:03:50 -0500 (EST) +Received: by Mail + with XWall v3.25 ; + Mon, 24 Feb 2003 10:03:52 -0700 +From: Oleg Lebedev +To: Robert Treat +Cc: "pgsql-performance@postgresql.org" +Subject: Re: slow query +Date: Mon, 24 Feb 2003 10:07:03 -0700 +X-Assembled-By: XWall v3.25 +Message-ID: <993DBE5B4D02194382EC8DF8554A5273113DF3@postoffice.waterford.org> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/175 +X-Sequence-Number: 1231 + +I run VACUUM (not FULL though) every night, which I thought would be +enough for good query performance. Moreover, the data in table does not +really change significantly since database usage is pretty low right +now, therefore I thought that VACUUM FULL was an overkill. +I think that creating, populating and dropping schemas in the master +database could have affected the query performance and required VACUUM +FULL. +I will definitely look at max_fsm_relations and max_fsm_pages parameter +settings. +Thank you. + +Oleg Lebedev +=20 + + +-----Original Message----- +From: Robert Treat [mailto:xzilla@users.sourceforge.net]=20 +Sent: Monday, February 24, 2003 9:59 AM +To: Oleg Lebedev +Cc: Josh Berkus; pgsql-performance@postgresql.org +Subject: Re: [PERFORM] slow query + + +On Mon, 2003-02-24 at 10:59, Oleg Lebedev wrote: +> Thanks everybody for your help. +> VACUUM FULL did the job, and now the query performance is the same in=20 +> both databases. I am surprised that FULL option makes such a dramatic=20 +> change to the query performance: from 4min. to 5sec.!!! It also=20 +> changed planner stats from ~9 sec to ~8sec. + +If your seeing wildly dramatic improvments from vacuum full, you might +want to look into running regular vacuums more often (especially for +high turnover tables), increase your max_fsm_relations to 1000, and +increasing your max_fsm_pages.=20 + +Robert Treat + + + +************************************* + +This email may contain privileged or confidential material intended for the= + named recipient only. +If you are not the named recipient, delete this message and all attachments= +.=20=20 +Any review, copying, printing, disclosure or other use is prohibited. +We reserve the right to monitor email sent through our network. + +************************************* + + +From pgsql-performance-owner@postgresql.org Mon Feb 24 12:58:32 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 14391475A3F + for ; + Mon, 24 Feb 2003 12:58:30 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 22771-06 for ; + Mon, 24 Feb 2003 12:58:19 -0500 (EST) +Received: from liberty.sba2.netlojix.net (liberty.sba2.netlojix.net + [207.71.234.103]) + by postgresql.org (Postfix) with ESMTP id 3C716475A7F + for ; + Mon, 24 Feb 2003 12:26:57 -0500 (EST) +Received: from liberty.sba2.netlojix.net (localhost.localdomain [127.0.0.1]) + by liberty.sba2.netlojix.net (8.12.5/8.12.5) with ESMTP id + h1OHRvm1026235; Mon, 24 Feb 2003 09:27:57 -0800 +Received: from localhost (clarence@localhost) + by liberty.sba2.netlojix.net (8.12.5/8.12.5/Submit) with ESMTP id + h1OHRu6R026231; Mon, 24 Feb 2003 09:27:56 -0800 +X-Authentication-Warning: liberty.sba2.netlojix.net: clarence owned process + doing -bs +Date: Mon, 24 Feb 2003 09:27:56 -0800 (PST) +From: Clarence Gardner +X-X-Sender: clarence@liberty.sba2.netlojix.net +To: Robert Treat +Cc: Oleg Lebedev , + Josh Berkus , + "pgsql-performance@postgresql.org" +Subject: Re: slow query +In-Reply-To: <1046105913.1014.66.camel@camel> +Message-ID: + +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/176 +X-Sequence-Number: 1232 + +On 24 Feb 2003, Robert Treat wrote: + +> +> If your seeing wildly dramatic improvments from vacuum full, you might +> want to look into running regular vacuums more often (especially for +> high turnover tables), increase your max_fsm_relations to 1000, and +> increasing your max_fsm_pages. + +I don't know about the settings you mention, but a frequent vacuum +does not at all obviate a vacuum full. My database is vacuumed every +night, but a while ago I found that a vacuum full changed a simple +single-table query from well over 30 seconds to one or two. We now +do a vacuum full every night. + + + +From pgsql-performance-owner@postgresql.org Mon Feb 24 13:12:47 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 1B17E475D87 + for ; + Mon, 24 Feb 2003 13:10:31 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 26379-01 for ; + Mon, 24 Feb 2003 13:10:20 -0500 (EST) +Received: from Mail (mail.waterford.org [205.124.117.40]) + by postgresql.org (Postfix) with ESMTP id 7848F475EB9 + for ; + Mon, 24 Feb 2003 12:41:43 -0500 (EST) +Received: by Mail + with XWall v3.25 ; + Mon, 24 Feb 2003 10:41:45 -0700 +From: Oleg Lebedev +To: Clarence Gardner +Cc: "pgsql-performance@postgresql.org" +Subject: Re: slow query +Date: Mon, 24 Feb 2003 10:44:57 -0700 +X-Assembled-By: XWall v3.25 +Message-ID: <993DBE5B4D02194382EC8DF8554A5273113DF5@postoffice.waterford.org> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/177 +X-Sequence-Number: 1233 + +What about REINDEXing and other DB tricks? +Do you use any of these regularly? +Thanks. + +Oleg + +-----Original Message----- +From: Clarence Gardner [mailto:clarence@silcom.com]=20 +Sent: Monday, February 24, 2003 10:28 AM +To: Robert Treat +Cc: Oleg Lebedev; Josh Berkus; pgsql-performance@postgresql.org +Subject: Re: [PERFORM] slow query + + +On 24 Feb 2003, Robert Treat wrote: + +>=20 +> If your seeing wildly dramatic improvments from vacuum full, you might + +> want to look into running regular vacuums more often (especially for=20 +> high turnover tables), increase your max_fsm_relations to 1000, and=20 +> increasing your max_fsm_pages. + +I don't know about the settings you mention, but a frequent vacuum does +not at all obviate a vacuum full. My database is vacuumed every night, +but a while ago I found that a vacuum full changed a simple single-table +query from well over 30 seconds to one or two. We now do a vacuum full +every night. + + + +************************************* + +This email may contain privileged or confidential material intended for the= + named recipient only. +If you are not the named recipient, delete this message and all attachments= +.=20=20 +Any review, copying, printing, disclosure or other use is prohibited. +We reserve the right to monitor email sent through our network. + +************************************* + + +From pgsql-performance-owner@postgresql.org Mon Feb 24 13:49:47 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0D8DA475E14 + for ; + Mon, 24 Feb 2003 13:49:45 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 34738-05 for ; + Mon, 24 Feb 2003 13:49:34 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id 4E62B475BC3 + for ; + Mon, 24 Feb 2003 13:23:02 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h1OILDwN025146; + Mon, 24 Feb 2003 11:21:17 -0700 (MST) +Date: Mon, 24 Feb 2003 11:11:33 -0700 (MST) +From: "scott.marlowe" +To: "Schaefer, Mario" +Cc: "'pgsql-performance@postgresql.org'" +Subject: Re: partitioning os swap data log tempdb +In-Reply-To: <5187C8401CB1D211AB6E00A0C9929D06018326C5@DDV_EXCH> +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 +X-Archive-Number: 200302/178 +X-Sequence-Number: 1234 + +On Mon, 24 Feb 2003, Schaefer, Mario wrote: + +> Hi, +> +> we want to migrate from MS SQL Server (windows2000) +> to PostgreSQL (Linux) :-)) +> and we want to use the old MSSQL Hardware. +> +> Dual Pentium III 800 +> 1 GB RAM +> 2 IDE 10 GB +> 2 RAID Controller (RAID 0,1 aviable) with 2 9GB SCSI HDD +> 1 RAID Controller (RAID 0,1,5 aviable) with 3 18GB SCSI HDD +> +> The configuration for MS-SQL was this: +> OS on the 2 IDE Harddisks with Software-RAID1 +> SQL-Data on RAID-Controller with RAID-5 (3 x 18GB SCSI Harddisks) +> SQL-TempDB on RAID-Controller with RAID-1 (2 x 9GB SCSI Harddisk) +> SQL-TransactionLog on RAID-Controller with RAID-1 (2 x 9GB SCSI Harddisk) +> +> Can i make a similar configuration with PostgreSQL? +> Or what is the prefered fragmentation for +> operatingsystem, swap-partition, data, indexes, tempdb and transactionlog? +> +> What is pg_xlog and how important is it? +> +> What ist the prefered filesystem (ext2, ext3 or raiserfs)? +> +> We want to use about 20 databases with varios size from 5 MB to 500MB per +> database +> and more selects than inserts (insert/select ratio about 1/10) for fast +> webaccess. + +With that ratio of writers to readers, you may find a big RAID5 works as +well as anything. + +Also, you don't mention what RAID controllers you're using. If they're +real low end stuff like adaptec 133s, then you're better off just using +them as straight scsi cards under linux and letting the kernel do the +work. + +Can you create RAID arrays across multiple RAID cards on that setup? if +so, a big RAID-5 with 4 9 gigs and 3 more 9 gigs from the other 3 drives +might be your fastest storage. That's 36 gigs of storage across 7 +spindles, which means good parallel read access. + +How many simo users are you expecting? + + +From pgsql-performance-owner@postgresql.org Mon Feb 24 13:55:29 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 58A5E475C85 + for ; + Mon, 24 Feb 2003 13:55:25 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 36423-01 for ; + Mon, 24 Feb 2003 13:55:14 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 7C2DA475D0D + for ; + Mon, 24 Feb 2003 13:28:52 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2854946 for pgsql-performance@postgresql.org; + Mon, 24 Feb 2003 10:28:51 -0800 +Content-Type: text/plain; + charset="us-ascii" +From: Josh Berkus +Organization: Aglio Database Solutions +To: pgsql-performance@postgresql.org +Subject: Memory taken by FSM_relations +Date: Mon, 24 Feb 2003 10:28:00 -0800 +User-Agent: KMail/1.4.3 +MIME-Version: 1.0 +Message-Id: <200302241028.00309.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/179 +X-Sequence-Number: 1235 + +Folks: + +I'm not clear on where the memory needed by max_fsm_pages comes from. Is = +it=20 +taken out of the shared_buffers, or in addition to them? + +Further, Joe Conway gave me a guesstimate of 6k per max_fsm_pages which see= +ms=20 +rather high ... in fact, the default settings for this value (10000) would= +=20 +swamp the memory used by the rest of Postgres. Does anyone have a good=20 +measurment of the memory load imposed by higher FSM settings? + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Mon Feb 24 13:57:18 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 72E5B475C60 + for ; + Mon, 24 Feb 2003 13:57:16 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 35938-08 for ; + Mon, 24 Feb 2003 13:57:05 -0500 (EST) +Received: from localhost.localdomain (unknown [65.217.53.66]) + by postgresql.org (Postfix) with ESMTP id 2CA8A475E30 + for ; + Mon, 24 Feb 2003 13:30:42 -0500 (EST) +Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) + by localhost.localdomain (8.12.5/8.12.5) with ESMTP id h1OIwi6P022019; + Mon, 24 Feb 2003 13:58:46 -0500 +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 h1OIUYp27505; + Mon, 24 Feb 2003 13:30:36 -0500 +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 F3HTHDGG; Mon, 24 Feb 2003 13:30:33 -0500 +Subject: Re: slow query +From: Robert Treat +To: Clarence Gardner +Cc: Oleg Lebedev , + Josh Berkus , + "pgsql-performance@postgresql.org" +In-Reply-To: + +References: + +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +X-Mailer: Ximian Evolution 1.0.8 +Date: 24 Feb 2003 13:30:34 -0500 +Message-Id: <1046111434.1014.165.camel@camel> +Mime-Version: 1.0 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/180 +X-Sequence-Number: 1236 + +On Mon, 2003-02-24 at 12:27, Clarence Gardner wrote: +> On 24 Feb 2003, Robert Treat wrote: +> +> > +> > If your seeing wildly dramatic improvments from vacuum full, you might +> > want to look into running regular vacuums more often (especially for +> > high turnover tables), increase your max_fsm_relations to 1000, and +> > increasing your max_fsm_pages. +> +> I don't know about the settings you mention, but a frequent vacuum +> does not at all obviate a vacuum full. My database is vacuumed every +> night, but a while ago I found that a vacuum full changed a simple +> single-table query from well over 30 seconds to one or two. We now +> do a vacuum full every night. +> + +Actually if you are vacuuming frequently enough, it can (and should*) +obviate a vacuum full. Be aware that frequently enough might mean really +frequent, for instance I have several tables in my database that update +every row within a 15 minute timeframe, so I run a "lazy" vacuum on +these tables every 10 minutes. This allows postgresql to reuse the space +for these tables almost continuously so I never have to vacuum full +them. + +(* this assumes your max_fsm_pages/relations settings are set correctly) + +Robert Treat + + + +From pgsql-performance-owner@postgresql.org Mon Feb 24 14:08:47 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 656BD475F34 + for ; + Mon, 24 Feb 2003 14:03:54 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 38845-02 for ; + Mon, 24 Feb 2003 14:03:43 -0500 (EST) +Received: from jester.inquent.com (unknown [216.208.117.7]) + by postgresql.org (Postfix) with ESMTP id BEC94475E3E + for ; + Mon, 24 Feb 2003 13:38:45 -0500 (EST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by jester.inquent.com (8.12.6/8.12.6) with ESMTP id h1OIdC9P011671; + Mon, 24 Feb 2003 13:39:13 -0500 (EST) (envelope-from rbt@rbt.ca) +Subject: Re: slow query +From: Rod Taylor +To: Clarence Gardner +Cc: Robert Treat , + Oleg Lebedev , Josh Berkus , + "pgsql-performance@postgresql.org" +In-Reply-To: + +References: + +Content-Type: multipart/signed; micalg=pgp-sha1; + protocol="application/pgp-signature"; + boundary="=-2ofMzJOskQwspJ0Mxr9R" +Organization: +Message-Id: <1046111952.632.34.camel@jester> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.2.2 +Date: 24 Feb 2003 13:39:12 -0500 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/182 +X-Sequence-Number: 1238 + +--=-2ofMzJOskQwspJ0Mxr9R +Content-Type: text/plain +Content-Transfer-Encoding: quoted-printable + +On Mon, 2003-02-24 at 12:27, Clarence Gardner wrote: +> On 24 Feb 2003, Robert Treat wrote: +>=20 +> >=20 +> > If your seeing wildly dramatic improvments from vacuum full, you might +> > want to look into running regular vacuums more often (especially for +> > high turnover tables), increase your max_fsm_relations to 1000, and +> > increasing your max_fsm_pages.=20 +>=20 +> I don't know about the settings you mention, but a frequent vacuum +> does not at all obviate a vacuum full. My database is vacuumed every +> night, but a while ago I found that a vacuum full changed a simple +> single-table query from well over 30 seconds to one or two. We now +> do a vacuum full every night. + +Sure is does. If your free-space-map (FSM) is up to date, tuples are +not appended to the end of the table, so table growth will not occur +(beyond a 'settling' point. + +Unless you remove more data from the table than you ever expect to have +in the table again, this is enough. That said, the instant the FSM is +empty, you're table starts to grow again and a VACUUM FULL will be +required to re-shrink it. + +--=20 +Rod Taylor + +PGP Key: http://www.rbt.ca/rbtpub.asc + +--=-2ofMzJOskQwspJ0Mxr9R +Content-Type: application/pgp-signature; name=signature.asc +Content-Description: This is a digitally signed message part + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.2.1 (FreeBSD) + +iD8DBQA+WmbQ6DETLow6vwwRAnpFAJ9BY19SakriGuJg8WNIfrRHAEuRtQCfXzA7 +biQ2S7m6qUjYIkjZwoFKvC4= +=xri6 +-----END PGP SIGNATURE----- + +--=-2ofMzJOskQwspJ0Mxr9R-- + + +From pgsql-performance-owner@postgresql.org Mon Feb 24 14:08:41 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 97531475ADE + for ; + Mon, 24 Feb 2003 14:08:17 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 40576-01 for ; + Mon, 24 Feb 2003 14:08:06 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 23BC7475D87 + for ; + Mon, 24 Feb 2003 13:46:13 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2855016; Mon, 24 Feb 2003 10:46:12 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: Robert Treat , + Clarence Gardner +Subject: Re: slow query +Date: Mon, 24 Feb 2003 10:45:20 -0800 +User-Agent: KMail/1.4.3 +Cc: Oleg Lebedev , + "pgsql-performance@postgresql.org" +References: + + <1046111434.1014.165.camel@camel> +In-Reply-To: <1046111434.1014.165.camel@camel> +MIME-Version: 1.0 +Message-Id: <200302241045.20856.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/181 +X-Sequence-Number: 1237 + +Robert, + +> Actually if you are vacuuming frequently enough, it can (and should*) +> obviate a vacuum full. Be aware that frequently enough might mean really +> frequent, for instance I have several tables in my database that update +> every row within a 15 minute timeframe, so I run a "lazy" vacuum on +> these tables every 10 minutes. This allows postgresql to reuse the space +> for these tables almost continuously so I never have to vacuum full +> them. + +This would assume absolutely perfect FSM settings, and that the DB never ge= +ts=20 +thrown off by unexpected loads. I have never been so fortunate as to work= +=20 +with such a database. However, I agree that good FSM tuning and frequent= +=20 +regular VACUUMs can greatly extend the period required for running FULL. + +I have not found, though, that this does anything to prevent the need for= +=20 +REINDEX on frequently-updated tables. How about you, Robert? + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Mon Feb 24 14:14:41 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E8E45475E8C + for ; + Mon, 24 Feb 2003 14:14:06 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 42106-02 for ; + Mon, 24 Feb 2003 14:13:56 -0500 (EST) +Received: from mail.libertyrms.com (unknown [209.167.124.227]) + by postgresql.org (Postfix) with ESMTP id DFD50475EE4 + for ; + Mon, 24 Feb 2003 13:51:25 -0500 (EST) +Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 + (Debian)) + id 18nNhF-0004xt-00 + for ; Mon, 24 Feb 2003 13:51:25 -0500 +Date: Mon, 24 Feb 2003 13:51:25 -0500 +From: Andrew Sullivan +To: "pgsql-performance@postgresql.org" +Subject: Re: slow query +Message-ID: <20030224135125.H2742@mail.libertyrms.com> +Mail-Followup-To: Andrew Sullivan , + "pgsql-performance@postgresql.org" +References: <1046105913.1014.66.camel@camel> + +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.2.5i +In-Reply-To: + ; + from clarence@silcom.com on Mon, Feb 24, 2003 at 09:27:56AM -0800 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/183 +X-Sequence-Number: 1239 + +On Mon, Feb 24, 2003 at 09:27:56AM -0800, Clarence Gardner wrote: +> +> I don't know about the settings you mention, but a frequent vacuum +> does not at all obviate a vacuum full. My database is vacuumed every +> night, but a while ago I found that a vacuum full changed a simple +> single-table query from well over 30 seconds to one or two. We now +> do a vacuum full every night. + +This probably means that either some of your FSM settings should be +different, or that you have long-running queries, or both. _Some_ +advantage to vacuum full is expected, but 30 seconds to one or two is +a pretty big deal. + +Except in cases where a large percentage of the table is a vacuum +candidate, the standard vacuum should be more than adequate. But +there are a couple of gotchas. + +You need to have room in your free space map to hold information +about the bulk of the to-be-freed tables. So perhaps your FSM +settings are not big enough, even though you tried to set them +higher. (Of course, if you're replacing, say, more than half the +table, setting the FSM high enough isn't practical.) + +Another possibility is that you have multiple long-running +transactions that are keeping non-blocking vacuum from being very +effective. Since those transactions are possibly referencing old +versions of a row, when the non-blocking vacuum comes around, it just +skips the "dead" tuples which are nevertheless alive to someone. +(You can see the effect of this by using the contrib/pgstattuple +function). Blocking vacuum doesn't have this problem, because it +just waits on the table until everything ahead of it has committed or +rolled back. So you pay in wait time for all transactions during the +vacuum. (I have encountered this very problem on a table which gets +a lot of update activity on just on just one row. Even vacuuming +every minute, the table grew and grew, because of another misbehaving +application which was keeping a transaction open when it shouldn't +have.) + +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 Mon Feb 24 14:23:05 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A916D475CE7 + for ; + Mon, 24 Feb 2003 14:22:31 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 44902-02 for ; + Mon, 24 Feb 2003 14:22:18 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id F0E5D475E75 + for ; + Mon, 24 Feb 2003 14:01:32 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2855061; Mon, 24 Feb 2003 11:01:31 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: "Schaefer, Mario" , + "'pgsql-performance@postgresql.org'" +Subject: Re: partitioning os swap data log tempdb +Date: Mon, 24 Feb 2003 11:00:37 -0800 +User-Agent: KMail/1.4.3 +References: <5187C8401CB1D211AB6E00A0C9929D06018326C5@DDV_EXCH> +In-Reply-To: <5187C8401CB1D211AB6E00A0C9929D06018326C5@DDV_EXCH> +MIME-Version: 1.0 +Message-Id: <200302241100.37249.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/184 +X-Sequence-Number: 1240 + +Mario, + +> we want to migrate from MS SQL Server (windows2000) +> to PostgreSQL (Linux) :-)) +> and we want to use the old MSSQL Hardware. + +I don't blame you. I just finished an MSSQL project. BLEAH! + +> The configuration for MS-SQL was this: +> OS on the 2 IDE Harddisks with Software-RAID1 +> SQL-Data on RAID-Controller with RAID-5 (3 x 18GB SCSI Harddisks) +> SQL-TempDB on RAID-Controller with RAID-1 (2 x 9GB SCSI Harddisk) +> SQL-TransactionLog on RAID-Controller with RAID-1 (2 x 9GB SCSI Harddisk) +> +> Can i make a similar configuration with PostgreSQL? + +Yes. Many of the concerns are the same. However, 3-disk RAID 5 performs= +=20 +poorly for UPDATES for PostgreSQL. That is, while reads are often better= +=20 +than for a single SCSI disk, UPDATES happen at half or less of the speed th= +an=20 +they would do on a SCSI disk alone. + +There is no TempDB in PostgreSQL. This gives you a whole free RAID array t= +o=20 +play with. + +> Or what is the prefered fragmentation for +> operatingsystem, swap-partition, data, indexes, tempdb and transactionlog? +> +> What is pg_xlog and how important is it? + +It is analogous to the SQL Transaction Log, although it does not need to be= +=20 +backed up to truncate it. Deal with it the way you would deal with an MSSQ= +L=20 +transaction log; i.e. on its own disk, if possible. However, you gain litt= +le=20 +by putting it on RAID other than failover safety; in fact, you might find= +=20 +that the xlog peforms better on a lone SCSI disk since even the best RAID 1= +=20 +will slow down data writes by up to 15%. + +Swap is not such a concern for PostgreSQL on Linux or BSD. With proper=20 +database tuning and a GB of memory, you will never use the swap. Or to put= +=20 +it another way, if you're seeing regular hits on swap, you need to re-tune= +=20 +your database. + +Finally, you want to make absolutely sure that either the write-through cac= +he=20 +on each RAID controller is disabled in the BIOS, or that you have a battery= +=20 +back-up which you trust 100%. Otherwise, the caching done by the RAID=20 +controllers will cancel completely the benefit of the Xlog for database=20 +recovery. + +> What ist the prefered filesystem (ext2, ext3 or raiserfs)? + +That's a matter of open debate. I like Reiser. Ext3 has its proponents, = +as=20 +does XFS. Ext2 is probably faster than all of the above ... provided that= +=20 +your machine never has an unexpected shutdown. Then Ext2 is very bad ar= +=20 +recovering from power-outs ... + +> We want to use about 20 databases with varios size from 5 MB to 500MB per +> database +> and more selects than inserts (insert/select ratio about 1/10) for fast +> webaccess. + +Keep in mind that unlike SQL Server, you cannot easily query between databa= +ses=20 +on PostgreSQL. So if those databases are all related, you probably want t= +o=20 +put them in the same PostgreSQL 7.3.2 database and use schema instead. + +If the databases are for different users and completely seperate, you'll wa= +nt=20 +to read up heavily on Postgres' security model, which has been significantl= +y=20 +improved for 7.3. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Mon Feb 24 14:30:23 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 82A77474E4F + for ; + Mon, 24 Feb 2003 14:30:21 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 46278-05 for ; + Mon, 24 Feb 2003 14:30:10 -0500 (EST) +Received: from joeconway.com (63-210-180-150.skyriver.net [63.210.180.150]) + by postgresql.org (Postfix) with ESMTP id CC799475EBC + for ; + Mon, 24 Feb 2003 14:13:34 -0500 (EST) +Received: from [206.19.64.3] (account jconway HELO joeconway.com) + by joeconway.com (CommuniGate Pro SMTP 4.0.4) + with ESMTP-TLS id 1620683; Mon, 24 Feb 2003 11:49:00 -0800 +Message-ID: <3E5A6E66.4030408@joeconway.com> +Date: Mon, 24 Feb 2003 11:11:34 -0800 +From: Joe Conway +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; + rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Josh Berkus +Cc: pgsql-performance@postgresql.org +Subject: Re: Memory taken by FSM_relations +References: <200302241028.00309.josh@agliodbs.com> +In-Reply-To: <200302241028.00309.josh@agliodbs.com> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/185 +X-Sequence-Number: 1241 + +Josh Berkus wrote: +> Further, Joe Conway gave me a guesstimate of 6k per max_fsm_pages which seems +> rather high ... in fact, the default settings for this value (10000) would +> swamp the memory used by the rest of Postgres. + +I don't recall (and cannot find in my sent mail) ever making that +guesstimate. Can you provide some context? + +Joe + + + + +From pgsql-performance-owner@postgresql.org Mon Feb 24 14:54:39 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0173F475E75 + for ; + Mon, 24 Feb 2003 14:54:37 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 52175-08 for ; + Mon, 24 Feb 2003 14:54:26 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id A92A747605C + for ; + Mon, 24 Feb 2003 14:26:32 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2855133; Mon, 24 Feb 2003 11:26:30 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: Joe Conway +Subject: Re: Memory taken by FSM_relations +Date: Mon, 24 Feb 2003 11:25:38 -0800 +User-Agent: KMail/1.4.3 +Cc: pgsql-performance@postgresql.org +References: <200302241028.00309.josh@agliodbs.com> + <3E5A6E66.4030408@joeconway.com> +In-Reply-To: <3E5A6E66.4030408@joeconway.com> +MIME-Version: 1.0 +Message-Id: <200302241125.38739.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/186 +X-Sequence-Number: 1242 + +Joe, + +> I don't recall (and cannot find in my sent mail) ever making that +> guesstimate. Can you provide some context? + +Yeah, hold on ... hmmm ... no, your e-mail did not provide a figure. Sorry! + +Maybe I got it from Neil? + +In any case, it can't be the right figure ... + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Mon Feb 24 15:25:11 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B3DB84761B2 + for ; + Mon, 24 Feb 2003 15:25:08 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 66874-03 for ; + Mon, 24 Feb 2003 15:24:39 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id D0F4E475FEE + for ; + Mon, 24 Feb 2003 14:45:22 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h1OJhewN000940; + Mon, 24 Feb 2003 12:43:40 -0700 (MST) +Date: Mon, 24 Feb 2003 12:34:00 -0700 (MST) +From: "scott.marlowe" +To: Joe Conway +Cc: Josh Berkus , + +Subject: Re: Memory taken by FSM_relations +In-Reply-To: <3E5A6E66.4030408@joeconway.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 +X-Archive-Number: 200302/188 +X-Sequence-Number: 1244 + +On Mon, 24 Feb 2003, Joe Conway wrote: + +> Josh Berkus wrote: +> > Further, Joe Conway gave me a guesstimate of 6k per max_fsm_pages which seems +> > rather high ... in fact, the default settings for this value (10000) would +> > swamp the memory used by the rest of Postgres. +> +> I don't recall (and cannot find in my sent mail) ever making that +> guesstimate. Can you provide some context? + +If I remember right, it was 6 BYTES per max fsm pages... not kbytes. +That sounds about right anyway. + + +From pgsql-performance-owner@postgresql.org Mon Feb 24 15:16:55 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 44D0B475ADD + for ; + Mon, 24 Feb 2003 15:12:10 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 57278-10 for ; + Mon, 24 Feb 2003 15:11:59 -0500 (EST) +Received: from lerami.lerctr.org (lerami.lerctr.org [207.158.72.11]) + by postgresql.org (Postfix) with ESMTP id D1FA1474E4F + for ; + Mon, 24 Feb 2003 14:35:46 -0500 (EST) +Received: from lerlaptop.iadfw.net (lerlaptop.iadfw.net [206.66.13.21]) + (authenticated bits=0) + by lerami.lerctr.org (8.12.7/8.12.7/20030220) with ESMTP id + h1OJZYGU016457; Mon, 24 Feb 2003 13:35:34 -0600 (CST) +Date: Mon, 24 Feb 2003 13:35:34 -0600 +From: Larry Rosenman +To: Joe Conway , Josh Berkus +Cc: pgsql-performance@postgresql.org +Subject: Re: Memory taken by FSM_relations +Message-ID: <251960000.1046115334@lerlaptop.iadfw.net> +In-Reply-To: <3E5A6E66.4030408@joeconway.com> +References: <200302241028.00309.josh@agliodbs.com> + <3E5A6E66.4030408@joeconway.com> +X-Mailer: Mulberry/3.0.1 (Linux/x86) +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +X-Virus-Scanned: by amavisd-milter (http://amavis.org/) +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/187 +X-Sequence-Number: 1243 + + + +--On Monday, February 24, 2003 11:11:34 -0800 Joe Conway + wrote: + +> Josh Berkus wrote: +>> Further, Joe Conway gave me a guesstimate of 6k per max_fsm_pages which +>> seems rather high ... in fact, the default settings for this value +>> (10000) would swamp the memory used by the rest of Postgres. +> +> I don't recall (and cannot find in my sent mail) ever making that +> guesstimate. Can you provide some context? +It may be 6 **BYTES** per max_fsm_pages. + + +> +> Joe +> +> +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 6: Have you searched our list archives? +> +> http://archives.postgresql.org +> + + + +-- +Larry Rosenman http://www.lerctr.org/~ler +Phone: +1 972-414-9812 E-Mail: ler@lerctr.org +US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749 + + + + +From pgsql-performance-owner@postgresql.org Mon Feb 24 15:43:50 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 792E6475F4A + for ; + Mon, 24 Feb 2003 15:43:36 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 70086-07 for ; + Mon, 24 Feb 2003 15:43:25 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 66CAF475DAD + for ; + Mon, 24 Feb 2003 14:56:38 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2855216; Mon, 24 Feb 2003 11:56:37 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: "scott.marlowe" , + Joe Conway +Subject: Re: Memory taken by FSM_relations +Date: Mon, 24 Feb 2003 11:55:45 -0800 +User-Agent: KMail/1.4.3 +Cc: +References: +In-Reply-To: +MIME-Version: 1.0 +Message-Id: <200302241155.45940.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/189 +X-Sequence-Number: 1245 + +Scott, + +> If I remember right, it was 6 BYTES per max fsm pages... not kbytes. +> That sounds about right anyway. + +So, does it come out of Shared_buffers or add to it? + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Mon Feb 24 16:04:08 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 3503A4762D7 + for ; + Mon, 24 Feb 2003 15:58:27 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 73540-05 for ; + Mon, 24 Feb 2003 15:58:16 -0500 (EST) +Received: from localhost.localdomain (unknown [65.217.53.66]) + by postgresql.org (Postfix) with ESMTP id 3740647606A + for ; + Mon, 24 Feb 2003 14:59:00 -0500 (EST) +Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) + by localhost.localdomain (8.12.5/8.12.5) with ESMTP id h1OKR66P022704; + Mon, 24 Feb 2003 15:27:06 -0500 +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 h1OJwvp29064; + Mon, 24 Feb 2003 14:58:57 -0500 +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 F3HTHDTP; Mon, 24 Feb 2003 14:58:57 -0500 +Subject: Re: slow query +From: Robert Treat +To: Josh Berkus +Cc: Clarence Gardner , + Oleg Lebedev , + "pgsql-performance@postgresql.org" +In-Reply-To: <200302241045.20856.josh@agliodbs.com> +References: + + <1046111434.1014.165.camel@camel> + <200302241045.20856.josh@agliodbs.com> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +X-Mailer: Ximian Evolution 1.0.8 +Date: 24 Feb 2003 14:58:57 -0500 +Message-Id: <1046116737.1014.284.camel@camel> +Mime-Version: 1.0 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/190 +X-Sequence-Number: 1246 + +On Mon, 2003-02-24 at 13:45, Josh Berkus wrote: +> Robert, +> +> > Actually if you are vacuuming frequently enough, it can (and should*) +> > obviate a vacuum full. Be aware that frequently enough might mean really +> > frequent, for instance I have several tables in my database that update +> > every row within a 15 minute timeframe, so I run a "lazy" vacuum on +> > these tables every 10 minutes. This allows postgresql to reuse the space +> > for these tables almost continuously so I never have to vacuum full +> > them. +> +> This would assume absolutely perfect FSM settings, and that the DB never gets +> thrown off by unexpected loads. I have never been so fortunate as to work +> with such a database. However, I agree that good FSM tuning and frequent +> regular VACUUMs can greatly extend the period required for running FULL. +> + +It's somewhat relative. On one of my tables, it has about 600 rows, each +row gets updated within 15 minutes. I vacuum it every 10 minutes, which +should leave me with around 1000 tuples (dead and alive) for that table, +Even if something overload the updates on that table, chances are that I +wouldn't see enough of a performance drop to warrant a vacuum full. Of +course, its a small table, so YMMV. I think the point is though that if +your running nightly vacuum fulls just to stay ahead of the game, your +not maintaining the database optimally. + +> I have not found, though, that this does anything to prevent the need for +> REINDEX on frequently-updated tables. How about you, Robert? +> + +Well, this touches on a different topic. On those tables where I get +"index bloat", I do have to do REINDEX's. But that's not currently +solvable with vacuum (remember indexes dont even use FSM) though IIRC +Tom & Co. have done some work toward this for 7.4 + +Robert Treat + + +From pgsql-performance-owner@postgresql.org Mon Feb 24 16:33:16 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E11EB475ED4 + for ; + Mon, 24 Feb 2003 16:33:12 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 79544-06 for ; + Mon, 24 Feb 2003 16:32:44 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 1A620475AD4 + for ; + Mon, 24 Feb 2003 15:17:41 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1OKHe5u005222; + Mon, 24 Feb 2003 15:17:40 -0500 (EST) +To: Josh Berkus +Cc: pgsql-performance@postgresql.org +Subject: Re: Memory taken by FSM_relations +In-reply-to: <200302241028.00309.josh@agliodbs.com> +References: <200302241028.00309.josh@agliodbs.com> +Comments: In-reply-to Josh Berkus + message dated "Mon, 24 Feb 2003 10:28:00 -0800" +Date: Mon, 24 Feb 2003 15:17:40 -0500 +Message-ID: <5221.1046117860@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/191 +X-Sequence-Number: 1247 + +Josh Berkus writes: +> I'm not clear on where the memory needed by max_fsm_pages comes from. +> Is it taken out of the shared_buffers, or in addition to them? + +In addition to. Basically max_fsm_pages and max_fsm_relations are used +to ratchet up the postmaster's initial shared memory request to the kernel. + +> Further, Joe Conway gave me a guesstimate of 6k per max_fsm_pages +> which seems rather high ... + +Quite ;-). The correct figure is six bytes per fsm_page slot, and +I think about forty bytes per fsm_relation slot (recent versions of +postgresql.conf mention the multipliers, although for some reason +the Admin Guide does not). + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Mon Feb 24 18:22:44 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 8156F475F39 + for ; + Mon, 24 Feb 2003 18:13:10 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 95659-10 for ; + Mon, 24 Feb 2003 18:12:42 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 2D6A5476065 + for ; + Mon, 24 Feb 2003 15:50:35 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1OKoZ5u005422; + Mon, 24 Feb 2003 15:50:35 -0500 (EST) +To: Josh Berkus +Cc: Robert Treat , + Clarence Gardner , + Oleg Lebedev , + "pgsql-performance@postgresql.org" +Subject: Re: slow query +In-reply-to: <200302241045.20856.josh@agliodbs.com> +References: + + <1046111434.1014.165.camel@camel> + <200302241045.20856.josh@agliodbs.com> +Comments: In-reply-to Josh Berkus + message dated "Mon, 24 Feb 2003 10:45:20 -0800" +Date: Mon, 24 Feb 2003 15:50:35 -0500 +Message-ID: <5421.1046119835@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/192 +X-Sequence-Number: 1248 + +Josh Berkus writes: +> ... However, I agree that good FSM tuning and frequent +> regular VACUUMs can greatly extend the period required for running FULL. + +> I have not found, though, that this does anything to prevent the need for +> REINDEX on frequently-updated tables. How about you, Robert? + +As of 7.3, FSM doesn't have anything to do with indexes. If you have +index bloat, it's because of the inherent inability of btree indexes to +reuse space when the data distribution changes over time. (Portions of +the btree may become empty, but they aren't recycled.) You'll +particularly get burnt by indexes that are on OIDs or sequentially +assigned ID numbers, since the set of IDs in use just naturally tends to +migrate higher over time. I don't think that the update rate per se has +much to do with this, it's the insertion of new IDs and deletion of old +ones that causes the statistical shift. The tree grows at the right +edge, but doesn't shrink at the left. + +As of CVS tip, however, the situation is different ;-). Btree indexes +will recycle space using FSM in 7.4. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Tue Feb 25 02:56:13 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 4C3BC476406 + for ; + Tue, 25 Feb 2003 02:56:11 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 13291-02 for ; + Tue, 25 Feb 2003 02:56:00 -0500 (EST) +Received: from mailserver.virtusa.com (mail.erunway.com [12.40.51.200]) + by postgresql.org (Postfix) with ESMTP id 4F17F4762DD + for ; + Mon, 24 Feb 2003 23:11:43 -0500 (EST) +Received: from enetslmaili.eRUNWAY (enetslmaili [10.2.1.10]) by + mailserver.virtusa.com with SMTP (Microsoft Exchange Internet + Mail Service Version 5.5.2653.13) + id FJKJ7D8F; Mon, 24 Feb 2003 23:12:23 -0500 +Received: from anuradha (ARATNAWEERA [10.2.2.86]) by enetslmaili.eRUNWAY with + SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) + id FSA0YBP3; Tue, 25 Feb 2003 10:01:32 +0600 +Received: from anuradha by anuradha with local (Exim 3.35 #1 (Debian)) + id 18nWRT-0001Hp-00 + for ; Tue, 25 Feb 2003 10:11:43 +0600 +Date: Tue, 25 Feb 2003 10:11:43 +0600 +From: Anuradha Ratnaweera +To: pgsql-performance@postgresql.org +Subject: Superfluous merge/sort +Message-ID: <20030225041143.GA4886@aratnaweera.virtusa.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.3.28i +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/193 +X-Sequence-Number: 1249 + + +Question in brief: does the planner/optimizer take into account the +foreign key constraints? + +If the answer is "no", please stop reading here. + +Here comes the details. Let me give a simple example to illustrate the +situation. + +1. We have two tables t1 and t2. + + create table t1 ( + id integer primary key, + dummy integer + ); + + create table t2 ( + id integer, + dummy integer + ); + +2. We create indexes on all the non-pkey fields. + + create index t1_dummy_idx on t1(dummy); + create index t2_id_idx on t2(id); + create index t2_dummy_idx on t2(dummy); + +3. We make t2(id) a foreign key of t1(id). + + alter table t2 add constraint t2_fkey foreign key (id) references t1(id); + +4. Populate "t1" with unique "id"s from 0 to 19999 with a dummy value. + + copy "t1" from stdin; + 0 654 + 1 86097 + ... + 19998 93716 + 19999 9106 + \. + +5. Populate "t2" with 50000 "id"s with a normal distribution. + + copy "t2" from stdin; + 8017 98659 + 11825 5946 + ... + 8202 35994 + 8436 19729 + \. + +Now we are ready to go ... + + +- First query is to find the "dummy" values with highest frequency. + + => explain select dummy from t2 group by dummy order by count(*) desc limit 10; + NOTICE: QUERY PLAN: + + Limit (cost=2303.19..2303.19 rows=10 width=4) + -> Sort (cost=2303.19..2303.19 rows=5000 width=4) + -> Aggregate (cost=0.00..1996.00 rows=5000 width=4) + -> Group (cost=0.00..1871.00 rows=50000 width=4) + -> Index Scan using t2_dummy_idx on t2 (cost=0.00..1746.00 rows=50000 width=4) + + EXPLAIN + + +- Second query is esseitially the same, but we do a merge with "t1" on + the foreign key (just for the sake of illustrating the point). + + => explain select t2.dummy from t1, t2 where t1.id = t2.id group by t2.dummy order by count(*) desc limit 10; + NOTICE: QUERY PLAN: + + Limit (cost=7643.60..7643.60 rows=10 width=12) + -> Sort (cost=7643.60..7643.60 rows=5000 width=12) + -> Aggregate (cost=7086.41..7336.41 rows=5000 width=12) + -> Group (cost=7086.41..7211.41 rows=50000 width=12) + -> Sort (cost=7086.41..7086.41 rows=50000 width=12) + -> Merge Join (cost=0.00..3184.00 rows=50000 width=12) + -> Index Scan using t1_pkey on t1 (cost=0.00..638.00 rows=20000 width=4) + -> Index Scan using t2_id_idx on t2 (cost=0.00..1746.00 rows=50000 width=8) + + EXPLAIN + + +Does this mean that the planner/optimizer doesn't take into account the +foreign key constraint? + + Anuradha + +-- + +Debian GNU/Linux (kernel 2.4.21-pre4) + +Don't worry about the world coming to an end today. It's already tomorrow +in Australia. + -- Charles Schulz + + +From pgsql-performance-owner@postgresql.org Tue Feb 25 05:40:06 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 94E6C476105 + for ; + Tue, 25 Feb 2003 05:40:03 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 67800-10 for ; + Tue, 25 Feb 2003 05:39:52 -0500 (EST) +Received: from galilee.canodesc.com (unknown [165.228.0.2]) + by postgresql.org (Postfix) with ESMTP id 930354762ED + for ; + Tue, 25 Feb 2003 03:03:43 -0500 (EST) +Received: from carbine.canodesc.com (carbine.canodesc.com [192.168.2.11]) + by galilee.canodesc.com (8.11.2/8.11.2/cooper-1.1) with ESMTP id + h1P83ge02311 + for ; Tue, 25 Feb 2003 19:03:42 +1100 +Received: (from root@localhost) + by carbine.canodesc.com (8.11.6/8.11.6) id h1P83gV26670 + for pgsql-performance@postgresql.org; Tue, 25 Feb 2003 19:03:42 +1100 +Received: from poseidon.canodesc.com (poseidon.canodesc.com [192.168.1.10]) + by carbine.canodesc.com (8.11.6/8.9.3) with ESMTP id h1P83fp26541 + for ; Tue, 25 Feb 2003 19:03:41 +1100 +Received: from localhost (localhost [[UNIX: localhost]]) + by poseidon.canodesc.com (8.11.6/8.11.6) id h1P83fu13450 + for pgsql-performance@postgresql.org; Tue, 25 Feb 2003 19:03:41 +1100 +X-scanner: scanned by Inflex 1.0.12.1 - (http://pldaniels.com/inflex/) +Content-Type: text/plain; + charset="us-ascii" +From: Mark Halliwell +To: pgsql-performance@postgresql.org +Subject: Query not using the index +Date: Tue, 25 Feb 2003 19:03:40 +1100 +User-Agent: KMail/1.4.1 +MIME-Version: 1.0 +Message-Id: <200302251903.40364.mark@transportservices.com.au> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/194 +X-Sequence-Number: 1250 + +Hello Everyone, + +I am having some problems getting my queries to use the correct index, and = +as=20 +a result they use a sequential scan that takes a very long time. + +The table in question is used for replicating data between computers and=20 +contains over 7 million records. The table is on a few different linux=20 +computers, some running postgresql version 7.3 and some 7.3.2; my problem i= +s=20 +the same on all. The relevent fields are: + Table "public.replicate" + Column | Type | Modifiers +--------------+-----------------------------+----------- + computer | integer | not null + sequence | integer | not null + +The majority of records (about 6.8 million) have computer =3D 8 with sequen= +ce=20 +starting at 2200000 and incrementing by 1. +There are about 497000 records with computer =3D 3 with the sequence starti= +ng at=20 +1 and also incrementing by 1. +There are only a few records with other computer numbers. +Records are inserted (they are never deleted but sometimes updated) in=20 +numerical order by the sequence field for each computer and together these= +=20 +fields (computer, sequence) are unique. + +I have a few queries that attempt to find recently inserted records for a= +=20 +particular computer. Most of my queries include other terms in the where= +=20 +clause and sort the results (usually by sequence), however this simple quer= +y=20 +can be used as an example of my problem: +select * from replicate where computer =3D 3 and sequence >=3D 490000; + +I have created several different indexes (always doing a vacuum analyse=20 +afterwards etc), but the explain always reports a sequential scan. If I=20 +force an index scan, it runs very quickly - as it should. Also, it appears= +=20 +that if a specify an upper limit for sequence (a value which I cannot alway= +s=20 +easily predict), it also uses the index. + +If my query is for those records with computer =3D 8, I believe it chooses = +the=20 +correct index every time. + +Here are some examples of the indexes I created and the explains: +=3D=3D=3D=3D=3D=3D=3D +This is the original index which works fine until there are lots (several= +=20 +thousand) of records for a particular computer number: +create unique index replicate_id on replicate (computer, sequence); + +explain analyse select * from replicate where computer =3D 3 and sequence >= +=3D=20 +490000; + QUERY PLAN +---------------------------------------------------------------------------= +--------------------------------------------- + Seq Scan on replicate (cost=3D0.00..400259.20 rows=3D300970 width=3D386) = +(actual=20 +time=3D80280.18..80974.41 rows=3D7459 loops=3D1) + Filter: ((computer =3D 3) AND ("sequence" >=3D 490000)) + Total runtime: 80978.67 msec +(3 rows) + +But if we put in an upper limit for the sequence we get: +explain analyse select * from replicate where computer =3D 3 and sequence >= +=3D=20 +490000 and sequence < 600000; + QUERY PLAN +---------------------------------------------------------------------------= +------------------------------------------------------- + Index Scan using replicate_id on replicate (cost=3D0.00..625.99 rows=3D18= +2=20 +width=3D388) (actual time=3D45.00..446.31 rows=3D7789 loops=3D1) + Index Cond: ((computer =3D 3) AND ("sequence" >=3D 490000) AND ("sequenc= +e" <=20 +600000)) + Total runtime: 451.18 msec +(3 rows) + + +set enable_seqscan=3Doff; +explain analyse select * from replicate where computer =3D 3 and sequence >= +=3D=20 +490000; + QUERY PLAN +---------------------------------------------------------------------------= +----------------------------------------------------------- + Index Scan using replicate_id on replicate (cost=3D0.00..991401.16 rows= +=3D289949=20 +width=3D388) (actual time=3D0.06..47.84 rows=3D7788 loops=3D1) + Index Cond: ((computer =3D 3) AND ("sequence" >=3D 490000)) + Total runtime: 52.48 msec +(3 rows) + +=3D=3D=3D=3D=3D=3D +I tried adding this index, and it seemed to work until (I think) there were= +=20 +about 400000 records for computer =3D 3. +create index replicate_computer_3 on replicate (sequence) WHERE computer = +=3D 3; + +explain analyse select * from replicate where computer =3D 3 and sequence >= +=3D=20 +490000; + QUERY PLAN +---------------------------------------------------------------------------= +--------------------------------------------- + Seq Scan on replicate (cost=3D0.00..400262.91 rows=3D287148 width=3D386) = +(actual=20 +time=3D74371.70..74664.84 rows=3D7637 loops=3D1) + Filter: ((computer =3D 3) AND ("sequence" >=3D 490000)) + Total runtime: 74669.22 msec +(3 rows) + +But if we put an upper limit for the sequence we get: +explain analyse select * from replicate where computer =3D 3 and sequence >= +=3D=20 +490000 and sequence < 600000; + QUERY PLAN +---------------------------------------------------------------------------= +------------------------------------------------------------- + Index Scan using replicate_computer_3 on replicate (cost=3D0.00..417.29= +=20 +rows=3D180 width=3D386) (actual time=3D0.06..54.21 rows=3D7657 loops=3D1) + Index Cond: (("sequence" >=3D 490000) AND ("sequence" < 600000)) + Filter: (computer =3D 3) + Total runtime: 58.86 msec +(4 rows) + + +And, forcing the index: +set enable_seqscan=3Doff; +explain analyse select * from replicate where computer =3D 3 and sequence >= +=3D=20 +490000; + QUERY PLAN +---------------------------------------------------------------------------= +------------------------------------------------------------------- + Index Scan using replicate_computer_3 on replicate (cost=3D0.00..660538.2= +8=20 +rows=3D287148 width=3D386) (actual time=3D0.06..53.05 rows=3D7657 loops=3D1) + Index Cond: ("sequence" >=3D 490000) + Filter: (computer =3D 3) + Total runtime: 57.66 msec +(4 rows) + + +I have tried quiet a few different indexes and they all seem to do the same= +=20 +sort of thing. Is there anything that I should be doing to make these=20 +queries use the index? I am unable to easily predict what the upper limit= +=20 +for the sequence should be in all cases, so I would rather a solution that= +=20 +didn't require specifying it. Am I missing something? + +Is there some other information that I should have provided? + +Thanks +Mark Halliwell + + + +From pgsql-performance-owner@postgresql.org Tue Feb 25 07:59:07 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A71ED47580B + for ; + Tue, 25 Feb 2003 07:58:44 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 04856-01 for ; + Tue, 25 Feb 2003 07:58:33 -0500 (EST) +Received: from mail.libertyrms.com (unknown [209.167.124.227]) + by postgresql.org (Postfix) with ESMTP id 62977475E83 + for ; + Tue, 25 Feb 2003 07:44:47 -0500 (EST) +Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 + (Debian)) + id 18neS2-0004Jx-00 + for ; Tue, 25 Feb 2003 07:44:50 -0500 +Date: Tue, 25 Feb 2003 07:44:50 -0500 +From: Andrew Sullivan +To: pgsql-performance@postgresql.org +Subject: Re: Query not using the index +Message-ID: <20030225074450.A16284@mail.libertyrms.com> +Mail-Followup-To: Andrew Sullivan , + pgsql-performance@postgresql.org +References: <200302251903.40364.mark@transportservices.com.au> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.2.5i +In-Reply-To: <200302251903.40364.mark@transportservices.com.au>; + from mark@transportservices.com.au on Tue, Feb 25, 2003 at + 07:03:40PM +1100 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/195 +X-Sequence-Number: 1251 + +On Tue, Feb 25, 2003 at 07:03:40PM +1100, Mark Halliwell wrote: + +> The majority of records (about 6.8 million) have computer = 8 with sequence +> starting at 2200000 and incrementing by 1. +> There are about 497000 records with computer = 3 with the sequence starting at +> 1 and also incrementing by 1. +> There are only a few records with other computer numbers. + +> select * from replicate where computer = 3 and sequence >= 490000; +> +> I have created several different indexes (always doing a vacuum analyse +> afterwards etc), but the explain always reports a sequential scan. If I + +Try setting the statistics on computer to a much wider value -- say + + ALTER TABLE computer ALTER COLUMN computer SET STATISTICS 1000 + +and see if it helps. You can poke around in the pg_stats view to see +why this might help, and perhaps to get a more realistic idea of what +you need to set the statistics to. The problem is likely the +overwhelming commonality of computer=8. + +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 Feb 25 08:49:39 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 24366474E42 + for ; + Tue, 25 Feb 2003 08:49:01 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 16398-05 for ; + Tue, 25 Feb 2003 08:48:50 -0500 (EST) +Received: from wolff.to (wolff.to [66.93.249.74]) + by postgresql.org (Postfix) with SMTP id ADDCD475A3F + for ; + Tue, 25 Feb 2003 08:42:52 -0500 (EST) +Received: (qmail 30334 invoked by uid 500); 25 Feb 2003 13:56:29 -0000 +Date: Tue, 25 Feb 2003 07:56:29 -0600 +From: Bruno Wolff III +To: Mark Halliwell +Cc: pgsql-performance@postgresql.org +Subject: Re: Query not using the index +Message-ID: <20030225135629.GA30236@wolff.to> +Mail-Followup-To: Mark Halliwell , + pgsql-performance@postgresql.org +References: <200302251903.40364.mark@transportservices.com.au> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <200302251903.40364.mark@transportservices.com.au> +User-Agent: Mutt/1.3.25i +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/196 +X-Sequence-Number: 1252 + +On Tue, Feb 25, 2003 at 19:03:40 +1100, + Mark Halliwell wrote: +> +> The majority of records (about 6.8 million) have computer = 8 with sequence +> starting at 2200000 and incrementing by 1. +> There are about 497000 records with computer = 3 with the sequence starting at +> 1 and also incrementing by 1. +> There are only a few records with other computer numbers. + +You might get some benefit using a partial index that just covers the +rows where computer = 3. + +From pgsql-performance-owner@postgresql.org Tue Feb 25 10:21:10 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id D447C475E2B + for ; + Tue, 25 Feb 2003 10:21:02 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 40732-02 for ; + Tue, 25 Feb 2003 10:20:46 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 007AA475AAC + for ; + Tue, 25 Feb 2003 10:13:23 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1PFDR5u010479; + Tue, 25 Feb 2003 10:13:27 -0500 (EST) +To: Mark Halliwell +Cc: pgsql-performance@postgresql.org +Subject: Re: Query not using the index +In-reply-to: <200302251903.40364.mark@transportservices.com.au> +References: <200302251903.40364.mark@transportservices.com.au> +Comments: In-reply-to Mark Halliwell + message dated "Tue, 25 Feb 2003 19:03:40 +1100" +Date: Tue, 25 Feb 2003 10:13:26 -0500 +Message-ID: <10478.1046186006@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/197 +X-Sequence-Number: 1253 + +Mark Halliwell writes: +> The majority of records (about 6.8 million) have computer = 8 with sequence +> starting at 2200000 and incrementing by 1. +> There are about 497000 records with computer = 3 with the sequence starting at +> 1 and also incrementing by 1. +> There are only a few records with other computer numbers. + +You aren't going to find any non-kluge solution, because Postgres keeps +no cross-column statistics and thus is quite unaware that there's any +correlation between the computer and sequence fields. So in a query +like + +> select * from replicate where computer = 3 and sequence >= 490000; + +the sequence constraint looks extremely unselective to the planner, and +you get a seqscan, even though *in the domain of computer = 3* it's a +reasonably selective constraint. + +> that if a specify an upper limit for sequence (a value which I cannot always +> easily predict), it also uses the index. + +I would think that it'd be sufficient to say + + select * from replicate where computer = 3 and sequence >= 490000 + and sequence < 2200000; + +If it's not, try increasing the statistics target for the sequence +column so that ANALYZE gathers a finer-grain histogram for that column. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Tue Feb 25 10:40:58 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 1E68D475EB2 + for ; + Tue, 25 Feb 2003 10:40:56 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 44280-07 for ; + Tue, 25 Feb 2003 10:40:45 -0500 (EST) +Received: from localhost.localdomain (unknown [65.217.53.66]) + by postgresql.org (Postfix) with ESMTP id 095B5475B99 + for ; + Tue, 25 Feb 2003 10:28:07 -0500 (EST) +Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) + by localhost.localdomain (8.12.5/8.12.5) with ESMTP id h1PFuM6P026022; + Tue, 25 Feb 2003 10:56:22 -0500 +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 h1PFS2p07183; + Tue, 25 Feb 2003 10:28:02 -0500 +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 F3HTHGLS; Tue, 25 Feb 2003 10:28:01 -0500 +Subject: Re: slow query +From: Robert Treat +To: Tom Lane +Cc: Josh Berkus , Clarence Gardner , + Oleg Lebedev , + "pgsql-performance@postgresql.org" +In-Reply-To: <5421.1046119835@sss.pgh.pa.us> +References: + + <1046111434.1014.165.camel@camel> + <200302241045.20856.josh@agliodbs.com> + <5421.1046119835@sss.pgh.pa.us> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +X-Mailer: Ximian Evolution 1.0.8 +Date: 25 Feb 2003 10:28:02 -0500 +Message-Id: <1046186882.1015.377.camel@camel> +Mime-Version: 1.0 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/198 +X-Sequence-Number: 1254 + +On Mon, 2003-02-24 at 15:50, Tom Lane wrote: +> You'll +> particularly get burnt by indexes that are on OIDs or sequentially +> assigned ID numbers, since the set of IDs in use just naturally tends to +> migrate higher over time. I don't think that the update rate per se has +> much to do with this, it's the insertion of new IDs and deletion of old +> ones that causes the statistical shift. + +Would it be safe to say that tables with high update rates where the +updates do not change the indexed value would not suffer from index +bloat? For example updates to non-index columns or updates that +overwrite, but don't change the value of indexed columns; do these even +need to touch the index? + +Robert Treat + + +From pgsql-performance-owner@postgresql.org Tue Feb 25 11:10:46 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 4A19F475B47 + for ; + Tue, 25 Feb 2003 11:10:15 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 53764-05 for ; + Tue, 25 Feb 2003 11:10:04 -0500 (EST) +Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) + by postgresql.org (Postfix) with ESMTP id 3063C475B8A + for ; + Tue, 25 Feb 2003 10:56:10 -0500 (EST) +Received: by megazone.bigpanda.com (Postfix, from userid 1001) + id D15C7D611; Tue, 25 Feb 2003 07:56:14 -0800 (PST) +Received: from localhost (localhost [127.0.0.1]) + by megazone.bigpanda.com (Postfix) with ESMTP + id C6D2D5C02; Tue, 25 Feb 2003 07:56:14 -0800 (PST) +Date: Tue, 25 Feb 2003 07:56:14 -0800 (PST) +From: Stephan Szabo +To: Anuradha Ratnaweera +Cc: +Subject: Re: Superfluous merge/sort +In-Reply-To: <20030225041143.GA4886@aratnaweera.virtusa.com> +Message-ID: <20030225075139.V57635-100000@megazone23.bigpanda.com> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/199 +X-Sequence-Number: 1255 + + +On Tue, 25 Feb 2003, Anuradha Ratnaweera wrote: + +> Question in brief: does the planner/optimizer take into account the +> foreign key constraints? +> +> If the answer is "no", please stop reading here. + +Not really. However, as a note, from t1,t2 where t1.id=t2.id is not +necessarily an identity even with the foreign key due to NULLs. + + +From pgsql-performance-owner@postgresql.org Tue Feb 25 11:19:20 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 1221C475A97 + for ; + Tue, 25 Feb 2003 11:19:17 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 55884-01 for ; + Tue, 25 Feb 2003 11:19:06 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 7CB87475AFA + for ; + Tue, 25 Feb 2003 11:07:11 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1PG7F5u010855; + Tue, 25 Feb 2003 11:07:16 -0500 (EST) +To: Robert Treat +Cc: Josh Berkus , Clarence Gardner , + Oleg Lebedev , + "pgsql-performance@postgresql.org" +Subject: Re: slow query +In-reply-to: <1046186882.1015.377.camel@camel> +References: + + <1046111434.1014.165.camel@camel> + <200302241045.20856.josh@agliodbs.com> + <5421.1046119835@sss.pgh.pa.us> <1046186882.1015.377.camel@camel> +Comments: In-reply-to Robert Treat + message dated "25 Feb 2003 10:28:02 -0500" +Date: Tue, 25 Feb 2003 11:07:15 -0500 +Message-ID: <10854.1046189235@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/200 +X-Sequence-Number: 1256 + +Robert Treat writes: +> Would it be safe to say that tables with high update rates where the +> updates do not change the indexed value would not suffer from index +> bloat? + +I would expect not. If you vacuum often enough to keep the main table +size under control, the index should stay under control too. + +> For example updates to non-index columns or updates that +> overwrite, but don't change the value of indexed columns; do these even +> need to touch the index? + +Yes, they do. Think MVCC. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Tue Feb 25 11:50:26 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id CB487475BD7 + for ; + Tue, 25 Feb 2003 11:50:12 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 61441-05 for ; + Tue, 25 Feb 2003 11:50:02 -0500 (EST) +Received: from smtp.blueyonder.co.uk (pc-62-31-245-195-gl.blueyonder.co.uk + [62.31.245.195]) + by postgresql.org (Postfix) with ESMTP id 70CD2475DDB + for ; + Tue, 25 Feb 2003 11:35:36 -0500 (EST) +Received: from reddragon.localdomain ([127.0.0.1] helo=localhost) + by smtp.blueyonder.co.uk with esmtp (Exim 4.10) id 18ni3v-0004FR-00 + for pgsql-performance@postgresql.org; Tue, 25 Feb 2003 16:36:11 +0000 +Date: Tue, 25 Feb 2003 16:36:11 +0000 (GMT) +From: Peter Childs +X-X-Sender: peter@RedDragon.Childs +Cc: "pgsql-performance@postgresql.org" +Subject: Re: slow query +In-Reply-To: <10854.1046189235@sss.pgh.pa.us> +Message-ID: +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/201 +X-Sequence-Number: 1257 + +On Tue, 25 Feb 2003, Tom Lane wrote: + +> Robert Treat writes: +> > Would it be safe to say that tables with high update rates where the +> > updates do not change the indexed value would not suffer from index +> > bloat? +> +> I would expect not. If you vacuum often enough to keep the main table +> size under control, the index should stay under control too. + + Yes and No, From what I can work out the index is a tree and if +many updates occus the tree can become unbalanced (eventually it get so +unbalanced its no better than a seq scan.... Its not big its just all the +data is all on one side of the tree. Which is why Reindexing is a good +plan. What is really needed is a quicker way of rebalancing the tree. So +the database notices when the index is unbalanced and picks a new root +node and hangs the old root to that. (Makes for a very intresting +algorithim if I remeber my University lectures....) + Now I'm trying to sort out a very large static table that I've +just finished updating. I am beginning to think that the quickest way of +sorting it out is to dump and reload it. But I'm trying a do it in place +method. (Of Reindex it, vaccum full analyse) but what is the correct order +to do this in? + +Reindex, Vaccum + +or + +Vaccum, Reindex. + +Peter Childs + +> +> > For example updates to non-index columns or updates that +> > overwrite, but don't change the value of indexed columns; do these even +> > need to touch the index? +> +> Yes, they do. Think MVCC. +> +> regards, tom lane +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 5: Have you checked our extensive FAQ? +> +> http://www.postgresql.org/users-lounge/docs/faq.html +> + + +From pgsql-performance-owner@postgresql.org Tue Feb 25 18:06:21 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 2EC7F475C98 + for ; + Tue, 25 Feb 2003 18:06:19 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 12427-02 for ; + Tue, 25 Feb 2003 18:05:50 -0500 (EST) +Received: from ms-smtp-01.texas.rr.com (ms-smtp-01.texas.rr.com + [24.93.36.229]) + by postgresql.org (Postfix) with ESMTP id 1523B475C26 + for ; + Tue, 25 Feb 2003 17:44:14 -0500 (EST) +Received: from spaceship.com (cs24243214-140.austin.rr.com [24.243.214.140]) + by ms-smtp-01.texas.rr.com (8.12.5/8.12.2) with ESMTP id h1PMcPU1023372 + for ; + Tue, 25 Feb 2003 17:38:26 -0500 (EST) +Message-ID: <3E5BF1BD.9070301@spaceship.com> +Date: Tue, 25 Feb 2003 16:44:13 -0600 +From: Matt Mello +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Faster 'select count(*) from table' ? +References: <3E564695.7030906@digital-ics.com> + <15034.1045842303@sss.pgh.pa.us> +In-Reply-To: <15034.1045842303@sss.pgh.pa.us> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/202 +X-Sequence-Number: 1258 + +Does anyone know if there is a fast way to find out how many records are +in a table? + +"Select count(*) from table" is very slow. + +I would think that PG would keep up with the number of undeleted rows on +a realtime basis. Is that the case? If so, how would I query it? + +Hope this is the correct list for this question. + +Thanks! + +-- +Matt Mello + + + +From pgsql-performance-owner@postgresql.org Tue Feb 25 18:50:43 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A4B92475AE4 + for ; + Tue, 25 Feb 2003 18:50:40 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 23304-05 for ; + Tue, 25 Feb 2003 18:50:29 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id 08084475E75 + for ; + Tue, 25 Feb 2003 18:24:56 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h1PNNgeF003746; + Tue, 25 Feb 2003 16:23:42 -0700 (MST) +Date: Tue, 25 Feb 2003 16:25:26 -0700 (MST) +From: "scott.marlowe" +To: Matt Mello +Cc: +Subject: Re: Faster 'select count(*) from table' ? +In-Reply-To: <3E5BF1BD.9070301@spaceship.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 +X-Archive-Number: 200302/203 +X-Sequence-Number: 1259 + +On Tue, 25 Feb 2003, Matt Mello wrote: + +> Does anyone know if there is a fast way to find out how many records are +> in a table? +> +> "Select count(*) from table" is very slow. +> +> I would think that PG would keep up with the number of undeleted rows on +> a realtime basis. Is that the case? If so, how would I query it? + +Sorry, it doesn't, and it's one of the areas that having an MVCC style +database costs you. Also, if postgresql kept up with this automatically, +it would have an overhead for each table, but how often do you use it on +ALL your tables? Most the time, folks use count(*) on a few tables only, +and it would be a waste to have a seperate counting mechanism for all +tables when you'd only need it for a few. + +The general mailing list has several postings in the last 12 months about +how to setup a trigger to a single row table that keeps the current +count(*) of the master table. + +If you need a rough count, you can get one from the statistics gathered by +analyze in the pg_* tables. + + +From pgsql-performance-owner@postgresql.org Tue Feb 25 23:57:44 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 403E7474E4F + for ; + Tue, 25 Feb 2003 23:57:42 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 69186-06 for ; + Tue, 25 Feb 2003 23:57:31 -0500 (EST) +Received: from mailserver.virtusa.com (mail.erunway.com [12.40.51.200]) + by postgresql.org (Postfix) with ESMTP id 84F11474E42 + for ; + Tue, 25 Feb 2003 23:57:31 -0500 (EST) +Received: from enetslmaili.eRUNWAY (enetslmaili [10.2.1.10]) by + mailserver.virtusa.com with SMTP (Microsoft Exchange Internet + Mail Service Version 5.5.2653.13) + id FJKJ7V4R; Tue, 25 Feb 2003 23:58:12 -0500 +Received: from anuradha (ARATNAWEERA [10.2.2.86]) by enetslmaili.eRUNWAY with + SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) + id FSA0YDG6; Wed, 26 Feb 2003 10:47:17 +0600 +Received: from anuradha by anuradha with local (Exim 3.35 #1 (Debian)) + id 18ntdM-0003MG-00; Wed, 26 Feb 2003 10:57:32 +0600 +Date: Wed, 26 Feb 2003 10:57:28 +0600 +From: Anuradha Ratnaweera +To: Stephan Szabo +Cc: pgsql-performance@postgresql.org +Subject: Re: Superfluous merge/sort +Message-ID: <20030226045728.GA12881@aratnaweera.virtusa.com> +References: <20030225041143.GA4886@aratnaweera.virtusa.com> + <20030225075139.V57635-100000@megazone23.bigpanda.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20030225075139.V57635-100000@megazone23.bigpanda.com> +User-Agent: Mutt/1.3.28i +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/204 +X-Sequence-Number: 1260 + +On Tue, Feb 25, 2003 at 07:56:14AM -0800, Stephan Szabo wrote: +> +> On Tue, 25 Feb 2003, Anuradha Ratnaweera wrote: +> +> > Question in brief: does the planner/optimizer take into account the +> > foreign key constraints? +> > +> > If the answer is "no", please stop reading here. +> +> Not really. However, as a note, from t1,t2 where t1.id=t2.id is not +> necessarily an identity even with the foreign key due to NULLs. + +"not null" doesn't make a difference, either :-( + + Anuradha + +-- + +Debian GNU/Linux (kernel 2.4.21-pre4) + +It's not Camelot, but it's not Cleveland, either. + -- Kevin White, Mayor of Boston + + +From pgsql-performance-owner@postgresql.org Wed Feb 26 00:40:04 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 61F83474E4F + for ; + Wed, 26 Feb 2003 00:40:02 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 72481-08 for ; + Wed, 26 Feb 2003 00:39:51 -0500 (EST) +Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) + by postgresql.org (Postfix) with ESMTP id 870AA474E42 + for ; + Wed, 26 Feb 2003 00:39:51 -0500 (EST) +Received: by megazone.bigpanda.com (Postfix, from userid 1001) + id DF530D5F7; Tue, 25 Feb 2003 21:39:56 -0800 (PST) +Received: from localhost (localhost [127.0.0.1]) + by megazone.bigpanda.com (Postfix) with ESMTP + id D11005C02; Tue, 25 Feb 2003 21:39:56 -0800 (PST) +Date: Tue, 25 Feb 2003 21:39:56 -0800 (PST) +From: Stephan Szabo +To: Anuradha Ratnaweera +Cc: +Subject: Re: Superfluous merge/sort +In-Reply-To: <20030226045728.GA12881@aratnaweera.virtusa.com> +Message-ID: <20030225212713.P66663-100000@megazone23.bigpanda.com> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/205 +X-Sequence-Number: 1261 + + +On Wed, 26 Feb 2003, Anuradha Ratnaweera wrote: + +> On Tue, Feb 25, 2003 at 07:56:14AM -0800, Stephan Szabo wrote: +> > +> > On Tue, 25 Feb 2003, Anuradha Ratnaweera wrote: +> > +> > > Question in brief: does the planner/optimizer take into account the +> > > foreign key constraints? +> > > +> > > If the answer is "no", please stop reading here. +> > +> > Not really. However, as a note, from t1,t2 where t1.id=t2.id is not +> > necessarily an identity even with the foreign key due to NULLs. +> +> "not null" doesn't make a difference, either :-( + +No, but the two queries you gave aren't equivalent without a not null +constraint and as such treating the second as the first is simply wrong +without it. ;) + +The big thing is that checking this would be a cost to all queries (or at +least any queries with joins). You'd probably have to come up with a +consistent set of rules on when the optimization applies (*) and then show +that there's a reasonable way to check for the case that's significantly +not expensive (right now I think it'd involve looking at the constraint +table, making sure that all columns of the constraint are referenced and +only in simple ways). + +(*) - I haven't done enough checking to say that the following is + sufficient, but it'll give an idea: + Given t1 and t2 where t2 is the foreign key table and t1 is the + primary key table in a foreign key constraint, a select that has no + column references to t1 other than to the key fields of the foreign key + directly in the where clause where the condition is simply + t1.pcol = t2.fcol (or reversed) and all key fields of the constraint + are so referenced then there exist two possible optimizations + if all of the foreign key constraint columns in t2 are marked as + not null, the join to t1 is redundant and it and the conditions + that reference it can be simply removed + otherwise, the join to t1 and the conditions that reference may be + replaced with a set of conditions (t2.fcol1 is not null [and t2.fcol2 + is not null ...]) anded to any other where clause elements + + +From pgsql-performance-owner@postgresql.org Wed Feb 26 01:27:55 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 08CB8474E4F + for ; + Wed, 26 Feb 2003 01:27:53 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 76138-09 for ; + Wed, 26 Feb 2003 01:27:40 -0500 (EST) +Received: from goatelecom.com (unknown [61.1.72.28]) + by postgresql.org (Postfix) with ESMTP id 09647474E42 + for ; + Wed, 26 Feb 2003 01:27:39 -0500 (EST) +Received: from email.philnet (dialup-73-91.goatelecom.com [61.1.73.91]) + by goatelecom.com (8.11.0/8.11.0) with ESMTP id h1Q6fw323650 + for ; + Wed, 26 Feb 2003 12:12:00 +0530 (IST) +Received: from minxserver.philnet (minxserver.philnet [172.16.1.250]) + by email.philnet (8.11.6/8.11.2) with ESMTP id h1Q6R4Q32449 + for ; Wed, 26 Feb 2003 11:57:04 +0530 +Received: from localhost (pragati@localhost) + by minxserver.philnet (8.11.6/8.11.6) with ESMTP id h1Q6QmX22441 + for ; Wed, 26 Feb 2003 11:56:51 +0530 +Date: Wed, 26 Feb 2003 11:56:48 +0530 (IST) +From: PRAGATI SAVAIKAR +To: +Subject: Index File growing big. +Message-ID: +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/206 +X-Sequence-Number: 1262 + + + +Hi !! + + We have "PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.96" +installed on Linux (RedHat 7.2) +Our database size is 15 GB. +Since the database size was increasing and was about to cross the actual +Hard Disk parttion Size, we moved the datafiles (also the index files) to +another partition and created link to them from the data directory. +This was working fine. +But what we found was , the index files(2 files) were not getting updated +in the new partition, instead postgres had created another index file with +name +"tableID".1 in the original data directory. The size of this file was +356MB, +The actual size of the data table is 1GB. and there were 2 indexes for the +table. which were of size approximately=150MB. + +But after we created link, those 2 index files were not getting updated, +instead the new file with ".1" extension got created in the data directory +(old parttion) and the same is getting updated everyday. + +We dropped the table but the file with ".1" extension was not getting +removed from data directory. We manually had to remove it. + +Can U please suggest some way to avoid the file getting created when we +move the data file (along with the index files) to another partition. + + +Thanks in Advance. + + + +Regards, +Pragati. + + + + + +From pgsql-performance-owner@postgresql.org Wed Feb 26 02:32:44 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0C90B474E4F + for ; + Wed, 26 Feb 2003 02:29:30 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 92308-03 for ; + Wed, 26 Feb 2003 02:29:19 -0500 (EST) +Received: from rtlocal.trade-india.com (mail-relay.trade-india.com + [203.196.129.235]) + by postgresql.org (Postfix) with SMTP id 54BE5474E42 + for ; + Wed, 26 Feb 2003 02:29:14 -0500 (EST) +Received: (qmail 8379 invoked from network); 26 Feb 2003 07:27:38 -0000 +Received: from unknown (HELO system67.trade-india-local.com) (192.168.0.67) + by infocom-236-129-del.trade-india.com with SMTP; + 26 Feb 2003 07:27:38 -0000 +From: Rajesh Kumar Mallah +Organization: Infocom Network Limited +To: PRAGATI SAVAIKAR , + +Subject: Re: Index File growing big. +Date: Wed, 26 Feb 2003 12:59:23 +0530 +User-Agent: KMail/1.5 +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: <200302261259.23604.mallah@trade-india.com> +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/207 +X-Sequence-Number: 1263 + + +I remember this is your second posting for the same problem. + +I hope you are aware that postgres can manage multiple databases that +lie in different partitions. + +If its feasible for you you may think of moving the *big* tables in another +database which can be initialised in another partition. it depends on ur app +design as you will have to create a new db connection. + +another possibility is to buy a new bigger hdd ofcourse ;-) +and migrate the data. + +also i think the .1 or .2 are extensions of the +datafile not index files. index files have seperate id of their own. +pg_class have that id in relfilenode. + + +in case i am getting the problem wrong , my query is have you relocated the +index files also and created the symlinks ? (using ln -s) + +Also 7.2.1 is too old an version to use in 7.2.x series 7.2.4 is latest +and in 7.3.x 7.3.2 is latest. + +regds +mallah. + + + +On Wednesday 26 February 2003 11:56 am, PRAGATI SAVAIKAR wrote: +> Hi !! +> +> We have "PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.96" +> installed on Linux (RedHat 7.2) +> Our database size is 15 GB. +> Since the database size was increasing and was about to cross the actual +> Hard Disk parttion Size, we moved the datafiles (also the index files) to +> another partition and created link to them from the data directory. +> This was working fine. +> But what we found was , the index files(2 files) were not getting updated +> in the new partition, instead postgres had created another index file with +> name +> "tableID".1 in the original data directory. The size of this file was +> 356MB, +> The actual size of the data table is 1GB. and there were 2 indexes for the +> table. which were of size approximately=150MB. +> +> But after we created link, those 2 index files were not getting updated, +> instead the new file with ".1" extension got created in the data directory +> (old parttion) and the same is getting updated everyday. +> +> We dropped the table but the file with ".1" extension was not getting +> removed from data directory. We manually had to remove it. +> +> Can U please suggest some way to avoid the file getting created when we +> move the data file (along with the index files) to another partition. +> +> +> Thanks in Advance. +> +> +> +> Regards, +> Pragati. +> +> +> +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 4: Don't 'kill -9' the postmaster + +-- + +Regds +Mallah + +---------------------------------------- +Rajesh Kumar Mallah, +Project Manager (Development) +Infocom Network Limited, New Delhi +phone: +91(11)6152172 (221) (L) ,9811255597 (M) + +Visit http://www.trade-india.com , +India's Leading B2B eMarketplace. + +From pgsql-performance-owner@postgresql.org Wed Feb 26 07:09:37 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 5F580474E42 + for ; + Wed, 26 Feb 2003 07:00:48 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 52668-02 for ; + Wed, 26 Feb 2003 07:00:37 -0500 (EST) +Received: from mail.libertyrms.com (unknown [209.167.124.227]) + by postgresql.org (Postfix) with ESMTP id 79AE14758DC + for ; + Wed, 26 Feb 2003 07:00:37 -0500 (EST) +Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 + (Debian)) + id 18o0Eq-0002UV-00 + for ; Wed, 26 Feb 2003 07:00:40 -0500 +Date: Wed, 26 Feb 2003 07:00:40 -0500 +From: Andrew Sullivan +To: pgsql-performance@postgresql.org +Subject: Re: Index File growing big. +Message-ID: <20030226070040.C8814@mail.libertyrms.com> +Mail-Followup-To: Andrew Sullivan , + pgsql-performance@postgresql.org +References: +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.2.5i +In-Reply-To: ; + from pragati@phildigital.com on Wed, Feb 26, 2003 at 11:56:48AM + +0530 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/208 +X-Sequence-Number: 1264 + +On Wed, Feb 26, 2003 at 11:56:48AM +0530, PRAGATI SAVAIKAR wrote: +> +> Can U please suggest some way to avoid the file getting created when we +> move the data file (along with the index files) to another partition. + +Yes. Submit a patch which implements tablespaces ;-) + +Seriously, there is no way to avoid this in the case where you are +moving the files by hand. The suggestions for how to move files +around note this. + +If this is merely a disk-size problem, why not move the entire +postgres installation to another disk, and make a link to it. If you +still need to spread things across disks, you can move things which +don't change in size very much. A good candidate here is the WAL +(pg_xlog), since it grows to a predictable size. You even get a +performance benefit. + +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 Feb 26 08:04:50 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id C5663474E5C + for ; + Wed, 26 Feb 2003 08:04:48 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 46130-09 for ; + Wed, 26 Feb 2003 08:04:38 -0500 (EST) +Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) + by postgresql.org (Postfix) with SMTP id 09926474E42 + for ; + Wed, 26 Feb 2003 08:04:37 -0500 (EST) +Received: (qmail 25502 invoked by uid 0); 26 Feb 2003 13:04:39 -0000 +Date: Wed, 26 Feb 2003 14:04:39 +0100 (MET) +From: daniel alvarez +To: pgsql-performance@postgresql.org +MIME-Version: 1.0 +Subject: +X-Priority: 3 (Normal) +X-Authenticated-Sender: #0002681999@gmx.net +X-Authenticated-IP: [217.6.136.218] +Message-ID: <1859.1046264679@www36.gmx.net> +X-Mailer: WWW-Mail 1.6 (Global Message Exchange) +X-Flags: 0001 +Content-Type: text/plain; charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/209 +X-Sequence-Number: 1265 + + +In some older mails in the archive I found rumors about difficulcies that +might +occur when OIDs are used as an integral part of a data model. + +I am considering the option of placing an index on the already existing oid +and using +it as the primary key for all tables (saves some space and a sequence +lookup). This +includes saving the oid in foreign keys (virtual ones, not actually declared +references). +I read that using OID in keys is generally a bad idea. Is it really? Why +exactly? + +Are there any disadvantages as to reliability or performance apart from +accidentally +forgetting to use the -o option with pg_dump? If so, please give details. + +I felt especially worried by a postgres developer's statement in another +archived mail: +"As far as I know, there is no reason oid's have to be unique, especially if +they are in different tables." +(http://archives.postgresql.org/pgsql-hackers/1998-12/msg00570.php) + +How unique are oids as of version 7.3 of postgres ? + +Is it planned to keep oids semantically the same in future releases of +postgres? +Will the oid type be extended so that oids can be larger than 4 bytes (if +this is still +correct for 7.3) and do not rotate in large systems? + + +Thanks for your time and advice. + +Daniel Alvarez +=20 +=20 + +--=20 ++++ GMX - Mail, Messaging & more http://www.gmx.net +++ +Bitte l=E4cheln! Fotogalerie online mit GMX ohne eigene Homepage! + + +From pgsql-performance-owner@postgresql.org Wed Feb 26 09:02:00 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id D3E864758F1 + for ; + Wed, 26 Feb 2003 09:01:53 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 59748-01 for ; + Wed, 26 Feb 2003 09:01:43 -0500 (EST) +Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net + [194.217.242.89]) + by postgresql.org (Postfix) with ESMTP id 37D854758BD + for ; + Wed, 26 Feb 2003 08:58:53 -0500 (EST) +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 18o25I-000I2p-0V; Wed, 26 Feb 2003 13:58:56 +0000 +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mainbox.archonet.com (Postfix) with ESMTP + id 73AFE17065; Wed, 26 Feb 2003 13:58:55 +0000 (GMT) +Received: from client.archonet.com (client.archonet.com [192.168.1.16]) + by mainbox.archonet.com (Postfix) with ESMTP + id B7A84162FA; Wed, 26 Feb 2003 13:58:54 +0000 (GMT) +Content-Type: text/plain; + charset="iso-8859-1" +From: Richard Huxton +Organization: Archonet Ltd +To: daniel alvarez , + pgsql-performance@postgresql.org +Subject: Re: OIDs as keys +Date: Wed, 26 Feb 2003 13:58:53 +0000 +User-Agent: KMail/1.4.3 +References: <1859.1046264679@www36.gmx.net> +In-Reply-To: <1859.1046264679@www36.gmx.net> +MIME-Version: 1.0 +Content-Transfer-Encoding: quoted-printable +Message-Id: <200302261358.53730.dev@archonet.com> +X-Virus-Scanned: by AMaViS snapshot-20020531 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/210 +X-Sequence-Number: 1266 + +On Wednesday 26 Feb 2003 1:04 pm, daniel alvarez wrote: +> In some older mails in the archive I found rumors about difficulcies that +> might +> occur when OIDs are used as an integral part of a data model. +> +> I am considering the option of placing an index on the already existing o= +id +> and using +> it as the primary key for all tables (saves some space and a sequence +> lookup). This +> includes saving the oid in foreign keys (virtual ones, not actually +> declared references). +> I read that using OID in keys is generally a bad idea. Is it really? Why +> exactly? + +OIDs are not even guaranteed to be there any more - you can create a table= +=20 +WITHOUT OIDs if you want to save some space. If you want a numeric primary= +=20 +key, I'd recommend int4/int8 attached to a sequence - it's much clearer=20 +what's going on then. + +> Are there any disadvantages as to reliability or performance apart from +> accidentally +> forgetting to use the -o option with pg_dump? If so, please give details. +> +> I felt especially worried by a postgres developer's statement in another +> archived mail: +> "As far as I know, there is no reason oid's have to be unique, especially +> if they are in different tables." +> (http://archives.postgresql.org/pgsql-hackers/1998-12/msg00570.php) +> +> How unique are oids as of version 7.3 of postgres ? + +OIDs are unique per object (table) I believe, no more so. See chapter 5.10 = +of=20 +the user guide for details. They are used to identify system objects and so= +=20 +the fact that a function and a table could both have the same OID should=20 +cause no problems. + +> Is it planned to keep oids semantically the same in future releases of +> postgres? + +Couldn't say - don't see why not. + +> Will the oid type be extended so that oids can be larger than 4 bytes (if +> this is still +> correct for 7.3) and do not rotate in large systems? + +Strikes me as unlikely, though I'm not a developer. Look into 8-byte=20 +serial/sequences. + +--=20 + Richard Huxton + +From pgsql-performance-owner@postgresql.org Wed Feb 26 09:59:47 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id C1F1547580B + for ; + Wed, 26 Feb 2003 09:59:43 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 70684-08 for ; + Wed, 26 Feb 2003 09:59:33 -0500 (EST) +Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) + by postgresql.org (Postfix) with SMTP id 77795474E5C + for ; + Wed, 26 Feb 2003 09:59:32 -0500 (EST) +Received: (qmail 18882 invoked by uid 0); 26 Feb 2003 14:59:36 -0000 +Date: Wed, 26 Feb 2003 15:59:35 +0100 (MET) +From: daniel alvarez +To: Richard Huxton +Cc: pgsql-performance@postgresql.org +MIME-Version: 1.0 +References: <200302261358.53730.dev@archonet.com> +Subject: Re: OIDs as keys +X-Priority: 3 (Normal) +X-Authenticated-Sender: #0002681999@gmx.net +X-Authenticated-IP: [217.6.136.218] +Message-ID: <24135.1046271575@www36.gmx.net> +X-Mailer: WWW-Mail 1.6 (Global Message Exchange) +X-Flags: 0001 +Content-Type: text/plain; charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/211 +X-Sequence-Number: 1267 + + +> > I am considering the option of placing an index on the already existing +oid +> > and using it as the primary key for all tables (saves some space and a +sequence +> > lookup). This includes saving the oid in foreign keys (virtual ones, not +actually +> > declared references). I read that using OID in keys is generally a bad +idea. +> > Is it really? Why exactly? + +> OIDs are not even guaranteed to be there any more - you can create a table +> WITHOUT OIDs if you want to save some space. If you want a numeric primary +> key, I'd recommend int4/int8 attached to a sequence - it's much clearer +what's +> going on then. + +Of course this is a cleaner solution. I did not know that oids can be +supressed and +was looking for a way to make space usage more efficient. Trying to get rid +of user- +defined surrogate primary keys and substitute them by the already existing +OID is +obviously the wrong approch, as postgres already defines a cleaner option. + +There can also be some problems when using replication, because one needs to +make +sure that OIDs are the same on all machines in the cluster. + +Why should user-defined tables have OIDs by default? Other DBMS use ROWIDs +as the physical storage location used for pointers in index leafs, but this +is equivalent +to Postgres TIDs. To the user an OID column is not different than any other +column +he can define himself. I'd find it more natural if the column wasn't there +at all. + +Daniel Alvarez + +--=20 ++++ GMX - Mail, Messaging & more http://www.gmx.net +++ +Bitte l=E4cheln! Fotogalerie online mit GMX ohne eigene Homepage! + + +From pgsql-performance-owner@postgresql.org Wed Feb 26 11:01:19 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B80934758F1 + for ; + Wed, 26 Feb 2003 11:00:39 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 80531-04 for ; + Wed, 26 Feb 2003 11:00:27 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id BEF24475BF9 + for ; + Wed, 26 Feb 2003 10:56:08 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1QFu45u029872; + Wed, 26 Feb 2003 10:56:04 -0500 (EST) +To: daniel alvarez +Cc: Richard Huxton , + pgsql-performance@postgresql.org +Subject: Re: OIDs as keys +In-reply-to: <24135.1046271575@www36.gmx.net> +References: <200302261358.53730.dev@archonet.com> + <24135.1046271575@www36.gmx.net> +Comments: In-reply-to daniel alvarez + message dated "Wed, 26 Feb 2003 15:59:35 +0100" +Date: Wed, 26 Feb 2003 10:56:04 -0500 +Message-ID: <29871.1046274964@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/212 +X-Sequence-Number: 1268 + +daniel alvarez writes: +> Why should user-defined tables have OIDs by default? + +At this point it's just for historical reasons. There actually is a +proposal on the table to flip the default to WITHOUT OIDS, but so far +it's not been accepted because of worries about compatibility. See +the pghackers archives a few weeks back. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Wed Feb 26 11:10:11 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E9834475AF8 + for ; + Wed, 26 Feb 2003 11:09:47 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 82222-01 for ; + Wed, 26 Feb 2003 11:09:37 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 6B4DB475AFA + for ; + Wed, 26 Feb 2003 11:02:31 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1QG2V5u029928; + Wed, 26 Feb 2003 11:02:31 -0500 (EST) +To: Richard Huxton +Cc: daniel alvarez , + pgsql-performance@postgresql.org +Subject: Re: OIDs as keys +In-reply-to: <200302261358.53730.dev@archonet.com> +References: <1859.1046264679@www36.gmx.net> + <200302261358.53730.dev@archonet.com> +Comments: In-reply-to Richard Huxton + message dated "Wed, 26 Feb 2003 13:58:53 +0000" +Date: Wed, 26 Feb 2003 11:02:30 -0500 +Message-ID: <29927.1046275350@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/213 +X-Sequence-Number: 1269 + +Richard Huxton writes: +>> How unique are oids as of version 7.3 of postgres ? + +> OIDs are unique per object (table) I believe, no more so. + +Even then, you should only assume uniqueness if you put a unique index +on the table's OID column to enforce it. (The system catalogs that use +OID all have such indexes.) Without that, you might have duplicates +after the OID counter wraps around. + +>> Will the oid type be extended so that oids can be larger than 4 bytes (if +>> this is still correct for 7.3) and do not rotate in large systems? + +> Strikes me as unlikely, though I'm not a developer. + +I tend to agree. At one point that was a live possibility, but now +we're more likely to change the default for user tables to WITHOUT OIDS +and declare the problem solved. Making OIDs 8 bytes looks like too much +of a performance hit for non-64-bit machines. (Not to mention machines +that haven't got "long long" at all; right now the only thing that +doesn't work for them is type int8, and I'd like it to stay that way, +at least for a few more years.) + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Wed Feb 26 11:14:28 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 73D99474E42 + for ; + Wed, 26 Feb 2003 11:14:26 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 82222-10 for ; + Wed, 26 Feb 2003 11:14:15 -0500 (EST) +Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net + [194.217.242.90]) + by postgresql.org (Postfix) with ESMTP id 427A9475B33 + for ; + Wed, 26 Feb 2003 11:10:11 -0500 (EST) +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 18o48N-000HfL-0W; Wed, 26 Feb 2003 16:10:15 +0000 +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mainbox.archonet.com (Postfix) with ESMTP + id 8E5D6171C9; Wed, 26 Feb 2003 16:10:14 +0000 (GMT) +Received: from client.archonet.com (client.archonet.com [192.168.1.16]) + by mainbox.archonet.com (Postfix) with ESMTP + id E3D16171C8; Wed, 26 Feb 2003 16:10:13 +0000 (GMT) +Content-Type: text/plain; + charset="iso-8859-1" +From: Richard Huxton +Organization: Archonet Ltd +To: daniel alvarez +Subject: Re: OIDs as keys +Date: Wed, 26 Feb 2003 16:10:13 +0000 +User-Agent: KMail/1.4.3 +Cc: pgsql-performance@postgresql.org +References: <200302261358.53730.dev@archonet.com> + <24135.1046271575@www36.gmx.net> +In-Reply-To: <24135.1046271575@www36.gmx.net> +MIME-Version: 1.0 +Content-Transfer-Encoding: quoted-printable +Message-Id: <200302261610.13115.dev@archonet.com> +X-Virus-Scanned: by AMaViS snapshot-20020531 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/214 +X-Sequence-Number: 1270 + +On Wednesday 26 Feb 2003 2:59 pm, daniel alvarez wrote: +> +> Why should user-defined tables have OIDs by default? Other DBMS use ROWIDs +> as the physical storage location used for pointers in index leafs, but th= +is +> is equivalent +> to Postgres TIDs. To the user an OID column is not different than any oth= +er +> column +> he can define himself. I'd find it more natural if the column wasn't there +> at all. + +I believe the plan is to phase them out, but some people are using them, so= +=20 +the default is still to create them. Imagine if you were using OIDs as keys= +=20 +and after a dump/restore they were all gone... +--=20 + Richard Huxton + +From pgsql-performance-owner@postgresql.org Wed Feb 26 12:24:15 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 4F9B0475B99 + for ; + Wed, 26 Feb 2003 12:24:09 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 94107-06 for ; + Wed, 26 Feb 2003 12:23:55 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 84021475A8D + for ; + Wed, 26 Feb 2003 12:18:27 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2870538; Wed, 26 Feb 2003 09:18:15 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: daniel alvarez , + Richard Huxton +Subject: Re: OIDs as keys +Date: Wed, 26 Feb 2003 09:17:24 -0800 +User-Agent: KMail/1.4.3 +Cc: pgsql-performance@postgresql.org +References: <200302261358.53730.dev@archonet.com> + <24135.1046271575@www36.gmx.net> +In-Reply-To: <24135.1046271575@www36.gmx.net> +MIME-Version: 1.0 +Message-Id: <200302260917.24500.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/215 +X-Sequence-Number: 1271 + +Daniel, + +> There can also be some problems when using replication, because one needs +> to make +> sure that OIDs are the same on all machines in the cluster. + +See the "uniqueidentifier" contrib package if you need a universally unique= + id=20 +for replication. + +> I'd find it more natural if the column wasn't there +> at all. + +Probably by Postgres 8.0, it won't be. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Wed Feb 26 20:19:12 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 1242C4758E6 + for ; + Wed, 26 Feb 2003 20:18:59 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 74573-09 for ; + Wed, 26 Feb 2003 20:18:48 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 9EDCE4758BD + for ; + Wed, 26 Feb 2003 20:18:46 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1R1Ink40529 + for pgsql-performance@postgresql.org; + Thu, 27 Feb 2003 09:18:49 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1R1Ik740439; + Thu, 27 Feb 2003 09:18:47 +0800 (WST) +Message-ID: <027001c2ddfe$49274fe0$6500a8c0@fhp.internal> +From: "Christopher Kings-Lynne" +To: "Andrew Sullivan" , + +References: + <20030226070040.C8814@mail.libertyrms.com> +Subject: Re: Index File growing big. +Date: Thu, 27 Feb 2003 09:19:32 +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.2720.3000 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/216 +X-Sequence-Number: 1272 + +> > Can U please suggest some way to avoid the file getting created when we +> > move the data file (along with the index files) to another partition. +> +> Yes. Submit a patch which implements tablespaces ;-) + +You should note that someone already has sent in a patch for tablespaces, it +hasn't been acted on though - can't quite remember why. Maybe we should +resurrect it... + +Chris + + + +From pgsql-performance-owner@postgresql.org Wed Feb 26 22:59:59 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 8CCED474E4F + for ; + Wed, 26 Feb 2003 22:59:57 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 98269-02 for ; + Wed, 26 Feb 2003 22:59:47 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 9EC19474E42 + for ; + Wed, 26 Feb 2003 22:59:45 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1R3xnL46241 + for pgsql-performance@postgresql.org; + Thu, 27 Feb 2003 11:59:49 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1R3xi746036; + Thu, 27 Feb 2003 11:59:44 +0800 (WST) +Message-ID: <032301c2de14$c64ccf70$6500a8c0@fhp.internal> +From: "Christopher Kings-Lynne" +To: "daniel alvarez" , + "Tom Lane" +Cc: "Richard Huxton" , + +References: <200302261358.53730.dev@archonet.com> + <24135.1046271575@www36.gmx.net> <29871.1046274964@sss.pgh.pa.us> +Subject: Re: OIDs as keys +Date: Thu, 27 Feb 2003 12:00:31 +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.2720.3000 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/217 +X-Sequence-Number: 1273 + + +> daniel alvarez writes: +> > Why should user-defined tables have OIDs by default? +> +> At this point it's just for historical reasons. There actually is a +> proposal on the table to flip the default to WITHOUT OIDS, but so far +> it's not been accepted because of worries about compatibility. See +> the pghackers archives a few weeks back. + +Shall I include a patch to pg_dump that will explicitly set WITH OIDS when I +submit this SET STORAGE dumping patch? + +Chris + + + +From pgsql-performance-owner@postgresql.org Thu Feb 27 01:47:04 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 7A5FD474E4F + for ; + Thu, 27 Feb 2003 01:35:54 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 18595-04 for ; + Thu, 27 Feb 2003 01:35:44 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id B038C474E42 + for ; + Thu, 27 Feb 2003 01:35:43 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1R6ZJ5u008928; + Thu, 27 Feb 2003 01:35:39 -0500 (EST) +To: "Christopher Kings-Lynne" +Cc: "daniel alvarez" , + "Richard Huxton" , pgsql-performance@postgresql.org +Subject: Re: OIDs as keys +In-reply-to: <032301c2de14$c64ccf70$6500a8c0@fhp.internal> +References: <200302261358.53730.dev@archonet.com> + <24135.1046271575@www36.gmx.net> <29871.1046274964@sss.pgh.pa.us> + <032301c2de14$c64ccf70$6500a8c0@fhp.internal> +Comments: In-reply-to "Christopher Kings-Lynne" + message dated "Thu, 27 Feb 2003 12:00:31 +0800" +Date: Thu, 27 Feb 2003 01:35:18 -0500 +Message-ID: <8927.1046327718@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/218 +X-Sequence-Number: 1274 + +"Christopher Kings-Lynne" writes: +> Shall I include a patch to pg_dump that will explicitly set WITH OIDS when I +> submit this SET STORAGE dumping patch? + +Not if you want it to be accepted ;-) + +We pretty much agreed we did not want that in the prior thread. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Feb 27 01:57:21 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E267A474E4F + for ; + Thu, 27 Feb 2003 01:57:04 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 23618-03 for ; + Thu, 27 Feb 2003 01:56:54 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 245F6474E42 + for ; + Thu, 27 Feb 2003 01:56:54 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1R6un5u009043; + Thu, 27 Feb 2003 01:56:49 -0500 (EST) +To: "Christopher Kings-Lynne" +Cc: "Andrew Sullivan" , + pgsql-performance@postgresql.org +Subject: Re: Index File growing big. +In-reply-to: <027001c2ddfe$49274fe0$6500a8c0@fhp.internal> +References: + <20030226070040.C8814@mail.libertyrms.com> + <027001c2ddfe$49274fe0$6500a8c0@fhp.internal> +Comments: In-reply-to "Christopher Kings-Lynne" + message dated "Thu, 27 Feb 2003 09:19:32 +0800" +Date: Thu, 27 Feb 2003 01:56:49 -0500 +Message-ID: <9042.1046329009@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/219 +X-Sequence-Number: 1275 + +"Christopher Kings-Lynne" writes: +>> Yes. Submit a patch which implements tablespaces ;-) + +> You should note that someone already has sent in a patch for tablespaces, it +> hasn't been acted on though - can't quite remember why. Maybe we should +> resurrect it... + +It's been awhile, but my recollection is that the patch had restricted +functionality (which would be okay for a first cut) and it invented SQL +syntax that seemed to lock us into that restricted functionality +permanently (not so okay). Details are fuzzy though... + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Feb 27 01:59:36 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0EB61474E53 + for ; + Thu, 27 Feb 2003 01:59:34 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 23724-06 for ; + Thu, 27 Feb 2003 01:59:23 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 1B185474E4F + for ; + Thu, 27 Feb 2003 01:59:22 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1R6xLt50542 + for pgsql-performance@postgresql.org; + Thu, 27 Feb 2003 14:59:21 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1R6xG750361; + Thu, 27 Feb 2003 14:59:16 +0800 (WST) +Message-ID: <040a01c2de2d$dac03780$6500a8c0@fhp.internal> +From: "Christopher Kings-Lynne" +To: "Tom Lane" +Cc: "daniel alvarez" , "Richard Huxton" , + +References: <200302261358.53730.dev@archonet.com> + <24135.1046271575@www36.gmx.net> <29871.1046274964@sss.pgh.pa.us> + <032301c2de14$c64ccf70$6500a8c0@fhp.internal> + <8927.1046327718@sss.pgh.pa.us> +Subject: Re: OIDs as keys +Date: Thu, 27 Feb 2003 15:00: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.2720.3000 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/220 +X-Sequence-Number: 1276 + +> "Christopher Kings-Lynne" writes: +> > Shall I include a patch to pg_dump that will explicitly set WITH OIDS +when I +> > submit this SET STORAGE dumping patch? +> +> Not if you want it to be accepted ;-) +> +> We pretty much agreed we did not want that in the prior thread. + +The patch I submitted did not include OID stuff, I decided that it's better +to submit orthogonal patches :) + +Chris + + + +From pgsql-performance-owner@postgresql.org Thu Feb 27 02:09:07 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 734FF474E4F + for ; + Thu, 27 Feb 2003 02:06:26 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 23729-08 for ; + Thu, 27 Feb 2003 02:06:15 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id A075A474E42 + for ; + Thu, 27 Feb 2003 02:06:15 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1R7685u009114; + Thu, 27 Feb 2003 02:06:08 -0500 (EST) +To: "Christopher Kings-Lynne" +Cc: "daniel alvarez" , + "Richard Huxton" , pgsql-performance@postgresql.org +Subject: Re: OIDs as keys +In-reply-to: <040a01c2de2d$dac03780$6500a8c0@fhp.internal> +References: <200302261358.53730.dev@archonet.com> + <24135.1046271575@www36.gmx.net> <29871.1046274964@sss.pgh.pa.us> + <032301c2de14$c64ccf70$6500a8c0@fhp.internal> + <8927.1046327718@sss.pgh.pa.us> + <040a01c2de2d$dac03780$6500a8c0@fhp.internal> +Comments: In-reply-to "Christopher Kings-Lynne" + message dated "Thu, 27 Feb 2003 15:00:04 +0800" +Date: Thu, 27 Feb 2003 02:06:08 -0500 +Message-ID: <9113.1046329568@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/221 +X-Sequence-Number: 1277 + +"Christopher Kings-Lynne" writes: +> The patch I submitted did not include OID stuff, I decided that it's better +> to submit orthogonal patches :) + +Right. But the problem with switching the OID default is not a matter +of code --- it's of working out what the compatibility issues are. +As I recall, one thing people did not want was for pg_dump to plaster +WITH OIDS or WITHOUT OIDS on every single CREATE TABLE, as this would +pretty much destroy any shot at loading PG dumps into any other +database. What we need is an agreement on the behavior we want (making +the best possible compromise between this and other compatibility +desires). After that, the actual patch is probably trivial, while in +advance of some consensus on the behavior, offering a patch is a waste +of time. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Fri Feb 28 19:35:51 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 72A41474E4F + for ; + Thu, 27 Feb 2003 02:19:05 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 28457-07 for ; + Thu, 27 Feb 2003 02:18:54 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 5FB64474E42 + for ; + Thu, 27 Feb 2003 02:18:53 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1R7Iq851412 + for pgsql-performance@postgresql.org; + Thu, 27 Feb 2003 15:18:52 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1R7Ik751189; + Thu, 27 Feb 2003 15:18:46 +0800 (WST) +Message-ID: <044801c2de30$93d71ca0$6500a8c0@fhp.internal> +From: "Christopher Kings-Lynne" +To: "Tom Lane" +Cc: "daniel alvarez" , "Richard Huxton" , + +References: <200302261358.53730.dev@archonet.com> + <24135.1046271575@www36.gmx.net> <29871.1046274964@sss.pgh.pa.us> + <032301c2de14$c64ccf70$6500a8c0@fhp.internal> + <8927.1046327718@sss.pgh.pa.us> + <040a01c2de2d$dac03780$6500a8c0@fhp.internal> + <9113.1046329568@sss.pgh.pa.us> +Subject: Re: OIDs as keys +Date: Thu, 27 Feb 2003 15:19:33 +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.2720.3000 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/241 +X-Sequence-Number: 1297 + +> Right. But the problem with switching the OID default is not a matter +> of code --- it's of working out what the compatibility issues are. +> As I recall, one thing people did not want was for pg_dump to plaster +> WITH OIDS or WITHOUT OIDS on every single CREATE TABLE, as this would +> pretty much destroy any shot at loading PG dumps into any other +> database. + +Ummm...what about SERIAL columns, ALTER TABLE / SET STATS, SET STORAGE, +custom types, 'btree' in CREATE INDEX, SET SEARCH_PATH, '::" cast operator, +stored procedures, rules, etc. - how is adding WITH OIDS going to change +that?! + +> What we need is an agreement on the behavior we want (making +> the best possible compromise between this and other compatibility +> desires). After that, the actual patch is probably trivial, while in +> advance of some consensus on the behavior, offering a patch is a waste +> of time. + +Sure. + +Chris + + + +From pgsql-performance-owner@postgresql.org Thu Feb 27 02:42:40 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 4A0ED475CBC + for ; + Thu, 27 Feb 2003 02:42:28 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 31627-10 for ; + Thu, 27 Feb 2003 02:42:17 -0500 (EST) +Received: from sss.pgh.pa.us (unknown [192.204.191.242]) + by postgresql.org (Postfix) with ESMTP id 6DCD3475E1E + for ; + Thu, 27 Feb 2003 02:30:50 -0500 (EST) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1R7Uh5u009228; + Thu, 27 Feb 2003 02:30:43 -0500 (EST) +To: "Christopher Kings-Lynne" +Cc: "daniel alvarez" , + "Richard Huxton" , pgsql-performance@postgresql.org +Subject: Re: OIDs as keys +In-reply-to: <044801c2de30$93d71ca0$6500a8c0@fhp.internal> +References: <200302261358.53730.dev@archonet.com> + <24135.1046271575@www36.gmx.net> <29871.1046274964@sss.pgh.pa.us> + <032301c2de14$c64ccf70$6500a8c0@fhp.internal> + <8927.1046327718@sss.pgh.pa.us> + <040a01c2de2d$dac03780$6500a8c0@fhp.internal> + <9113.1046329568@sss.pgh.pa.us> + <044801c2de30$93d71ca0$6500a8c0@fhp.internal> +Comments: In-reply-to "Christopher Kings-Lynne" + message dated "Thu, 27 Feb 2003 15:19:33 +0800" +Date: Thu, 27 Feb 2003 02:30:43 -0500 +Message-ID: <9227.1046331043@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/222 +X-Sequence-Number: 1278 + +"Christopher Kings-Lynne" writes: +>> As I recall, one thing people did not want was for pg_dump to plaster +>> WITH OIDS or WITHOUT OIDS on every single CREATE TABLE, as this would +>> pretty much destroy any shot at loading PG dumps into any other +>> database. + +> Ummm...what about SERIAL columns, ALTER TABLE / SET STATS, SET STORAGE, +> custom types, 'btree' in CREATE INDEX, SET SEARCH_PATH, '::" cast operator, +> stored procedures, rules, etc. - how is adding WITH OIDS going to change +> that?! + +It's moving in the wrong direction. We've been slowly eliminating +unnecessary nonstandardisms in pg_dump output; this puts in a new one +in a quite fundamental place. You could perhaps expect another DB +to drop commands it didn't understand like SET SEARCH_PATH ... but if +it drops all your CREATE TABLEs, you ain't got much dump left to load. + +I'm not necessarily wedded to the above argument myself, mind you; +but it is a valid point that needs to be weighed in the balance of +what we're trying to accomplish. + +The bottom line is that "code first, design later" is no way to +approach this problem. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Feb 27 04:03:12 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 26B49474E4F + for ; + Thu, 27 Feb 2003 04:03:09 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 53472-05 for ; + Thu, 27 Feb 2003 04:02:58 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id 07AEA474E42 + for ; + Thu, 27 Feb 2003 04:02:57 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1R92ui53790 + for pgsql-performance@postgresql.org; + Thu, 27 Feb 2003 17:02:56 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1R92o753654; + Thu, 27 Feb 2003 17:02:51 +0800 (WST) +Message-ID: <04d701c2de3f$1f241700$6500a8c0@fhp.internal> +From: "Christopher Kings-Lynne" +To: "Tom Lane" +Cc: "Andrew Sullivan" , + +References: + <20030226070040.C8814@mail.libertyrms.com> + <027001c2ddfe$49274fe0$6500a8c0@fhp.internal> + <9042.1046329009@sss.pgh.pa.us> +Subject: Re: Index File growing big. +Date: Thu, 27 Feb 2003 17:03: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.2720.3000 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/223 +X-Sequence-Number: 1279 + +> > You should note that someone already has sent in a patch for +tablespaces, it +> > hasn't been acted on though - can't quite remember why. Maybe we should +> > resurrect it... +> +> It's been awhile, but my recollection is that the patch had restricted +> functionality (which would be okay for a first cut) and it invented SQL +> syntax that seemed to lock us into that restricted functionality +> permanently (not so okay). Details are fuzzy though... + +Well, I'll resurrect it and see if it can be improved. Tablespaces seem to +be a requested feature these days... + +Chris + + + +From pgsql-performance-owner@postgresql.org Thu Feb 27 07:19:21 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 2E62B474E5C + for ; + Thu, 27 Feb 2003 07:19:18 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 05201-09 for ; + Thu, 27 Feb 2003 07:19:07 -0500 (EST) +Received: from dristor.cabanova.ro (cabanova.ro [213.157.162.113]) + by postgresql.org (Postfix) with SMTP id 2BA2E474E4F + for ; + Thu, 27 Feb 2003 07:19:06 -0500 (EST) +Received: (qmail 4506 invoked from network); 27 Feb 2003 12:22:38 -0000 +Received: from catalin.dristor.cabanova.ro (HELO catalin) (192.168.1.2) + by dristor.cabanova.ro with SMTP; 27 Feb 2003 12:22:38 -0000 +Message-ID: <00c801c2de5a$76cb40d0$0201a8c0@catalin> +From: "Catalin" +To: +Subject: Daily crash +Date: Thu, 27 Feb 2003 14:19:23 +0200 +MIME-Version: 1.0 +Content-Type: text/plain; + charset="iso-8859-2" +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-Spam-Rating: dristor.cabanova.ro 1.6.2 0/1000/N +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/224 +X-Sequence-Number: 1280 + +Hi there, + +Is there any performance tunning that i can make to the postgresql server to +make the server more stable. +In my case the main usage of the DB is from an website which has quite lots +of visitors. +In the last weeks the SQL server crashes every day ! + +Before complete crash the transaction start to work slower. + +I would appreciate any suggestion regarding this issue ! + +Thank you ! + +Catalin +www.xclub.ro + + + +From pgsql-performance-owner@postgresql.org Thu Feb 27 07:23:30 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 3F204474E4F + for ; + Thu, 27 Feb 2003 07:23:28 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 11421-07 for ; + Thu, 27 Feb 2003 07:23:17 -0500 (EST) +Received: from www.pspl.co.in (www.pspl.co.in [202.54.11.65]) + by postgresql.org (Postfix) with ESMTP id 00C1C474E42 + for ; + Thu, 27 Feb 2003 07:23:15 -0500 (EST) +Received: (from root@localhost) + by www.pspl.co.in (8.11.6/8.11.6) id h1RCNHe07652 + for ; Thu, 27 Feb 2003 17:53:17 +0530 +Received: from daithan (daithan.intranet.pspl.co.in [192.168.7.161]) + by www.pspl.co.in (8.11.6/8.11.0) with ESMTP id h1RCNHf07647 + for ; Thu, 27 Feb 2003 17:53:17 +0530 +From: "Shridhar Daithankar" +To: +Date: Thu, 27 Feb 2003 17:54:00 +0530 +MIME-Version: 1.0 +Subject: Re: Daily crash +Reply-To: shridhar_daithankar@persistent.co.in +Message-ID: <3E5E50B8.10803.E998B57@localhost> +In-reply-to: <00c801c2de5a$76cb40d0$0201a8c0@catalin> +X-mailer: Pegasus Mail for Windows (v4.02) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/225 +X-Sequence-Number: 1281 + +On 27 Feb 2003 at 14:19, Catalin wrote: +> Is there any performance tunning that i can make to the postgresql server to +> make the server more stable. +> In my case the main usage of the DB is from an website which has quite lots +> of visitors. +> In the last weeks the SQL server crashes every day ! + +Could you please post the database logs? This is weird as far as I can guess. + +Bye + Shridhar + +-- +I'm frequently appalled by the low regard you Earthmen have for life. -- +Spock, "The Galileo Seven", stardate 2822.3 + + +From pgsql-performance-owner@postgresql.org Thu Feb 27 07:41:31 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 226E54758DC + for ; + Thu, 27 Feb 2003 07:34:30 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 00751-05 for ; + Thu, 27 Feb 2003 07:34:19 -0500 (EST) +Received: from contactbda.com (ipn36372-e65122.net-resource.net + [216.204.66.226]) + by postgresql.org (Postfix) with ESMTP id 7158F474E42 + for ; + Thu, 27 Feb 2003 07:34:10 -0500 (EST) +Received: (from apache@localhost) + by contactbda.com (8.11.2/8.11.2) id h1RCYCF13164; + Thu, 27 Feb 2003 07:34:12 -0500 +Date: Thu, 27 Feb 2003 07:34:12 -0500 +Message-Id: <200302271234.h1RCYCF13164@contactbda.com> +From: "Jim Buttafuoco" +To: "Christopher Kings-Lynne" , + "Tom Lane" , "Andrew Sullivan" , + +Reply-To: jim@contactbda.com +Subject: Re: Index File growing big. +In-Reply-To: <04d701c2de3f$1f241700$6500a8c0@fhp.internal> +References: + <20030226070040.C8814@mail.libertyrms.com> + <027001c2ddfe$49274fe0$6500a8c0@fhp.internal> + <9042.1046329009@sss.pgh.pa.us> +X-Mailer: Open WebMail 1.53 20011216 +X-OriginatingIP: 192.168.1.22 (jim) +MIME-Version: 1.0 +Content-Type: text/plain; charset=iso-8859-1 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/226 +X-Sequence-Number: 1282 + +All, + +I was the person who submitted the patch. I tried to a generic syntax. I also tried to keep the tablespace concept +simple. See my posting on HACKERS/GENERAL from a week or 2 ago about the syntax. I am still interested in working on +this patch with others. I have many system here that are 500+ gigabytes and growing. It is a real pain to add more +disk space (I have to backup, drop database(s), rebuild raid set (I am using raid 10) and reload data). + +Jim + + + +> > > You should note that someone already has sent in a patch for +> tablespaces, it +> > > hasn't been acted on though - can't quite remember why. Maybe we should +> > > resurrect it... +> > +> > It's been awhile, but my recollection is that the patch had restricted +> > functionality (which would be okay for a first cut) and it invented SQL +> > syntax that seemed to lock us into that restricted functionality +> > permanently (not so okay). Details are fuzzy though... +> +> Well, I'll resurrect it and see if it can be improved. Tablespaces seem to +> be a requested feature these days... +> +> Chris +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 4: Don't 'kill -9' the postmaster + + + + + +From pgsql-performance-owner@postgresql.org Thu Feb 27 07:53:37 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 7AA4C474E61 + for ; + Thu, 27 Feb 2003 07:52:59 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 98752-03 for ; + Thu, 27 Feb 2003 07:52:48 -0500 (EST) +Received: from dristor.cabanova.ro (cabanova.ro [213.157.162.113]) + by postgresql.org (Postfix) with SMTP id 1AC5D475A71 + for ; + Thu, 27 Feb 2003 07:51:41 -0500 (EST) +Received: (qmail 4850 invoked from network); 27 Feb 2003 12:55:13 -0000 +Received: from catalin.dristor.cabanova.ro (HELO catalin) (192.168.1.2) + by dristor.cabanova.ro with SMTP; 27 Feb 2003 12:55:13 -0000 +Message-ID: <00da01c2de5f$04154f40$0201a8c0@catalin> +From: "Catalin" +To: +References: <3E5E50B8.10803.E998B57@localhost> +Subject: Re: Daily crash +Date: Thu, 27 Feb 2003 14:51:59 +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-Spam-Rating: dristor.cabanova.ro 1.6.2 0/1000/N +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/227 +X-Sequence-Number: 1283 + +i'm afraid i don't have any logs. +i have the default redhat instalation of postgres 7.0.2 which comes with no +logging enabled. + +i will try to enable logging and post the logs to the list ! + +anyway in PHP when trying to connect to the crashed SQL server i get the +error message: +Too many connections... + +Catalin + +----- Original Message ----- +From: Shridhar Daithankar +To: pgsql-performance@postgresql.org +Sent: Thursday, February 27, 2003 2:24 PM +Subject: Re: [PERFORM] Daily crash + + +On 27 Feb 2003 at 14:19, Catalin wrote: +> Is there any performance tunning that i can make to the postgresql server +to +> make the server more stable. +> In my case the main usage of the DB is from an website which has quite +lots +> of visitors. +> In the last weeks the SQL server crashes every day ! + +Could you please post the database logs? This is weird as far as I can +guess. + +Bye + Shridhar + +-- +I'm frequently appalled by the low regard you Earthmen have for life. -- +Spock, "The Galileo Seven", stardate 2822.3 + + +---------------------------(end of broadcast)--------------------------- +TIP 5: Have you checked our extensive FAQ? + +http://www.postgresql.org/users-lounge/docs/faq.html + + +From pgsql-performance-owner@postgresql.org Thu Feb 27 08:04:12 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 07BF8475458 + for ; + Thu, 27 Feb 2003 08:02:44 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 99222-05 for ; + Thu, 27 Feb 2003 08:02:33 -0500 (EST) +Received: from www.pspl.co.in (www.pspl.co.in [202.54.11.65]) + by postgresql.org (Postfix) with ESMTP id 1C1D1474E5C + for ; + Thu, 27 Feb 2003 08:02:31 -0500 (EST) +Received: (from root@localhost) + by www.pspl.co.in (8.11.6/8.11.6) id h1RD2Xh13279 + for ; Thu, 27 Feb 2003 18:32:33 +0530 +Received: from daithan (daithan.intranet.pspl.co.in [192.168.7.161]) + by www.pspl.co.in (8.11.6/8.11.0) with ESMTP id h1RD2Xf13273 + for ; Thu, 27 Feb 2003 18:32:33 +0530 +From: "Shridhar Daithankar" +To: +Date: Thu, 27 Feb 2003 18:33:15 +0530 +MIME-Version: 1.0 +Subject: Re: Daily crash +Reply-To: shridhar_daithankar@persistent.co.in +Message-ID: <3E5E59EB.26039.EBD7DCB@localhost> +In-reply-to: <00da01c2de5f$04154f40$0201a8c0@catalin> +X-mailer: Pegasus Mail for Windows (v4.02) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/228 +X-Sequence-Number: 1284 + +On 27 Feb 2003 at 14:51, Catalin wrote: + +> i'm afraid i don't have any logs. +> i have the default redhat instalation of postgres 7.0.2 which comes with no +> logging enabled. +> +> i will try to enable logging and post the logs to the list ! +> +> anyway in PHP when trying to connect to the crashed SQL server i get the +> error message: +> Too many connections... + +Tell me. Does that sound like a crash? To me the server is well alive. + +And if you are using default configuration, you must be experiencing a real +pathetic performance for a real world load. + +Try tuning the database. There are too many tips to put in one place. but +editing /var/lib/data/postgresql/postgresql.conf ( I hope I am right, I am too +used to do pg_ctl by hand. Never used services provided by disro.s) is first +step. You need to read the admin guide as well. + +HTH + +Bye + Shridhar + +-- +Glib's Fourth Law of Unreliability: Investment in reliability will increase +until it exceeds the probable cost of errors, or until someone insists on +getting some useful work done. + + +From pgsql-performance-owner@postgresql.org Thu Feb 27 08:22:47 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id CA877474E5C + for ; + Thu, 27 Feb 2003 08:22:23 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 05547-02 for ; + Thu, 27 Feb 2003 08:22:02 -0500 (EST) +Received: from biomax.de (unknown [212.6.137.236]) + by postgresql.org (Postfix) with ESMTP id C4EB7474E4F + for ; + Thu, 27 Feb 2003 08:22:01 -0500 (EST) +Received: from biomax.de (guffert.biomax.de [192.168.3.166]) + by biomax.de (8.8.8/8.8.8) with ESMTP id OAA11466 + for ; Thu, 27 Feb 2003 14:21:54 +0100 +Message-ID: <3E5E10F2.2000907@biomax.de> +Date: Thu, 27 Feb 2003 14:21:54 +0100 +From: Chantal Ackermann +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: tsearch performance +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/230 +X-Sequence-Number: 1286 + +hi all, + +we have a tsearch index on the following table: + + Table "public.sentences" + Column | Type | Modifiers +---------------+---------+-------------------- + sentence_id | bigint | not null + puid | integer | + py | integer | + journal_id | integer | + sentence_pos | integer | not null + sentence_type | integer | not null default 0 + sentence | text | not null + sentenceidx | txtidx | not null +Indexes: sentences_pkey primary key btree (sentence_id), + sentence_uni unique btree (puid, sentence_pos, sentence), + sentenceidx_i gist (sentenceidx), + sentences_puid_i btree (puid), + sentences_py_i btree (py) + +the table contains 50.554.768 rows and is vacuum full analyzed. + +The sentenceidx has been filled NOT USING txt2txtidx, but a custom +implementation that should have had the same effect (parsing into +words/phrases, deleting stop words). Nevertheless, might this be the +reason for the very bad performance of the index, or is the table "just" +to big (I hope not!)? + +Note that the index on sentenceidx has not been clustered, yet. I wanted +to ask first whether I might need to refill the column sentenceidx using +txt2txtidx. (with so many rows every action has to be reconsidered ;-) ) + +EXPLAIN ANALYZE +SELECT sentence FROM sentences WHERE sentenceidx @@ 'amino\\ acid'; + + + QUERY PLAN +------------------------------------------------------------------- + Index Scan using sentenceidx_i on sentences + (cost=0.00..201327.85 rows=50555 width=148) + (actual time=973940.41..973940.41 rows=0 loops=1) + + Index Cond: (sentenceidx @@ '\'amino acid\''::query_txt) + Filter: (sentenceidx @@ '\'amino acid\''::query_txt) + + Total runtime: 973941.09 msec +(4 rows) + +thank you for any thoughts, hints, tips! +Chantal + + +From pgsql-performance-owner@postgresql.org Thu Feb 27 08:16:42 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id B1690474E4F + for ; + Thu, 27 Feb 2003 08:16:40 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 03587-09 for ; + Thu, 27 Feb 2003 08:16:30 -0500 (EST) +Received: from wolff.to (wolff.to [66.93.249.74]) + by postgresql.org (Postfix) with SMTP id E82CC474E42 + for ; + Thu, 27 Feb 2003 08:16:29 -0500 (EST) +Received: (qmail 28999 invoked by uid 500); 27 Feb 2003 13:30:11 -0000 +Date: Thu, 27 Feb 2003 07:30:11 -0600 +From: Bruno Wolff III +To: Catalin +Cc: pgsql-performance@postgresql.org +Subject: Re: Daily crash +Message-ID: <20030227133011.GA28616@wolff.to> +Mail-Followup-To: Catalin , pgsql-performance@postgresql.org +References: <3E5E50B8.10803.E998B57@localhost> + <00da01c2de5f$04154f40$0201a8c0@catalin> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <00da01c2de5f$04154f40$0201a8c0@catalin> +User-Agent: Mutt/1.3.25i +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/229 +X-Sequence-Number: 1285 + +On Thu, Feb 27, 2003 at 14:51:59 +0200, + Catalin wrote: +> i'm afraid i don't have any logs. +> i have the default redhat instalation of postgres 7.0.2 which comes with no +> logging enabled. + +You should upgrade to 7.2.4 or 7.3.2. (7.3 has schemas and that may make +upgrading harder which is why you might consider just going to 7.2.4.) + +> i will try to enable logging and post the logs to the list ! +> +> anyway in PHP when trying to connect to the crashed SQL server i get the +> error message: +> Too many connections... + +You are going to want the number of allowed connections to match the number +of simultaneous requests possible from the web server. Typically this is +the maximum number of allowed apache processes which defaults to something +like 150. The default maximum number of connections to postgres is about +32. You will also want to raise the number of shared buffers to about +1000 (assuming you have at least a couple hundred of megabytes of memory), +not just to 2 times the new maximum number of connections. This may require +to change the maximum amount of shared memory allowed by your operating +system. Also take a look at increasing sort mem as well. You don't want +this too high because each sort gets this much memory and in your situation +it may be that you could have a lot of sorts runing at the same time +(dpending on the types of queries being done). + +From pgsql-performance-owner@postgresql.org Thu Feb 27 09:43:46 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id A9F934758F1 + for ; + Thu, 27 Feb 2003 09:43:19 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 31431-07 for ; + Thu, 27 Feb 2003 09:43:00 -0500 (EST) +Received: from ndl1mr1-a-fixed (ndl1mr1-a-fixed.sancharnet.in [61.0.0.45]) + by postgresql.org (Postfix) with ESMTP id 4B63F47592C + for ; + Thu, 27 Feb 2003 09:41:59 -0500 (EST) +Received: from conversion-daemon.ndl1mr1-a-fixed.sancharnet.in by + ndl1mr1-a-fixed.sancharnet.in + (iPlanet Messaging Server 5.2 HotFix 0.9 (built Jul 29 2002)) + id <0HAZ00L011S464@ndl1mr1-a-fixed.sancharnet.in> for + pgsql-performance@postgresql.org; Thu, 27 Feb 2003 20:12:01 +0530 (IST) +Received: from societykotla ([61.0.95.99]) by ndl1mr1-a-fixed.sancharnet.in + (iPlanet Messaging Server 5.2 HotFix 0.9 (built Jul 29 2002)) + with ESMTPA id <0HAZ00K3824M7L@ndl1mr1-a-fixed.sancharnet.in> for + pgsql-performance@postgresql.org; Thu, 27 Feb 2003 20:12:01 +0530 (IST) +Date: Thu, 27 Feb 2003 20:14:54 +0530 +From: Aspire Something +Subject: Re: [Performance] Daily Crash +To: pgsql-performance@postgresql.org +Reply-To: Aspire Something +Message-id: <01c201c2de6e$e9b3aab0$c9c832c0@societykotla> +MIME-version: 1.0 +X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +X-Mailer: Microsoft Outlook Express 6.00.2600.0000 +Content-type: text/plain; charset=iso-8859-1 +Content-transfer-encoding: 7BIT +X-Priority: 3 +X-MSMail-priority: Normal +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/231 +X-Sequence-Number: 1287 + +Dear Catalin, + + +What I understand from ur post is, +1. U are using PHP for connection. what version ??? assuming u are on PHP +version >4.2.X +2. Ur Postgresql server is not tuned to handle loads. + +What U can try is ...... + +1.Make sure that ur PHP scripts close the connection when transaction is +complete (HOW??? see after pg_connect + +U see a pg_close function of PHP) + a. Use pg_pconnect and forget about pg_connect and pg_close +2. Increse the limit of connection to be made to PostgreSQL this can be +done as said by Shridhar the default is 32 +3. For God sake Upgrade to PostgreSQL 7.3.2 and PHP 4.3.1 you are missing a +lot with that old versions. + + + +Regards, +V Kashyap + +================================ +Some people think it's holding on that makes one strong; + sometimes it's letting go. +================================ + + + +From pgsql-performance-owner@postgresql.org Thu Feb 27 09:54:49 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 59D8847595A + for ; + Thu, 27 Feb 2003 09:54:12 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 35470-04 for ; + Thu, 27 Feb 2003 09:54:01 -0500 (EST) +Received: from dristor.cabanova.ro (cabanova.ro [213.157.162.113]) + by postgresql.org (Postfix) with SMTP id 6E16D4759BD + for ; + Thu, 27 Feb 2003 09:53:03 -0500 (EST) +Received: (qmail 5792 invoked from network); 27 Feb 2003 14:56:39 -0000 +Received: from catalin.dristor.cabanova.ro (HELO catalin) (192.168.1.2) + by dristor.cabanova.ro with SMTP; 27 Feb 2003 14:56:39 -0000 +Message-ID: <000701c2de6f$f96f1ce0$0201a8c0@catalin> +From: "Catalin" +To: +References: <01c201c2de6e$e9b3aab0$c9c832c0@societykotla> +Subject: Re: [Performance] Daily Crash +Date: Thu, 27 Feb 2003 16:53:22 +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-Spam-Rating: dristor.cabanova.ro 1.6.2 0/1000/N +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/232 +X-Sequence-Number: 1288 + +i have php 4.2.3 +i use pg_pConnect and no pg_Close. + +thanks for yours advices. +i will upgrade to postgresql 7.2.3 asap +and see if there are improvments ! + +thanks again ! + +Catalin + +----- Original Message ----- +From: Aspire Something +To: pgsql-performance@postgresql.org +Sent: Thursday, February 27, 2003 4:44 PM +Subject: Re: [PERFORM] [Performance] Daily Crash + + +Dear Catalin, + + +What I understand from ur post is, +1. U are using PHP for connection. what version ??? assuming u are on PHP +version >4.2.X +2. Ur Postgresql server is not tuned to handle loads. + +What U can try is ...... + +1.Make sure that ur PHP scripts close the connection when transaction is +complete (HOW??? see after pg_connect + +U see a pg_close function of PHP) + a. Use pg_pconnect and forget about pg_connect and pg_close +2. Increse the limit of connection to be made to PostgreSQL this can be +done as said by Shridhar the default is 32 +3. For God sake Upgrade to PostgreSQL 7.3.2 and PHP 4.3.1 you are missing a +lot with that old versions. + + + +Regards, +V Kashyap + +================================ +Some people think it's holding on that makes one strong; + sometimes it's letting go. +================================ + + + +---------------------------(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 Thu Feb 27 12:22:07 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E64CE475C60 + for ; + Thu, 27 Feb 2003 12:21:47 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 76762-08 for ; + Thu, 27 Feb 2003 12:21:36 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id CEA3A475F37 + for ; + Thu, 27 Feb 2003 11:54:18 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2872282; Thu, 27 Feb 2003 08:54:06 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: "Catalin" , +Subject: Re: [Performance] Daily Crash +Date: Thu, 27 Feb 2003 08:53:08 -0800 +User-Agent: KMail/1.4.3 +References: <01c201c2de6e$e9b3aab0$c9c832c0@societykotla> + <000701c2de6f$f96f1ce0$0201a8c0@catalin> +In-Reply-To: <000701c2de6f$f96f1ce0$0201a8c0@catalin> +MIME-Version: 1.0 +Message-Id: <200302270853.08304.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/233 +X-Sequence-Number: 1289 + +Catalin, + +> thanks for yours advices. +> i will upgrade to postgresql 7.2.3 asap +> and see if there are improvments ! + +Um, that's 7.2.4. 7.2.3 has a couple of bugs in it. + +Also, you are going to have to edit your postgresql.conf file per the=20 +suggestions already made on this list. + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Thu Feb 27 12:27:50 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id E98D5475F6A + for ; + Thu, 27 Feb 2003 12:27:25 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 78476-06 for ; + Thu, 27 Feb 2003 12:27:13 -0500 (EST) +Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) + by postgresql.org (Postfix) with ESMTP id 38787475F55 + for ; + Thu, 27 Feb 2003 11:58:42 -0500 (EST) +Received: from [63.195.55.98] (HELO spooky) + by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) + with ESMTP id 2872289; Thu, 27 Feb 2003 08:58:30 -0800 +Content-Type: text/plain; + charset="iso-8859-1" +From: Josh Berkus +Organization: Aglio Database Solutions +To: Murthy Kambhampaty +Subject: Re: Data write speed +Date: Thu, 27 Feb 2003 08:57:32 -0800 +User-Agent: KMail/1.4.3 +References: <2D92FEBFD3BE1346A6C397223A8DD3FC092171@THOR.goeci.com> +In-Reply-To: <2D92FEBFD3BE1346A6C397223A8DD3FC092171@THOR.goeci.com> +Cc: pgsql-performance@postgresql.org +MIME-Version: 1.0 +Message-Id: <200302270857.32247.josh@agliodbs.com> +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/234 +X-Sequence-Number: 1290 + +Murthy, + +> You could get mondo (http://www.microwerks.net/~hugo/), then backup your +> system to CDs and restore it with the new filesystem layout. You might wa= +nt +> to do these backups as a matter of course? + +Thanks for the suggestion. The problem isn't backup media ... we have a D= +LT=20 +drive ... the problem is time. This particular application is already abo= +ut=20 +4 weeks behind schedule because of various hardware problems. At some poin= +t,=20 +Kevin Brown and I will take a weekend to swap the postgres files to a spare= +=20 +disk, and re-format the data array as pass-through Linux RAID. + +And this is the last time I leave it up to the company sysadmin to buy=20 +hardware for a database server, even with explicit instructions ... "Yes, I= +=20 +saw which one you wanted, but the 2200S was on sale!" + +--=20 +Josh Berkus +Aglio Database Solutions +San Francisco + +From pgsql-performance-owner@postgresql.org Thu Feb 27 13:32:59 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 8D18D475F55 + for ; + Thu, 27 Feb 2003 13:32:51 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 92042-04 for ; + Thu, 27 Feb 2003 13:32:36 -0500 (EST) +Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) + by postgresql.org (Postfix) with ESMTP id E0E65475F64 + for ; + Thu, 27 Feb 2003 12:57:03 -0500 (EST) +Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) + by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h1RHrjb2022174; + Thu, 27 Feb 2003 10:54:24 -0700 (MST) +Date: Thu, 27 Feb 2003 10:54:49 -0700 (MST) +From: "scott.marlowe" +To: Josh Berkus +Cc: Murthy Kambhampaty , + +Subject: Re: Data write speed +In-Reply-To: <200302270857.32247.josh@agliodbs.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 +X-Archive-Number: 200302/235 +X-Sequence-Number: 1291 + +On Thu, 27 Feb 2003, Josh Berkus wrote: + +> Murthy, +> +> > You could get mondo (http://www.microwerks.net/~hugo/), then backup your +> > system to CDs and restore it with the new filesystem layout. You might want +> > to do these backups as a matter of course? +> +> Thanks for the suggestion. The problem isn't backup media ... we have a DLT +> drive ... the problem is time. This particular application is already about +> 4 weeks behind schedule because of various hardware problems. At some point, +> Kevin Brown and I will take a weekend to swap the postgres files to a spare +> disk, and re-format the data array as pass-through Linux RAID. +> +> And this is the last time I leave it up to the company sysadmin to buy +> hardware for a database server, even with explicit instructions ... "Yes, I +> saw which one you wanted, but the 2200S was on sale!" + +I still remember going round and round with a hardware engineer who was +extolling the adaptec AIC 133 controller as a great raid controller. I +finally made him test it instead of just reading the pamphlet that came +with it... Needless to say, it couldn't hold it's own against a straight +symbios UW card running linux software RAID. + +He's the same guy who speced my workstation with no AGP slot in it. The +week before he was laid off. Talk about bad timing... :-( + + +From pgsql-performance-owner@postgresql.org Thu Feb 27 14:27:04 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 0BAB7475FDA + for ; + Thu, 27 Feb 2003 14:26:49 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 09489-06 for ; + Thu, 27 Feb 2003 14:26:38 -0500 (EST) +Received: from ds9.quadratec-software.com (ds9.quadratec-software.com + [62.23.102.82]) by postgresql.org (Postfix) with ESMTP id 9A155475B8D + for ; + Thu, 27 Feb 2003 13:46:51 -0500 (EST) +Received: from spade.orsay.quadratec.fr (deltaq.quadratec-software.com + [62.23.102.66]) + by ds9.quadratec-software.com (8.11.3/8.11.3) with ESMTP id + h1RIkmI04256; Thu, 27 Feb 2003 19:46:50 +0100 +Received: from hotshine (hotshine.orsay.quadratec.fr [172.16.200.100]) + by spade.orsay.quadratec.fr (Switch-2.1.0/Switch-2.1.0) with SMTP id + h1RIklT18903; Thu, 27 Feb 2003 19:46:47 +0100 (CET) +From: "philip johnson" +To: "Catalin" , +Subject: Re: [Performance] Daily Crash +Date: Thu, 27 Feb 2003 19:51:01 +0100 +Message-ID: +MIME-Version: 1.0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: 7bit +X-Priority: 1 (Highest) +X-MSMail-Priority: High +X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) +In-Reply-To: <000701c2de6f$f96f1ce0$0201a8c0@catalin> +Importance: High +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/236 +X-Sequence-Number: 1292 + +pgsql-performance-owner@postgresql.org wrote: +> i have php 4.2.3 +> i use pg_pConnect and no pg_Close. +> +> thanks for yours advices. +> i will upgrade to postgresql 7.2.3 asap +> and see if there are improvments ! +> +> thanks again ! +> +> Catalin +> +> ----- Original Message ----- +> From: Aspire Something +> To: pgsql-performance@postgresql.org +> Sent: Thursday, February 27, 2003 4:44 PM +> Subject: Re: [PERFORM] [Performance] Daily Crash +> +> +> Dear Catalin, +> +> +> What I understand from ur post is, +> 1. U are using PHP for connection. what version ??? assuming u are on +> PHP version >4.2.X +> 2. Ur Postgresql server is not tuned to handle loads. +> +> What U can try is ...... +> +> 1.Make sure that ur PHP scripts close the connection when +> transaction is complete (HOW??? see after pg_connect +> +> U see a pg_close function of PHP) +> a. Use pg_pconnect and forget about pg_connect and pg_close +> 2. Increse the limit of connection to be made to PostgreSQL this can +> be done as said by Shridhar the default is 32 +> 3. For God sake Upgrade to PostgreSQL 7.3.2 and PHP 4.3.1 you are +> missing a lot with that old versions. +> +> +> +> Regards, +> V Kashyap +> +> ================================ +> Some people think it's holding on that makes one strong; +> sometimes it's letting go. +> ================================ +> +> +> +> ---------------------------(end of +> broadcast)--------------------------- TIP 2: you can get off all +> lists at once with the unregister command (send "unregister +> YourEmailAddressHere" to majordomo@postgresql.org) +> +> ---------------------------(end of +> broadcast)--------------------------- TIP 5: Have you checked our +> extensive FAQ? +> +> http://www.postgresql.org/users-lounge/docs/faq.html + +you can use no persistent link to database +see in php.ini + +pgsql.allow_persistent = Off + +From pgsql-performance-owner@postgresql.org Thu Feb 27 15:44:19 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 55202475EA4 + for ; + Thu, 27 Feb 2003 15:44:12 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 38541-08 for ; + Thu, 27 Feb 2003 15:43:35 -0500 (EST) +Received: from dristor.cabanova.ro (cabanova.ro [213.157.162.113]) + by postgresql.org (Postfix) with SMTP id E820F475E31 + for ; + Thu, 27 Feb 2003 15:19:25 -0500 (EST) +Received: (qmail 7751 invoked from network); 27 Feb 2003 20:23:03 -0000 +Received: from catalin.dristor.cabanova.ro (HELO catalin) (192.168.1.2) + by dristor.cabanova.ro with SMTP; 27 Feb 2003 20:23:03 -0000 +Message-ID: <00be01c2de9d$8fd8b150$0201a8c0@catalin> +From: "Catalin" +To: +References: +Subject: Re: [Performance] Daily Crash +Date: Thu, 27 Feb 2003 22:19:42 +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-Spam-Rating: dristor.cabanova.ro 1.6.2 0/1000/N +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/237 +X-Sequence-Number: 1293 + +how often should i run VACUUM to keep the thing tunned ? + +Catalin + +----- Original Message ----- +From: philip johnson +To: Catalin ; pgsql-performance@postgresql.org +Sent: Thursday, February 27, 2003 8:51 PM +Subject: RE: [PERFORM] [Performance] Daily Crash + + +pgsql-performance-owner@postgresql.org wrote: +> i have php 4.2.3 +> i use pg_pConnect and no pg_Close. +> +> thanks for yours advices. +> i will upgrade to postgresql 7.2.3 asap +> and see if there are improvments ! +> +> thanks again ! +> +> Catalin +> +> ----- Original Message ----- +> From: Aspire Something +> To: pgsql-performance@postgresql.org +> Sent: Thursday, February 27, 2003 4:44 PM +> Subject: Re: [PERFORM] [Performance] Daily Crash +> +> +> Dear Catalin, +> +> +> What I understand from ur post is, +> 1. U are using PHP for connection. what version ??? assuming u are on +> PHP version >4.2.X +> 2. Ur Postgresql server is not tuned to handle loads. +> +> What U can try is ...... +> +> 1.Make sure that ur PHP scripts close the connection when +> transaction is complete (HOW??? see after pg_connect +> +> U see a pg_close function of PHP) +> a. Use pg_pconnect and forget about pg_connect and pg_close +> 2. Increse the limit of connection to be made to PostgreSQL this can +> be done as said by Shridhar the default is 32 +> 3. For God sake Upgrade to PostgreSQL 7.3.2 and PHP 4.3.1 you are +> missing a lot with that old versions. +> +> +> +> Regards, +> V Kashyap +> +> ================================ +> Some people think it's holding on that makes one strong; +> sometimes it's letting go. +> ================================ +> +> +> +> ---------------------------(end of +> broadcast)--------------------------- TIP 2: you can get off all +> lists at once with the unregister command (send "unregister +> YourEmailAddressHere" to majordomo@postgresql.org) +> +> ---------------------------(end of +> broadcast)--------------------------- TIP 5: Have you checked our +> extensive FAQ? +> +> http://www.postgresql.org/users-lounge/docs/faq.html + +you can use no persistent link to database +see in php.ini + +pgsql.allow_persistent = Off + +From pgsql-performance-owner@postgresql.org Thu Feb 27 22:10:50 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 8D22A474E42 + for ; + Thu, 27 Feb 2003 22:10:45 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 53332-02 for ; + Thu, 27 Feb 2003 22:10:28 -0500 (EST) +Received: from torque.intervideoinc.com (mail.intervideo.com + [206.112.112.151]) + by postgresql.org (Postfix) with ESMTP id D6652475E52 + for ; + Thu, 27 Feb 2003 20:59:25 -0500 (EST) +Received: from ronpc [63.68.5.2] by torque.intervideoinc.com + (SMTPD32-5.05) id A6FCC7013C; Thu, 27 Feb 2003 18:18:36 -0800 +From: "Ron Mayer" +To: +Cc: "daniel alvarez" , + "Richard Huxton" +Subject: Re: OIDs as keys +Date: Thu, 27 Feb 2003 17:51:13 -0800 +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 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +In-Reply-To: <9113.1046329568@sss.pgh.pa.us> +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/238 +X-Sequence-Number: 1294 + +Tom wrote: +> +>As I recall, one thing people did not want was for pg_dump to plaster +>WITH OIDS or WITHOUT OIDS on every single CREATE TABLE, as this would +>pretty much destroy any shot at loading PG dumps into any other +>database. + + Has there been any talk about adding a flag to pg_dump to explicitly +ask for a standard format? (sql3? sql99? etc?) Ideally for me, such +a flag would produce a "portable" dump file of the subset that did +follow the standard, and also produce a separate log file that could +contain any constructs that could not be standardly dumped. + + If such a flag existed, it might be the easiest way to load to other +databases, and people might be less opposed to plastering more postgres +specific stuff to the default format. + + If I were going to try to write portable dumps for other databases, I'd +want as few postgresisms in the big file as possible. The separate log file +would make it easier for me to make hand-ported separate files to set up +functions, views, etc. + + Yes, I know that would restrict the functionality I could +depend on, including types, sequences, etc. However if I were in an +environment where developers did prototyping on postgres / mssql /etc +and migrated functionality to whatever the company's official +standard system was, I think developers would want to constrain +themselves to standards as much as possible, and this option may help +them do so. + + Ron + +PS: I'm not sure if I'm volunteering or not, unless someone tells + me how easy/hard it would be. Last thing I tried was harder + than it first appeared. + + +From pgsql-hackers-owner@postgresql.org Thu Feb 27 22:08:13 2003 +X-Original-To: pgsql-hackers@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 50D10475CED + for ; + Thu, 27 Feb 2003 22:08:09 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 50753-10 for ; + Thu, 27 Feb 2003 22:07:58 -0500 (EST) +Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) + by postgresql.org (Postfix) with ESMTP id DCDFD475AFA + for ; + Thu, 27 Feb 2003 20:56:53 -0500 (EST) +Received: (from root@localhost) + by houston.familyhealth.com.au (8.11.6/8.11.6) id h1S1uu175990 + for pgsql-hackers@postgresql.org; Fri, 28 Feb 2003 09:56:56 +0800 (WST) + (envelope-from chriskl@familyhealth.com.au) +Received: from mariner (mariner.internal [192.168.0.101]) + by houston.familyhealth.com.au (8.11.6/8.9.3) with SMTP id h1S1uq775900; + Fri, 28 Feb 2003 09:56:52 +0800 (WST) +Message-ID: <05a901c2decc$c8a81af0$6500a8c0@fhp.internal> +From: "Christopher Kings-Lynne" +To: , "Hackers" +References: + <20030226070040.C8814@mail.libertyrms.com> + <027001c2ddfe$49274fe0$6500a8c0@fhp.internal> + <9042.1046329009@sss.pgh.pa.us> + <200302271234.h1RCYCF13164@contactbda.com> +Subject: Re: [PERFORM] Index File growing big. +Date: Fri, 28 Feb 2003 09:57:43 +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.2720.3000 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 +X-scanner: scanned by Inflex 0.1.5c - (http://www.inflex.co.za/) +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/1277 +X-Sequence-Number: 36218 + +Hi Jim, + +Do you have a version of the patch that's synced against CVS HEAD? + +Chris + +> All, +> +> I was the person who submitted the patch. I tried to a generic syntax. I +also tried to keep the tablespace concept +> simple. See my posting on HACKERS/GENERAL from a week or 2 ago about the +syntax. I am still interested in working on +> this patch with others. I have many system here that are 500+ gigabytes +and growing. It is a real pain to add more +> disk space (I have to backup, drop database(s), rebuild raid set (I am +using raid 10) and reload data). +> +> Jim + + + +From pgsql-performance-owner@postgresql.org Fri Feb 28 08:41:38 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 8861B475EAA + for ; + Fri, 28 Feb 2003 08:41:24 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 50372-07 for ; + Fri, 28 Feb 2003 08:41:08 -0500 (EST) +Received: from etna.obsidian.co.za (etna.obsidian.co.za [196.36.119.67]) + by postgresql.org (Postfix) with ESMTP id AA27D4762D2 + for ; + Fri, 28 Feb 2003 06:09:35 -0500 (EST) +Received: (from uucp@localhost) + by etna.obsidian.co.za (8.11.6/8.11.6) with UUCP id h1SB9YG09767 + for pgsql-performance@postgresql.org; Fri, 28 Feb 2003 13:09:34 +0200 +Received: from tarcil (tarcil [172.16.1.14]) + by flash.itvs.co.za (8.9.3/8.9.3) with ESMTP id NAA01344 + for ; Fri, 28 Feb 2003 13:36:28 +0200 +Date: Fri, 28 Feb 2003 13:03:49 +0200 (SAST) +From: Jeandre du Toit +X-X-Sender: jeandre@localhost.localdomain +To: pgsql-performance@postgresql.org +Message-ID: +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/239 +X-Sequence-Number: 1295 + + +Is there any way to see all the columns in the database? I have a column +that needs to be changed in all the tables that use it, without having to +check each table manually. In Sybase you would link syscolumns with +sysobjects, I can only find info on pg_tables in Postgres but none on +columns. I would like to write some sort of dynamic sql to complete my +task. Is there any way of doing this? + +Thanks in advance +Jeandre + + +From pgsql-performance-owner@postgresql.org Fri Feb 28 09:30:08 2003 +X-Original-To: pgsql-performance@postgresql.org +Received: from localhost (postgresql.org [64.49.215.8]) + by postgresql.org (Postfix) with ESMTP id 28DD9475ADD + for ; + Fri, 28 Feb 2003 09:29:55 -0500 (EST) +Received: from postgresql.org ([64.49.215.8]) + by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with + SMTP id 41191-04 for ; + Fri, 28 Feb 2003 09:29:44 -0500 (EST) +Received: from dristor.cabanova.ro (cabanova.ro [213.157.162.113]) + by postgresql.org (Postfix) with SMTP id 73A02475E10 + for ; + Fri, 28 Feb 2003 08:21:59 -0500 (EST) +Received: (qmail 12941 invoked from network); 28 Feb 2003 13:25:53 -0000 +Received: from catalin.dristor.cabanova.ro (HELO catalin) (192.168.1.2) + by dristor.cabanova.ro with SMTP; 28 Feb 2003 13:25:53 -0000 +Message-ID: <005901c2df2c$6ae8ec40$0201a8c0@catalin> +From: "Catalin" +To: +References: + <00be01c2de9d$8fd8b150$0201a8c0@catalin> +Subject: Re: [Performance] Daily Crash +Date: Fri, 28 Feb 2003 15:22:18 +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-Spam-Rating: dristor.cabanova.ro 1.6.2 0/1000/N +X-Virus-Scanned: by amavisd-new +X-Archive-Number: 200302/240 +X-Sequence-Number: 1296 + +so i did the server upgrade to postgresql 7.3.2 +and tunned it like you ppl said. + +it works great. +plus my DB on postgresql 7.0 had 640 MB, including indexes, etc (files) +now it has only 140MB. +this is much better ! + +thank you for your help ! + +Catalin + +----- Original Message ----- +From: Catalin +To: pgsql-performance@postgresql.org +Sent: Thursday, February 27, 2003 10:19 PM +Subject: Re: [PERFORM] [Performance] Daily Crash + + +how often should i run VACUUM to keep the thing tunned ? + +Catalin + +----- Original Message ----- +From: philip johnson +To: Catalin ; pgsql-performance@postgresql.org +Sent: Thursday, February 27, 2003 8:51 PM +Subject: RE: [PERFORM] [Performance] Daily Crash + + +pgsql-performance-owner@postgresql.org wrote: +> i have php 4.2.3 +> i use pg_pConnect and no pg_Close. +> +> thanks for yours advices. +> i will upgrade to postgresql 7.2.3 asap +> and see if there are improvments ! +> +> thanks again ! +> +> Catalin +> +> ----- Original Message ----- +> From: Aspire Something +> To: pgsql-performance@postgresql.org +> Sent: Thursday, February 27, 2003 4:44 PM +> Subject: Re: [PERFORM] [Performance] Daily Crash +> +> +> Dear Catalin, +> +> +> What I understand from ur post is, +> 1. U are using PHP for connection. what version ??? assuming u are on +> PHP version >4.2.X +> 2. Ur Postgresql server is not tuned to handle loads. +> +> What U can try is ...... +> +> 1.Make sure that ur PHP scripts close the connection when +> transaction is complete (HOW??? see after pg_connect +> +> U see a pg_close function of PHP) +> a. Use pg_pconnect and forget about pg_connect and pg_close +> 2. Increse the limit of connection to be made to PostgreSQL this can +> be done as said by Shridhar the default is 32 +> 3. For God sake Upgrade to PostgreSQL 7.3.2 and PHP 4.3.1 you are +> missing a lot with that old versions. +> +> +> +> Regards, +> V Kashyap +> +> ================================ +> Some people think it's holding on that makes one strong; +> sometimes it's letting go. +> ================================ +> +> +> +> ---------------------------(end of +> broadcast)--------------------------- TIP 2: you can get off all +> lists at once with the unregister command (send "unregister +> YourEmailAddressHere" to majordomo@postgresql.org) +> +> ---------------------------(end of +> broadcast)--------------------------- TIP 5: Have you checked our +> extensive FAQ? +> +> http://www.postgresql.org/users-lounge/docs/faq.html + +you can use no persistent link to database +see in php.ini + +pgsql.allow_persistent = Off + +---------------------------(end of broadcast)--------------------------- +TIP 2: you can get off all lists at once with the unregister command + (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) +