Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iaf1C-0007c4-52 for pgsql-performance@arkaria.postgresql.org; Fri, 29 Nov 2019 12:05:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iaf19-0007TS-LB for pgsql-performance@arkaria.postgresql.org; Fri, 29 Nov 2019 12:04:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iaf19-0007Le-0Z for pgsql-performance@lists.postgresql.org; Fri, 29 Nov 2019 12:04:59 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iaf15-0002Kt-Am for pgsql-performance@lists.postgresql.org; Fri, 29 Nov 2019 12:04:57 +0000 Received: by mail-wr1-x442.google.com with SMTP id t2so34841226wrr.1 for ; Fri, 29 Nov 2019 04:04:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=hiaQdaY9ZMUHu//KXYNLYe5WCi6WOKixyZKpixk7Ohg=; b=MAPQX6eQlBXz6egHyzoT0YtLnQ6veoYq28mUpC8l8eT0k/odAMbHi94Wv7VlVvlXOY mQ77+TXfmxoG7i+pMpHS8vAeJ3MuIWPZuslVvKBIMi1nWWFLz6xeDyEPLoA4eDKkE78s gsawS12Ck4BNrbeS6CfgVJ5jmXLbe2cWuSmkQpE3izLzEexBunvxxSFNyidxwWpBzrRn OUsjej3DFkwRjsZHmsWybPNlaRIcs6lDTXJyBnFMysSoOlMHAwekxktlb3/0QeutE9gR THd/HHL0oU761DEUEGfgeKdkOtDnITdT0LDhspVGUW0zWwaljZ6KJLHWh0eqI9wrYK52 wcEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=hiaQdaY9ZMUHu//KXYNLYe5WCi6WOKixyZKpixk7Ohg=; b=NjYLvgczz6CFptOINNBE+Dx9M5fsph/fDO38HemEsprdvGe+sCLZ3K4h6cEen3DVZe 431P6ul5yD+8YXW3yv4qrCPbj/S3WmIK1gpu0Gsj8hNura1qnkVhNxS7mg/W588sqUKo LbacIm8AYgZU8HRSGi+xWMrgmWFaVnuCE8/K8q48lTCjsRwERdMZjm5ZKlUxDhGvODD1 JskIS73bFIgW8mgbUr/qg3dJ4z4Mg1SNszUKo09ZGeCO0LL3CNUJPZwE36kZ4PFL5WfP qMjOcCT5poXhEvDBQyzF7mteNnNUS8xfzadOIDW5TR9Xqr74IxEKFZC2HWzBEIPdQ3rU aauA== X-Gm-Message-State: APjAAAWE/iWM3PWK/Lg+u0CJNJOcKEomfc+dHXOPmvT04unY2mrh3t54 /Y9TBEwxBU0KfsdhtpnkiIl3RNvBBIw= X-Google-Smtp-Source: APXvYqyYN2As88QoLEGA8sb+jSX3XZCTQUtuXCD+FGUijdOXgYOQshPtzDpWfEBbnU6kZbbmxPcj3A== X-Received: by 2002:a5d:50d2:: with SMTP id f18mr12497wrt.366.1575029091992; Fri, 29 Nov 2019 04:04:51 -0800 (PST) Received: from localhost.localdomain (217-149-173-91.nat.highway.telekom.at. [217.149.173.91]) by smtp.gmail.com with ESMTPSA id r15sm28253101wrc.5.2019.11.29.04.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2019 04:04:51 -0800 (PST) Message-ID: Subject: Re: Considerable performance downgrade of v11 and 12 on Windows From: Laurenz Albe To: Eugene Podshivalov , pgsql-performance@lists.postgresql.org Date: Fri, 29 Nov 2019 13:04:49 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, 2019-11-29 at 13:04 +0300, Eugene Podshivalov wrote: > I'm using PostgreSQL on Windows for Planet OSM database and have > noticed considirable decrease in performance when upgrading from v10 > to 11 or 12. Here are the details of the experiment I conducted trying > to figure out what is causing the issue. > > Installed PostgreSQL 10 from scratch. Created a database and a table. > [...] > SET synchronous_commit TO OFF; > COPY ways FROM 'E:\ways.txt'; > ALTER TABLE ONLY ways ADD CONSTRAINT pk_ways PRIMARY KEY (id); > > The file is 365GB in size. > > The copy operation took 3.5h and the resulting table size is 253GB. > The primary key operation took 20 minutes and occuped 13GB of disk > space. > > Then I unstalled PostgreSQL v10, deleted the data directory and > installed v11 from scratch. Created the same kind of database and > table. v11 is not able to handle large files, so the I piped the data > through the cmd type command, and then added the primary key with the > same command as above. synchronous_commit turned off beforehand as > above. > > COPY ways FROM PROGRAM 'cmd /c "type E:\ways.txt"'; > > The copy operation took 7 hours and adding primary key took 1h 40m ! > The resulting table and pk sizes are the same as in v10. Also very > high load on disk drive (quite often at 100%) was observed. > > v12 performs the same as v11. > > Here are the changes in v11 default postgresql.conf file compared to > v10 one. Differences in Authentication, Replication and Logging > sections are skipped. > > -#replacement_sort_tuples = 150000 > +#max_parallel_maintenance_workers = 2 > +#parallel_leader_participation = on > ~max_wal_size = 1GB (in v10 is commented out) > ~min_wal_size = 80MB (in v10 is commented out) > +#enable_parallel_append = on > +#enable_partitionwise_join = off > +#enable_partitionwise_aggregate = off > +#enable_parallel_hash = on > +#enable_partition_pruning = on > +#jit_above_cost = 100000 > +#jit_inline_above_cost = 500000 > +#jit_optimize_above_cost = 500000 > +#jit = off > +#jit_provider = 'llvmjit' > +#vacuum_cleanup_index_scale_factor = 0.1 > > Any ideas pleaes on what is trapping the performance? Seems like you have a very weak I/O subsystem. For the COPY, try doing it the same way in both cases (without the "type"). For the index creation, perhaps set "max_parallel_maintenance_workers = 0" so that your system doesn't get overloaded. Is "maintenance_work_mem" set to the same value in both cases? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com