X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C2E2752881 for ; Wed, 15 Jun 2005 13:54:21 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 44529-09 for ; Wed, 15 Jun 2005 16:54:16 +0000 (GMT) Received: from veggie-fuel.com (veggie-fuel.com [200.46.208.238]) by svr1.postgresql.org (Postfix) with ESMTP id 8345B5282A for ; Wed, 15 Jun 2005 13:54:13 -0300 (ADT) Received: from localhost (unknown [200.46.204.144]) by veggie-fuel.com (Postfix) with ESMTP id BA8CC35F960 for ; Wed, 15 Jun 2005 16:54:13 +0000 (GMT) Received: from veggie-fuel.com ([200.46.208.238]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 47351-01; Wed, 15 Jun 2005 16:54:06 +0000 (GMT) Received: from [10.0.0.7] (63-229-122-71.phnx.qwest.net [63.229.122.71]) by veggie-fuel.com (Postfix) with ESMTP id 6767335F95A; Wed, 15 Jun 2005 16:54:05 +0000 (GMT) Subject: Re: Index ot being used From: Karim Nassar Reply-To: karim.nassar@acm.org To: Madison Kelly Cc: pgsql-performance@postgresql.org In-Reply-To: <42ADFAF8.7080107@alteeve.com> References: <1825.216.209.137.1.1118419819.squirrel@mail.alteeve.com> <20050610155535.GO8451@tobias.nordicbet.com> <42AC42CB.8050703@alteeve.com> <24636.1118591783@sss.pgh.pa.us> <42ACBC95.9020404@alteeve.com> <20050613030001.GB17491@wolff.to> <20050613031317.GA18988@wolff.to> <42AD008D.4080600@alteeve.com> <20050613035346.GA20703@wolff.to> <42AD0B94.9090508@alteeve.com> <20050613132852.GA31142@wolff.to> <42ADC77B.7000007@alteeve.com> <22127.1118686403@sss.pgh.pa.us> <42ADD8DC.1000001@alteeve.com> <3643.1118696404@sss.pgh.pa.us> <42ADFAF8.7080107@alteeve.com> Content-Type: text/plain Date: Wed, 15 Jun 2005 09:52:02 -0700 Message-Id: <1118854322.7135.133.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200506/332 X-Sequence-Number: 12969 On Mon, 2005-06-13 at 17:30 -0400, Madison Kelly wrote: > As I mentioned to Bruno in my reply to him, I am trying to keep as > many tweaks as I can inside my program. The reason for this is that this > is a backup program that I am trying to aim to more mainstream users or > where a techy would set it up and then it would be used by mainstream > users. At this point I want to avoid, as best I can, any changes from > default to the 'postgres.conf' file or other external files. Later > though, once I finish this testing phase, I plan to write a section of > external tweaking where I will test these changes out and note my > success for mre advanced users who feel more comfortable playing with > postgres (and web server, rsync, etc) configs. > > If there is any way that I can make changes like this similar from > inside my (perl) program I would prefer that. For example, I implemented > the 'enable_seqscan' via: > > $DB->do("SET ENABLE_SEQSCAN TO OFF") || die... > ... > $DB->do("SET ENABLE_SEQSCAN TO ON") || die... Your goal is admirable. However, many people tweak their postgresql.conf files, and your program can't know whether or not this has happened. It might be a good idea to have a var $do_db_optimization, which defaults to on. Then, if your users have trouble or are advanced admins they can turn it off. My personal opinion is that there are too many architectures and configurations for you to accurately optimize inside your program, and this gives you and your users an easy out. if ($do_db_optimization == 1) { $DB->do("SET ENABLE_SEQSCAN TO OFF") || die... } else { # do nothing -- postgresql will figure it out } -- Karim Nassar