X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 555DDD1B906 for ; Thu, 18 Dec 2003 18:44:29 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 64935-03 for ; Thu, 18 Dec 2003 14:43:41 -0400 (AST) Received: from morework.geizhals.at (home.geizhals.at [213.229.14.34]) by svr1.postgresql.org (Postfix) with ESMTP id DC588D1B8C0 for ; Thu, 18 Dec 2003 14:43:38 -0400 (AST) Received: from localhost (morework [127.0.0.1]) by morework.geizhals.at (Postfix) with ESMTP id 84B21524176 for ; Thu, 18 Dec 2003 19:43:25 +0100 (CET) Received: from geizhals.at (chello080110242194.117.11.tuwien.teleweb.at [80.110.242.194]) by morework.geizhals.at (Postfix) with ESMTP id 4623D52410E for ; Thu, 18 Dec 2003 19:43:25 +0100 (CET) Message-ID: <3FE1F5A1.6080908@geizhals.at> Date: Thu, 18 Dec 2003 19:44:49 +0100 From: "Marinos J. Yannikos" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: why do optimizer parameters have to be set manually? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS snapshot-20020222 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/264 X-Sequence-Number: 5124 Hi, it seems to me that the optimizer parameters (like random_page_cost etc.) could easily be calculated and adjusted dynamically be the DB backend based on the planner's cost estimates and actual run times for different queries. Perhaps the developers could comment on that? I'm not sure how the parameters are used internally (apart from whatever "EXPLAIN" shows), but if cpu_operator_cost is the same for all operators, this should probably also be adjusted for individual operators (I suppose that ">" is not as costly as "~*"). As far as the static configuration is concerned, I'd be interested in other users' parameters and hardware configurations. Here's ours (for a write-intensive db that also performs many queries with regular expression matching): effective_cache_size = 1000000 # typically 8KB each #random_page_cost = 0.2 # units are one sequential page fetch cost random_page_cost = 3 # units are one sequential page fetch cost #cpu_tuple_cost = 0.01 # (same) cpu_index_tuple_cost = 0.01 # (same) 0.1 #cpu_operator_cost = 0.0025 # (same) cpu_operator_cost = 0.025 # (same) other options: shared_buffers = 240000 # 2*max_connections, min 16, typically 8KB each max_fsm_relations = 10000 # min 10, fsm is free space map, ~40 bytes max_fsm_pages = 10000000 # min 1000, fsm is free space map, ~6 bytes #max_locks_per_transaction = 20 # min 10 wal_buffers = 128 # min 4, typically 8KB each sort_mem = 800000 # min 64, size in KB vacuum_mem = 100000 # min 1024, size in KB checkpoint_segments = 80 # in logfile segments, min 1, 16MB each checkpoint_timeout = 300 # range 30-3600, in seconds commit_delay = 100000 # range 0-100000, in microseconds commit_siblings = 5 # range 1-1000 12GB RAM, dual 2,80GHz Xeon, 6x 10K rpm disks in a RAID-5, Linux 2.4.23 with HT enabled. Regards, Marinos