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 1i595g-0000CT-UJ for pgsql-general@arkaria.postgresql.org; Tue, 03 Sep 2019 13:43:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i595f-0005gH-IB for pgsql-general@arkaria.postgresql.org; Tue, 03 Sep 2019 13:43:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i595f-0005g6-7o for pgsql-general@lists.postgresql.org; Tue, 03 Sep 2019 13:43:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i595Y-0006Fd-72 for pgsql-general@lists.postgresql.org; Tue, 03 Sep 2019 13:43:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x83DhBsI023866; Tue, 3 Sep 2019 09:43:11 -0400 From: Tom Lane To: arnaud.listes@codata.eu cc: pgsql-general Subject: Re: Slow statement using parallelism after 9.6>11 upgrade In-reply-to: <872bffe7-82d0-86db-e3d6-2e20b1a72c4b@codata.eu> References: <872bffe7-82d0-86db-e3d6-2e20b1a72c4b@codata.eu> Comments: In-reply-to "Arnaud L." message dated "Tue, 03 Sep 2019 14:10:59 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23864.1567518191.1@sss.pgh.pa.us> Date: Tue, 03 Sep 2019 09:43:11 -0400 Message-ID: <23865.1567518191@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "Arnaud L." writes: > We have upgraded our database from 9.6 to 11 (and updated PostGIS from > 2.3 to 2.5 as well). > ... Have you re-ANALYZEd the database? The problem with this query seems to be the spectacularly awful rowcount estimate here: > -> Bitmap Index Scan on planet_osm_ways_nodes_idx > (cost=0.00..11190.36 rows=1420982 width=0) (actual time=0.268..0.268 > rows=1 loops=1) > Index Cond: (nodes && '{1}'::bigint[]) The planner should be able to do better than that, given up-to-date statistics on the "nodes" column. regards, tom lane