Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 458F99FB357 for ; Thu, 28 Sep 2006 14:11:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 44540-09 for ; Thu, 28 Sep 2006 14:11:34 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from lists.commandprompt.com (host-130.commandprompt.net [207.173.203.130]) by postgresql.org (Postfix) with ESMTP id 9329D9FB356 for ; Thu, 28 Sep 2006 14:11:34 -0300 (ADT) Received: from [192.168.1.95] (or-67-76-146-141.sta.embarqhsd.net [67.76.146.141]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k8SHBXEf010129 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 28 Sep 2006 10:11:35 -0700 Message-ID: <451C0243.2060307@commandprompt.com> Date: Thu, 28 Sep 2006 10:11:31 -0700 From: "Joshua D. Drake" Organization: Command Prompt, Inc. User-Agent: Thunderbird 1.5.0.7 (X11/20060918) MIME-Version: 1.0 To: Carlo Stonebanks CC: pgsql-performance@postgresql.org Subject: Re: Performace Optimization for Dummies References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Thu, 28 Sep 2006 10:11:35 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.345 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, SARE_MILLIONSOF X-Spam-Level: X-Archive-Number: 200609/387 X-Sequence-Number: 21073 > The import is slow - and degrades as the tables grow. With even more > millions of rows in dozens of import tables to come, the imports will take > forever. My ability to analyse the queries is limited; because of the nature > of the import process, the SQL queries are mutable, every imported row can > change the structure of a SQL query as the program adds and subtracts search > conditions to the SQL command text before execution. The import program is > scripted in Tcl. An attempt to convert our queries to prepared queries > (curiousy) did not bring any performance improvements, and we converted back > to simplify the code. How are you loading the tables? Copy? Insert? > > We urgently need a major performance improvement. We are running the > PostgreSQL 8.1.4 on a Windows 2003 x64 Server on a dual processor, dual core > 3.2Ghz Xeon box with 4gb RAM and a RAID (sorry, I don't know what type) disc > subsystem. Sorry about the long intro, but here are my questions: > > 1) Are we paying any big penalties by running Windows vs LINUX (or any other > OS)? Yes. Linux or FreeBSD is going to stomp Win32 for PostgreSQL performance. > > 2) Has the debate over PostgreSQL and Xeon processors been settled? Is this > a factor? Depends. PostgreSQL is much better with the Xeon in general, but are you running woodcrest based CPUs or the older models? > > 3) Are there any easy-to-use performance analysis/optimisation tools that we > can use? I am dreaming of one that could point out problems and suggest > and.or effect solutions. I don't know about Windows, but *nix has a number of tools available directly at the operating system level to help you determine various bottlenecks. > > 4) Can anyone recommend any commercial PostgreSQL service providers that may > be able to swiftly come in and assist us with our performance issues? http://www.commandprompt.com/ (disclaimer, I am an employee) > > Below, please find what I believe are the configuration settings of interest > in our system > > Any help and advice will be much appreciated. TIA, > > Carlo > > max_connections = 100 > shared_buffers = 50000 This could probably be higher. > work_mem = 32768 Depending on what you are doing, this is could be to low or to high. > maintenance_work_mem = 32768 > checkpoint_segments = 128 > effective_cache_size = 10000 This coudl probably be higher. > random_page_cost = 3 > stats_start_collector = on > stats_command_string = on > stats_row_level = on > autovacuum = on Stats are a hit... you need to determine if you actually need them. Joshua D. Drake > > > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: 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 > -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/