Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id AF6FF2E2DB9 for ; Fri, 30 May 2008 22:38:28 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 52388-02-2 for ; Fri, 30 May 2008 22:38:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail137139.authsmtp.co.uk (outmail137139.authsmtp.co.uk [62.13.137.139]) by developer.postgresql.org (Postfix) with ESMTP id 5D4E22E3316 for ; Fri, 30 May 2008 21:34:48 -0300 (ADT) Received: from mail.authsmtp.com (mail.authsmtp.com [62.13.128.187]) by punt6.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m4V0Ykv6088731 for ; Sat, 31 May 2008 01:34:46 +0100 (BST) Received: from josh-berkuss-macbook.local (sca-ea-fw-1.Sun.COM [192.18.43.225]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m4V0YhHX073867 for ; Sat, 31 May 2008 01:34:44 +0100 (BST) Message-ID: <48409D1E.3070208@agliodbs.com> Date: Fri, 30 May 2008 17:34:38 -0700 From: Josh Berkus User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: pgsql-hackers@postgresql.org Subject: Overhauling GUCS Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Server-Quench: 5def6763-2ea9-11dd-8782-001185d377ca X-AuthRoute: OCdyZgscClZXSx8a IioLCC5HRQ8+YBZL BAkbIhBDJB8JXA9S P1xBBkJUK0ETX1xC QjoVBBYDHl5wRh4k IhVTbQVVckpPVQZu WkxMDFNbFhtpCQIF BQAcUBxtdQBEfWFw KxtmOHAyBDwSdUF+ SkhTW24GYm4ubTRK BkZfcQBJclYbdwJE awQrSXsKaWcaZnph Rl9uM2tuYj5WPgNL TxsNJE8WQEAEVhEB bCtq X-Authentic-SMTP: 61633136333939.squirrel.dmpriest.net.uk:1045/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system! X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/1062 X-Sequence-Number: 119061 Magnus and I had the fortune to share a plane flight when leaving pgCon. This gave us a chance to discuss my ideas around reforming PostgreSQL configuration at some length. Here's what we came up with (Magnus will presumably correct the parts I got wrong): Currently, PostgreSQL,conf and our set of GUC configurations suffer from 4 large problems: 1. Most people have no idea how to set these. 2. The current postgresql.conf file is a huge mess of 194 options, the vast majority of which most users will never touch. 3. GUCS lists are kept in 3 different places (guc.c, postgresql.conf, and the settings.sgml), which are only synched with each other manually. 4. We don't seem to be getting any closer to autotuning. We think all of these are solvable for 8.4. We also think that it's vitally important than any overhaul of the GUCS to be completed in one version to minimize the pain involved. Here's a list of the things we want to change. It's all a package and should make sense if you take all the changes as a whole. 1) Add several pieces of extra information to guc.c in the form of extra "gettext" commands: default value, subcategory, long description, recommendations, enum lists. 2) Incorporate this data into pg_settings 3) Delete postgresql.conf.sample 4) Add a script called pg_generate_conf to generate a postgresql.conf based on guc.c and command-line switches (rather than postgresql.conf.sample), which would be called automatically by initdb. For (4), pg_generate_conf would take the following switches: -b , --basic = short conf file, listing only the 15-18 most commonly changed options -a , --advanced = conf file listing all 196+ options -t, --terse = conf file lists only category headings and actual settings, no comments -n, --normal = conf file has category and subcategory settings, with short desc comments -v, --verbose = conf file lists full descriptions and recommendations in comments with each option -c "option = value" set specific option to specific value in the file -f "filename" = take options and values from file "filename" The default would be "-b, -n" with specific settings for shared_buffers and wal_sync_method. The current postgresql.conf is a lot more like an "-a, -v" file. This would help us in the following ways: A. there would now only be 2 places to maintain GUCS lists, the docs and guc.c. B. by having a generated postgresql.conf and an easy way to generate it, writing autoconfiguration scripts (as well as shortcuts like SET PERSISTENT) become vastly easier. C. Most users would deal only with a limited set of 15-20 configuration variables. There's obviously some refinements needed, but what do people think of the above general idea?